New upstream version 10.34
authorMatthew Vernon <matthew@debian.org>
Thu, 28 Nov 2019 16:13:58 +0000 (16:13 +0000)
committerMatthew Vernon <matthew@debian.org>
Thu, 28 Nov 2019 16:13:58 +0000 (16:13 +0000)
200 files changed:
AUTHORS
CMakeLists.txt
ChangeLog
HACKING
LICENCE
Makefile.am
Makefile.in
NEWS
NON-AUTOTOOLS-BUILD
README
RunGrepTest
RunGrepTest.bat
RunTest
aclocal.m4
ar-lib
compile
config-cmake.h.in
config.guess
config.sub
configure
configure.ac
depcomp
doc/html/NON-AUTOTOOLS-BUILD.txt
doc/html/README.txt
doc/html/index.html
doc/html/pcre2.html
doc/html/pcre2_compile.html
doc/html/pcre2_dfa_match.html
doc/html/pcre2_get_match_data_size.html [new file with mode: 0644]
doc/html/pcre2_jit_compile.html
doc/html/pcre2_maketables.html
doc/html/pcre2_maketables_free.html [new file with mode: 0644]
doc/html/pcre2_match.html
doc/html/pcre2_match_data_free.html
doc/html/pcre2_pattern_info.html
doc/html/pcre2_set_character_tables.html
doc/html/pcre2_set_compile_extra_options.html
doc/html/pcre2_set_substitute_callout.html [new file with mode: 0644]
doc/html/pcre2_substring_nametable_scan.html
doc/html/pcre2api.html
doc/html/pcre2build.html
doc/html/pcre2callout.html
doc/html/pcre2compat.html
doc/html/pcre2demo.html
doc/html/pcre2grep.html
doc/html/pcre2jit.html
doc/html/pcre2limits.html
doc/html/pcre2matching.html
doc/html/pcre2partial.html
doc/html/pcre2pattern.html
doc/html/pcre2perform.html
doc/html/pcre2posix.html
doc/html/pcre2syntax.html
doc/html/pcre2test.html
doc/html/pcre2unicode.html
doc/index.html.src
doc/pcre2-config.txt
doc/pcre2.3
doc/pcre2.txt
doc/pcre2_compile.3
doc/pcre2_dfa_match.3
doc/pcre2_get_match_data_size.3 [new file with mode: 0644]
doc/pcre2_jit_compile.3
doc/pcre2_maketables.3
doc/pcre2_maketables_free.3 [new file with mode: 0644]
doc/pcre2_match.3
doc/pcre2_match_data_free.3
doc/pcre2_pattern_info.3
doc/pcre2_set_character_tables.3
doc/pcre2_set_compile_extra_options.3
doc/pcre2_set_substitute_callout.3 [new file with mode: 0644]
doc/pcre2_substring_nametable_scan.3
doc/pcre2api.3
doc/pcre2build.3
doc/pcre2callout.3
doc/pcre2compat.3
doc/pcre2demo.3
doc/pcre2grep.1
doc/pcre2grep.txt
doc/pcre2jit.3
doc/pcre2limits.3
doc/pcre2matching.3
doc/pcre2partial.3
doc/pcre2pattern.3
doc/pcre2perform.3
doc/pcre2posix.3
doc/pcre2syntax.3
doc/pcre2test.1
doc/pcre2test.txt
doc/pcre2unicode.3
install-sh
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
missing
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_chartables.c.dist
src/pcre2_compile.c
src/pcre2_context.c
src/pcre2_convert.c
src/pcre2_dfa_match.c
src/pcre2_error.c
src/pcre2_extuni.c
src/pcre2_internal.h
src/pcre2_intmodedep.h
src/pcre2_jit_compile.c
src/pcre2_jit_match.c
src/pcre2_jit_neon_inc.h [new file with mode: 0644]
src/pcre2_jit_simd_inc.h [new file with mode: 0644]
src/pcre2_jit_test.c
src/pcre2_maketables.c
src/pcre2_match.c
src/pcre2_match_data.c
src/pcre2_printint.c
src/pcre2_script_run.c [new file with mode: 0644]
src/pcre2_study.c
src/pcre2_substitute.c
src/pcre2_tables.c
src/pcre2_ucd.c
src/pcre2_ucp.h
src/pcre2_xclass.c
src/pcre2demo.c
src/pcre2grep.c
src/pcre2posix.c
src/pcre2posix.h
src/pcre2test.c
src/sljit/sljitConfigInternal.h
src/sljit/sljitExecAllocator.c
src/sljit/sljitLir.c
src/sljit/sljitLir.h
src/sljit/sljitNativeARM_32.c
src/sljit/sljitNativeARM_64.c
src/sljit/sljitNativeARM_T2_32.c
src/sljit/sljitNativeMIPS_32.c
src/sljit/sljitNativeMIPS_64.c
src/sljit/sljitNativeMIPS_common.c
src/sljit/sljitNativePPC_32.c
src/sljit/sljitNativePPC_64.c
src/sljit/sljitNativePPC_common.c
src/sljit/sljitNativeSPARC_32.c
src/sljit/sljitNativeSPARC_common.c
src/sljit/sljitNativeX86_32.c
src/sljit/sljitNativeX86_64.c
src/sljit/sljitNativeX86_common.c
src/sljit/sljitUtils.c
test-driver
testdata/grepoutput
testdata/grepoutput8
testdata/grepoutputCN [new file with mode: 0644]
testdata/testinput1
testdata/testinput10
testdata/testinput12
testdata/testinput15
testdata/testinput17
testdata/testinput2
testdata/testinput4
testdata/testinput5
testdata/testinput6
testdata/testinput8
testdata/testoutput1
testdata/testoutput10
testdata/testoutput11-16
testdata/testoutput11-32
testdata/testoutput12-16
testdata/testoutput12-32
testdata/testoutput15
testdata/testoutput16
testdata/testoutput17
testdata/testoutput2
testdata/testoutput20
testdata/testoutput21
testdata/testoutput22-16
testdata/testoutput22-32
testdata/testoutput22-8
testdata/testoutput3
testdata/testoutput3A
testdata/testoutput3B
testdata/testoutput4
testdata/testoutput5
testdata/testoutput6
testdata/testoutput7
testdata/testoutput8-16-2
testdata/testoutput8-16-3
testdata/testoutput8-16-4
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

diff --git a/AUTHORS b/AUTHORS
index d5592bbc5b5a57b619e18d4b6565a2305f23fffc..8d4e15a247f60f078099f57b44f99f4ca94d4890 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-2018 University of Cambridge
+Copyright (c) 1997-2019 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-2018 Zoltan Herczeg
+Copyright(c) 2010-2019 Zoltan Herczeg
 All rights reserved.
 
 
@@ -30,7 +30,7 @@ Written by:       Zoltan Herczeg
 Email local part: hzmester
 Emain domain:     freemail.hu
 
-Copyright(c) 2009-2018 Zoltan Herczeg
+Copyright(c) 2009-2019 Zoltan Herczeg
 All rights reserved.
 
 ####
index 1a2c95ba35c998e375c993e710127174b65792c4..9a3e5dac6d20c168a53fed8a191f861f96ac8d07 100644 (file)
 # 2017-03-11 PH turned HEAP_MATCH_RECURSE into a NO-OP for 10.30
 # 2017-04-08 PH added HEAP_LIMIT
 # 2017-06-15 ZH added SUPPORT_JIT_SEALLOC support
-# 2018-06-19 PH added checks for stdint.h and inttypes.h
+# 2018-06-19 PH added checks for stdint.h and inttypes.h (later removed)
 # 2018-06-27 PH added Daniel's patch to increase the stack for MSVC
+# 2018-11-14 PH removed unnecessary checks for stdint.h and inttypes.h
+# 2018-11-16 PH added PCRE2GREP_SUPPORT_CALLOUT_FORK support and tidied
+# 2019-02-16 PH hacked to avoid CMP0026 policy issue (see comments below)
 
 PROJECT(PCRE2 C)
 
-# Increased minimum to 2.8.0 to support newer add_test features. Set policy
-# CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY.
-
+# Increased minimum to 2.8.0 to support newer add_test features.
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
-CMAKE_POLICY(SET CMP0026 OLD)
+
+# Set policy CMP0026 to avoid warnings for the use of LOCATION in
+# GET_TARGET_PROPERTY. This should no longer be required.
+# CMAKE_POLICY(SET CMP0026 OLD)
 
 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
 
@@ -115,18 +119,6 @@ CHECK_INCLUDE_FILE(sys/types.h  HAVE_SYS_TYPES_H)
 CHECK_INCLUDE_FILE(unistd.h     HAVE_UNISTD_H)
 CHECK_INCLUDE_FILE(windows.h    HAVE_WINDOWS_H)
 
-IF(HAVE_INTTYPES_H)
-  SET(PCRE2_HAVE_INTTYPES_H 1)
-ELSE(HAVE_INTTYPES_H)
-  SET(PCRE2_HAVE_INTTYPES_H 0)
-ENDIF(HAVE_INTTYPES_H)
-
-IF(HAVE_STDINT_H)
-  SET(PCRE2_HAVE_STDINT_H 1)
-ELSE(HAVE_STDINT_H)
-  SET(PCRE2_HAVE_STDINT_H 0)
-ENDIF(HAVE_STDINT_H)
-
 CHECK_FUNCTION_EXISTS(bcopy     HAVE_BCOPY)
 CHECK_FUNCTION_EXISTS(memmove   HAVE_MEMMOVE)
 CHECK_FUNCTION_EXISTS(strerror  HAVE_STRERROR)
@@ -147,6 +139,8 @@ OPTION(PCRE2_BUILD_PCRE2_32 "Build 32 bit PCRE2 library" OFF)
 
 OPTION(PCRE2_DEBUG "Include debugging code" OFF)
 
+OPTION(PCRE2_DISABLE_PERCENT_ZT "Disable the use of %zu and %td (rarely needed)" OFF)
+
 SET(PCRE2_EBCDIC OFF CACHE BOOL
     "Use EBCDIC coding instead of ASCII. (This is rarely used outside of mainframe systems.)")
 
@@ -184,14 +178,17 @@ SET(PCRE2_SUPPORT_JIT OFF CACHE BOOL
     "Enable support for Just-in-time compiling.")
 
 SET(PCRE2_SUPPORT_JIT_SEALLOC OFF CACHE BOOL
-    "Enable SELinux compatible execmem allocator in JIT.")
+    "Enable SELinux compatible execmem allocator in JIT (experimental).")
 
-SET(PCRE2_SUPPORT_PCRE2GREP_JIT ON CACHE BOOL
+SET(PCRE2GREP_SUPPORT_JIT ON CACHE BOOL
     "Enable use of Just-in-time compiling in pcre2grep.")
 
-SET(PCRE2_SUPPORT_PCRE2GREP_CALLOUT ON CACHE BOOL
+SET(PCRE2GREP_SUPPORT_CALLOUT ON CACHE BOOL
     "Enable callout string support in pcre2grep.")
 
+SET(PCRE2GREP_SUPPORT_CALLOUT_FORK ON CACHE BOOL
+    "Enable callout string fork support in pcre2grep.")
+
 SET(PCRE2_SUPPORT_UNICODE ON CACHE BOOL
     "Enable support for Unicode and UTF-8/UTF-16/UTF-32 encoding.")
 
@@ -310,18 +307,25 @@ IF(PCRE2_SUPPORT_JIT_SEALLOC)
         SET(SLJIT_PROT_EXECUTABLE_ALLOCATOR 1)
 ENDIF(PCRE2_SUPPORT_JIT_SEALLOC)
 
-IF(PCRE2_SUPPORT_PCRE2GREP_JIT)
+IF(PCRE2GREP_SUPPORT_JIT)
         SET(SUPPORT_PCRE2GREP_JIT 1)
-ENDIF(PCRE2_SUPPORT_PCRE2GREP_JIT)
+ENDIF(PCRE2GREP_SUPPORT_JIT)
 
-IF(PCRE2_SUPPORT_PCRE2GREP_CALLOUT)
+IF(PCRE2GREP_SUPPORT_CALLOUT)
         SET(SUPPORT_PCRE2GREP_CALLOUT 1)
-ENDIF(PCRE2_SUPPORT_PCRE2GREP_CALLOUT)
+        IF(PCRE2GREP_SUPPORT_CALLOUT_FORK)
+                SET(SUPPORT_PCRE2GREP_CALLOUT_FORK 1)
+        ENDIF(PCRE2GREP_SUPPORT_CALLOUT_FORK)
+ENDIF(PCRE2GREP_SUPPORT_CALLOUT)
 
 IF(PCRE2_SUPPORT_VALGRIND)
         SET(SUPPORT_VALGRIND 1)
 ENDIF(PCRE2_SUPPORT_VALGRIND)
 
+IF(PCRE2_DISABLE_PERCENT_ZT)
+        SET(DISABLE_PERCENT_ZT 1)
+ENDIF(PCRE2_DISABLE_PERCENT_ZT)
+
 # This next one used to reference ${READLINE_LIBRARY})
 # but I was advised to add the NCURSES test as well, along with
 # some modifications to cmake/FindReadline.cmake which should
@@ -455,6 +459,7 @@ SET(PCRE2_SOURCES
   src/pcre2_newline.c
   src/pcre2_ord2utf.c
   src/pcre2_pattern_info.c
+  src/pcre2_script_run.c
   src/pcre2_serialize.c
   src/pcre2_string_utils.c
   src/pcre2_study.c
@@ -644,14 +649,27 @@ IF(PCRE2_BUILD_TESTS)
     TARGET_LINK_LIBRARIES(pcre2_jit_test ${PCRE2_JIT_TEST_LIBS})
   ENDIF(PCRE2_SUPPORT_JIT)
 
-  # exes in Debug location tested by the RunTest shell script
+  # exes in Debug location tested by the RunTest and RunGrepTest shell scripts
   # via "make test"
 
+  # The commented out code below provokes a warning about future removal
+  # of the facility, and requires policy CMP0026 to be set to "OLD". I have
+  # got fed-up with the warnings, but my plea for help on the mailing list
+  # produced no response. So, I've hacked. The new code below seems to work on
+  # Linux.
+
+#  IF(PCRE2_BUILD_PCRE2GREP)
+#    GET_TARGET_PROPERTY(PCRE2GREP_EXE pcre2grep DEBUG_LOCATION)
+#  ENDIF(PCRE2_BUILD_PCRE2GREP)
+#
+#  GET_TARGET_PROPERTY(PCRE2TEST_EXE pcre2test DEBUG_LOCATION)
+
   IF(PCRE2_BUILD_PCRE2GREP)
-    GET_TARGET_PROPERTY(PCRE2GREP_EXE pcre2grep DEBUG_LOCATION)
+    SET(PCRE2GREP_EXE $<TARGET_FILE:pcre2grep>)
   ENDIF(PCRE2_BUILD_PCRE2GREP)
 
-  GET_TARGET_PROPERTY(PCRE2TEST_EXE pcre2test DEBUG_LOCATION)
+  SET(PCRE2TEST_EXE $<TARGET_FILE:pcre2test>)
+
 
 # =================================================
   # Write out a CTest configuration file
@@ -810,10 +828,11 @@ IF(PCRE2_SHOW_REPORT)
   MESSAGE(STATUS "  Build shared libs ............... : ${BUILD_SHARED_LIBS}")
   MESSAGE(STATUS "  Build static libs ............... : ${BUILD_STATIC_LIBS}")
   MESSAGE(STATUS "  Build pcre2grep ................. : ${PCRE2_BUILD_PCRE2GREP}")
-  MESSAGE(STATUS "  Enable JIT in pcre2grep ......... : ${PCRE2_SUPPORT_PCRE2GREP_JIT}")
-  MESSAGE(STATUS "  Enable callouts in pcre2grep .... : ${PCRE2_SUPPORT_PCRE2GREP_CALLOUT}")
+  MESSAGE(STATUS "  Enable JIT in pcre2grep ......... : ${PCRE2GREP_SUPPORT_JIT}")
+  MESSAGE(STATUS "  Enable callouts in pcre2grep .... : ${PCRE2GREP_SUPPORT_CALLOUT}")
+  MESSAGE(STATUS "  Enable callout fork in pcre2grep. : ${PCRE2GREP_SUPPORT_CALLOUT_FORK}")
   MESSAGE(STATUS "  Buffer size for pcre2grep ....... : ${PCRE2GREP_BUFSIZE}")
-  MESSAGE(STATUS "  Build tests (implies pcre2test  . : ${PCRE2_BUILD_TESTS}")
+  MESSAGE(STATUS "  Build tests (implies pcre2test .. : ${PCRE2_BUILD_TESTS}")
   MESSAGE(STATUS "               and pcre2grep)")
   IF(ZLIB_FOUND)
     MESSAGE(STATUS "  Link pcre2grep with libz ........ : ${PCRE2_SUPPORT_LIBZ}")
@@ -836,6 +855,11 @@ IF(PCRE2_SHOW_REPORT)
     MESSAGE(STATUS "  Link pcre2test with libreadline . : Library not found" )
   ENDIF(READLINE_FOUND)
   MESSAGE(STATUS "  Support Valgrind .................: ${PCRE2_SUPPORT_VALGRIND}")
+  IF(PCRE2_DISABLE_PERCENT_ZT)
+    MESSAGE(STATUS "  Use %zu and %td ..................: OFF" )
+  ELSE(PCRE2_DISABLE_PERCENT_ZT)
+    MESSAGE(STATUS "  Use %zu and %td ..................: AUTO" )
+  ENDIF(PCRE2_DISABLE_PERCENT_ZT)
 
   IF(MINGW AND NOT PCRE2_STATIC)
     MESSAGE(STATUS "  Non-standard dll names (prefix) . : ${NON_STANDARD_LIB_PREFIX}")
index 06b69f8dc878f0dd470378d11067207115733995..0926c29ef451db6f357bc51b7d492aed7577de94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,348 @@ Change Log for PCRE2
 --------------------
 
 
-Version 10.32-RC1 10-September-2018
------------------------------------
+Version 10.34 21-November-2019
+------------------------------
+
+1. The maximum number of capturing subpatterns is 65535 (documented), but no
+check on this was ever implemented. This omission has been rectified; it fixes
+ClusterFuzz 14376.
+
+2. Improved the invalid utf32 support of the JIT compiler. Now it correctly
+detects invalid characters in the 0xd800-0xdfff range.
+
+3. Fix minor typo bug in JIT compile when \X is used in a non-UTF string.
+
+4. Add support for matching in invalid UTF strings to the pcre2_match()
+interpreter, and integrate with the existing JIT support via the new
+PCRE2_MATCH_INVALID_UTF compile-time option.
+
+5. Give more error detail for invalid UTF-8 when detected in pcre2grep.
+
+6. Add support for invalid UTF-8 to pcre2grep.
+
+7. Adjust the limit for "must have" code unit searching, in particular,
+increase it substantially for non-anchored patterns.
+
+8. Allow (*ACCEPT) to be quantified, because an ungreedy quantifier with a zero
+minimum is potentially useful.
+
+9. Some changes to the way the minimum subject length is handled:
+
+   * When PCRE2_NO_START_OPTIMIZE is set, no minimum length is computed;
+     pcre2test now omits this item instead of showing a value of zero.
+
+   * An incorrect minimum length could be calculated for a pattern that
+     contained (*ACCEPT) inside a qualified group whose minimum repetition was
+     zero, for example /A(?:(*ACCEPT))?B/, which incorrectly computed a minimum
+     of 2. The minimum length scan no longer happens for a pattern that
+     contains (*ACCEPT).
+
+   * When no minimum length is set by the normal scan, but a first and/or last
+     code unit is recorded, set the minimum to 1 or 2 as appropriate.
+
+   * When a pattern contains multiple groups with the same number, a back
+     reference cannot know which one to scan for a minimum length. This used to
+     cause the minimum length finder to give up with no result. Now it treats
+     such references as not adding to the minimum length (which it should have
+     done all along).
+
+   * Furthermore, the above action now happens only if the back reference is to
+     a group that exists more than once in a pattern instead of any back
+     reference in a pattern with duplicate numbers.
+
+10. A (*MARK) value inside a successful condition was not being returned by the
+interpretive matcher (it was returned by JIT). This bug has been mended.
+
+11. A bug in pcre2grep meant that -o without an argument (or -o0) didn't work
+if the pattern had more than 32 capturing parentheses. This is fixed. In
+addition (a) the default limit for groups requested by -o<n> has been raised to
+50, (b) the new --om-capture option changes the limit, (c) an error is raised
+if -o asks for a group that is above the limit.
+
+12. The quantifier {1} was always being ignored, but this is incorrect when it
+is made possessive and applied to an item in parentheses, because a
+parenthesized item may contain multiple branches or other backtracking points,
+for example /(a|ab){1}+c/ or /(a+){1}+a/.
+
+13. For partial matches, pcre2test was always showing the maximum lookbehind
+characters, flagged with "<", which is misleading when the lookbehind didn't
+actually look behind the start (because it was later in the pattern). Showing
+all consulted preceding characters for partial matches is now controlled by the
+existing "allusedtext" modifier and, as for complete matches, this facility is
+available only for non-JIT matching, because JIT does not maintain the first
+and last consulted characters.
+
+14. DFA matching (using pcre2_dfa_match()) was not recognising a partial match
+if the end of the subject was encountered in a lookahead (conditional or
+otherwise), an atomic group, or a recursion.
+
+15. Give error if pcre2test -t, -T, -tm or -TM is given an argument of zero.
+
+16. Check for integer overflow when computing lookbehind lengths. Fixes
+Clusterfuzz issue 15636.
+
+17. Implemented non-atomic positive lookaround assertions.
+
+18. If a lookbehind contained a lookahead that contained another lookbehind
+within it, the nested lookbehind was not correctly processed. For example, if
+/(?<=(?=(?<=a)))b/ was matched to "ab" it gave no match instead of matching
+"b".
+
+19. Implemented pcre2_get_match_data_size().
+
+20. Two alterations to partial matching:
+
+    (a) The definition of a partial match is slightly changed: if a pattern
+    contains any lookbehinds, an empty partial match may be given, because this
+    is another situation where adding characters to the current subject can
+    lead to a full match. Example: /c*+(?<=[bc])/ with subject "ab".
+
+    (b) Similarly, if a pattern could match an empty string, an empty partial
+    match may be given. Example: /(?![ab]).*/ with subject "ab". This case
+    applies only to PCRE2_PARTIAL_HARD.
+
+    (c) An empty string partial hard match can be returned for \z and \Z as it
+    is documented that they shouldn't match.
+
+21. A branch that started with (*ACCEPT) was not being recognized as one that
+could match an empty string.
+
+22. Corrected pcre2_set_character_tables() tables data type: was const unsigned
+char * instead of const uint8_t *, as generated by pcre2_maketables().
+
+23. Upgraded to Unicode 12.1.0.
+
+24. Add -jitfast command line option to pcre2test (to make all the jit options
+available directly).
+
+25. Make pcre2test -C show if libreadline or libedit is supported.
+
+26. If the length of one branch of a group exceeded 65535 (the maximum value
+that is remembered as a minimum length), the whole group's length was
+incorrectly recorded as 65535, leading to incorrect "no match" when start-up
+optimizations were in force.
+
+27. The "rightmost consulted character" value was not always correct; in
+particular, if a pattern ended with a negative lookahead, characters that were
+inspected in that lookahead were not included.
+
+28. Add the pcre2_maketables_free() function.
+
+29. The start-up optimization that looks for a unique initial matching
+code unit in the interpretive engines uses memchr() in 8-bit mode. When the
+search is caseless, it was doing so inefficiently, which ended up slowing down
+the match drastically when the subject was very long. The revised code (a)
+remembers if one case is not found, so it never repeats the search for that
+case after a bumpalong and (b) when one case has been found, it searches only
+up to that position for an earlier occurrence of the other case. This fix
+applies to both interpretive pcre2_match() and to pcre2_dfa_match().
+
+30. While scanning to find the minimum length of a group, if any branch has
+minimum length zero, there is no need to scan any subsequent branches (a small
+compile-time performance improvement).
+
+31. Installed a .gitignore file on a user's suggestion. When using the svn
+repository with git (through git svn) this helps keep it tidy.
+
+32. Add underflow check in JIT which may occur when the value of subject
+string pointer is close to 0.
+
+33. Arrange for classes such as [Aa] which contain just the two cases of the
+same character, to be treated as a single caseless character. This causes the
+first and required code unit optimizations to kick in where relevant.
+
+34. Improve the bitmap of starting bytes for positive classes that include wide
+characters, but no property types, in UTF-8 mode. Previously, on encountering
+such a class, the bits for all bytes greater than \xc4 were set, thus
+specifying any character with codepoint >= 0x100. Now the only bits that are
+set are for the relevant bytes that start the wide characters. This can give a
+noticeable performance improvement.
+
+35. If the bitmap of starting code units contains only 1 or 2 bits, replace it
+with a single starting code unit (1 bit) or a caseless single starting code
+unit if the two relevant characters are case-partners. This is particularly
+relevant to the 8-bit library, though it applies to all. It can give a
+performance boost for patterns such as [Ww]ord and (word|WORD). However, this
+optimization doesn't happen if there is a "required" code unit of the same
+value (because the search for a "required" code unit starts at the match start
+for non-unique first code unit patterns, but after a unique first code unit,
+and patterns such as a*a need the former action).
+
+36. Small patch to pcre2posix.c to set the erroroffset field to -1 immediately
+after a successful compile, instead of at the start of matching to avoid a
+sanitizer complaint (regexec is supposed to be thread safe).
+
+37. Add NEON vectorization to JIT to speed up matching of first character and
+pairs of characters on ARM64 CPUs.
+
+38. If a non-ASCII character was the first in a starting assertion in a
+caseless match, the "first code unit" optimization did not get the casing
+right, and the assertion failed to match a character in the other case if it
+did not start with the same code unit.
+
+39. Fixed the incorrect computation of jump sizes on x86 CPUs in JIT. A masking
+operation was incorrectly removed in r1136. Reported by Ralf Junker.
+
+
+Version 10.33 16-April-2019
+---------------------------
+
+1. Added "allvector" to pcre2test to make it easy to check the part of the
+ovector that shouldn't be changed, in particular after substitute and failed or
+partial matches.
+
+2. Fix subject buffer overread in JIT when UTF is disabled and \X or \R has
+a greater than 1 fixed quantifier. This issue was found by Yunho Kim.
+
+3. Added support for callouts from pcre2_substitute(). After 10.33-RC1, but
+prior to release, fixed a bug that caused a crash if pcre2_substitute() was
+called with a NULL match context.
+
+4. The POSIX functions are now all called pcre2_regcomp() etc., with wrapper
+functions that use the standard POSIX names. However, in pcre2posix.h the POSIX
+names are defined as macros. This should help avoid linking with the wrong
+library in some environments while still exporting the POSIX names for
+pre-existing programs that use them. (The Debian alternative names are also
+defined as macros, but not documented.)
+
+5. Fix an xclass matching issue in JIT.
+
+6. Implement PCRE2_EXTRA_ESCAPED_CR_IS_LF (see Bugzilla 2315).
+
+7. Implement the Perl 5.28 experimental alphabetic names for atomic groups and
+lookaround assertions, for example, (*pla:...) and (*atomic:...). These are
+characterized by a lower case letter following (* and to simplify coding for
+this, the character tables created by pcre2_maketables() were updated to add a
+new "is lower case letter" bit. At the same time, the now unused "is
+hexadecimal digit" bit was removed. The default tables in
+src/pcre2_chartables.c.dist are updated.
+
+8. Implement the new Perl "script run" features (*script_run:...) and
+(*atomic_script_run:...) aka (*sr:...) and (*asr:...).
+
+9. Fixed two typos in change 22 for 10.21, which added special handling for
+ranges such as a-z in EBCDIC environments. The original code probably never
+worked, though there were no bug reports.
+
+10. Implement PCRE2_COPY_MATCHED_SUBJECT for pcre2_match() (including JIT via
+pcre2_match()) and pcre2_dfa_match(), but *not* the pcre2_jit_match() fast
+path. Also, when a match fails, set the subject field in the match data to NULL
+for tidiness - none of the substring extractors should reference this after
+match failure.
+
+11. If a pattern started with a subroutine call that had a quantifier with a
+minimum of zero, an incorrect "match must start with this character" could be
+recorded. Example: /(?&xxx)*ABC(?<xxx>XYZ)/ would (incorrectly) expect 'A' to
+be the first character of a match.
+
+12. The heap limit checking code in pcre2_dfa_match() could suffer from
+overflow if the heap limit was set very large. This could cause incorrect "heap
+limit exceeded" errors.
+
+13. Add "kibibytes" to the heap limit output from pcre2test -C to make the
+units clear.
+
+14. Add a call to pcre2_jit_free_unused_memory() in pcre2grep, for tidiness.
+
+15. Updated the VMS-specific code in pcre2test on the advice of a VMS user.
+
+16. Removed the unnecessary inclusion of stdint.h (or inttypes.h) from
+pcre2_internal.h as it is now included by pcre2.h. Also, change 17 for 10.32
+below was unnecessarily complicated, as inttypes.h is a Standard C header,
+which is defined to be a superset of stdint.h. Instead of conditionally
+including stdint.h or inttypes.h, pcre2.h now unconditionally includes
+inttypes.h. This supports environments that do not have stdint.h but do have
+inttypes.h, which are known to exist. A note in the autotools documentation
+says (November 2018) that there are none known that are the other way round.
+
+17. Added --disable-percent-zt to "configure" (and equivalent to CMake) to
+forcibly disable the use of %zu and %td in formatting strings because there is
+at least one version of VMS that claims to be C99 but does not support these
+modifiers.
+
+18. Added --disable-pcre2grep-callout-fork, which restricts the callout support
+in pcre2grep to the inbuilt echo facility. This may be useful in environments
+that do not support fork().
+
+19. Fix two instances of <= 0 being applied to unsigned integers (the VMS
+compiler complains).
+
+20. Added "fork" support for VMS to pcre2grep, for running an external program
+via a string callout.
+
+21. Improve MAP_JIT flag usage on MacOS. Patch by Rich Siegel.
+
+22. If a pattern started with (*MARK), (*COMMIT), (*PRUNE), (*SKIP), or (*THEN)
+followed by ^ it was not recognized as anchored.
+
+23. The RunGrepTest script used to cut out the test of NUL characters for
+Solaris and MacOS as printf and sed can't handle them. It seems that the *BSD
+systems can't either. I've inverted the test so that only those OS that are
+known to work (currently only Linux) try to run this test.
+
+24. Some tests in RunGrepTest appended to testtrygrep from two different file
+descriptors instead of redirecting stderr to stdout. This worked on Linux, but
+it was reported not to on other systems, causing the tests to fail.
+
+25. In the RunTest script, make the test for stack setting use the same value
+for the stack as it needs for -bigstack.
+
+26. Insert a cast in pcre2_dfa_match.c to suppress a compiler warning.
+
+26. With PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL set, escape sequences such as \s
+which are valid in character classes, but not as the end of ranges, were being
+treated as literals. An example is [_-\s] (but not [\s-_] because that gave an
+error at the *start* of a range). Now an "invalid range" error is given
+independently of PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL.
+
+27. Related to 26 above, PCRE2_BAD_ESCAPE_IS_LITERAL was affecting known escape
+sequences such as \eX when they appeared invalidly in a character class. Now
+the option applies only to unrecognized or malformed escape sequences.
+
+28. Fix word boundary in JIT compiler. Patch by Mike Munday.
+
+29. The pcre2_dfa_match() function was incorrectly handling conditional version
+tests such as (?(VERSION>=0)...) when the version test was true. Incorrect
+processing or a crash could result.
+
+30. When PCRE2_UTF is set, allow non-ASCII letters and decimal digits in group
+names, as Perl does. There was a small bug in this new code, found by
+ClusterFuzz 12950, fixed before release.
+
+31. Implemented PCRE2_EXTRA_ALT_BSUX to support ECMAScript 6's \u{hhh}
+construct.
+
+32. Compile \p{Any} to be the same as . in DOTALL mode, so that it benefits
+from auto-anchoring if \p{Any}* starts a pattern.
+
+33. Compile invalid UTF check in JIT test when only pcre32 is enabled.
+
+34. For some time now, CMake has been warning about the setting of policy
+CMP0026 to "OLD" in CmakeLists.txt, and hinting that the feature might be
+removed in a future version. A request for CMake expertise on the list produced
+no result, so I have now hacked CMakeLists.txt along the lines of some changes
+I found on the Internet. The new code no longer needs the policy setting, and
+it appears to work fine on Linux.
+
+35. Setting --enable-jit=auto for an out-of-tree build failed because the
+source directory wasn't in the search path for AC_TRY_COMPILE always. Patch
+from Ross Burton.
+
+36. Disable SSE2 JIT optimizations in x86 CPUs when SSE2 is not available.
+Patch by Guillem Jover.
+
+37. Changed expressions such as 1<<10 to 1u<<10 in many places because compiler
+warnings were reported.
+
+38. Using the clang compiler with sanitizing options causes runtime complaints
+about truncation for statments such as x = ~x when x is an 8-bit value; it
+seems to compute ~x as a 32-bit value. Changing such statements to x = 255 ^ x
+gets rid of the warnings. There were also two missing casts in pcre2test.
+
+
+Version 10.32 10-September-2018
+-------------------------------
 
 1. When matching using the the REG_STARTEND feature of the POSIX API with a
 non-zero starting offset, unset capturing groups with lower numbers than a
diff --git a/HACKING b/HACKING
index f99616ac2ae839443492a03bbbfb9475283c0091..20faf8f47c78b26893c826c318c468d246ddb6ca 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -195,6 +195,7 @@ META_END              End of pattern (this value is 0x80000000)
 META_FAIL             (*FAIL)
 META_KET              ) closing parenthesis
 META_LOOKAHEAD        (?= start of lookahead
+META_LOOKAHEAD_NA     (*napla: start of non-atomic lookahead
 META_LOOKAHEADNOT     (?! start of negative lookahead
 META_NOCAPTURE        (?: no capture parens
 META_PLUS             +
@@ -286,8 +287,9 @@ The following are also followed just by an offset, but also the lower 16 bits
 of the main word contain the length of the first branch of the lookbehind
 group; this is used when generating OP_REVERSE for that branch.
 
-META_LOOKBEHIND       (?<=
-META_LOOKBEHINDNOT    (?<!
+META_LOOKBEHIND       (?<=      start of lookbehind
+META_LOOKBEHIND_NA    (*naplb:  start of non-atomic lookbehind
+META_LOOKBEHINDNOT    (?<!      start of negative lookbehind
 
 The following are followed by two elements, the minimum and maximum. Repeat
 values are limited to 65535 (MAX_REPEAT). A maximum value of "unlimited" is
@@ -715,13 +717,15 @@ Assertions
 ----------
 
 Forward assertions are also just like other subpatterns, but starting with one
-of the opcodes OP_ASSERT or OP_ASSERT_NOT. Backward assertions use the opcodes
-OP_ASSERTBACK and OP_ASSERTBACK_NOT, and the first opcode inside the assertion
-is OP_REVERSE, followed by a count of the number of characters to move back the
-pointer in the subject string. In ASCII or UTF-32 mode, the count is also the
-number of code units, but in UTF-8/16 mode each character may occupy more than
-one code unit. A separate count is present in each alternative of a lookbehind
-assertion, allowing them to have different (but fixed) lengths.
+of the opcodes OP_ASSERT, OP_ASSERT_NA (non-atomic assertion), or
+OP_ASSERT_NOT. Backward assertions use the opcodes OP_ASSERTBACK, 
+OP_ASSERTBACK_NA, and OP_ASSERTBACK_NOT, and the first opcode inside the
+assertion is OP_REVERSE, followed by a count of the number of characters to
+move back the pointer in the subject string. In ASCII or UTF-32 mode, the count
+is also the number of code units, but in UTF-8/16 mode each character may
+occupy more than one code unit. A separate count is present in each alternative
+of a lookbehind assertion, allowing each branch to have a different (but fixed)
+length.
 
 
 Conditional subpatterns
@@ -754,11 +758,11 @@ tests the PCRE2 version number. This compiles into one of the opcodes OP_TRUE
 or OP_FALSE.
 
 If a condition is not a back reference, recursion test, DEFINE, or VERSION, it
-must start with a parenthesized assertion, whose opcode normally immediately
-follows OP_COND or OP_SCOND. However, if automatic callouts are enabled, a
-callout is inserted immediately before the assertion. It is also possible to
-insert a manual callout at this point. Only assertion conditions may have
-callouts preceding the condition.
+must start with a parenthesized atomic assertion, whose opcode normally
+immediately follows OP_COND or OP_SCOND. However, if automatic callouts are
+enabled, a callout is inserted immediately before the assertion. It is also
+possible to insert a manual callout at this point. Only assertion conditions
+may have callouts preceding the condition.
 
 A condition that is the negative assertion (?!) is optimized to OP_FAIL in all
 parts of the pattern, so this is another opcode that may appear as a condition.
@@ -823,4 +827,4 @@ not a real opcode, but is used to check at compile time that tables indexed by
 opcode are the correct length, in order to catch updating errors.
 
 Philip Hazel
-20 July 2018
+12 July 2019
diff --git a/LICENCE b/LICENCE
index b0f8804fffa04d79407eab9b8ab2005c61f73d94..142b3b3f9adbca4cb4bacad7b86e3959b79ee4e4 100644 (file)
--- a/LICENCE
+++ b/LICENCE
@@ -26,7 +26,7 @@ Email domain:     cam.ac.uk
 University of Cambridge Computing Service,
 Cambridge, England.
 
-Copyright (c) 1997-2018 University of Cambridge
+Copyright (c) 1997-2019 University of Cambridge
 All rights reserved.
 
 
@@ -37,7 +37,7 @@ Written by:       Zoltan Herczeg
 Email local part: hzmester
 Email domain:     freemail.hu
 
-Copyright(c) 2010-2018 Zoltan Herczeg
+Copyright(c) 2010-2019 Zoltan Herczeg
 All rights reserved.
 
 
@@ -48,7 +48,7 @@ Written by:       Zoltan Herczeg
 Email local part: hzmester
 Email domain:     freemail.hu
 
-Copyright(c) 2009-2018 Zoltan Herczeg
+Copyright(c) 2009-2019 Zoltan Herczeg
 All rights reserved.
 
 
index a4bcdf6e41a5c23a95a33b1c06517788b58db86e..db16377af52cc132ac008c04f41fd71ef546c6f4 100644 (file)
@@ -46,6 +46,7 @@ dist_html_DATA = \
   doc/html/pcre2_general_context_free.html \
   doc/html/pcre2_get_error_message.html \
   doc/html/pcre2_get_mark.html \
+  doc/html/pcre2_get_match_data_size.html \
   doc/html/pcre2_get_ovector_count.html \
   doc/html/pcre2_get_ovector_pointer.html \
   doc/html/pcre2_get_startchar.html \
@@ -56,6 +57,7 @@ dist_html_DATA = \
   doc/html/pcre2_jit_stack_create.html \
   doc/html/pcre2_jit_stack_free.html \
   doc/html/pcre2_maketables.html \
+  doc/html/pcre2_maketables_free.html \
   doc/html/pcre2_match.html \
   doc/html/pcre2_match_context_copy.html \
   doc/html/pcre2_match_context_create.html \
@@ -85,6 +87,7 @@ dist_html_DATA = \
   doc/html/pcre2_set_parens_nest_limit.html \
   doc/html/pcre2_set_recursion_limit.html \
   doc/html/pcre2_set_recursion_memory_management.html \
+  doc/html/pcre2_set_substitute_callout.html \
   doc/html/pcre2_substitute.html \
   doc/html/pcre2_substring_copy_byname.html \
   doc/html/pcre2_substring_copy_bynumber.html \
@@ -139,6 +142,7 @@ dist_man_MANS = \
   doc/pcre2_general_context_free.3 \
   doc/pcre2_get_error_message.3 \
   doc/pcre2_get_mark.3 \
+  doc/pcre2_get_match_data_size.3 \
   doc/pcre2_get_ovector_count.3 \
   doc/pcre2_get_ovector_pointer.3 \
   doc/pcre2_get_startchar.3 \
@@ -149,6 +153,7 @@ dist_man_MANS = \
   doc/pcre2_jit_stack_create.3 \
   doc/pcre2_jit_stack_free.3 \
   doc/pcre2_maketables.3 \
+  doc/pcre2_maketables_free.3 \
   doc/pcre2_match.3 \
   doc/pcre2_match_context_copy.3 \
   doc/pcre2_match_context_create.3 \
@@ -178,6 +183,7 @@ dist_man_MANS = \
   doc/pcre2_set_parens_nest_limit.3 \
   doc/pcre2_set_recursion_limit.3 \
   doc/pcre2_set_recursion_memory_management.3 \
+  doc/pcre2_set_substitute_callout.3 \
   doc/pcre2_substitute.3 \
   doc/pcre2_substring_copy_byname.3 \
   doc/pcre2_substring_copy_bynumber.3 \
@@ -231,7 +237,7 @@ noinst_PROGRAMS =
 # and 'make maintainer-clean'.
 
 CLEANFILES =
-DISTCLEANFILES = src/config.h.in~ config.h pcre2.h.generic
+DISTCLEANFILES = src/config.h.in~
 MAINTAINERCLEANFILES =
 
 # Additional files to bundle with the distribution, over and above what
@@ -356,12 +362,15 @@ COMMON_SOURCES = \
   src/pcre2_internal.h \
   src/pcre2_intmodedep.h \
   src/pcre2_jit_compile.c \
+  src/pcre2_jit_neon_inc.h \
+  src/pcre2_jit_simd_inc.h \
   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_script_run.c \
   src/pcre2_serialize.c \
   src/pcre2_string_utils.c \
   src/pcre2_study.c \
@@ -528,6 +537,10 @@ noinst_PROGRAMS += pcre2fuzzcheck
 pcre2fuzzcheck_SOURCES = src/pcre2_fuzzsupport.c
 pcre2fuzzcheck_CFLAGS = -DSTANDALONE $(AM_CFLAGS)
 pcre2fuzzcheck_LDADD = libpcre2-8.la
+if WITH_GCOV
+pcre2fuzzcheck_CFLAGS += $(GCOV_CFLAGS)
+pcre2fuzzcheck_LDADD += $(GCOV_LIBS)
+endif # WITH_GCOV
 endif # WITH FUZZ_SUPPORT
 endif # WITH_PCRE2_8
 
@@ -618,6 +631,7 @@ EXTRA_DIST += \
   testdata/grepoutput \
   testdata/grepoutput8 \
   testdata/grepoutputC \
+  testdata/grepoutputCN \
   testdata/grepoutputN \
   testdata/greppatN4 \
   testdata/testinput1 \
index 597b171528bb0632569c85099b5ffb8b59cf46d7..4304521d89d31ad78a364046a20576ba61c90c78 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -93,7 +93,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-TESTS = $(am__EXEEXT_4) RunTest $(am__append_30)
+TESTS = $(am__EXEEXT_4) RunTest $(am__append_32)
 bin_PROGRAMS = $(am__EXEEXT_1) pcre2test$(EXEEXT)
 noinst_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
 @WITH_REBUILD_CHARTABLES_TRUE@am__append_1 = dftables
@@ -112,26 +112,28 @@ noinst_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
 @WITH_GCOV_TRUE@@WITH_PCRE2_8_TRUE@am__append_14 = $(GCOV_CFLAGS)
 @WITH_GCOV_TRUE@@WITH_PCRE2_8_TRUE@am__append_15 = $(GCOV_LIBS)
 @WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@am__append_16 = pcre2fuzzcheck
-@WITH_JIT_TRUE@am__append_17 = pcre2_jit_test
-@WITH_JIT_TRUE@am__append_18 = pcre2_jit_test
-@WITH_JIT_TRUE@@WITH_PCRE2_8_TRUE@am__append_19 = libpcre2-8.la
-@WITH_JIT_TRUE@@WITH_PCRE2_16_TRUE@am__append_20 = libpcre2-16.la
-@WITH_JIT_TRUE@@WITH_PCRE2_32_TRUE@am__append_21 = libpcre2-32.la
-@WITH_GCOV_TRUE@@WITH_JIT_TRUE@am__append_22 = $(GCOV_CFLAGS)
-@WITH_GCOV_TRUE@@WITH_JIT_TRUE@am__append_23 = $(GCOV_LIBS)
-@WITH_PCRE2_8_TRUE@am__append_24 = libpcre2-8.la libpcre2-posix.la
-@WITH_PCRE2_16_TRUE@am__append_25 = libpcre2-16.la
-@WITH_PCRE2_32_TRUE@am__append_26 = libpcre2-32.la
-@WITH_VALGRIND_TRUE@am__append_27 = $(VALGRIND_CFLAGS)
-@WITH_GCOV_TRUE@am__append_28 = $(GCOV_CFLAGS)
-@WITH_GCOV_TRUE@am__append_29 = $(GCOV_LIBS)
-@WITH_PCRE2_8_TRUE@am__append_30 = RunGrepTest
-@WITH_PCRE2_8_TRUE@am__append_31 = RunGrepTest.bat
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_GCOV_TRUE@@WITH_PCRE2_8_TRUE@am__append_17 = $(GCOV_CFLAGS)
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_GCOV_TRUE@@WITH_PCRE2_8_TRUE@am__append_18 = $(GCOV_LIBS)
+@WITH_JIT_TRUE@am__append_19 = pcre2_jit_test
+@WITH_JIT_TRUE@am__append_20 = pcre2_jit_test
+@WITH_JIT_TRUE@@WITH_PCRE2_8_TRUE@am__append_21 = libpcre2-8.la
+@WITH_JIT_TRUE@@WITH_PCRE2_16_TRUE@am__append_22 = libpcre2-16.la
+@WITH_JIT_TRUE@@WITH_PCRE2_32_TRUE@am__append_23 = libpcre2-32.la
+@WITH_GCOV_TRUE@@WITH_JIT_TRUE@am__append_24 = $(GCOV_CFLAGS)
+@WITH_GCOV_TRUE@@WITH_JIT_TRUE@am__append_25 = $(GCOV_LIBS)
+@WITH_PCRE2_8_TRUE@am__append_26 = libpcre2-8.la libpcre2-posix.la
+@WITH_PCRE2_16_TRUE@am__append_27 = libpcre2-16.la
+@WITH_PCRE2_32_TRUE@am__append_28 = libpcre2-32.la
+@WITH_VALGRIND_TRUE@am__append_29 = $(VALGRIND_CFLAGS)
+@WITH_GCOV_TRUE@am__append_30 = $(GCOV_CFLAGS)
+@WITH_GCOV_TRUE@am__append_31 = $(GCOV_LIBS)
 @WITH_PCRE2_8_TRUE@am__append_32 = RunGrepTest
-@WITH_PCRE2_8_TRUE@am__append_33 = libpcre2-8.pc libpcre2-posix.pc
-@WITH_PCRE2_16_TRUE@am__append_34 = libpcre2-16.pc
-@WITH_PCRE2_32_TRUE@am__append_35 = libpcre2-32.pc
-@WITH_GCOV_FALSE@am__append_36 = src/*.gcda src/*.gcno
+@WITH_PCRE2_8_TRUE@am__append_33 = RunGrepTest.bat
+@WITH_PCRE2_8_TRUE@am__append_34 = RunGrepTest
+@WITH_PCRE2_8_TRUE@am__append_35 = libpcre2-8.pc libpcre2-posix.pc
+@WITH_PCRE2_16_TRUE@am__append_36 = libpcre2-16.pc
+@WITH_PCRE2_32_TRUE@am__append_37 = libpcre2-32.pc
+@WITH_GCOV_FALSE@am__append_38 = src/*.gcda src/*.gcno
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
@@ -153,20 +155,17 @@ CONFIG_HEADER = $(top_builddir)/src/config.h
 CONFIG_CLEAN_FILES = libpcre2-8.pc libpcre2-16.pc libpcre2-32.pc \
        libpcre2-posix.pc pcre2-config src/pcre2.h
 CONFIG_CLEAN_VPATH_FILES =
+@WITH_PCRE2_8_TRUE@am__EXEEXT_1 = pcre2grep$(EXEEXT)
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \
+       "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
+       "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(docdir)" \
+       "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(pkgconfigdir)" \
+       "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"
+@WITH_REBUILD_CHARTABLES_TRUE@am__EXEEXT_2 = dftables$(EXEEXT)
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@am__EXEEXT_3 = pcre2fuzzcheck$(EXEEXT)
+@WITH_JIT_TRUE@am__EXEEXT_4 = pcre2_jit_test$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
 LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_@AM_V@)
-am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
-am__v_AR_0 = @echo "  AR      " $@;
-am__v_AR_1 = 
-_libs_libpcre2_fuzzsupport_a_AR = $(AR) $(ARFLAGS)
-_libs_libpcre2_fuzzsupport_a_DEPENDENCIES =
-am___libs_libpcre2_fuzzsupport_a_SOURCES_DIST =  \
-       src/pcre2_fuzzsupport.c
-am__dirstamp = $(am__leading_dot)dirstamp
-@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@am__libs_libpcre2_fuzzsupport_a_OBJECTS = src/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.$(OBJEXT)
-_libs_libpcre2_fuzzsupport_a_OBJECTS =  \
-       $(am__libs_libpcre2_fuzzsupport_a_OBJECTS)
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -194,23 +193,33 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
-       "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
-       "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(docdir)" \
-       "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(pkgconfigdir)" \
-       "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo "  AR      " $@;
+am__v_AR_1 = 
+_libs_libpcre2_fuzzsupport_a_AR = $(AR) $(ARFLAGS)
+_libs_libpcre2_fuzzsupport_a_DEPENDENCIES =
+am___libs_libpcre2_fuzzsupport_a_SOURCES_DIST =  \
+       src/pcre2_fuzzsupport.c
+am__dirstamp = $(am__leading_dot)dirstamp
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@am__libs_libpcre2_fuzzsupport_a_OBJECTS = src/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.$(OBJEXT)
+_libs_libpcre2_fuzzsupport_a_OBJECTS =  \
+       $(am__libs_libpcre2_fuzzsupport_a_OBJECTS)
 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_convert.c src/pcre2_dfa_match.c src/pcre2_error.c \
        src/pcre2_extuni.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_jit_compile.c src/pcre2_jit_neon_inc.h \
+       src/pcre2_jit_simd_inc.h 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_serialize.c src/pcre2_string_utils.c \
-       src/pcre2_study.c src/pcre2_substitute.c src/pcre2_substring.c \
+       src/pcre2_script_run.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
 am__objects_1 = src/libpcre2_16_la-pcre2_auto_possess.lo \
@@ -229,6 +238,7 @@ am__objects_1 = src/libpcre2_16_la-pcre2_auto_possess.lo \
        src/libpcre2_16_la-pcre2_newline.lo \
        src/libpcre2_16_la-pcre2_ord2utf.lo \
        src/libpcre2_16_la-pcre2_pattern_info.lo \
+       src/libpcre2_16_la-pcre2_script_run.lo \
        src/libpcre2_16_la-pcre2_serialize.lo \
        src/libpcre2_16_la-pcre2_string_utils.lo \
        src/libpcre2_16_la-pcre2_study.lo \
@@ -258,11 +268,13 @@ am__libpcre2_32_la_SOURCES_DIST = src/pcre2_auto_possess.c \
        src/pcre2_convert.c src/pcre2_dfa_match.c src/pcre2_error.c \
        src/pcre2_extuni.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_jit_compile.c src/pcre2_jit_neon_inc.h \
+       src/pcre2_jit_simd_inc.h 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_serialize.c src/pcre2_string_utils.c \
-       src/pcre2_study.c src/pcre2_substitute.c src/pcre2_substring.c \
+       src/pcre2_script_run.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
 am__objects_3 = src/libpcre2_32_la-pcre2_auto_possess.lo \
@@ -281,6 +293,7 @@ am__objects_3 = src/libpcre2_32_la-pcre2_auto_possess.lo \
        src/libpcre2_32_la-pcre2_newline.lo \
        src/libpcre2_32_la-pcre2_ord2utf.lo \
        src/libpcre2_32_la-pcre2_pattern_info.lo \
+       src/libpcre2_32_la-pcre2_script_run.lo \
        src/libpcre2_32_la-pcre2_serialize.lo \
        src/libpcre2_32_la-pcre2_string_utils.lo \
        src/libpcre2_32_la-pcre2_study.lo \
@@ -306,11 +319,13 @@ am__libpcre2_8_la_SOURCES_DIST = src/pcre2_auto_possess.c \
        src/pcre2_convert.c src/pcre2_dfa_match.c src/pcre2_error.c \
        src/pcre2_extuni.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_jit_compile.c src/pcre2_jit_neon_inc.h \
+       src/pcre2_jit_simd_inc.h 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_serialize.c src/pcre2_string_utils.c \
-       src/pcre2_study.c src/pcre2_substitute.c src/pcre2_substring.c \
+       src/pcre2_script_run.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
 am__objects_5 = src/libpcre2_8_la-pcre2_auto_possess.lo \
@@ -329,6 +344,7 @@ am__objects_5 = src/libpcre2_8_la-pcre2_auto_possess.lo \
        src/libpcre2_8_la-pcre2_newline.lo \
        src/libpcre2_8_la-pcre2_ord2utf.lo \
        src/libpcre2_8_la-pcre2_pattern_info.lo \
+       src/libpcre2_8_la-pcre2_script_run.lo \
        src/libpcre2_8_la-pcre2_serialize.lo \
        src/libpcre2_8_la-pcre2_string_utils.lo \
        src/libpcre2_8_la-pcre2_study.lo \
@@ -357,11 +373,6 @@ libpcre2_posix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
        $(libpcre2_posix_la_CFLAGS) $(CFLAGS) \
        $(libpcre2_posix_la_LDFLAGS) $(LDFLAGS) -o $@
 @WITH_PCRE2_8_TRUE@am_libpcre2_posix_la_rpath = -rpath $(libdir)
-@WITH_PCRE2_8_TRUE@am__EXEEXT_1 = pcre2grep$(EXEEXT)
-@WITH_REBUILD_CHARTABLES_TRUE@am__EXEEXT_2 = dftables$(EXEEXT)
-@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@am__EXEEXT_3 = pcre2fuzzcheck$(EXEEXT)
-@WITH_JIT_TRUE@am__EXEEXT_4 = pcre2_jit_test$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
 am__dftables_SOURCES_DIST = src/dftables.c
 @WITH_REBUILD_CHARTABLES_TRUE@am_dftables_OBJECTS =  \
 @WITH_REBUILD_CHARTABLES_TRUE@ src/dftables.$(OBJEXT)
@@ -374,8 +385,8 @@ pcre2_jit_test_OBJECTS = $(am_pcre2_jit_test_OBJECTS)
 am__DEPENDENCIES_1 =
 @WITH_GCOV_TRUE@@WITH_JIT_TRUE@am__DEPENDENCIES_2 =  \
 @WITH_GCOV_TRUE@@WITH_JIT_TRUE@        $(am__DEPENDENCIES_1)
-@WITH_JIT_TRUE@pcre2_jit_test_DEPENDENCIES = $(am__append_19) \
-@WITH_JIT_TRUE@        $(am__append_20) $(am__append_21) \
+@WITH_JIT_TRUE@pcre2_jit_test_DEPENDENCIES = $(am__append_21) \
+@WITH_JIT_TRUE@        $(am__append_22) $(am__append_23) \
 @WITH_JIT_TRUE@        $(am__DEPENDENCIES_2)
 pcre2_jit_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
        $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
@@ -384,8 +395,10 @@ pcre2_jit_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
 am__pcre2fuzzcheck_SOURCES_DIST = src/pcre2_fuzzsupport.c
 @WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@am_pcre2fuzzcheck_OBJECTS = src/pcre2fuzzcheck-pcre2_fuzzsupport.$(OBJEXT)
 pcre2fuzzcheck_OBJECTS = $(am_pcre2fuzzcheck_OBJECTS)
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_GCOV_TRUE@@WITH_PCRE2_8_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1)
 @WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@pcre2fuzzcheck_DEPENDENCIES =  \
-@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@    libpcre2-8.la
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@    libpcre2-8.la \
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@    $(am__DEPENDENCIES_3)
 pcre2fuzzcheck_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
        $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
        $(pcre2fuzzcheck_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
@@ -394,19 +407,19 @@ am__pcre2grep_SOURCES_DIST = src/pcre2grep.c
 @WITH_PCRE2_8_TRUE@am_pcre2grep_OBJECTS =  \
 @WITH_PCRE2_8_TRUE@    src/pcre2grep-pcre2grep.$(OBJEXT)
 pcre2grep_OBJECTS = $(am_pcre2grep_OBJECTS)
-@WITH_GCOV_TRUE@@WITH_PCRE2_8_TRUE@am__DEPENDENCIES_3 =  \
+@WITH_GCOV_TRUE@@WITH_PCRE2_8_TRUE@am__DEPENDENCIES_4 =  \
 @WITH_GCOV_TRUE@@WITH_PCRE2_8_TRUE@    $(am__DEPENDENCIES_1)
 @WITH_PCRE2_8_TRUE@pcre2grep_DEPENDENCIES = $(am__DEPENDENCIES_1) \
 @WITH_PCRE2_8_TRUE@    $(am__DEPENDENCIES_1) libpcre2-8.la \
-@WITH_PCRE2_8_TRUE@    $(am__DEPENDENCIES_3)
+@WITH_PCRE2_8_TRUE@    $(am__DEPENDENCIES_4)
 pcre2grep_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pcre2grep_CFLAGS) \
        $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 am_pcre2test_OBJECTS = src/pcre2test-pcre2test.$(OBJEXT)
 pcre2test_OBJECTS = $(am_pcre2test_OBJECTS)
-@WITH_GCOV_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1)
-pcre2test_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__append_24) \
-       $(am__append_25) $(am__append_26) $(am__DEPENDENCIES_4)
+@WITH_GCOV_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1)
+pcre2test_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__append_26) \
+       $(am__append_27) $(am__append_28) $(am__DEPENDENCIES_5)
 pcre2test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pcre2test_CFLAGS) \
        $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
@@ -426,7 +439,95 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = src/$(DEPDIR)/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.Po \
+       src/$(DEPDIR)/dftables.Po \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_convert.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_dfa_match.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_error.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_extuni.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_find_bracket.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_jit_compile.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_maketables.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_match.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_match_data.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_newline.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_ord2utf.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_pattern_info.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_script_run.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_serialize.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_string_utils.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_study.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_substitute.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_substring.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_tables.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_ucd.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_valid_utf.Plo \
+       src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_convert.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_dfa_match.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_error.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_extuni.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_find_bracket.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_jit_compile.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_maketables.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_match.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_match_data.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_newline.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_ord2utf.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_pattern_info.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_script_run.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_serialize.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_string_utils.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_study.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_substitute.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_substring.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_tables.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_ucd.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_valid_utf.Plo \
+       src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_convert.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_dfa_match.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_error.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_extuni.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_find_bracket.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_jit_compile.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_maketables.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_match.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_match_data.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_newline.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_ord2utf.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_pattern_info.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_script_run.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_serialize.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_string_utils.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_study.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_substitute.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_substring.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_tables.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_ucd.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_valid_utf.Plo \
+       src/$(DEPDIR)/libpcre2_8_la-pcre2_xclass.Plo \
+       src/$(DEPDIR)/libpcre2_posix_la-pcre2posix.Plo \
+       src/$(DEPDIR)/pcre2_jit_test-pcre2_jit_test.Po \
+       src/$(DEPDIR)/pcre2fuzzcheck-pcre2_fuzzsupport.Po \
+       src/$(DEPDIR)/pcre2grep-pcre2grep.Po \
+       src/$(DEPDIR)/pcre2test-pcre2test.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -767,8 +868,6 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCRE2_DATE = @PCRE2_DATE@
-PCRE2_HAVE_INTTYPES_H = @PCRE2_HAVE_INTTYPES_H@
-PCRE2_HAVE_STDINT_H = @PCRE2_HAVE_STDINT_H@
 PCRE2_MAJOR = @PCRE2_MAJOR@
 PCRE2_MINOR = @PCRE2_MINOR@
 PCRE2_PRERELEASE = @PCRE2_PRERELEASE@
@@ -886,6 +985,7 @@ dist_html_DATA = \
   doc/html/pcre2_general_context_free.html \
   doc/html/pcre2_get_error_message.html \
   doc/html/pcre2_get_mark.html \
+  doc/html/pcre2_get_match_data_size.html \
   doc/html/pcre2_get_ovector_count.html \
   doc/html/pcre2_get_ovector_pointer.html \
   doc/html/pcre2_get_startchar.html \
@@ -896,6 +996,7 @@ dist_html_DATA = \
   doc/html/pcre2_jit_stack_create.html \
   doc/html/pcre2_jit_stack_free.html \
   doc/html/pcre2_maketables.html \
+  doc/html/pcre2_maketables_free.html \
   doc/html/pcre2_match.html \
   doc/html/pcre2_match_context_copy.html \
   doc/html/pcre2_match_context_create.html \
@@ -925,6 +1026,7 @@ dist_html_DATA = \
   doc/html/pcre2_set_parens_nest_limit.html \
   doc/html/pcre2_set_recursion_limit.html \
   doc/html/pcre2_set_recursion_memory_management.html \
+  doc/html/pcre2_set_substitute_callout.html \
   doc/html/pcre2_substitute.html \
   doc/html/pcre2_substring_copy_byname.html \
   doc/html/pcre2_substring_copy_bynumber.html \
@@ -979,6 +1081,7 @@ dist_man_MANS = \
   doc/pcre2_general_context_free.3 \
   doc/pcre2_get_error_message.3 \
   doc/pcre2_get_mark.3 \
+  doc/pcre2_get_match_data_size.3 \
   doc/pcre2_get_ovector_count.3 \
   doc/pcre2_get_ovector_pointer.3 \
   doc/pcre2_get_startchar.3 \
@@ -989,6 +1092,7 @@ dist_man_MANS = \
   doc/pcre2_jit_stack_create.3 \
   doc/pcre2_jit_stack_free.3 \
   doc/pcre2_maketables.3 \
+  doc/pcre2_maketables_free.3 \
   doc/pcre2_match.3 \
   doc/pcre2_match_context_copy.3 \
   doc/pcre2_match_context_create.3 \
@@ -1018,6 +1122,7 @@ dist_man_MANS = \
   doc/pcre2_set_parens_nest_limit.3 \
   doc/pcre2_set_recursion_limit.3 \
   doc/pcre2_set_recursion_memory_management.3 \
+  doc/pcre2_set_substitute_callout.3 \
   doc/pcre2_substitute.3 \
   doc/pcre2_substring_copy_byname.3 \
   doc/pcre2_substring_copy_bynumber.3 \
@@ -1055,7 +1160,7 @@ dist_man_MANS = \
 lib_LTLIBRARIES = $(am__append_2) $(am__append_3) $(am__append_4) \
        $(am__append_11)
 check_SCRIPTS = 
-dist_noinst_SCRIPTS = RunTest $(am__append_32)
+dist_noinst_SCRIPTS = RunTest $(am__append_34)
 
 # Additional files to delete on 'make clean', 'make distclean',
 # and 'make maintainer-clean'.
@@ -1066,8 +1171,7 @@ CLEANFILES = src/pcre2_chartables.c testSinput test3input test3output \
        test3outputA test3outputB testtry teststdout teststderr \
        teststderrgrep testtemp1grep testtemp2grep testtrygrep \
        testNinputgrep
-DISTCLEANFILES = src/config.h.in~ config.h pcre2.h.generic \
-       $(am__append_36)
+DISTCLEANFILES = src/config.h.in~ $(am__append_38)
 MAINTAINERCLEANFILES = src/pcre2.h.generic src/config.h.generic
 
 # Additional files to bundle with the distribution, over and above what
@@ -1113,22 +1217,22 @@ EXTRA_DIST = m4/ax_pthread.m4 m4/pcre2_visibility.m4 \
        src/sljit/sljitNativeX86_common.c \
        src/sljit/sljitProtExecAllocator.c src/sljit/sljitUtils.c \
        src/pcre2_jit_match.c src/pcre2_jit_misc.c \
-       src/pcre2_printint.c RunTest.bat $(am__append_31) \
+       src/pcre2_printint.c RunTest.bat $(am__append_33) \
        testdata/grepbinary testdata/grepfilelist testdata/grepinput \
        testdata/grepinput3 testdata/grepinput8 testdata/grepinputM \
        testdata/grepinputv testdata/grepinputx testdata/greplist \
        testdata/grepoutput testdata/grepoutput8 testdata/grepoutputC \
-       testdata/grepoutputN testdata/greppatN4 testdata/testinput1 \
-       testdata/testinput2 testdata/testinput3 testdata/testinput4 \
-       testdata/testinput5 testdata/testinput6 testdata/testinput7 \
-       testdata/testinput8 testdata/testinput9 testdata/testinput10 \
-       testdata/testinput11 testdata/testinput12 testdata/testinput13 \
-       testdata/testinput14 testdata/testinput15 testdata/testinput16 \
-       testdata/testinput17 testdata/testinput18 testdata/testinput19 \
-       testdata/testinput20 testdata/testinput21 testdata/testinput22 \
-       testdata/testinput23 testdata/testinput24 testdata/testinput25 \
-       testdata/testinputEBC testdata/testoutput1 \
-       testdata/testoutput2 testdata/testoutput3 \
+       testdata/grepoutputCN testdata/grepoutputN testdata/greppatN4 \
+       testdata/testinput1 testdata/testinput2 testdata/testinput3 \
+       testdata/testinput4 testdata/testinput5 testdata/testinput6 \
+       testdata/testinput7 testdata/testinput8 testdata/testinput9 \
+       testdata/testinput10 testdata/testinput11 testdata/testinput12 \
+       testdata/testinput13 testdata/testinput14 testdata/testinput15 \
+       testdata/testinput16 testdata/testinput17 testdata/testinput18 \
+       testdata/testinput19 testdata/testinput20 testdata/testinput21 \
+       testdata/testinput22 testdata/testinput23 testdata/testinput24 \
+       testdata/testinput25 testdata/testinputEBC \
+       testdata/testoutput1 testdata/testoutput2 testdata/testoutput3 \
        testdata/testoutput3A testdata/testoutput3B \
        testdata/testoutput4 testdata/testoutput5 testdata/testoutput6 \
        testdata/testoutput7 testdata/testoutput8-16-2 \
@@ -1178,12 +1282,15 @@ COMMON_SOURCES = \
   src/pcre2_internal.h \
   src/pcre2_intmodedep.h \
   src/pcre2_jit_compile.c \
+  src/pcre2_jit_neon_inc.h \
+  src/pcre2_jit_simd_inc.h \
   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_script_run.c \
   src/pcre2_serialize.c \
   src/pcre2_string_utils.c \
   src/pcre2_study.c \
@@ -1246,21 +1353,26 @@ COMMON_SOURCES = \
 @WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@_libs_libpcre2_fuzzsupport_a_CFLAGS = $(AM_CFLAGS)
 @WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@_libs_libpcre2_fuzzsupport_a_LIBADD = 
 @WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@pcre2fuzzcheck_SOURCES = src/pcre2_fuzzsupport.c
-@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@pcre2fuzzcheck_CFLAGS = -DSTANDALONE $(AM_CFLAGS)
-@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@pcre2fuzzcheck_LDADD = libpcre2-8.la
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@pcre2fuzzcheck_CFLAGS =  \
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@    -DSTANDALONE \
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@    $(AM_CFLAGS) \
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@    $(am__append_17)
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@pcre2fuzzcheck_LDADD =  \
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@    libpcre2-8.la \
+@WITH_FUZZ_SUPPORT_TRUE@@WITH_PCRE2_8_TRUE@    $(am__append_18)
 @WITH_JIT_TRUE@pcre2_jit_test_SOURCES = src/pcre2_jit_test.c
-@WITH_JIT_TRUE@pcre2_jit_test_CFLAGS = $(AM_CFLAGS) $(am__append_22)
-@WITH_JIT_TRUE@pcre2_jit_test_LDADD = $(am__append_19) \
-@WITH_JIT_TRUE@        $(am__append_20) $(am__append_21) \
-@WITH_JIT_TRUE@        $(am__append_23)
+@WITH_JIT_TRUE@pcre2_jit_test_CFLAGS = $(AM_CFLAGS) $(am__append_24)
+@WITH_JIT_TRUE@pcre2_jit_test_LDADD = $(am__append_21) \
+@WITH_JIT_TRUE@        $(am__append_22) $(am__append_23) \
+@WITH_JIT_TRUE@        $(am__append_25)
 pcre2test_SOURCES = src/pcre2test.c
-pcre2test_CFLAGS = $(AM_CFLAGS) $(am__append_27) $(am__append_28)
-pcre2test_LDADD = $(LIBREADLINE) $(am__append_24) $(am__append_25) \
-       $(am__append_26) $(am__append_29)
+pcre2test_CFLAGS = $(AM_CFLAGS) $(am__append_29) $(am__append_30)
+pcre2test_LDADD = $(LIBREADLINE) $(am__append_26) $(am__append_27) \
+       $(am__append_28) $(am__append_31)
 
 # We have .pc files for pkg-config users.
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(am__append_33) $(am__append_34) $(am__append_35)
+pkgconfig_DATA = $(am__append_35) $(am__append_36) $(am__append_37)
 
 # gcov/lcov code coverage reporting
 #
@@ -1311,8 +1423,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' $(SHELL) ./config.status'; \
            $(SHELL) ./config.status;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -1350,25 +1462,67 @@ pcre2-config: $(top_builddir)/config.status $(srcdir)/pcre2-config.in
        cd $(top_builddir) && $(SHELL) ./config.status $@
 src/pcre2.h: $(top_builddir)/config.status $(top_srcdir)/src/pcre2.h.in
        cd $(top_builddir) && $(SHELL) ./config.status $@
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
+clean-noinstPROGRAMS:
+       @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
 
 clean-noinstLIBRARIES:
        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-src/$(am__dirstamp):
-       @$(MKDIR_P) src
-       @: > src/$(am__dirstamp)
-src/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) src/$(DEPDIR)
-       @: > src/$(DEPDIR)/$(am__dirstamp)
-src/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.$(OBJEXT):  \
-       src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-.libs/$(am__dirstamp):
-       @$(MKDIR_P) .libs
-       @: > .libs/$(am__dirstamp)
-
-.libs/libpcre2-fuzzsupport.a: $(_libs_libpcre2_fuzzsupport_a_OBJECTS) $(_libs_libpcre2_fuzzsupport_a_DEPENDENCIES) $(EXTRA__libs_libpcre2_fuzzsupport_a_DEPENDENCIES) .libs/$(am__dirstamp)
-       $(AM_V_at)-rm -f .libs/libpcre2-fuzzsupport.a
-       $(AM_V_AR)$(_libs_libpcre2_fuzzsupport_a_AR) .libs/libpcre2-fuzzsupport.a $(_libs_libpcre2_fuzzsupport_a_OBJECTS) $(_libs_libpcre2_fuzzsupport_a_LIBADD)
-       $(AM_V_at)$(RANLIB) .libs/libpcre2-fuzzsupport.a
 
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
@@ -1404,6 +1558,22 @@ clean-libLTLIBRARIES:
          echo rm -f $${locs}; \
          rm -f $${locs}; \
        }
+src/$(am__dirstamp):
+       @$(MKDIR_P) src
+       @: > src/$(am__dirstamp)
+src/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) src/$(DEPDIR)
+       @: > src/$(DEPDIR)/$(am__dirstamp)
+src/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.$(OBJEXT):  \
+       src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+.libs/$(am__dirstamp):
+       @$(MKDIR_P) .libs
+       @: > .libs/$(am__dirstamp)
+
+.libs/libpcre2-fuzzsupport.a: $(_libs_libpcre2_fuzzsupport_a_OBJECTS) $(_libs_libpcre2_fuzzsupport_a_DEPENDENCIES) $(EXTRA__libs_libpcre2_fuzzsupport_a_DEPENDENCIES) .libs/$(am__dirstamp)
+       $(AM_V_at)-rm -f .libs/libpcre2-fuzzsupport.a
+       $(AM_V_AR)$(_libs_libpcre2_fuzzsupport_a_AR) .libs/libpcre2-fuzzsupport.a $(_libs_libpcre2_fuzzsupport_a_OBJECTS) $(_libs_libpcre2_fuzzsupport_a_LIBADD)
+       $(AM_V_at)$(RANLIB) .libs/libpcre2-fuzzsupport.a
 src/libpcre2_16_la-pcre2_auto_possess.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_16_la-pcre2_compile.lo: src/$(am__dirstamp) \
@@ -1436,6 +1606,8 @@ src/libpcre2_16_la-pcre2_ord2utf.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_16_la-pcre2_pattern_info.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
+src/libpcre2_16_la-pcre2_script_run.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_16_la-pcre2_serialize.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_16_la-pcre2_string_utils.lo: src/$(am__dirstamp) \
@@ -1491,6 +1663,8 @@ src/libpcre2_32_la-pcre2_ord2utf.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_32_la-pcre2_pattern_info.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
+src/libpcre2_32_la-pcre2_script_run.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_32_la-pcre2_serialize.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_32_la-pcre2_string_utils.lo: src/$(am__dirstamp) \
@@ -1546,6 +1720,8 @@ src/libpcre2_8_la-pcre2_ord2utf.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_8_la-pcre2_pattern_info.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
+src/libpcre2_8_la-pcre2_script_run.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_8_la-pcre2_serialize.lo: src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/libpcre2_8_la-pcre2_string_utils.lo: src/$(am__dirstamp) \
@@ -1574,64 +1750,6 @@ src/libpcre2_posix_la-pcre2posix.lo: src/$(am__dirstamp) \
 
 libpcre2-posix.la: $(libpcre2_posix_la_OBJECTS) $(libpcre2_posix_la_DEPENDENCIES) $(EXTRA_libpcre2_posix_la_DEPENDENCIES) 
        $(AM_V_CCLD)$(libpcre2_posix_la_LINK) $(am_libpcre2_posix_la_rpath) $(libpcre2_posix_la_OBJECTS) $(libpcre2_posix_la_LIBADD) $(LIBS)
-install-binPROGRAMS: $(bin_PROGRAMS)
-       @$(NORMAL_INSTALL)
-       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-       fi; \
-       for p in $$list; do echo "$$p $$p"; done | \
-       sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p \
-        || test -f $$p1 \
-         ; then echo "$$p"; echo "$$p"; else :; fi; \
-       done | \
-       sed -e 'p;s,.*/,,;n;h' \
-           -e 's|.*|.|' \
-           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-       sed 'N;N;N;s,\n, ,g' | \
-       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-           if ($$2 == $$4) files[d] = files[d] " " $$1; \
-           else { print "f", $$3 "/" $$4, $$1; } } \
-         END { for (d in files) print "f", d, files[d] }' | \
-       while read type dir files; do \
-           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-           test -z "$$files" || { \
-           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-           } \
-       ; done
-
-uninstall-binPROGRAMS:
-       @$(NORMAL_UNINSTALL)
-       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-       files=`for p in $$list; do echo "$$p"; done | \
-         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' \
-       `; \
-       test -n "$$list" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-       echo " rm -f" $$list; \
-       rm -f $$list || exit $$?; \
-       test -n "$(EXEEXT)" || exit 0; \
-       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-       echo " rm -f" $$list; \
-       rm -f $$list
-
-clean-noinstPROGRAMS:
-       @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
-       echo " rm -f" $$list; \
-       rm -f $$list || exit $$?; \
-       test -n "$(EXEEXT)" || exit 0; \
-       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-       echo " rm -f" $$list; \
-       rm -f $$list
 src/dftables.$(OBJEXT): src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 
@@ -1706,91 +1824,100 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dftables.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo@am__quote@
-@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_convert.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_extuni.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@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_match_data.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_newline.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_ord2utf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_pattern_info.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_serialize.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_string_utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_study.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_substitute.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_substring.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_tables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_ucd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_valid_utf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo@am__quote@
-@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_convert.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_extuni.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@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_match_data.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_newline.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_ord2utf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_pattern_info.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_serialize.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_string_utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_study.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_substitute.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_substring.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_tables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_ucd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_valid_utf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo@am__quote@
-@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_convert.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_extuni.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@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_match_data.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_newline.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_ord2utf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_pattern_info.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_serialize.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_string_utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_study.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_substitute.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_substring.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_tables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_ucd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_valid_utf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_xclass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_posix_la-pcre2posix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pcre2_jit_test-pcre2_jit_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pcre2fuzzcheck-pcre2_fuzzsupport.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pcre2grep-pcre2grep.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pcre2test-pcre2test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dftables.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_convert.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_dfa_match.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_error.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_extuni.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_find_bracket.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_jit_compile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_maketables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_match.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_match_data.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_newline.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_ord2utf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_pattern_info.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_script_run.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_serialize.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_string_utils.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_study.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_substitute.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_substring.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_tables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_ucd.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_valid_utf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_convert.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_dfa_match.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_error.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_extuni.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_find_bracket.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_jit_compile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_maketables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_match.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_match_data.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_newline.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_ord2utf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_pattern_info.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_script_run.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_serialize.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_string_utils.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_study.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_substitute.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_substring.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_tables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_ucd.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_valid_utf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_convert.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_dfa_match.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_error.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_extuni.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_find_bracket.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_jit_compile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_maketables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_match.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_match_data.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_newline.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_ord2utf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_pattern_info.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_script_run.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_serialize.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_string_utils.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_study.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_substitute.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_substring.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_tables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_ucd.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_valid_utf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_xclass.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_posix_la-pcre2posix.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pcre2_jit_test-pcre2_jit_test.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pcre2fuzzcheck-pcre2_fuzzsupport.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pcre2grep-pcre2grep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pcre2test-pcre2test.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -1942,6 +2069,13 @@ src/libpcre2_16_la-pcre2_pattern_info.lo: src/pcre2_pattern_info.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_pattern_info.lo `test -f 'src/pcre2_pattern_info.c' || echo '$(srcdir)/'`src/pcre2_pattern_info.c
 
+src/libpcre2_16_la-pcre2_script_run.lo: src/pcre2_script_run.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_script_run.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_16_la-pcre2_script_run.Tpo -c -o src/libpcre2_16_la-pcre2_script_run.lo `test -f 'src/pcre2_script_run.c' || echo '$(srcdir)/'`src/pcre2_script_run.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_16_la-pcre2_script_run.Tpo src/$(DEPDIR)/libpcre2_16_la-pcre2_script_run.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/pcre2_script_run.c' object='src/libpcre2_16_la-pcre2_script_run.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_script_run.lo `test -f 'src/pcre2_script_run.c' || echo '$(srcdir)/'`src/pcre2_script_run.c
+
 src/libpcre2_16_la-pcre2_serialize.lo: src/pcre2_serialize.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_serialize.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_16_la-pcre2_serialize.Tpo -c -o src/libpcre2_16_la-pcre2_serialize.lo `test -f 'src/pcre2_serialize.c' || echo '$(srcdir)/'`src/pcre2_serialize.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_16_la-pcre2_serialize.Tpo src/$(DEPDIR)/libpcre2_16_la-pcre2_serialize.Plo
@@ -2124,6 +2258,13 @@ src/libpcre2_32_la-pcre2_pattern_info.lo: src/pcre2_pattern_info.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_pattern_info.lo `test -f 'src/pcre2_pattern_info.c' || echo '$(srcdir)/'`src/pcre2_pattern_info.c
 
+src/libpcre2_32_la-pcre2_script_run.lo: src/pcre2_script_run.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_script_run.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_32_la-pcre2_script_run.Tpo -c -o src/libpcre2_32_la-pcre2_script_run.lo `test -f 'src/pcre2_script_run.c' || echo '$(srcdir)/'`src/pcre2_script_run.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_32_la-pcre2_script_run.Tpo src/$(DEPDIR)/libpcre2_32_la-pcre2_script_run.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/pcre2_script_run.c' object='src/libpcre2_32_la-pcre2_script_run.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_script_run.lo `test -f 'src/pcre2_script_run.c' || echo '$(srcdir)/'`src/pcre2_script_run.c
+
 src/libpcre2_32_la-pcre2_serialize.lo: src/pcre2_serialize.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_serialize.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_32_la-pcre2_serialize.Tpo -c -o src/libpcre2_32_la-pcre2_serialize.lo `test -f 'src/pcre2_serialize.c' || echo '$(srcdir)/'`src/pcre2_serialize.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_32_la-pcre2_serialize.Tpo src/$(DEPDIR)/libpcre2_32_la-pcre2_serialize.Plo
@@ -2306,6 +2447,13 @@ src/libpcre2_8_la-pcre2_pattern_info.lo: src/pcre2_pattern_info.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_pattern_info.lo `test -f 'src/pcre2_pattern_info.c' || echo '$(srcdir)/'`src/pcre2_pattern_info.c
 
+src/libpcre2_8_la-pcre2_script_run.lo: src/pcre2_script_run.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_script_run.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_8_la-pcre2_script_run.Tpo -c -o src/libpcre2_8_la-pcre2_script_run.lo `test -f 'src/pcre2_script_run.c' || echo '$(srcdir)/'`src/pcre2_script_run.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_8_la-pcre2_script_run.Tpo src/$(DEPDIR)/libpcre2_8_la-pcre2_script_run.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/pcre2_script_run.c' object='src/libpcre2_8_la-pcre2_script_run.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_script_run.lo `test -f 'src/pcre2_script_run.c' || echo '$(srcdir)/'`src/pcre2_script_run.c
+
 src/libpcre2_8_la-pcre2_serialize.lo: src/pcre2_serialize.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_serialize.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_8_la-pcre2_serialize.Tpo -c -o src/libpcre2_8_la-pcre2_serialize.lo `test -f 'src/pcre2_serialize.c' || echo '$(srcdir)/'`src/pcre2_serialize.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_8_la-pcre2_serialize.Tpo src/$(DEPDIR)/libpcre2_8_la-pcre2_serialize.Plo
@@ -2819,7 +2967,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
        fi;                                                             \
        $$success || exit 1
 
-check-TESTS:
+check-TESTS: $(check_SCRIPTS)
        @list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
        @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@@ -2876,7 +3024,10 @@ RunGrepTest.log: RunGrepTest
 @am__EXEEXT_TRUE@      $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
 @am__EXEEXT_TRUE@      "$$tst" $(AM_TESTS_FD_REDIRECT)
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        $(am__remove_distdir)
        test -d "$(distdir)" || mkdir "$(distdir)"
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -3042,12 +3193,12 @@ check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \
+all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(LTLIBRARIES) $(SCRIPTS) \
                $(MANS) $(DATA) $(HEADERS)
 install-binPROGRAMS: install-libLTLIBRARIES
 
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
@@ -3100,7 +3251,94 @@ clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
 
 distclean: distclean-am
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -rf src/$(DEPDIR)
+               -rm -f src/$(DEPDIR)/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.Po
+       -rm -f src/$(DEPDIR)/dftables.Po
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_convert.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_dfa_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_error.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_extuni.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_find_bracket.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_jit_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_maketables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_match_data.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_newline.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_ord2utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_pattern_info.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_script_run.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_serialize.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_string_utils.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_study.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_substitute.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_substring.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_tables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_ucd.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_valid_utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_convert.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_dfa_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_error.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_extuni.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_find_bracket.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_jit_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_maketables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_match_data.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_newline.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_ord2utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_pattern_info.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_script_run.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_serialize.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_string_utils.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_study.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_substitute.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_substring.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_tables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_ucd.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_valid_utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_convert.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_dfa_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_error.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_extuni.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_find_bracket.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_jit_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_maketables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_match_data.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_newline.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_ord2utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_pattern_info.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_script_run.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_serialize.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_string_utils.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_study.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_substitute.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_substring.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_tables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_ucd.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_valid_utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_xclass.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_posix_la-pcre2posix.Plo
+       -rm -f src/$(DEPDIR)/pcre2_jit_test-pcre2_jit_test.Po
+       -rm -f src/$(DEPDIR)/pcre2fuzzcheck-pcre2_fuzzsupport.Po
+       -rm -f src/$(DEPDIR)/pcre2grep-pcre2grep.Po
+       -rm -f src/$(DEPDIR)/pcre2test-pcre2test.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-hdr distclean-libtool distclean-local distclean-tags
@@ -3151,7 +3389,94 @@ installcheck-am:
 maintainer-clean: maintainer-clean-am
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
        -rm -rf $(top_srcdir)/autom4te.cache
-       -rm -rf src/$(DEPDIR)
+               -rm -f src/$(DEPDIR)/_libs_libpcre2_fuzzsupport_a-pcre2_fuzzsupport.Po
+       -rm -f src/$(DEPDIR)/dftables.Po
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_convert.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_dfa_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_error.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_extuni.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_find_bracket.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_jit_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_maketables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_match_data.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_newline.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_ord2utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_pattern_info.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_script_run.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_serialize.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_string_utils.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_study.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_substitute.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_substring.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_tables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_ucd.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_valid_utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_convert.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_dfa_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_error.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_extuni.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_find_bracket.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_jit_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_maketables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_match_data.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_newline.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_ord2utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_pattern_info.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_script_run.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_serialize.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_string_utils.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_study.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_substitute.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_substring.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_tables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_ucd.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_valid_utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_convert.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_dfa_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_error.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_extuni.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_find_bracket.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_jit_compile.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_maketables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_match.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_match_data.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_newline.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_ord2utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_pattern_info.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_script_run.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_serialize.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_string_utils.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_study.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_substitute.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_substring.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_tables.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_ucd.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_valid_utf.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_xclass.Plo
+       -rm -f src/$(DEPDIR)/libpcre2_posix_la-pcre2posix.Plo
+       -rm -f src/$(DEPDIR)/pcre2_jit_test-pcre2_jit_test.Po
+       -rm -f src/$(DEPDIR)/pcre2fuzzcheck-pcre2_fuzzsupport.Po
+       -rm -f src/$(DEPDIR)/pcre2grep-pcre2grep.Po
+       -rm -f src/$(DEPDIR)/pcre2test-pcre2test.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -3178,9 +3503,9 @@ uninstall-man: uninstall-man1 uninstall-man3
 
 .MAKE: all check check-am install install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \
-       check-am clean clean-binPROGRAMS clean-cscope clean-generic \
-       clean-libLTLIBRARIES clean-libtool clean-local \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \
+       check-TESTS check-am clean clean-binPROGRAMS clean-cscope \
+       clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
        clean-noinstLIBRARIES clean-noinstPROGRAMS cscope \
        cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
        dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
diff --git a/NEWS b/NEWS
index 94345b3cb11fb0292d57195f7c2955f77edbd808..30075d05a2905e322a835dc3d903335fbf8b9f9e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,71 @@ News about PCRE2 releases
 -------------------------
 
 
+Version 10.34 21-November-2019
+------------------------------
+
+Another release with a few enhancements as well as bugfixes and tidies. The
+main new features are:
+
+1. There is now some support for matching in invalid UTF strings.
+
+2. Non-atomic positive lookarounds are implemented in the pcre2_match()
+interpreter, but not in JIT.
+
+3. Added two new functions: pcre2_get_match_data_size() and
+pcre2_maketables_free().
+
+4. Upgraded to Unicode 12.1.0.
+
+
+Version 10.33 16-April-2019
+---------------------------
+
+Yet more bugfixes, tidies, and a few enhancements, summarized here (see
+ChangeLog for the full list):
+
+1. Callouts from pcre2_substitute() are now available.
+
+2. The POSIX functions are now all called pcre2_regcomp() etc., with wrapper
+functions that use the standard POSIX names. However, in pcre2posix.h the POSIX
+names are defined as macros. This should help avoid linking with the wrong
+library in some environments, while still exporting the POSIX names for
+pre-existing programs that use them.
+
+3. Some new options:
+
+   (a) PCRE2_EXTRA_ESCAPED_CR_IS_LF makes \r behave as \n.
+
+   (b) PCRE2_EXTRA_ALT_BSUX enables support for ECMAScript 6's \u{hh...}
+       construct.
+
+   (c) PCRE2_COPY_MATCHED_SUBJECT causes a copy of a matched subject to be
+       made, instead of just remembering a pointer.
+
+4. Some new Perl features:
+
+   (a) Perl 5.28's experimental alphabetic names for atomic groups and
+       lookaround assertions, for example, (*pla:...) and (*atomic:...).
+
+   (b) The new Perl "script run" features (*script_run:...) and
+       (*atomic_script_run:...) aka (*sr:...) and (*asr:...).
+
+   (c) When PCRE2_UTF is set, allow non-ASCII letters and decimal digits in
+       capture group names.
+
+5. --disable-percent-zt disables the use of %zu and %td in formatting strings
+in pcre2test. They were already automatically disabled for VC and older C
+compilers.
+
+6. Some changes related to callouts in pcre2grep:
+
+   (a) Support for running an external program under VMS has been added, in
+       addition to Windows and fork() support.
+
+   (b) --disable-pcre2grep-callout-fork restricts the callout support in
+       to the inbuilt echo facility.
+
+
 Version 10.32 10-September-2018
 -------------------------------
 
index b742ed34801de12758db1d2656e4705ddf52b70e..39e7620aae052f87337801116b48f122ad0223c5 100644 (file)
@@ -48,7 +48,7 @@ can skip ahead to the CMake section.
      macro to specify what character(s) you want to be interpreted as line
      terminators by default.
 
-     When you compile any of the PCRE2 modules, you must specify
+     When you subsequently compile any of the PCRE2 modules, you must specify
      -DHAVE_CONFIG_H to your compiler so that src/config.h is included in the
      sources.
 
@@ -62,6 +62,11 @@ can skip ahead to the CMake section.
      new release, you are strongly advised to review src/config.h.generic
      before re-using what you had previously.
 
+     Note also that the src/config.h.generic file is created from a config.h
+     that was generated by Autotools, which automatically includes settings of
+     a number of macros that are not actually used by PCRE2 (for example,
+     HAVE_MEMORY_H).
+
  (2) Copy or rename the file src/pcre2.h.generic as src/pcre2.h.
 
  (3) EITHER:
@@ -104,6 +109,7 @@ can skip ahead to the CMake section.
        pcre2_newline.c
        pcre2_ord2utf.c
        pcre2_pattern_info.c
+       pcre2_script_run.c
        pcre2_serialize.c
        pcre2_string_utils.c
        pcre2_study.c
@@ -395,6 +401,6 @@ Everything in that location, source and executable, is in EBCDIC and native
 z/OS file formats. The port provides an API for LE languages such as COBOL and
 for the z/OS and z/VM versions of the Rexx languages.
 
-===========================
-Last Updated: 19 April 2018
-===========================
+==============================
+Last Updated: 14 November 2018
+==============================
diff --git a/README b/README
index 2eb621b0ffcd7122f505ae177aa209a14d2c6139..8ce6f968abcacfee01ef470e3acb80bc4f3e7950 100644 (file)
--- a/README
+++ b/README
@@ -1,13 +1,15 @@
 README file for PCRE2 (Perl-compatible regular expression library)
 ------------------------------------------------------------------
 
-PCRE2 is a re-working of the original PCRE library to provide an entirely new
-API. The latest release of PCRE2 is always available in three alternative
-formats from:
+PCRE2 is a re-working of the original PCRE1 library to provide an entirely new
+API. Since its initial release in 2015, there has been further development of
+the code and it now differs from PCRE1 in more than just the API. There are new
+features and the internals have been improved. The latest release of PCRE2 is
+available in three alternative formats from:
 
-  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-xxx.tar.gz
-  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-xxx.tar.bz2
-  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-xxx.zip
+https://ftp.pcre.org/pub/pcre/pcre2-10.xx.tar.gz
+https://ftp.pcre.org/pub/pcre/pcre2-10.xx.tar.bz2
+https://ftp.pcre.org/pub/pcre/pcre2-10.xx.tar.zip
 
 There is a mailing list for discussion about the development of PCRE (both the
 original and new APIs) at pcre-dev@exim.org. You can access the archives and
@@ -39,13 +41,13 @@ The PCRE2 APIs
 PCRE2 is written in C, and it has its own API. There are three sets of
 functions, one for the 8-bit library, which processes strings of bytes, one for
 the 16-bit library, which processes strings of 16-bit values, and one for the
-32-bit library, which processes strings of 32-bit values. There are no C++
-wrappers.
+32-bit library, which processes strings of 32-bit values. Unlike PCRE1, there
+are no C++ wrappers.
 
 The distribution does contain a set of C wrapper functions for the 8-bit
 library that are based on the POSIX regular expression API (see the pcre2posix
-man page). These can be found in a library called libpcre2-posix. Note that
-this just provides a POSIX calling interface to PCRE2; the regular expressions
+man page). These are built into a library called libpcre2-posix. Note that this
+just provides a POSIX calling interface to PCRE2; the regular expressions
 themselves still follow Perl syntax and semantics. The POSIX API is restricted,
 and does not give full access to all of PCRE2's facilities.
 
@@ -53,20 +55,8 @@ The header file for the POSIX-style functions is called pcre2posix.h. The
 official POSIX name is regex.h, but I did not want to risk possible problems
 with existing files of that name by distributing it that way. To use PCRE2 with
 an existing program that uses the POSIX API, pcre2posix.h will have to be
-renamed or pointed at by a link.
-
-If you are using the POSIX interface to PCRE2 and there is already a POSIX
-regex library installed on your system, as well as worrying about the regex.h
-header file (as mentioned above), you must also take care when linking programs
-to ensure that they link with PCRE2's libpcre2-posix library. Otherwise they
-may pick up the POSIX functions of the same name from the other library.
-
-One way of avoiding this confusion is to compile PCRE2 with the addition of
--Dregcomp=PCRE2regcomp (and similarly for the other POSIX functions) to the
-compiler flags (CFLAGS if you are using "configure" -- see below). This has the
-effect of renaming the functions so that the names no longer clash. Of course,
-you have to do the same thing for your applications, or write them using the
-new names.
+renamed or pointed at by a link (or the program modified, of course). See the
+pcre2posix documentation for more details.
 
 
 Documentation for PCRE2
@@ -174,9 +164,11 @@ library. They are also documented in the pcre2build man page.
   will be a compile time error. If in doubt, use --enable-jit=auto, which
   enables JIT only if the current hardware is supported.
 
-. If you are enabling JIT under SELinux you may also want to add
-  --enable-jit-sealloc, which enables the use of an execmem allocator in JIT
-  that is compatible with SELinux. This has no effect if JIT is not enabled.
+. If you are enabling JIT under SELinux environment you may also want to add
+  --enable-jit-sealloc, which enables the use of an executable memory allocator
+  that is compatible with SELinux. Warning: this allocator is experimental!
+  It does not support fork() operation and may crash when no disk space is
+  available. This option has no effect if JIT is disabled.
 
 . If you do not want to make use of the default support for UTF-8 Unicode
   character strings in the 8-bit library, UTF-16 Unicode character strings in
@@ -323,7 +315,11 @@ library. They are also documented in the pcre2build man page.
 . There is support for calling external programs during matching in the
   pcre2grep command, using PCRE2's callout facility with string arguments. This
   support can be disabled by adding --disable-pcre2grep-callout to the
-  "configure" command.
+  "configure" command. There are two kinds of callout: one that generates
+  output from inbuilt code, and another that calls an external program. The
+  latter has special support for Windows and VMS; otherwise it assumes the
+  existence of the fork() function. This facility can be disabled by adding
+  --disable-pcre2grep-callout-fork to the "configure" command.
 
 . The pcre2grep program currently supports only 8-bit data files, and so
   requires the 8-bit PCRE2 library. It is possible to compile pcre2grep to use
@@ -376,6 +372,15 @@ library. They are also documented in the pcre2build man page.
   tgetflag, or tgoto, this is the problem, and linking with the ncurses library
   should fix it.
 
+. The C99 standard defines formatting modifiers z and t for size_t and
+  ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in
+  environments other than Microsoft Visual Studio when __STDC_VERSION__ is
+  defined and has a value greater than or equal to 199901L (indicating C99).
+  However, there is at least one environment that claims to be C99 but does not
+  support these modifiers. If --disable-percent-zt is specified, no use is made
+  of the z or t modifiers. Instead or %td or %zu, %lu is used, with a cast for
+  size_t values.
+
 . There is a special option called --enable-fuzz-support for use by people who
   want to run fuzzing tests on PCRE2. At present this applies only to the 8-bit
   library. If set, it causes an extra library called libpcre2-fuzzsupport.a to
@@ -789,6 +794,7 @@ The distribution should contain the files listed below.
   src/pcre2_newline.c      )
   src/pcre2_ord2utf.c      )
   src/pcre2_pattern_info.c )
+  src/pcre2_script_run.c   )
   src/pcre2_serialize.c    )
   src/pcre2_string_utils.c )
   src/pcre2_study.c        )
@@ -888,4 +894,4 @@ The distribution should contain the files listed below.
 Philip Hazel
 Email local part: ph10
 Email domain: cam.ac.uk
-Last updated: 17 June 2018
+Last updated: 16 April 2019
index 74ff4c13c56ae80d849c7b0d55c9b270c8f79490..1113cd49754528e0bf112359a2d46fab5871f5a2 100755 (executable)
@@ -8,7 +8,7 @@
 # * Put printf arguments in single, not double quotes to avoid unwanted
 #     escaping.
 # * Use \0 for binary zero in printf, not \x0, for the benefit of older
-#     versions.
+#     versions (and use octal for other special values).
 
 # Set the C locale, so that sort(1) behaves predictably.
 
@@ -170,11 +170,11 @@ echo "---------------------------- Test 14 -----------------------------" >>test
 echo "RC=$?" >>testtrygrep
 
 echo "---------------------------- Test 15 -----------------------------" >>testtrygrep
-(cd $srcdir; $valgrind $vjs $pcre2grep 'abc^*' ./testdata/grepinput) 2>>testtrygrep >>testtrygrep
+(cd $srcdir; $valgrind $vjs $pcre2grep 'abc^*' ./testdata/grepinput) >>testtrygrep 2>&1
 echo "RC=$?" >>testtrygrep
 
 echo "---------------------------- Test 16 -----------------------------" >>testtrygrep
-(cd $srcdir; $valgrind $vjs $pcre2grep abc ./testdata/grepinput ./testdata/nonexistfile) 2>>testtrygrep >>testtrygrep
+(cd $srcdir; $valgrind $vjs $pcre2grep abc ./testdata/grepinput ./testdata/nonexistfile) >>testtrygrep 2>&1
 echo "RC=$?" >>testtrygrep
 
 echo "---------------------------- Test 17 -----------------------------" >>testtrygrep
@@ -296,7 +296,7 @@ echo "---------------------------- Test 45 ------------------------------" >>tes
 echo "RC=$?" >>testtrygrep
 
 echo "---------------------------- Test 46 ------------------------------" >>testtrygrep
-(cd $srcdir; $valgrind $vjs $pcre2grep -eabc -e '(unclosed' ./testdata/grepinput) 2>>testtrygrep >>testtrygrep
+(cd $srcdir; $valgrind $vjs $pcre2grep -eabc -e '(unclosed' ./testdata/grepinput) >>testtrygrep 2>&1
 echo "RC=$?" >>testtrygrep
 
 echo "---------------------------- Test 47 ------------------------------" >>testtrygrep
@@ -653,6 +653,13 @@ printf 'ABC\0XYZ\nABCDEF\nDEFABC\n' >testtemp2grep
 $valgrind $vjs $pcre2grep -a -f testtemp1grep testtemp2grep >>testtrygrep
 echo "RC=$?" >>testtrygrep
 
+echo "---------------------------- Test 127 -----------------------------" >>testtrygrep
+(cd $srcdir; $valgrind $vjs $pcre2grep -o --om-capture=0 'pattern()()()()' testdata/grepinput) >>testtrygrep
+echo "RC=$?" >>testtrygrep
+
+echo "---------------------------- Test 128 -----------------------------" >>testtrygrep
+(cd $srcdir; $valgrind $vjs $pcre2grep -o1 --om-capture=0 'pattern()()()()' testdata/grepinput) >>testtrygrep 2>&1
+echo "RC=$?" >>testtrygrep
 
 # Now compare the results.
 
@@ -677,6 +684,16 @@ if [ $utf8 -ne 0 ] ; then
   (cd $srcdir; $valgrind $vjs $pcre2grep --line-offsets -u --newline=any '(?<=\K\x{17f})' ./testdata/grepinput8) >>testtrygrep
   echo "RC=$?" >>testtrygrep
 
+  echo "---------------------------- Test U4 ------------------------------" >>testtrygrep
+  printf 'A\341\200\200\200CD\342\200\200Z\n' >testtemp1grep
+  (cd $srcdir; $valgrind $vjs $pcre2grep -u -o '....' $builddir/testtemp1grep) >>testtrygrep 2>&1
+  echo "RC=$?" >>testtrygrep
+
+  echo "---------------------------- Test U5 ------------------------------" >>testtrygrep
+  printf 'A\341\200\200\200CD\342\200\200Z\n' >testtemp1grep
+  (cd $srcdir; $valgrind $vjs $pcre2grep -U -o '....' $builddir/testtemp1grep) >>testtrygrep
+  echo "RC=$?" >>testtrygrep
+
   $cf $srcdir/testdata/grepoutput8 testtrygrep
   if [ $? != 0 ] ; then exit 1; fi
 
@@ -714,34 +731,46 @@ $valgrind $vjs $pcre2grep -n --newline=any "^(abc|def|ghi|jkl)" testNinputgrep >
 printf '%c--------------------------- Test N6 ------------------------------\r\n' - >>testtrygrep
 $valgrind $vjs $pcre2grep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
 
-# It seems impossible to handle NUL characters easily in Solaris (aka SunOS).
-# The version of sed explicitly doesn't like them. For the moment, we just
-# don't run this test under SunOS. Fudge the output so that the comparison
-# works. A similar problem has also been reported for MacOS (Darwin).
+# It seems impossible to handle NUL characters easily in many operating
+# systems, including Solaris (aka SunOS), where the version of sed explicitly
+# doesn't like them, and also MacOS (Darwin), OpenBSD, FreeBSD, and NetBSD. So
+# now we run this test only on OS that are known to work. For the rest, we
+# fudge the output so that the comparison works.
 
 printf '%c--------------------------- Test N7 ------------------------------\r\n' - >>testtrygrep
 uname=`uname`
-if [ "$uname" != "SunOS" -a "$uname" != "Darwin" ] ; then
-  printf 'abc\0def' >testNinputgrep
-  $valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | sed 's/\x00/ZERO/' >>testtrygrep
-  echo "" >>testtrygrep
-else
-  echo '1:abcZERO2:def' >>testtrygrep
-fi
+case $uname in
+  Linux)
+    printf 'abc\0def' >testNinputgrep
+    $valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | sed 's/\x00/ZERO/' >>testtrygrep
+    echo "" >>testtrygrep
+    ;;
+  *)
+    echo '1:abcZERO2:def' >>testtrygrep
+    ;;
+esac
 
 $cf $srcdir/testdata/grepoutputN testtrygrep
 if [ $? != 0 ] ; then exit 1; fi
 
-# If pcre2grep supports script callouts, run some tests on them.
+# If pcre2grep supports script callouts, run some tests on them. It is possible
+# to restrict these callouts to the non-fork case, either for security, or for
+# environments that do not support fork(). This is handled by comparing to a
+# different output.
 
-if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'Callout scripts in patterns are supported'; then
+if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scripts in patterns are supported'; then
   echo "Testing pcre2grep script callouts"
   $valgrind $vjs $pcre2grep '(T)(..(.))(?C"/bin/echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4) ($14) ($0)")()' $srcdir/testdata/grepinputv >testtrygrep
   $valgrind $vjs $pcre2grep '(T)(..(.))()()()()()()()(..)(?C"/bin/echo|Arg1: [$11] [${11}]")' $srcdir/testdata/grepinputv >>testtrygrep
   $valgrind $vjs $pcre2grep '(T)(?C"|$0:$1$n")' $srcdir/testdata/grepinputv >>testtrygrep
   $valgrind $vjs $pcre2grep '(T)(?C"|$1$n")(*F)' $srcdir/testdata/grepinputv >>testtrygrep
-  # The above has no newline, which 'diff -ub' ignores, so add one.
-  $cf $srcdir/testdata/grepoutputC testtrygrep
+
+  if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'Non-fork callout scripts in patterns are supported'; then
+    $cf $srcdir/testdata/grepoutputCN testtrygrep
+  else
+    $cf $srcdir/testdata/grepoutputC testtrygrep
+  fi
+
   if [ $? != 0 ] ; then exit 1; fi
 else
   echo "Script callouts are not supported"
index 50a96448f70cacbfccb63f0b59ec371fb776d6de..4a095a36ebc19e94ff08c7746e4164497b4cc612 100644 (file)
@@ -653,14 +653,19 @@ if ERRORLEVEL 1 exit /b 1
 \r
 :: If pcre2grep supports script callouts, run some tests on them.\r
 \r
-%pcre2grep% --help | %pcre2grep% -q "Callout scripts in patterns are supported"\r
+%pcre2grep% --help | %pcre2grep% -q "callout scripts in patterns are supported"\r
 if %ERRORLEVEL% equ 0 (\r
   echo Testing pcre2grep script callouts\r
   %pcre2grep% "(T)(..(.))(?C'cmd|/c echo|Arg1: [$1] [$2] [$3]|Arg2: ^$|${1}^$| ($4) ($14) ($0)')()" %srcdir%/testdata/grepinputv >testtrygrep\r
   %pcre2grep% "(T)(..(.))()()()()()()()(..)(?C'cmd|/c echo|Arg1: [$11] [${11}]')" %srcdir%/testdata/grepinputv >>testtrygrep\r
   %pcre2grep% "(T)(?C'|$0:$1$n')" %srcdir%/testdata/grepinputv >>testtrygrep\r
   %pcre2grep% "(T)(?C'|$1$n')(*F)" %srcdir%/testdata/grepinputv >>testtrygrep\r
-  %cf% %srcdir%\testdata\grepoutputC testtrygrep %cfout%\r
+  %pcre2grep% --help | %pcre2grep% -q "Non-script callout scripts in patterns are supported"\r
+  if %ERRORLEVEL% equ 0 (\r
+    %cf% %srcdir%\testdata\grepoutputCN testtrygrep %cfout%\r
+  ) else (\r
+    %cf% %srcdir%\testdata\grepoutputC testtrygrep %cfout%\r
+  )\r
   if ERRORLEVEL 1 exit /b 1\r
 ) else (\r
   echo Script callouts are not supported\r
diff --git a/RunTest b/RunTest
index 39f04d4061bf8f1682047e5b5ee91317f6fb2962..6715d153053a625dde45d5529c83ee0f1566b641 100755 (executable)
--- a/RunTest
+++ b/RunTest
@@ -319,7 +319,7 @@ fi
 # If it is possible to set the system stack size and -bigstack was given,
 # set up a large stack.
 
-$sim ./pcre2test -S 1 /dev/null /dev/null
+$sim ./pcre2test -S 64 /dev/null /dev/null
 if [ $? -eq 0 -a "$bigstack" != "" ] ; then
   setstack="-S 64"
 else
index cc10b262ef2f6ec62108c82edb5277f8bf4791da..87e34b082afd95d4b687880ac886f3fcd694e937 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -364,7 +364,7 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
         [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
 ])dnl PKG_HAVE_DEFINE_WITH_MODULES
 
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -376,10 +376,10 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.16'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15.1], [],
+m4_if([$1], [1.16.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -395,12 +395,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15.1])dnl
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -462,7 +462,7 @@ AC_SUBST([AR])dnl
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -514,7 +514,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -545,7 +545,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -736,13 +736,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -750,49 +749,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  AS_CASE([$CONFIG_FILES],
+          [*\'*], [eval set x "$CONFIG_FILES"],
+          [*], [set x $CONFIG_FILES])
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`AS_DIRNAME(["$am_mf"])`
+    am_filepart=`AS_BASENAME(["$am_mf"])`
+    AM_RUN_LOG([cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles]) || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).])
+  fi
+  AS_UNSET([am_dirpart])
+  AS_UNSET([am_filepart])
+  AS_UNSET([am_mf])
+  AS_UNSET([am_rc])
+  rm -f conftest-deps.mk
 }
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
@@ -801,18 +792,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # -----------------------------
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -899,8 +889,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target (and possibly the TAP driver).  The
 # system "awk" is bad on some platforms.
@@ -967,7 +957,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -1009,7 +999,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1030,7 +1020,7 @@ if test x"${install_sh+set}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2017 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1051,7 +1041,7 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1059,49 +1049,42 @@ AC_SUBST([am__leading_dot])])
 
 # AM_MAKE_INCLUDE()
 # -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
 AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+      ['0:this is the am__doit target'],
+      [AS_CASE([$s],
+          [BSD], [am__include='.include' am__quote='"'],
+          [am__include='include' am__quote=''])])
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1140,7 +1123,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1169,7 +1152,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1216,7 +1199,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1235,7 +1218,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1316,7 +1299,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1376,7 +1359,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1404,7 +1387,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1423,7 +1406,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2017 Free Software Foundation, Inc.
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/ar-lib b/ar-lib
index 05094d34c696249b10c58ac61f381a3f3b54f501..0baa4f607608a8e07a0e2be8ae0735791a9b1a68 100755 (executable)
--- a/ar-lib
+++ b/ar-lib
@@ -4,7 +4,7 @@
 me=ar-lib
 scriptversion=2012-03-01.08; # UTC
 
-# Copyright (C) 2010-2017 Free Software Foundation, Inc.
+# Copyright (C) 2010-2018 Free Software Foundation, Inc.
 # Written by Peter Rosin <peda@lysator.liu.se>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@ scriptversion=2012-03-01.08; # UTC
 # 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/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
diff --git a/compile b/compile
index 2ab71e4ea13e0e902ec8a5357546f0a10d3f67ea..99e50524b3bade179355469777b4d664bcd5c964 100755 (executable)
--- a/compile
+++ b/compile
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
 # 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/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -340,7 +340,7 @@ exit $ret
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 9b4f15da4ddb212344ae0869bdbf0b8d701ea60d..529b00935598b8f6f1e45c425d4386f1bb5abe9b 100644 (file)
@@ -18,6 +18,7 @@
 #cmakedefine SUPPORT_PCRE2_16 1
 #cmakedefine SUPPORT_PCRE2_32 1
 #cmakedefine PCRE2_DEBUG 1
+#cmakedefine DISABLE_PERCENT_ZT 1
 
 #cmakedefine SUPPORT_LIBBZ2 1
 #cmakedefine SUPPORT_LIBEDIT 1
@@ -27,6 +28,8 @@
 #cmakedefine SUPPORT_JIT 1
 #cmakedefine SLJIT_PROT_EXECUTABLE_ALLOCATOR 1
 #cmakedefine SUPPORT_PCRE2GREP_JIT 1
+#cmakedefine SUPPORT_PCRE2GREP_CALLOUT 1
+#cmakedefine SUPPORT_PCRE2GREP_CALLOUT_FORK 1
 #cmakedefine SUPPORT_UNICODE 1
 #cmakedefine SUPPORT_VALGRIND 1
 
index 2193702b12af303e32e673f25121fb646aa68d95..256083a70d35921d544b15f4f51749af89d18b89 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2017 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2017-05-27'
+timestamp='2018-03-08'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2017-05-27'
 # 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/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -27,7 +27,7 @@ timestamp='2017-05-27'
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 #
 # Please send patches to <config-patches@gnu.org>.
 
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
 
 Output the configuration name of the system \`$me' is run on.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -107,9 +107,9 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 dummy=$tmp/dummy ;
 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
 case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
+ ,,)    echo "int x;" > "$dummy.c" ;
        for c in cc gcc c89 c99 ; do
-         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+         if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
             CC_FOR_BUILD="$c"; break ;
          fi ;
        done ;
@@ -132,14 +132,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
        # If the system lacks a compiler, then just pick glibc.
        # We could probably try harder.
        LIBC=gnu
 
-       eval $set_cc_for_build
-       cat <<-EOF > $dummy.c
+       eval "$set_cc_for_build"
+       cat <<-EOF > "$dummy.c"
        #include <features.h>
        #if defined(__UCLIBC__)
        LIBC=uclibc
@@ -149,13 +149,20 @@ Linux|GNU|GNU/*)
        LIBC=gnu
        #endif
        EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+       # If ldd exists, use it to detect musl libc.
+       if command -v ldd >/dev/null && \
+               ldd --version 2>&1 | grep -q ^musl
+       then
+           LIBC=musl
+       fi
        ;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +176,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # portion of the name.  We always set it to "unknown".
        sysctl="sysctl -n hw.machine_arch"
        UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-           /sbin/$sysctl 2>/dev/null || \
-           /usr/sbin/$sysctl 2>/dev/null || \
+           "/sbin/$sysctl" 2>/dev/null || \
+           "/usr/sbin/$sysctl" 2>/dev/null || \
            echo unknown)`
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
            sh5el) machine=sh5le-unknown ;;
            earmv*)
-               arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-               endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-               machine=${arch}${endian}-unknown
+               arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+               endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+               machine="${arch}${endian}"-unknown
                ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+           *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
        esac
        # The Operating System including object format, if it has switched
        # to ELF recently (or will in the future) and ABI.
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            earm*)
                os=netbsdelf
                ;;
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
+               eval "$set_cc_for_build"
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep -q __ELF__
                then
@@ -208,10 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # Determine ABI tags.
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            earm*)
                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-               abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+               abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
                ;;
        esac
        # The OS release
@@ -219,46 +226,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # thus, need a distinct triplet. However, they do not need
        # kernel version information, so it can be replaced with a
        # suitable tag, in the style of linux-gnu.
-       case "${UNAME_VERSION}" in
+       case "$UNAME_VERSION" in
            Debian*)
                release='-gnu'
                ;;
            *)
-               release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+               release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
                ;;
        esac
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "${machine}-${os}${release}${abi}"
+       echo "$machine-${os}${release}${abi}"
        exit ;;
     *:Bitrig:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
        exit ;;
     *:OpenBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
        exit ;;
     *:LibertyBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+       exit ;;
+    *:MidnightBSD:*:*)
+       echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
        exit ;;
     *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
        exit ;;
     *:SolidBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
        exit ;;
     macppc:MirBSD:*:*)
-       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:MirBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:Sortix:*:*)
-       echo ${UNAME_MACHINE}-unknown-sortix
+       echo "$UNAME_MACHINE"-unknown-sortix
+       exit ;;
+    *:Redox:*:*)
+       echo "$UNAME_MACHINE"-unknown-redox
        exit ;;
+    mips:OSF1:*.*)
+        echo mips-dec-osf1
+        exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -310,28 +326,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+       echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
        exitcode=$?
        trap '' 0
        exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # Should we change UNAME_MACHINE based on the output of uname instead
-       # of the specific Alpha model?
-       echo alpha-pc-interix
-       exit ;;
-    21064:Windows_NT:50:3)
-       echo alpha-dec-winnt3.5
-       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
        exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-amigaos
+       echo "$UNAME_MACHINE"-unknown-amigaos
        exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-morphos
+       echo "$UNAME_MACHINE"-unknown-morphos
        exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
@@ -343,7 +350,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-       echo arm-acorn-riscix${UNAME_RELEASE}
+       echo arm-acorn-riscix"$UNAME_RELEASE"
        exit ;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
        echo arm-unknown-riscos
@@ -370,19 +377,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     s390x:SunOS:*:*)
-       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
        exit ;;
     sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
        exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-       echo i386-pc-auroraux${UNAME_RELEASE}
+       echo i386-pc-auroraux"$UNAME_RELEASE"
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       eval $set_cc_for_build
+       eval "$set_cc_for_build"
        SUN_ARCH=i386
        # If there is a compiler, see if it is configured for 64-bit objects.
        # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -395,13 +402,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                SUN_ARCH=x86_64
            fi
        fi
-       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
@@ -410,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
        exit ;;
     sun3*:SunOS:*:*)
-       echo m68k-sun-sunos${UNAME_RELEASE}
+       echo m68k-sun-sunos"$UNAME_RELEASE"
        exit ;;
     sun*:*:4.2BSD:*)
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-       test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+       test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
        case "`/bin/arch`" in
            sun3)
-               echo m68k-sun-sunos${UNAME_RELEASE}
+               echo m68k-sun-sunos"$UNAME_RELEASE"
                ;;
            sun4)
-               echo sparc-sun-sunos${UNAME_RELEASE}
+               echo sparc-sun-sunos"$UNAME_RELEASE"
                ;;
        esac
        exit ;;
     aushp:SunOS:*:*)
-       echo sparc-auspex-sunos${UNAME_RELEASE}
+       echo sparc-auspex-sunos"$UNAME_RELEASE"
        exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -439,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-       echo m68k-milan-mint${UNAME_RELEASE}
+       echo m68k-milan-mint"$UNAME_RELEASE"
        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-       echo m68k-hades-mint${UNAME_RELEASE}
+       echo m68k-hades-mint"$UNAME_RELEASE"
        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-       echo m68k-unknown-mint${UNAME_RELEASE}
+       echo m68k-unknown-mint"$UNAME_RELEASE"
        exit ;;
     m68k:machten:*:*)
-       echo m68k-apple-machten${UNAME_RELEASE}
+       echo m68k-apple-machten"$UNAME_RELEASE"
        exit ;;
     powerpc:machten:*:*)
-       echo powerpc-apple-machten${UNAME_RELEASE}
+       echo powerpc-apple-machten"$UNAME_RELEASE"
        exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
        exit ;;
     RISC*:ULTRIX:*:*)
-       echo mips-dec-ultrix${UNAME_RELEASE}
+       echo mips-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     VAX*:ULTRIX*:*:*)
-       echo vax-dec-ultrix${UNAME_RELEASE}
+       echo vax-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-       echo clipper-intergraph-clix${UNAME_RELEASE}
+       echo clipper-intergraph-clix"$UNAME_RELEASE"
        exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       eval "$set_cc_for_build"
+       sed 's/^        //' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
        int main (int argc, char *argv[]) {
@@ -485,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 #endif
        #if defined (host_mips) && defined (MIPSEB)
        #if defined (SYSTYPE_SYSV)
-         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
        #endif
        #if defined (SYSTYPE_SVR4)
-         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
        #endif
        #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
        #endif
        #endif
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c &&
-         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-         SYSTEM_NAME=`$dummy $dummyarg` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+         dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
            { echo "$SYSTEM_NAME"; exit; }
-       echo mips-mips-riscos${UNAME_RELEASE}
+       echo mips-mips-riscos"$UNAME_RELEASE"
        exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
@@ -527,17 +534,17 @@ EOF
     AViiON:dgux:*:*)
        # DG/UX returns AViiON for all architectures
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
        then
-           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+              [ "$TARGET_BINARY_INTERFACE"x = x ]
            then
-               echo m88k-dg-dgux${UNAME_RELEASE}
+               echo m88k-dg-dgux"$UNAME_RELEASE"
            else
-               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+               echo m88k-dg-dguxbcs"$UNAME_RELEASE"
            fi
        else
-           echo i586-dg-dgux${UNAME_RELEASE}
+           echo i586-dg-dgux"$UNAME_RELEASE"
        fi
        exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
@@ -554,7 +561,7 @@ EOF
        echo m68k-tektronix-bsd
        exit ;;
     *:IRIX*:*:*)
-       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
        exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
@@ -566,14 +573,14 @@ EOF
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               eval $set_cc_for_build
-               sed 's/^                //' << EOF >$dummy.c
+               eval "$set_cc_for_build"
+               sed 's/^                //' << EOF > "$dummy.c"
                #include <sys/systemcfg.h>
 
                main()
@@ -584,7 +591,7 @@ EOF
                        exit(0);
                        }
 EOF
-               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
                then
                        echo "$SYSTEM_NAME"
                else
@@ -598,7 +605,7 @@ EOF
        exit ;;
     *:AIX:*:[4567])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+       if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
        else
                IBM_ARCH=powerpc
@@ -607,18 +614,18 @@ EOF
                IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
                           awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
        exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
        echo romp-ibm-bsd4.4
        exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
        exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
@@ -633,28 +640,28 @@ EOF
        echo m68k-hp-bsd4.4
        exit ;;
     9000/[34678]??:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       case "${UNAME_MACHINE}" in
-           9000/31? )            HP_ARCH=m68000 ;;
-           9000/[34]?? )         HP_ARCH=m68k ;;
+       HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+       case "$UNAME_MACHINE" in
+           9000/31?)            HP_ARCH=m68000 ;;
+           9000/[34]??)         HP_ARCH=m68k ;;
            9000/[678][0-9][0-9])
                if [ -x /usr/bin/getconf ]; then
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                   case "${sc_cpu_version}" in
+                   case "$sc_cpu_version" in
                      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
                      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
                      532)                      # CPU_PA_RISC2_0
-                       case "${sc_kernel_bits}" in
+                       case "$sc_kernel_bits" in
                          32) HP_ARCH=hppa2.0n ;;
                          64) HP_ARCH=hppa2.0w ;;
                          '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
                        esac ;;
                    esac
                fi
-               if [ "${HP_ARCH}" = "" ]; then
-                   eval $set_cc_for_build
-                   sed 's/^            //' << EOF >$dummy.c
+               if [ "$HP_ARCH" = "" ]; then
+                   eval "$set_cc_for_build"
+                   sed 's/^            //' << EOF > "$dummy.c"
 
                #define _HPUX_SOURCE
                #include <stdlib.h>
@@ -687,13 +694,13 @@ EOF
                    exit (0);
                }
 EOF
-                   (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
                    test -z "$HP_ARCH" && HP_ARCH=hppa
                fi ;;
        esac
-       if [ ${HP_ARCH} = hppa2.0w ]
+       if [ "$HP_ARCH" = hppa2.0w ]
        then
-           eval $set_cc_for_build
+           eval "$set_cc_for_build"
 
            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -712,15 +719,15 @@ EOF
                HP_ARCH=hppa64
            fi
        fi
-       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
        exit ;;
     ia64:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       echo ia64-hp-hpux${HPUX_REV}
+       HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+       echo ia64-hp-hpux"$HPUX_REV"
        exit ;;
     3050*:HI-UX:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       eval "$set_cc_for_build"
+       sed 's/^        //' << EOF > "$dummy.c"
        #include <unistd.h>
        int
        main ()
@@ -745,11 +752,11 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
                { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
        exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
        echo hppa1.1-hp-bsd
        exit ;;
     9000/8??:4.3bsd:*:*)
@@ -758,7 +765,7 @@ EOF
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
        exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
        echo hppa1.1-hp-osf
        exit ;;
     hp8??:OSF1:*:*)
@@ -766,9 +773,9 @@ EOF
        exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-unknown-osf1mk
+           echo "$UNAME_MACHINE"-unknown-osf1mk
        else
-           echo ${UNAME_MACHINE}-unknown-osf1
+           echo "$UNAME_MACHINE"-unknown-osf1
        fi
        exit ;;
     parisc*:Lites*:*:*)
@@ -793,128 +800,109 @@ EOF
        echo c4-convex-bsd
        exit ;;
     CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*[A-Z]90:*:*:*)
-       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*TS:*:*:*)
-       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*T3E:*:*:*)
-       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*SV1:*:*:*)
-       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     *:UNICOS/mp:*:*)
-       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
        FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+       FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     5000:UNIX_System_V:4.*:*)
        FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-       FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+       FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
        exit ;;
     sparc*:BSD/OS:*:*)
-       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       echo sparc-unknown-bsdi"$UNAME_RELEASE"
        exit ;;
     *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
        exit ;;
     *:FreeBSD:*:*)
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       case ${UNAME_PROCESSOR} in
+       case "$UNAME_PROCESSOR" in
            amd64)
                UNAME_PROCESSOR=x86_64 ;;
            i386)
                UNAME_PROCESSOR=i586 ;;
        esac
-       echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
        exit ;;
     i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
+       echo "$UNAME_MACHINE"-pc-cygwin
        exit ;;
     *:MINGW64*:*)
-       echo ${UNAME_MACHINE}-pc-mingw64
+       echo "$UNAME_MACHINE"-pc-mingw64
        exit ;;
     *:MINGW*:*)
-       echo ${UNAME_MACHINE}-pc-mingw32
+       echo "$UNAME_MACHINE"-pc-mingw32
        exit ;;
     *:MSYS*:*)
-       echo ${UNAME_MACHINE}-pc-msys
-       exit ;;
-    i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
+       echo "$UNAME_MACHINE"-pc-msys
        exit ;;
     i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
+       echo "$UNAME_MACHINE"-pc-pw32
        exit ;;
     *:Interix*:*)
-       case ${UNAME_MACHINE} in
+       case "$UNAME_MACHINE" in
            x86)
-               echo i586-pc-interix${UNAME_RELEASE}
+               echo i586-pc-interix"$UNAME_RELEASE"
                exit ;;
            authenticamd | genuineintel | EM64T)
-               echo x86_64-unknown-interix${UNAME_RELEASE}
+               echo x86_64-unknown-interix"$UNAME_RELEASE"
                exit ;;
            IA64)
-               echo ia64-unknown-interix${UNAME_RELEASE}
+               echo ia64-unknown-interix"$UNAME_RELEASE"
                exit ;;
        esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-       echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
-    8664:Windows_NT:*)
-       echo x86_64-pc-mks
-       exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-       # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i586-pc-interix
-       exit ;;
     i*:UWIN*:*)
-       echo ${UNAME_MACHINE}-pc-uwin
+       echo "$UNAME_MACHINE"-pc-uwin
        exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
        echo x86_64-unknown-cygwin
        exit ;;
-    p*:CYGWIN*:*)
-       echo powerpcle-unknown-cygwin
-       exit ;;
     prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+       echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
        exit ;;
     i*86:Minix:*:*)
-       echo ${UNAME_MACHINE}-pc-minix
+       echo "$UNAME_MACHINE"-pc-minix
        exit ;;
     aarch64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     aarch64_be:Linux:*:*)
        UNAME_MACHINE=aarch64_be
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -928,63 +916,63 @@ EOF
        esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
        if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arc:Linux:*:* | arceb:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arm*:Linux:*:*)
-       eval $set_cc_for_build
+       eval "$set_cc_for_build"
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
-           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+           echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        else
            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                | grep -q __ARM_PCS_VFP
            then
-               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
            else
-               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
            fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     cris:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     crisv32:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     e2k:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     frv:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     hexagon:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:Linux:*:*)
-       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     k1om:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       eval "$set_cc_for_build"
+       sed 's/^        //' << EOF > "$dummy.c"
        #undef CPU
        #undef ${UNAME_MACHINE}
        #undef ${UNAME_MACHINE}el
@@ -998,70 +986,70 @@ EOF
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+       test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
        ;;
     mips64el:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     openrisc*:Linux:*:*)
-       echo or1k-unknown-linux-${LIBC}
+       echo or1k-unknown-linux-"$LIBC"
        exit ;;
     or32:Linux:*:* | or1k*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     padre:Linux:*:*)
-       echo sparc-unknown-linux-${LIBC}
+       echo sparc-unknown-linux-"$LIBC"
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-${LIBC}
+       echo hppa64-unknown-linux-"$LIBC"
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-         *)    echo hppa-unknown-linux-${LIBC} ;;
+         PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+         PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+         *)    echo hppa-unknown-linux-"$LIBC" ;;
        esac
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-${LIBC}
+       echo powerpc64-unknown-linux-"$LIBC"
        exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-${LIBC}
+       echo powerpc-unknown-linux-"$LIBC"
        exit ;;
     ppc64le:Linux:*:*)
-       echo powerpc64le-unknown-linux-${LIBC}
+       echo powerpc64le-unknown-linux-"$LIBC"
        exit ;;
     ppcle:Linux:*:*)
-       echo powerpcle-unknown-linux-${LIBC}
+       echo powerpcle-unknown-linux-"$LIBC"
        exit ;;
     riscv32:Linux:*:* | riscv64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+       echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     tile*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+       echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
        exit ;;
     x86_64:Linux:*:*)
-       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1075,34 +1063,34 @@ EOF
        # I am not positive that other SVR4 systems won't match this,
        # I just have to hope.  -- rms.
        # Use sysv4.2uw... so that sysv4* matches it.
-       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
        exit ;;
     i*86:OS/2:*:*)
        # If we were able to find `uname', then EMX Unix compatibility
        # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
+       echo "$UNAME_MACHINE"-pc-os2-emx
        exit ;;
     i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-unknown-stop
+       echo "$UNAME_MACHINE"-unknown-stop
        exit ;;
     i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-unknown-atheos
+       echo "$UNAME_MACHINE"-unknown-atheos
        exit ;;
     i*86:syllable:*:*)
-       echo ${UNAME_MACHINE}-pc-syllable
+       echo "$UNAME_MACHINE"-pc-syllable
        exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
+       echo i386-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       echo "$UNAME_MACHINE"-pc-msdosdjgpp
        exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+    i*86:*:4.*:*)
+       UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
        fi
        exit ;;
     i*86:*:5:[678]*)
@@ -1112,12 +1100,12 @@ EOF
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
-       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
        exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+               echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1127,9 +1115,9 @@ EOF
                        && UNAME_MACHINE=i686
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
                        && UNAME_MACHINE=i686
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+               echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv32
+               echo "$UNAME_MACHINE"-pc-sysv32
        fi
        exit ;;
     pc:*:*:*)
@@ -1149,9 +1137,9 @@ EOF
        exit ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+         echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
-         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+         echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
        fi
        exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1171,9 +1159,9 @@ EOF
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+         && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+         && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
          && { echo i486-ncr-sysv4; exit; } ;;
@@ -1182,28 +1170,28 @@ EOF
        test -r /etc/.relid \
            && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+           && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       echo m68k-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
        exit ;;
     TSUNAMI:LynxOS:2.*:*)
-       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       echo sparc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     rs6000:LynxOS:2.*:*)
-       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       echo rs6000-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       echo powerpc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
-       echo mips-dde-sysv${UNAME_RELEASE}
+       echo mips-dde-sysv"$UNAME_RELEASE"
        exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
@@ -1214,7 +1202,7 @@ EOF
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
-               echo ${UNAME_MACHINE}-sni-sysv4
+               echo "$UNAME_MACHINE"-sni-sysv4
        else
                echo ns32k-sni-sysv
        fi
@@ -1234,23 +1222,23 @@ EOF
        exit ;;
     i*86:VOS:*:*)
        # From Paul.Green@stratus.com.
-       echo ${UNAME_MACHINE}-stratus-vos
+       echo "$UNAME_MACHINE"-stratus-vos
        exit ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
        exit ;;
     mc68*:A/UX:*:*)
-       echo m68k-apple-aux${UNAME_RELEASE}
+       echo m68k-apple-aux"$UNAME_RELEASE"
        exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
        exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
+               echo mips-nec-sysv"$UNAME_RELEASE"
        else
-               echo mips-unknown-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv"$UNAME_RELEASE"
        fi
        exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
@@ -1269,39 +1257,39 @@ EOF
        echo x86_64-unknown-haiku
        exit ;;
     SX-4:SUPER-UX:*:*)
-       echo sx4-nec-superux${UNAME_RELEASE}
+       echo sx4-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-5:SUPER-UX:*:*)
-       echo sx5-nec-superux${UNAME_RELEASE}
+       echo sx5-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-6:SUPER-UX:*:*)
-       echo sx6-nec-superux${UNAME_RELEASE}
+       echo sx6-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-7:SUPER-UX:*:*)
-       echo sx7-nec-superux${UNAME_RELEASE}
+       echo sx7-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8:SUPER-UX:*:*)
-       echo sx8-nec-superux${UNAME_RELEASE}
+       echo sx8-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8R:SUPER-UX:*:*)
-       echo sx8r-nec-superux${UNAME_RELEASE}
+       echo sx8r-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-ACE:SUPER-UX:*:*)
-       echo sxace-nec-superux${UNAME_RELEASE}
+       echo sxace-nec-superux"$UNAME_RELEASE"
        exit ;;
     Power*:Rhapsody:*:*)
-       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       echo powerpc-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Rhapsody:*:*)
-       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       eval $set_cc_for_build
+       eval "$set_cc_for_build"
        if test "$UNAME_PROCESSOR" = unknown ; then
            UNAME_PROCESSOR=powerpc
        fi
-       if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+       if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
            if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
                if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
                       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
@@ -1329,7 +1317,7 @@ EOF
            # that Apple uses in portable devices.
            UNAME_PROCESSOR=x86_64
        fi
-       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
@@ -1337,22 +1325,25 @@ EOF
                UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
        fi
-       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
        exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
     NEO-*:NONSTOP_KERNEL:*:*)
-       echo neo-tandem-nsk${UNAME_RELEASE}
+       echo neo-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-       echo nse-tandem-nsk${UNAME_RELEASE}
+       echo nse-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSR-*:NONSTOP_KERNEL:*:*)
-       echo nsr-tandem-nsk${UNAME_RELEASE}
+       echo nsr-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    NSV-*:NONSTOP_KERNEL:*:*)
+       echo nsv-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSX-*:NONSTOP_KERNEL:*:*)
-       echo nsx-tandem-nsk${UNAME_RELEASE}
+       echo nsx-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
@@ -1361,7 +1352,7 @@ EOF
        echo bs2000-siemens-sysv
        exit ;;
     DS/*:UNIX_System_V:*:*)
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
        exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
@@ -1372,7 +1363,7 @@ EOF
        else
            UNAME_MACHINE="$cputype"
        fi
-       echo ${UNAME_MACHINE}-unknown-plan9
+       echo "$UNAME_MACHINE"-unknown-plan9
        exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
@@ -1393,14 +1384,14 @@ EOF
        echo pdp10-unknown-its
        exit ;;
     SEI:*:*:SEIUX)
-       echo mips-sei-seiux${UNAME_RELEASE}
+       echo mips-sei-seiux"$UNAME_RELEASE"
        exit ;;
     *:DragonFly:*:*)
-       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
        exit ;;
     *:*VMS:*:*)
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
-       case "${UNAME_MACHINE}" in
+       case "$UNAME_MACHINE" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
            V*) echo vax-dec-vms ; exit ;;
@@ -1409,32 +1400,44 @@ EOF
        echo i386-pc-xenix
        exit ;;
     i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+       echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
        exit ;;
     i*86:rdos:*:*)
-       echo ${UNAME_MACHINE}-pc-rdos
+       echo "$UNAME_MACHINE"-pc-rdos
        exit ;;
     i*86:AROS:*:*)
-       echo ${UNAME_MACHINE}-pc-aros
+       echo "$UNAME_MACHINE"-pc-aros
        exit ;;
     x86_64:VMkernel:*:*)
-       echo ${UNAME_MACHINE}-unknown-esx
+       echo "$UNAME_MACHINE"-unknown-esx
        exit ;;
     amd64:Isilon\ OneFS:*:*)
        echo x86_64-unknown-onefs
        exit ;;
 esac
 
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+    mips:Linux | mips64:Linux)
+       # If we got here on MIPS GNU/Linux, output extra information.
+       cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+       ;;
+esac
+
 cat >&2 <<EOF
-$0: unable to guess system type
 
 This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite
-config.guess and config.sub with the latest versions from:
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 If $0 has already been updated, send the following data and any
 information you think might be pertinent to config-patches@gnu.org to
@@ -1457,16 +1460,16 @@ hostinfo               = `(hostinfo) 2>/dev/null`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM  = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
 EOF
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index 40ea5dfe1152f0fc5160879bb71bfe1fae2595f6..9ccf09a7a335ff98c87c5533fc30e2e051deb759 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2017 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2017-04-02'
+timestamp='2018-03-08'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2017-04-02'
 # 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/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -33,7 +33,7 @@ timestamp='2017-04-02'
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
 
 Canonicalize a configuration name.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -94,7 +94,7 @@ while test $# -gt 0 ; do
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -112,7 +112,7 @@ esac
 
 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 # Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
@@ -120,16 +120,16 @@ case $maybe_os in
   kopensolaris*-gnu* | cloudabi*-eabi* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
   android-linux)
     os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
     ;;
   *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
+    basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
+    if [ "$basic_machine" != "$1" ]
+    then os=`echo "$1" | sed 's/.*-/-/'`
     else os=; fi
     ;;
 esac
@@ -178,44 +178,44 @@ case $os in
                ;;
        -sco6)
                os=-sco5v6
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -sco5)
                os=-sco3.2v5
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -sco4)
                os=-sco3.2v4
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -sco3.2.[4-9]*)
                os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -sco3.2v[4-9]*)
                # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -sco5v6*)
                # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -sco*)
                os=-sco3.2v2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -udk*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -isc)
                os=-isc2.2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -clix*)
                basic_machine=clipper-intergraph
                ;;
        -isc*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
                ;;
        -lynx*178)
                os=-lynxos178
@@ -227,10 +227,7 @@ case $os in
                os=-lynxos
                ;;
        -ptx*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-               ;;
-       -windowsnt*)
-               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+               basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
                ;;
        -psos*)
                os=-psos
@@ -299,7 +296,7 @@ case $basic_machine in
        | nios | nios2 | nios2eb | nios2el \
        | ns16k | ns32k \
        | open8 | or1k | or1knd | or32 \
-       | pdp10 | pdp11 | pj | pjl \
+       | pdp10 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle \
        | pru \
        | pyramid \
@@ -316,7 +313,6 @@ case $basic_machine in
        | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
        | visium \
        | wasm32 \
-       | we32k \
        | x86 | xc16x | xstormy16 | xtensa \
        | z8k | z80)
                basic_machine=$basic_machine-unknown
@@ -337,7 +333,7 @@ case $basic_machine in
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
                ;;
        ms1)
                basic_machine=mt-unknown
@@ -366,7 +362,7 @@ case $basic_machine in
          ;;
        # Object if more than one company name word.
        *-*-*)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
                exit 1
                ;;
        # Recognize the basic CPU types with company name.
@@ -461,7 +457,7 @@ case $basic_machine in
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
        386bsd)
-               basic_machine=i386-unknown
+               basic_machine=i386-pc
                os=-bsd
                ;;
        3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
@@ -495,7 +491,7 @@ case $basic_machine in
                basic_machine=x86_64-pc
                ;;
        amd64-*)
-               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        amdahl)
                basic_machine=580-amdahl
@@ -540,7 +536,7 @@ case $basic_machine in
                os=-linux
                ;;
        blackfin-*)
-               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                os=-linux
                ;;
        bluegene*)
@@ -548,13 +544,13 @@ case $basic_machine in
                os=-cnk
                ;;
        c54x-*)
-               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        c55x-*)
-               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        c6x-*)
-               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        c90)
                basic_machine=c90-cray
@@ -643,7 +639,7 @@ case $basic_machine in
                basic_machine=rs6000-bull
                os=-bosx
                ;;
-       dpx2* | dpx2*-bull)
+       dpx2*)
                basic_machine=m68k-bull
                os=-sysv3
                ;;
@@ -652,7 +648,7 @@ case $basic_machine in
                os=$os"spe"
                ;;
        e500v[12]-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                os=$os"spe"
                ;;
        ebmon29k)
@@ -744,9 +740,6 @@ case $basic_machine in
        hp9k8[0-9][0-9] | hp8[0-9][0-9])
                basic_machine=hppa1.0-hp
                ;;
-       hppa-next)
-               os=-nextstep3
-               ;;
        hppaosf)
                basic_machine=hppa1.1-hp
                os=-osf
@@ -759,26 +752,26 @@ case $basic_machine in
                basic_machine=i370-ibm
                ;;
        i*86v32)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
                os=-sysv32
                ;;
        i*86v4*)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
                os=-sysv4
                ;;
        i*86v)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
                os=-sysv
                ;;
        i*86sol2)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
                os=-solaris2
                ;;
        i386mach)
                basic_machine=i386-mach
                os=-mach
                ;;
-       i386-vsta | vsta)
+       vsta)
                basic_machine=i386-unknown
                os=-vsta
                ;;
@@ -797,19 +790,16 @@ case $basic_machine in
                os=-sysv
                ;;
        leon-*|leon[3-9]-*)
-               basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+               basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
                ;;
        m68knommu)
                basic_machine=m68k-unknown
                os=-linux
                ;;
        m68knommu-*)
-               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                os=-linux
                ;;
-       m88k-omron*)
-               basic_machine=m88k-omron
-               ;;
        magnum | m3230)
                basic_machine=mips-mips
                os=-sysv
@@ -841,10 +831,10 @@ case $basic_machine in
                os=-mint
                ;;
        mips3*-*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+               basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
                ;;
        mips3*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+               basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
                ;;
        monitor)
                basic_machine=m68k-rom68k
@@ -863,7 +853,7 @@ case $basic_machine in
                os=-msdos
                ;;
        ms1-*)
-               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
                ;;
        msys)
                basic_machine=i686-pc
@@ -905,7 +895,7 @@ case $basic_machine in
                basic_machine=v70-nec
                os=-sysv
                ;;
-       next | m*-next )
+       next | m*-next)
                basic_machine=m68k-next
                case $os in
                    -nextstep* )
@@ -950,6 +940,9 @@ case $basic_machine in
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
+       nsv-tandem)
+               basic_machine=nsv-tandem
+               ;;
        nsx-tandem)
                basic_machine=nsx-tandem
                ;;
@@ -985,7 +978,7 @@ case $basic_machine in
                os=-linux
                ;;
        parisc-*)
-               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                os=-linux
                ;;
        pbd)
@@ -1001,7 +994,7 @@ case $basic_machine in
                basic_machine=i386-pc
                ;;
        pc98-*)
-               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
@@ -1016,16 +1009,16 @@ case $basic_machine in
                basic_machine=i786-pc
                ;;
        pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        pentiumpro-* | p6-* | 6x86-* | athlon-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        pentium4-*)
-               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        pn)
                basic_machine=pn-gould
@@ -1035,23 +1028,23 @@ case $basic_machine in
        ppc | ppcbe)    basic_machine=powerpc-unknown
                ;;
        ppc-* | ppcbe-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        ppcle | powerpclittle)
                basic_machine=powerpcle-unknown
                ;;
        ppcle-* | powerpclittle-*)
-               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        ppc64)  basic_machine=powerpc64-unknown
                ;;
-       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+       ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        ppc64le | powerpc64little)
                basic_machine=powerpc64le-unknown
                ;;
        ppc64le-* | powerpc64little-*)
-               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        ps2)
                basic_machine=i386-ibm
@@ -1105,17 +1098,10 @@ case $basic_machine in
        sequent)
                basic_machine=i386-sequent
                ;;
-       sh)
-               basic_machine=sh-hitachi
-               os=-hms
-               ;;
        sh5el)
                basic_machine=sh5le-unknown
                ;;
-       sh64)
-               basic_machine=sh64-unknown
-               ;;
-       sparclite-wrs | simso-wrs)
+       simso-wrs)
                basic_machine=sparclite-wrs
                os=-vxworks
                ;;
@@ -1134,7 +1120,7 @@ case $basic_machine in
                os=-sysv4
                ;;
        strongarm-* | thumb-*)
-               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+               basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
                ;;
        sun2)
                basic_machine=m68000-sun
@@ -1248,9 +1234,6 @@ case $basic_machine in
                basic_machine=a29k-wrs
                os=-vxworks
                ;;
-       wasm32)
-               basic_machine=wasm32-unknown
-               ;;
        w65*)
                basic_machine=w65-wdc
                os=-none
@@ -1259,6 +1242,9 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
+       x64)
+               basic_machine=x86_64-pc
+               ;;
        xbox)
                basic_machine=i686-pc
                os=-mingw32
@@ -1267,20 +1253,12 @@ case $basic_machine in
                basic_machine=xps100-honeywell
                ;;
        xscale-* | xscalee[bl]-*)
-               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+               basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
                ;;
        ymp)
                basic_machine=ymp-cray
                os=-unicos
                ;;
-       z8k-*-coff)
-               basic_machine=z8k-unknown
-               os=-sim
-               ;;
-       z80-*-coff)
-               basic_machine=z80-unknown
-               os=-sim
-               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -1309,10 +1287,6 @@ case $basic_machine in
        vax)
                basic_machine=vax-dec
                ;;
-       pdp10)
-               # there are many clones, so DEC is not a safe bet
-               basic_machine=pdp10-unknown
-               ;;
        pdp11)
                basic_machine=pdp11-dec
                ;;
@@ -1322,9 +1296,6 @@ case $basic_machine in
        sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-               basic_machine=sparc-sun
-               ;;
        cydra)
                basic_machine=cydra-cydrome
                ;;
@@ -1344,7 +1315,7 @@ case $basic_machine in
                # Make sure to match an already-canonicalized machine name.
                ;;
        *)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
                exit 1
                ;;
 esac
@@ -1352,10 +1323,10 @@ esac
 # Here we canonicalize certain aliases for manufacturers.
 case $basic_machine in
        *-digital*)
-               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+               basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
                ;;
        *-commodore*)
-               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+               basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
                ;;
        *)
                ;;
@@ -1366,8 +1337,8 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-       # First match some system type aliases
-       # that might get confused with valid system types.
+       # First match some system type aliases that might get confused
+       # with valid system types.
        # -solaris* is a basic system type, with this one exception.
        -auroraux)
                os=-auroraux
@@ -1378,18 +1349,19 @@ case $os in
        -solaris)
                os=-solaris2
                ;;
-       -svr4*)
-               os=-sysv4
-               ;;
        -unixware*)
                os=-sysv4.2uw
                ;;
        -gnu/linux*)
                os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
                ;;
-       # First accept the basic system types.
+       # es1800 is here to avoid being matched by es* (a different OS)
+       -es1800*)
+               os=-ose
+               ;;
+       # Now accept the basic system types.
        # The portable systems comes first.
-       # Each alternative MUST END IN A *, to match a version number.
+       # Each alternative MUST end in a * to match a version number.
        # -sysv* is not here because it comes later, after sysvr4.
        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
              | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
@@ -1399,25 +1371,26 @@ case $os in
              | -aos* | -aros* | -cloudabi* | -sortix* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
              | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
              | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
              | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
              | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
              | -linux-newlib* | -linux-musl* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+             | -morphos* | -superux* | -rtmk* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
              | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-             | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
+             | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
+             | -midnightbsd*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1434,12 +1407,12 @@ case $os in
        -nto*)
                os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
-       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+       -sim | -xray | -os68k* | -v88r* \
+             | -windows* | -osx | -abug | -netware* | -os9* \
              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
                ;;
        -mac*)
-               os=`echo $os | sed -e 's|mac|macos|'`
+               os=`echo "$os" | sed -e 's|mac|macos|'`
                ;;
        -linux-dietlibc)
                os=-linux-dietlibc
@@ -1448,10 +1421,10 @@ case $os in
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
        -sunos5*)
-               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+               os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
                ;;
        -sunos6*)
-               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+               os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
                ;;
        -opened*)
                os=-openedition
@@ -1462,12 +1435,6 @@ case $os in
        -wince*)
                os=-wince
                ;;
-       -osfrose*)
-               os=-osfrose
-               ;;
-       -osf*)
-               os=-osf
-               ;;
        -utek*)
                os=-bsd
                ;;
@@ -1492,7 +1459,7 @@ case $os in
        -nova*)
                os=-rtmk-nova
                ;;
-       -ns2 )
+       -ns2)
                os=-nextstep2
                ;;
        -nsk*)
@@ -1514,7 +1481,7 @@ case $os in
        -oss*)
                os=-sysv3
                ;;
-       -svr4)
+       -svr4*)
                os=-sysv4
                ;;
        -svr3)
@@ -1529,24 +1496,28 @@ case $os in
        -ose*)
                os=-ose
                ;;
-       -es1800*)
-               os=-ose
-               ;;
-       -xenix)
-               os=-xenix
-               ;;
        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
                os=-mint
                ;;
-       -aros*)
-               os=-aros
-               ;;
        -zvmoe)
                os=-zvmoe
                ;;
        -dicos*)
                os=-dicos
                ;;
+       -pikeos*)
+               # Until real need of OS specific support for
+               # particular features comes up, bare metal
+               # configurations are quite functional.
+               case $basic_machine in
+                   arm*)
+                       os=-eabi
+                       ;;
+                   *)
+                       os=-elf
+                       ;;
+               esac
+               ;;
        -nacl*)
                ;;
        -ios)
@@ -1556,7 +1527,7 @@ case $os in
        *)
                # Get rid of the `-' at the beginning of $os.
                os=`echo $os | sed 's/[^-]*-//'`
-               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
                exit 1
                ;;
 esac
@@ -1652,9 +1623,6 @@ case $basic_machine in
        *-be)
                os=-beos
                ;;
-       *-haiku)
-               os=-haiku
-               ;;
        *-ibm)
                os=-aix
                ;;
@@ -1694,7 +1662,7 @@ case $basic_machine in
        m88k-omron*)
                os=-luna
                ;;
-       *-next )
+       *-next)
                os=-nextstep
                ;;
        *-sequent)
@@ -1709,9 +1677,6 @@ case $basic_machine in
        i370-*)
                os=-mvs
                ;;
-       *-next)
-               os=-nextstep3
-               ;;
        *-gould)
                os=-sysv
                ;;
@@ -1821,15 +1786,15 @@ case $basic_machine in
                                vendor=stratus
                                ;;
                esac
-               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+               basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
                ;;
 esac
 
-echo $basic_machine$os
+echo "$basic_machine$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index 6091d75bd896aeee1bc242e3e92a17433bd72356..9fbe564cd03da598ded8dcddec320eaeaedb11cd 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.32.
+# Generated by GNU Autoconf 2.69 for PCRE2 10.34.
 #
 #
 # 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.32'
-PACKAGE_STRING='PCRE2 10.32'
+PACKAGE_VERSION='10.34'
+PACKAGE_STRING='PCRE2 10.34'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -677,8 +677,6 @@ WITH_PCRE2_16_FALSE
 WITH_PCRE2_16_TRUE
 WITH_PCRE2_8_FALSE
 WITH_PCRE2_8_TRUE
-PCRE2_HAVE_INTTYPES_H
-PCRE2_HAVE_STDINT_H
 enable_pcre2_32
 enable_pcre2_16
 enable_pcre2_8
@@ -728,7 +726,6 @@ am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
-am__quote
 am__include
 DEPDIR
 OBJEXT
@@ -802,7 +799,8 @@ PACKAGE_VERSION
 PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -827,6 +825,7 @@ enable_jit
 enable_jit_sealloc
 enable_pcre2grep_jit
 enable_pcre2grep_callout
+enable_pcre2grep_callout_fork
 enable_rebuild_chartables
 enable_unicode
 enable_newline_is_cr
@@ -855,6 +854,7 @@ enable_valgrind
 enable_coverage
 enable_fuzz_support
 enable_stack_for_recursion
+enable_percent_zt
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1413,7 +1413,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.32 to adapt to many kinds of systems.
+\`configure' configures PCRE2 10.34 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1483,7 +1483,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of PCRE2 10.32:";;
+     short | recursive ) echo "Configuration of PCRE2 10.34:";;
    esac
   cat <<\_ACEOF
 
@@ -1509,9 +1509,12 @@ Optional Features:
   --enable-debug          enable debugging code
   --enable-jit            enable Just-In-Time compiling support
   --enable-jit-sealloc    enable SELinux compatible execmem allocator in JIT
+                          (experimental)
   --disable-pcre2grep-jit disable JIT support in pcre2grep
   --disable-pcre2grep-callout
                           disable callout script support in pcre2grep
+  --disable-pcre2grep-callout-fork
+                          disable callout script fork support in pcre2grep
   --enable-rebuild-chartables
                           rebuild character tables in current locale
   --disable-unicode       disable Unicode support
@@ -1541,6 +1544,7 @@ Optional Features:
   --enable-valgrind       enable valgrind support
   --enable-coverage       enable code coverage reports using gcov
   --enable-fuzz-support   enable fuzzer support
+  --disable-percent-zt    disable the use of z and t formatting modifiers
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1659,7 +1663,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-PCRE2 configure 10.32
+PCRE2 configure 10.34
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2154,7 +2158,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.32, which was
+It was created by PCRE2 $as_me 10.34, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2503,7 +2507,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-am__api_version='1.15'
+am__api_version='1.16'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -3018,7 +3022,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='pcre2'
- VERSION='10.32'
+ VERSION='10.34'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3048,8 +3052,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
 # We need awk for the "check" target (and possibly the TAP driver).  The
@@ -3100,7 +3104,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -4017,45 +4021,45 @@ DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
      ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
 
 # Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then :
@@ -5246,8 +5250,8 @@ esac
 
 
 
-macro_version='2.4.6.40-6ca5-dirty'
-macro_revision='2.4.6.40'
+macro_version='2.4.6.42-b88ce'
+macro_revision='2.4.6.42'
 
 
 
@@ -7173,7 +7177,7 @@ for ac_symprfx in "" "_"; do
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
     # Fake it for dumpbin and say T for any non-static function,
     # D for any global variable and I for any imported variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
+    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
@@ -8837,8 +8841,8 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
+# All known linkers require a '.a' archive for static linking (except MSVC and
+# ICC, which need '.lib').
 libext=a
 
 with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -9765,15 +9769,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 
   case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
+    # Microsoft Visual C++ or Intel C++ Compiler.
     if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
   interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
     with_gnu_ld=yes
     ;;
   openbsd* | bitrig*)
 
     cygwin* | mingw* | pw32* | cegcc*)
       # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
+      # Microsoft Visual C++ or Intel C++ Compiler.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
       case $cc_basename in
-      cl*)
-       # Native MSVC
+      cl* | icl*)
+       # Native MSVC or ICC
        hardcode_libdir_flag_spec=' '
        allow_undefined_flag=unsupported
        always_export_symbols=yes
@@ -10468,7 +10472,7 @@ fi
           fi'
        ;;
       *)
-       # Assume MSVC wrapper
+       # Assume MSVC and ICC wrapper
        hardcode_libdir_flag_spec=' '
        allow_undefined_flag=unsupported
        # Tell ltmain to make .lib files, not .a files.
@@ -11500,8 +11504,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     dynamic_linker='Win32 ld.exe'
     ;;
 
-  *,cl*)
-    # Native MSVC
+  *,cl* | *,icl*)
+    # Native MSVC or ICC
     libname_spec='$name'
     soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
     library_names_spec='$libname.dll.lib'
@@ -11557,7 +11561,7 @@ cygwin* | mingw* | pw32* | cegcc*)
     ;;
 
   *)
-    # Assume MSVC wrapper
+    # Assume MSVC and ICC wrapper
     library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
@@ -12978,9 +12982,9 @@ _ACEOF
 # Versioning
 
 PCRE2_MAJOR="10"
-PCRE2_MINOR="32"
+PCRE2_MINOR="34"
 PCRE2_PRERELEASE=""
-PCRE2_DATE="2018-09-10"
+PCRE2_DATE="2019-11-21"
 
 if test "$PCRE2_MINOR" = "08" -o "$PCRE2_MINOR" = "09"
 then
@@ -13061,7 +13065,7 @@ fi
 
 
 
-# Handle --dnable-debug (disabled by default)
+# Handle --enable-debug (disabled by default)
 # Check whether --enable-debug was given.
 if test "${enable_debug+set}" = set; then :
   enableval=$enable_debug;
@@ -13087,6 +13091,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+  SAVE_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS=-I$srcdir
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -13102,6 +13108,7 @@ else
   enable_jit=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CPPFLAGS=$SAVE_CPPFLAGS
   echo checking for JIT support on this hardware... $enable_jit
 fi
 
@@ -13132,6 +13139,15 @@ else
 fi
 
 
+# Handle --disable-pcre2grep-callout-fork (enabled by default)
+# Check whether --enable-pcre2grep-callout-fork was given.
+if test "${enable_pcre2grep_callout_fork+set}" = set; then :
+  enableval=$enable_pcre2grep_callout_fork;
+else
+  enable_pcre2grep_callout_fork=yes
+fi
+
+
 # Handle --enable-rebuild-chartables
 # Check whether --enable-rebuild-chartables was given.
 if test "${enable_rebuild_chartables+set}" = set; then :
 #                              [don't use stack recursion when matching]),
 #               , enable_stack_for_recursion=yes)
 
+# Handle --disable-percent_zt (set as "auto" by default)
+# Check whether --enable-percent-zt was given.
+if test "${enable_percent_zt+set}" = set; then :
+  enableval=$enable_percent_zt;
+else
+  enable_percent_zt=auto
+fi
+
+
 # Set the default value for pcre2-8
 if test "x$enable_pcre2_8" = "xunset"
 then
 done
 
 
-for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
- PCRE2_HAVE_STDINT_H=1
-else
-  PCRE2_HAVE_STDINT_H=0
-fi
-
-done
-
-for ac_header in inttypes.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
-if test "x$ac_cv_header_inttypes_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_INTTYPES_H 1
-_ACEOF
- PCRE2_HAVE_INTTYPES_H=1
-else
-  PCRE2_HAVE_INTTYPES_H=0
-fi
-
-done
-
-
-
-
 # Conditional compilation
  if test "x$enable_pcre2_8" = "xyes"; then
   WITH_PCRE2_8_TRUE=
@@ -14358,6 +14352,14 @@ $as_echo "#define PCRE2_DEBUG /**/" >>confdefs.h
 
 fi
 
+if test "$enable_percent_zt" = "no"; then
+
+$as_echo "#define DISABLE_PERCENT_ZT /**/" >>confdefs.h
+
+else
+  enable_percent_zt=auto
+fi
+
 # Unless running under Windows, JIT support requires pthreads.
 
 if test "$enable_jit" = "yes"; then
@@ -14782,14 +14784,21 @@ $as_echo "#define SUPPORT_PCRE2GREP_JIT /**/" >>confdefs.h
 fi
 
 if test "$enable_pcre2grep_callout" = "yes"; then
-  if test "$HAVE_WINDOWS_H" != "1"; then
-    if test "$HAVE_SYS_WAIT_H" != "1"; then
-      as_fn_error $? "Callout script support needs sys/wait.h." "$LINENO" 5
+  if test "$enable_pcre2grep_callout_fork" = "yes"; then
+    if test "$HAVE_WINDOWS_H" != "1"; then
+      if test "$HAVE_SYS_WAIT_H" != "1"; then
+        as_fn_error $? "Callout script support needs sys/wait.h." "$LINENO" 5
+      fi
     fi
+
+$as_echo "#define SUPPORT_PCRE2GREP_CALLOUT_FORK /**/" >>confdefs.h
+
   fi
 
 $as_echo "#define SUPPORT_PCRE2GREP_CALLOUT /**/" >>confdefs.h
 
+else
+  enable_pcre2grep_callout_fork="no"
 fi
 
 if test "$enable_unicode" = "yes"; then
@@ -14964,16 +14973,16 @@ esac
 # are m4 variables, assigned above.
 
 EXTRA_LIBPCRE2_8_LDFLAGS="$EXTRA_LIBPCRE2_8_LDFLAGS \
-  $NO_UNDEFINED -version-info 7:1:7"
+  $NO_UNDEFINED -version-info 9:0:9"
 
 EXTRA_LIBPCRE2_16_LDFLAGS="$EXTRA_LIBPCRE2_16_LDFLAGS \
-  $NO_UNDEFINED -version-info 7:1:7"
+  $NO_UNDEFINED -version-info 9:0:9"
 
 EXTRA_LIBPCRE2_32_LDFLAGS="$EXTRA_LIBPCRE2_32_LDFLAGS \
-  $NO_UNDEFINED -version-info 7:1:7"
+  $NO_UNDEFINED -version-info 9:0:9"
 
 EXTRA_LIBPCRE2_POSIX_LDFLAGS="$EXTRA_LIBPCRE2_POSIX_LDFLAGS \
-  $NO_UNDEFINED -version-info 2:1:0"
+  $NO_UNDEFINED -version-info 2:3:0"
 
 
 
@@ -16016,7 +16025,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.32, which was
+This file was extended by PCRE2 $as_me 10.34, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16082,7 +16091,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.32
+PCRE2 config.status 10.34
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -16201,7 +16210,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
 
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -17107,29 +17116,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$am_mf" : 'X\(//\)[^/]' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -17147,53 +17162,48 @@ $as_echo X"$mf" |
            q
          }
          s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
          }
-         /^X\(\/\/\)$/{
+         /^X\/\(\/\/\)$/{
            s//\1/
            q
          }
-         /^X\(\/\).*/{
+         /^X\/\(\/\).*/{
            s//\1/
            q
          }
          s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
 }
  ;;
     "libtool":C)
@@ -17840,6 +17850,7 @@ $PACKAGE-$VERSION configuration summary:
     Build static libs .................. : ${enable_static}
     Use JIT in pcre2grep ............... : ${enable_pcre2grep_jit}
     Enable callouts in pcre2grep ....... : ${enable_pcre2grep_callout}
+    Enable fork in pcre2grep callouts .. : ${enable_pcre2grep_callout_fork}
     Initial buffer size for pcre2grep .. : ${with_pcre2grep_bufsize}
     Maximum buffer size for pcre2grep .. : ${with_pcre2grep_max_bufsize}
     Link pcre2grep with libz ........... : ${enable_pcre2grep_libz}
@@ -17849,6 +17860,7 @@ $PACKAGE-$VERSION configuration summary:
     Valgrind support ................... : ${enable_valgrind}
     Code coverage ...................... : ${enable_coverage}
     Fuzzer support ..................... : ${enable_fuzz_support}
+    Use %zu and %td .................... : ${enable_percent_zt}
 
 EOF
 
index c43ae3806fd953883e298a06048a653acba516ac..30d4ddd42cca708c16949b613f55946d3f5ff460 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, [32])
+m4_define(pcre2_minor, [34])
 m4_define(pcre2_prerelease, [])
-m4_define(pcre2_date, [2018-09-10])
+m4_define(pcre2_date, [2019-11-21])
 
 # 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,     [7:1:7])
-m4_define(libpcre2_16_version,    [7:1:7])
-m4_define(libpcre2_32_version,    [7:1:7])
-m4_define(libpcre2_posix_version, [2:1:0])
+m4_define(libpcre2_8_version,     [9:0:9])
+m4_define(libpcre2_16_version,    [9:0:9])
+m4_define(libpcre2_32_version,    [9:0:9])
+m4_define(libpcre2_posix_version, [2:3:0])
 
 AC_PREREQ(2.57)
 AC_INIT(PCRE2, pcre2_major.pcre2_minor[]pcre2_prerelease, , pcre2)
@@ -131,7 +131,7 @@ AC_ARG_ENABLE(pcre2-32,
               , enable_pcre2_32=unset)
 AC_SUBST(enable_pcre2_32)
 
-# Handle --dnable-debug (disabled by default)
+# Handle --enable-debug (disabled by default)
 AC_ARG_ENABLE(debug,
               AS_HELP_STRING([--enable-debug],
                              [enable debugging code]),
@@ -146,19 +146,22 @@ AC_ARG_ENABLE(jit,
 # This code enables JIT if the hardware supports it.
 if test "$enable_jit" = "auto"; then
   AC_LANG(C)
+  SAVE_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS=-I$srcdir
   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
   #define SLJIT_CONFIG_AUTO 1
   #include "src/sljit/sljitConfigInternal.h"
   #if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
   #error unsupported
   #endif]])], enable_jit=yes, enable_jit=no)
+  CPPFLAGS=$SAVE_CPPFLAGS
   echo checking for JIT support on this hardware... $enable_jit
 fi
 
 # Handle --enable-jit-sealloc (disabled by default)
 AC_ARG_ENABLE(jit-sealloc,
               AS_HELP_STRING([--enable-jit-sealloc],
-                             [enable SELinux compatible execmem allocator in JIT]),
+                             [enable SELinux compatible execmem allocator in JIT (experimental)]),
               , enable_jit_sealloc=no)
 
 # Handle --disable-pcre2grep-jit (enabled by default)
@@ -173,6 +176,12 @@ AC_ARG_ENABLE(pcre2grep-callout,
                              [disable callout script support in pcre2grep]),
               , enable_pcre2grep_callout=yes)
 
+# Handle --disable-pcre2grep-callout-fork (enabled by default)
+AC_ARG_ENABLE(pcre2grep-callout-fork,
+              AS_HELP_STRING([--disable-pcre2grep-callout-fork],
+                             [disable callout script fork support in pcre2grep]),
+              , enable_pcre2grep_callout_fork=yes)
+
 # Handle --enable-rebuild-chartables
 AC_ARG_ENABLE(rebuild-chartables,
               AS_HELP_STRING([--enable-rebuild-chartables],
@@ -343,6 +352,12 @@ AC_ARG_ENABLE(stack-for-recursion,,
 #                              [don't use stack recursion when matching]),
 #               , enable_stack_for_recursion=yes)
 
+# Handle --disable-percent_zt (set as "auto" by default)
+AC_ARG_ENABLE(percent-zt,
+              AS_HELP_STRING([--disable-percent-zt],
+                             [disable the use of z and t formatting modifiers]),
+              , enable_percent_zt=auto)
+
 # Set the default value for pcre2-8
 if test "x$enable_pcre2_8" = "xunset"
 then
@@ -451,11 +466,6 @@ AC_CHECK_HEADERS(limits.h sys/types.h sys/stat.h dirent.h)
 AC_CHECK_HEADERS([windows.h], [HAVE_WINDOWS_H=1])
 AC_CHECK_HEADERS([sys/wait.h], [HAVE_SYS_WAIT_H=1])
 
-AC_CHECK_HEADERS([stdint.h], [PCRE2_HAVE_STDINT_H=1], [PCRE2_HAVE_STDINT_H=0])
-AC_CHECK_HEADERS([inttypes.h], [PCRE2_HAVE_INTTYPES_H=1], [PCRE2_HAVE_INTTYPES_H=0])
-AC_SUBST([PCRE2_HAVE_STDINT_H])
-AC_SUBST([PCRE2_HAVE_INTTYPES_H])
-
 # Conditional compilation
 AM_CONDITIONAL(WITH_PCRE2_8, test "x$enable_pcre2_8" = "xyes")
 AM_CONDITIONAL(WITH_PCRE2_16, test "x$enable_pcre2_16" = "xyes")
@@ -592,6 +602,14 @@ if test "$enable_debug" = "yes"; then
     Define to any value to include debugging code.])
 fi
 
+if test "$enable_percent_zt" = "no"; then
+  AC_DEFINE([DISABLE_PERCENT_ZT], [], [
+    Define to any value to disable the use of the z and t modifiers in
+    formatting settings such as %zu or %td (this is rarely needed).])
+else
+  enable_percent_zt=auto
+fi
+
 # Unless running under Windows, JIT support requires pthreads.
 
 if test "$enable_jit" = "yes"; then
@@ -621,13 +639,21 @@ if test "$enable_pcre2grep_jit" = "yes"; then
 fi
 
 if test "$enable_pcre2grep_callout" = "yes"; then
-  if test "$HAVE_WINDOWS_H" != "1"; then
-    if test "$HAVE_SYS_WAIT_H" != "1"; then
-      AC_MSG_ERROR([Callout script support needs sys/wait.h.])
+  if test "$enable_pcre2grep_callout_fork" = "yes"; then
+    if test "$HAVE_WINDOWS_H" != "1"; then
+      if test "$HAVE_SYS_WAIT_H" != "1"; then
+        AC_MSG_ERROR([Callout script support needs sys/wait.h.])
+      fi
     fi
+    AC_DEFINE([SUPPORT_PCRE2GREP_CALLOUT_FORK], [], [
+      Define to any value to enable fork support in pcre2grep callout scripts.
+      This will have no effect unless SUPPORT_PCRE2GREP_CALLOUT is also
+      defined.])
   fi
   AC_DEFINE([SUPPORT_PCRE2GREP_CALLOUT], [], [
     Define to any value to enable callout script support in pcre2grep.])
+else
+  enable_pcre2grep_callout_fork="no"
 fi
 
 if test "$enable_unicode" = "yes"; then
@@ -1029,6 +1055,7 @@ $PACKAGE-$VERSION configuration summary:
     Build static libs .................. : ${enable_static}
     Use JIT in pcre2grep ............... : ${enable_pcre2grep_jit}
     Enable callouts in pcre2grep ....... : ${enable_pcre2grep_callout}
+    Enable fork in pcre2grep callouts .. : ${enable_pcre2grep_callout_fork}
     Initial buffer size for pcre2grep .. : ${with_pcre2grep_bufsize}
     Maximum buffer size for pcre2grep .. : ${with_pcre2grep_max_bufsize}
     Link pcre2grep with libz ........... : ${enable_pcre2grep_libz}
@@ -1038,6 +1065,7 @@ $PACKAGE-$VERSION configuration summary:
     Valgrind support ................... : ${enable_valgrind}
     Code coverage ...................... : ${enable_coverage}
     Fuzzer support ..................... : ${enable_fuzz_support}
+    Use %zu and %td .................... : ${enable_percent_zt}
 
 EOF
 
diff --git a/depcomp b/depcomp
index b39f98f9ae9f950391abb09f4fa03ee113a07ac6..65cbf7093a1e4c4a2da08ac8dcd725f8376c344c 100755 (executable)
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 
 # 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
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
 # 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/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -783,7 +783,7 @@ exit 0
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index b742ed34801de12758db1d2656e4705ddf52b70e..39e7620aae052f87337801116b48f122ad0223c5 100644 (file)
@@ -48,7 +48,7 @@ can skip ahead to the CMake section.
      macro to specify what character(s) you want to be interpreted as line
      terminators by default.
 
-     When you compile any of the PCRE2 modules, you must specify
+     When you subsequently compile any of the PCRE2 modules, you must specify
      -DHAVE_CONFIG_H to your compiler so that src/config.h is included in the
      sources.
 
@@ -62,6 +62,11 @@ can skip ahead to the CMake section.
      new release, you are strongly advised to review src/config.h.generic
      before re-using what you had previously.
 
+     Note also that the src/config.h.generic file is created from a config.h
+     that was generated by Autotools, which automatically includes settings of
+     a number of macros that are not actually used by PCRE2 (for example,
+     HAVE_MEMORY_H).
+
  (2) Copy or rename the file src/pcre2.h.generic as src/pcre2.h.
 
  (3) EITHER:
@@ -104,6 +109,7 @@ can skip ahead to the CMake section.
        pcre2_newline.c
        pcre2_ord2utf.c
        pcre2_pattern_info.c
+       pcre2_script_run.c
        pcre2_serialize.c
        pcre2_string_utils.c
        pcre2_study.c
@@ -395,6 +401,6 @@ Everything in that location, source and executable, is in EBCDIC and native
 z/OS file formats. The port provides an API for LE languages such as COBOL and
 for the z/OS and z/VM versions of the Rexx languages.
 
-===========================
-Last Updated: 19 April 2018
-===========================
+==============================
+Last Updated: 14 November 2018
+==============================
index 2eb621b0ffcd7122f505ae177aa209a14d2c6139..8ce6f968abcacfee01ef470e3acb80bc4f3e7950 100644 (file)
@@ -1,13 +1,15 @@
 README file for PCRE2 (Perl-compatible regular expression library)
 ------------------------------------------------------------------
 
-PCRE2 is a re-working of the original PCRE library to provide an entirely new
-API. The latest release of PCRE2 is always available in three alternative
-formats from:
+PCRE2 is a re-working of the original PCRE1 library to provide an entirely new
+API. Since its initial release in 2015, there has been further development of
+the code and it now differs from PCRE1 in more than just the API. There are new
+features and the internals have been improved. The latest release of PCRE2 is
+available in three alternative formats from:
 
-  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-xxx.tar.gz
-  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-xxx.tar.bz2
-  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-xxx.zip
+https://ftp.pcre.org/pub/pcre/pcre2-10.xx.tar.gz
+https://ftp.pcre.org/pub/pcre/pcre2-10.xx.tar.bz2
+https://ftp.pcre.org/pub/pcre/pcre2-10.xx.tar.zip
 
 There is a mailing list for discussion about the development of PCRE (both the
 original and new APIs) at pcre-dev@exim.org. You can access the archives and
@@ -39,13 +41,13 @@ The PCRE2 APIs
 PCRE2 is written in C, and it has its own API. There are three sets of
 functions, one for the 8-bit library, which processes strings of bytes, one for
 the 16-bit library, which processes strings of 16-bit values, and one for the
-32-bit library, which processes strings of 32-bit values. There are no C++
-wrappers.
+32-bit library, which processes strings of 32-bit values. Unlike PCRE1, there
+are no C++ wrappers.
 
 The distribution does contain a set of C wrapper functions for the 8-bit
 library that are based on the POSIX regular expression API (see the pcre2posix
-man page). These can be found in a library called libpcre2-posix. Note that
-this just provides a POSIX calling interface to PCRE2; the regular expressions
+man page). These are built into a library called libpcre2-posix. Note that this
+just provides a POSIX calling interface to PCRE2; the regular expressions
 themselves still follow Perl syntax and semantics. The POSIX API is restricted,
 and does not give full access to all of PCRE2's facilities.
 
@@ -53,20 +55,8 @@ The header file for the POSIX-style functions is called pcre2posix.h. The
 official POSIX name is regex.h, but I did not want to risk possible problems
 with existing files of that name by distributing it that way. To use PCRE2 with
 an existing program that uses the POSIX API, pcre2posix.h will have to be
-renamed or pointed at by a link.
-
-If you are using the POSIX interface to PCRE2 and there is already a POSIX
-regex library installed on your system, as well as worrying about the regex.h
-header file (as mentioned above), you must also take care when linking programs
-to ensure that they link with PCRE2's libpcre2-posix library. Otherwise they
-may pick up the POSIX functions of the same name from the other library.
-
-One way of avoiding this confusion is to compile PCRE2 with the addition of
--Dregcomp=PCRE2regcomp (and similarly for the other POSIX functions) to the
-compiler flags (CFLAGS if you are using "configure" -- see below). This has the
-effect of renaming the functions so that the names no longer clash. Of course,
-you have to do the same thing for your applications, or write them using the
-new names.
+renamed or pointed at by a link (or the program modified, of course). See the
+pcre2posix documentation for more details.
 
 
 Documentation for PCRE2
@@ -174,9 +164,11 @@ library. They are also documented in the pcre2build man page.
   will be a compile time error. If in doubt, use --enable-jit=auto, which
   enables JIT only if the current hardware is supported.
 
-. If you are enabling JIT under SELinux you may also want to add
-  --enable-jit-sealloc, which enables the use of an execmem allocator in JIT
-  that is compatible with SELinux. This has no effect if JIT is not enabled.
+. If you are enabling JIT under SELinux environment you may also want to add
+  --enable-jit-sealloc, which enables the use of an executable memory allocator
+  that is compatible with SELinux. Warning: this allocator is experimental!
+  It does not support fork() operation and may crash when no disk space is
+  available. This option has no effect if JIT is disabled.
 
 . If you do not want to make use of the default support for UTF-8 Unicode
   character strings in the 8-bit library, UTF-16 Unicode character strings in
@@ -323,7 +315,11 @@ library. They are also documented in the pcre2build man page.
 . There is support for calling external programs during matching in the
   pcre2grep command, using PCRE2's callout facility with string arguments. This
   support can be disabled by adding --disable-pcre2grep-callout to the
-  "configure" command.
+  "configure" command. There are two kinds of callout: one that generates
+  output from inbuilt code, and another that calls an external program. The
+  latter has special support for Windows and VMS; otherwise it assumes the
+  existence of the fork() function. This facility can be disabled by adding
+  --disable-pcre2grep-callout-fork to the "configure" command.
 
 . The pcre2grep program currently supports only 8-bit data files, and so
   requires the 8-bit PCRE2 library. It is possible to compile pcre2grep to use
@@ -376,6 +372,15 @@ library. They are also documented in the pcre2build man page.
   tgetflag, or tgoto, this is the problem, and linking with the ncurses library
   should fix it.
 
+. The C99 standard defines formatting modifiers z and t for size_t and
+  ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in
+  environments other than Microsoft Visual Studio when __STDC_VERSION__ is
+  defined and has a value greater than or equal to 199901L (indicating C99).
+  However, there is at least one environment that claims to be C99 but does not
+  support these modifiers. If --disable-percent-zt is specified, no use is made
+  of the z or t modifiers. Instead or %td or %zu, %lu is used, with a cast for
+  size_t values.
+
 . There is a special option called --enable-fuzz-support for use by people who
   want to run fuzzing tests on PCRE2. At present this applies only to the 8-bit
   library. If set, it causes an extra library called libpcre2-fuzzsupport.a to
@@ -789,6 +794,7 @@ The distribution should contain the files listed below.
   src/pcre2_newline.c      )
   src/pcre2_ord2utf.c      )
   src/pcre2_pattern_info.c )
+  src/pcre2_script_run.c   )
   src/pcre2_serialize.c    )
   src/pcre2_string_utils.c )
   src/pcre2_study.c        )
@@ -888,4 +894,4 @@ The distribution should contain the files listed below.
 Philip Hazel
 Email local part: ph10
 Email domain: cam.ac.uk
-Last updated: 17 June 2018
+Last updated: 16 April 2019
index 82b43c352caa77b5f83816aa0e091437ff02e599..2c7c5fb2e280f9f4669771a80743511113499fed 100644 (file)
@@ -146,6 +146,9 @@ in the library.
 <tr><td><a href="pcre2_get_mark.html">pcre2_get_mark</a></td>
     <td>&nbsp;&nbsp;Get a (*MARK) name</td></tr>
 
+<tr><td><a href="pcre2_get_match_data_size.html">pcre2_get_match_data_size</a></td>
+    <td>&nbsp;&nbsp;Get the size of a match data block</td></tr>
+
 <tr><td><a href="pcre2_get_ovector_count.html">pcre2_get_ovector_count</a></td>
     <td>&nbsp;&nbsp;Get the ovector count</td></tr>
 
@@ -176,6 +179,9 @@ in the library.
 <tr><td><a href="pcre2_maketables.html">pcre2_maketables</a></td>
     <td>&nbsp;&nbsp;Build character tables in current locale</td></tr>
 
+<tr><td><a href="pcre2_maketables_free.html">pcre2_maketables_free</a></td>
+    <td>&nbsp;&nbsp;Free character tables</td></tr>
+
 <tr><td><a href="pcre2_match.html">pcre2_match</a></td>
     <td>&nbsp;&nbsp;Match a compiled pattern to a subject string
     (Perl compatible)</td></tr>
index bc588c4c49edcceebefa91f06d2b1d365017efc2..dc2d058b691d0f5bcddd4861103729fca9153909 100644 (file)
@@ -162,7 +162,7 @@ listing), and the short pages for individual functions, are concatenated in
   pcre2-config       show PCRE2 installation configuration information
   pcre2api           details of PCRE2's native C API
   pcre2build         building PCRE2
-  pcre2callout       details of the callout feature
+  pcre2callout       details of the pattern callout feature
   pcre2compat        discussion of Perl compatibility
   pcre2convert       details of pattern conversion functions
   pcre2demo          a demonstration C program that uses PCRE2
@@ -198,7 +198,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: 11 July 2018
+Last updated: 17 September 2018
 <br>
 Copyright &copy; 1997-2018 University of Cambridge.
 <br>
index d109eebbb2b9f34dbaecc8a4e593d36e90da67b7..f6485f2276abd3ea6e75a77a05ddfd0fee39e87c 100644 (file)
@@ -65,6 +65,7 @@ The option bits are:
   PCRE2_EXTENDED           Ignore white space and # comments
   PCRE2_FIRSTLINE          Force matching to be before newline
   PCRE2_LITERAL            Pattern characters are all literal
+  PCRE2_MATCH_INVALID_UTF  Enable support for matching invalid UTF
   PCRE2_MATCH_UNSET_BACKREF  Match unset backreferences
   PCRE2_MULTILINE          ^ and $ match newlines within data
   PCRE2_NEVER_BACKSLASH_C  Lock out the use of \C in patterns
@@ -86,7 +87,12 @@ PCRE2 must be built with Unicode support (the default) in order to use
 PCRE2_UTF, PCRE2_UCP and related options.
 </P>
 <P>
-The yield of the function is a pointer to a private data structure that
+Additional options may be set in the compile context via the
+<a href="pcre2_set_compile_extra_options.html"><b>pcre2_set_compile_extra_options</b></a>
+function.
+</P>
+<P>
+The yield of this function is a pointer to a private data structure that
 contains the compiled pattern, or NULL if an error was detected.
 </P>
 <P>
index 8702cca326884238b3e2714f4f42c6a9ae2aca49..232e2bcef89fd75c5ccc1cb8f82c90b6addb2115 100644 (file)
@@ -51,6 +51,8 @@ depth limits. The <i>length</i> and <i>startoffset</i> values are code units, no
 characters. The options are:
 <pre>
   PCRE2_ANCHORED          Match only at the first position
+  PCRE2_COPY_MATCHED_SUBJECT
+                          On success, make a private subject copy
   PCRE2_ENDANCHORED       Pattern can match only at end of subject
   PCRE2_NOTBOL            Subject is not the beginning of a line
   PCRE2_NOTEOL            Subject is not the end of a line
diff --git a/doc/html/pcre2_get_match_data_size.html b/doc/html/pcre2_get_match_data_size.html
new file mode 100644 (file)
index 0000000..113ecaa
--- /dev/null
@@ -0,0 +1,39 @@
+<html>
+<head>
+<title>pcre2_get_match_data_size specification</title>
+</head>
+<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
+<h1>pcre2_get_match_data_size 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>PCRE2_SIZE pcre2_get_match_data_size(pcre2_match_data *<i>match_data</i>);</b>
+</P>
+<br><b>
+DESCRIPTION
+</b><br>
+<P>
+This function returns the size, in bytes, of the match data block that is its
+argument.
+</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 15b0138b121bf86faadbffd5eef320fce45427c7..873d0ddefc6286279f4a06bb06b782c2744a372f 100644 (file)
@@ -41,9 +41,16 @@ bits:
   PCRE2_JIT_PARTIAL_SOFT  compile code for soft partial matching
   PCRE2_JIT_PARTIAL_HARD  compile code for hard partial matching
 </pre>
+There is also an obsolete option called PCRE2_JIT_INVALID_UTF, which has been
+superseded by the <b>pcre2_compile()</b> option PCRE2_MATCH_INVALID_UTF. The old
+option is deprecated and may be removed in the future.
+</P>
+<P>
 The yield of the function is 0 for success, or a negative error code otherwise.
 In particular, PCRE2_ERROR_JIT_BADOPTION is returned if JIT is not supported or
-if an unknown bit is set in <i>options</i>.
+if an unknown bit is set in <i>options</i>. The function can also return
+PCRE2_ERROR_NOMEMORY if JIT is unable to allocate executable memory for the
+compiler, even if it was because of a system security restriction.
 </P>
 <P>
 There is a complete description of the PCRE2 native API in the
index 6d240e322791d0f6753cede4e6ce3c058623b2be..196365453a9a9f9dda4c6c85c4217c6d5e3fd6a4 100644 (file)
@@ -19,7 +19,7 @@ SYNOPSIS
 <b>#include &#60;pcre2.h&#62;</b>
 </P>
 <P>
-<b>const unsigned char *pcre2_maketables(pcre2_general_context *<i>gcontext</i>);</b>
+<b>const uint8_t *pcre2_maketables(pcre2_general_context *<i>gcontext</i>);</b>
 </P>
 <br><b>
 DESCRIPTION
diff --git a/doc/html/pcre2_maketables_free.html b/doc/html/pcre2_maketables_free.html
new file mode 100644 (file)
index 0000000..7316ab2
--- /dev/null
@@ -0,0 +1,44 @@
+<html>
+<head>
+<title>pcre2_maketables_free specification</title>
+</head>
+<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
+<h1>pcre2_maketables_free 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>void pcre2_maketables_free(pcre2_general_context *<i>gcontext</i>,</b>
+<b>  const uint8_t *<i>tables</i>);</b>
+</P>
+<br><b>
+DESCRIPTION
+</b><br>
+<P>
+This function discards a set of character tables that were created by a call
+to
+<a href="pcre2_maketables.html"><b>pcre2_maketables()</b>.</a>
+</P>
+<P>
+The <i>gcontext</i> parameter should match what was used in that call to
+account for any custom allocators that might be in use; if it is NULL
+the system <b>free()</b> is used.
+</P>
+<P>
+There is a complete description of the PCRE2 native API in the
+<a href="pcre2api.html"><b>pcre2api</b></a>
+page.
+<p>
+Return to the <a href="index.html">PCRE2 index page</a>.
+</p>
index ced70bb2a9b0bb616322e4d29250b6891bbc9c93..90f7fcc189289fce3272e31867058b2958343d2e 100644 (file)
@@ -55,11 +55,13 @@ A match context is needed only if you want to:
   Change the backtracking depth limit
   Set custom memory management specifically for the match
 </pre>
-The <i>length</i> and <i>startoffset</i> values are code
-units, not characters. The length may be given as PCRE2_ZERO_TERMINATE for a
-subject that is terminated by a binary zero code unit. The options are:
+The <i>length</i> and <i>startoffset</i> values are code units, not characters.
+The length may be given as PCRE2_ZERO_TERMINATED for a subject that is
+terminated by a binary zero code unit. The options are:
 <pre>
   PCRE2_ANCHORED          Match only at the first position
+  PCRE2_COPY_MATCHED_SUBJECT
+                          On success, make a private subject copy
   PCRE2_ENDANCHORED       Pattern can match only at end of subject
   PCRE2_NOTBOL            Subject string is not the beginning of a line
   PCRE2_NOTEOL            Subject string is not the end of a line
index 68a446114760f9658f08f2a5eee2cc705c2f10bb..6ba6162d27f18f7c2cec5760e63d8c08ab58b142 100644 (file)
@@ -31,6 +31,11 @@ using the memory freeing function from the general context or compiled pattern
 with which it was created, or <b>free()</b> if that was not set.
 </P>
 <P>
+If the PCRE2_COPY_MATCHED_SUBJECT was used for a successful match using this
+match data block, the copy of the subject that was remembered with the block is
+also freed.
+</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
index 2e357094c8269a3e4229f50c229d862403e82878..eaaac6c0d39f53cfa572bdc0d6484113144dff6c 100644 (file)
@@ -19,7 +19,8 @@ SYNOPSIS
 <b>#include &#60;pcre2.h&#62;</b>
 </P>
 <P>
-<b>int pcre2_pattern_info(const pcre2 *<i>code</i>, uint32_t <i>what</i>, void *<i>where</i>);</b>
+<b>int pcre2_pattern_info(const pcre2_code *<i>code</i>, uint32_t <i>what</i>,</b>
+<b>   void *<i>where</i>);</b>
 </P>
 <br><b>
 DESCRIPTION
index 5a1bd20efe015436c100263c611dac3984f3e79c..43c02ff06a53bc950f36c41d898ec3489bd7618e 100644 (file)
@@ -20,7 +20,7 @@ SYNOPSIS
 </P>
 <P>
 <b>int pcre2_set_character_tables(pcre2_compile_context *<i>ccontext</i>,</b>
-<b>  const unsigned char *<i>tables</i>);</b>
+<b>  const uint8_t *<i>tables</i>);</b>
 </P>
 <br><b>
 DESCRIPTION
index 737493131a8b543a068d14d8be309e40fc2b3d06..c6c11f7e502074aafc48c9ed08de83d358c798c7 100644 (file)
@@ -20,7 +20,7 @@ SYNOPSIS
 </P>
 <P>
 <b>int pcre2_set_compile_extra_options(pcre2_compile_context *<i>ccontext</i>,</b>
-<b>  PCRE2_SIZE <i>extra_options</i>);</b>
+<b>  uint32_t <i>extra_options</i>);</b>
 </P>
 <br><b>
 DESCRIPTION
@@ -31,7 +31,9 @@ housed in a compile context. It completely replaces all the bits. The extra
 options are:
 <pre>
   PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES  Allow \x{df800} to \x{dfff} in UTF-8 and UTF-32 modes
+  PCRE2_EXTRA_ALT_BSUX                 Extended alternate \u, \U, and \x handling
   PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL    Treat all invalid escapes as a literal following character
+  PCRE2_EXTRA_ESCAPED_CR_IS_LF         Interpret \r as \n
   PCRE2_EXTRA_MATCH_LINE               Pattern matches whole lines
   PCRE2_EXTRA_MATCH_WORD               Pattern matches "words"
 </pre>
diff --git a/doc/html/pcre2_set_substitute_callout.html b/doc/html/pcre2_set_substitute_callout.html
new file mode 100644 (file)
index 0000000..7ae3a39
--- /dev/null
@@ -0,0 +1,43 @@
+<html>
+<head>
+<title>pcre2_set_substitute_callout specification</title>
+</head>
+<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
+<h1>pcre2_set_substitute_callout 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_substitute_callout(pcre2_match_context *<i>mcontext</i>,</b>
+<b>  int (*<i>callout_function</i>)(pcre2_substitute_callout_block *),</b>
+<b>  void *<i>callout_data</i>);</b>
+</P>
+<br><b>
+DESCRIPTION
+</b><br>
+<P>
+This function sets the substitute callout fields in a match context (the first
+argument). The second argument specifies a callout function, and the third
+argument is an opaque data item that is passed to it. The result of this
+function 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 5a44ea9ce70fe531a3de1b297133dd568b46a55b..277affae01144fa5550d3589fd067bf4f77c5d65 100644 (file)
@@ -27,8 +27,8 @@ DESCRIPTION
 </b><br>
 <P>
 This convenience function finds, for a compiled pattern, the first and last
-entries for a given name in the table that translates capturing parenthesis
-names into numbers.
+entries for a given name in the table that translates capture group names into
+numbers.
 <pre>
   <i>code</i>    Compiled regular expression
   <i>name</i>    Name whose entries required
index 17f9794df914abdf3037ea1ad2fe26b9eef0a503..82aabee2fa5bf065ded03679117b47983c7aa9d6 100644 (file)
@@ -49,7 +49,7 @@ please consult the man page, in case the conversion went wrong.
 <li><a name="TOC34" href="#SEC34">EXTRACTING A LIST OF ALL CAPTURED SUBSTRINGS</a>
 <li><a name="TOC35" href="#SEC35">EXTRACTING CAPTURED SUBSTRINGS BY NAME</a>
 <li><a name="TOC36" href="#SEC36">CREATING A NEW STRING WITH SUBSTITUTIONS</a>
-<li><a name="TOC37" href="#SEC37">DUPLICATE SUBPATTERN NAMES</a>
+<li><a name="TOC37" href="#SEC37">DUPLICATE CAPTURE GROUP NAMES</a>
 <li><a name="TOC38" href="#SEC38">FINDING ALL POSSIBLE MATCHES AT ONE POSITION</a>
 <li><a name="TOC39" href="#SEC39">MATCHING A PATTERN: THE ALTERNATIVE FUNCTION</a>
 <li><a name="TOC40" href="#SEC40">SEE ALSO</a>
@@ -142,7 +142,7 @@ document for an overview of all the PCRE2 documentation.
 <br>
 <br>
 <b>int pcre2_set_character_tables(pcre2_compile_context *<i>ccontext</i>,</b>
-<b>  const unsigned char *<i>tables</i>);</b>
+<b>  const uint8_t *<i>tables</i>);</b>
 <br>
 <br>
 <b>int pcre2_set_compile_extra_options(pcre2_compile_context *<i>ccontext</i>,</b>
@@ -182,6 +182,11 @@ document for an overview of all the PCRE2 documentation.
 <b>  void *<i>callout_data</i>);</b>
 <br>
 <br>
+<b>int pcre2_set_substitute_callout(pcre2_match_context *<i>mcontext</i>,</b>
+<b>  int (*<i>callout_function</i>)(pcre2_substitute_callout_block *, void *),</b>
+<b>  void *<i>callout_data</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>
@@ -304,10 +309,15 @@ document for an overview of all the PCRE2 documentation.
 <b>  PCRE2_SIZE <i>bufflen</i>);</b>
 <br>
 <br>
-<b>const unsigned char *pcre2_maketables(pcre2_general_context *<i>gcontext</i>);</b>
+<b>const uint8_t *pcre2_maketables(pcre2_general_context *<i>gcontext</i>);</b>
 <br>
 <br>
-<b>int pcre2_pattern_info(const pcre2 *<i>code</i>, uint32_t <i>what</i>, void *<i>where</i>);</b>
+<b>void pcre2_maketables_free(pcre2_general_context *<i>gcontext</i>,</b>
+<b>  const uint8_t *<i>tables</i>);</b>
+<br>
+<br>
+<b>int pcre2_pattern_info(const pcre2_code *<i>code</i>, uint32_t <i>what</i>,</b>
+<b>  void *<i>where</i>);</b>
 <br>
 <br>
 <b>int pcre2_callout_enumerate(const pcre2_code *<i>code</i>,</b>
@@ -785,10 +795,10 @@ interpreted matching functions, <i>pcre2_match()</i> and
 <br>
 <br>
 <b>int pcre2_set_character_tables(pcre2_compile_context *<i>ccontext</i>,</b>
-<b>  const unsigned char *<i>tables</i>);</b>
+<b>  const uint8_t *<i>tables</i>);</b>
 <br>
 <br>
-The value must be the result of a call to <i>pcre2_maketables()</i>, whose only
+The value must be the result of a call to <b>pcre2_maketables()</b>, whose only
 argument is a general context. This function builds a set of character tables
 in the current locale.
 <br>
@@ -847,7 +857,7 @@ functions, <i>pcre2_match()</i> and <i>pcre2_dfa_match()</i>.
 <b>  uint32_t <i>value</i>);</b>
 <br>
 <br>
-This parameter ajusts the limit, set when PCRE2 is built (default 250), on the
+This parameter adjusts the limit, set when PCRE2 is built (default 250), on the
 depth of parenthesis nesting in a pattern. This limit stops rogue patterns
 using up too much system stack when being compiled. The limit applies to
 parentheses of all kinds, not just capturing parentheses.
@@ -912,12 +922,23 @@ PCRE2_ERROR_BADDATA if invalid data is detected.
 <b>  void *<i>callout_data</i>);</b>
 <br>
 <br>
-This sets up a "callout" function for PCRE2 to call at specified points
+This sets up a callout function for PCRE2 to call at specified points
 during a matching operation. Details are given in the
 <a href="pcre2callout.html"><b>pcre2callout</b></a>
 documentation.
 <br>
 <br>
+<b>int pcre2_set_substitute_callout(pcre2_match_context *<i>mcontext</i>,</b>
+<b>  int (*<i>callout_function</i>)(pcre2_substitute_callout_block *, void *),</b>
+<b>  void *<i>callout_data</i>);</b>
+<br>
+<br>
+This sets up a callout function for PCRE2 to call after each substitution
+made by <b>pcre2_substitute()</b>. Details are given in the section entitled
+"Creating a new string with substitutions"
+<a href="#substitutions">below.</a>
+<br>
+<br>
 <b>int pcre2_set_offset_limit(pcre2_match_context *<i>mcontext</i>,</b>
 <b>  PCRE2_SIZE <i>value</i>);</b>
 <br>
@@ -931,7 +952,7 @@ substitutions.
 </P>
 <P>
 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
+limit less than 3, the result is PCRE2_ERROR_NOMATCH. A match can never be
 found if the <i>startoffset</i> argument of <b>pcre2_match()</b>,
 <b>pcre2_dfa_match()</b>, or <b>pcre2_substitute()</b> is greater than the offset
 limit set in the match context.
@@ -1282,21 +1303,24 @@ are needed. The <b>pcre2_code_copy_with_tables()</b> provides this facility.
 Copies of both the code and the tables are made, with the new code pointing to
 the new tables. The memory for the new tables is automatically freed when
 <b>pcre2_code_free()</b> is called for the new copy of the compiled code. If
-<b>pcre2_code_copy_withy_tables()</b> is called with a NULL argument, it returns
+<b>pcre2_code_copy_with_tables()</b> is called with a NULL argument, it returns
 NULL.
 </P>
 <P>
 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 substring extraction functions. After running a match, you
-must not free a compiled pattern (or a subject string) until after all
-operations on the
+be referenced by the substring extraction functions after a successful match.
+After running a match, you must not free a compiled pattern or a subject string
+until after all operations on the
 <a href="#matchdatablock">match data block</a>
-have taken place.
+have taken place, unless, in the case of the subject string, you have used the
+PCRE2_COPY_MATCHED_SUBJECT option, which is described in the section entitled
+"Option bits for <b>pcre2_match()</b>"
+<a href="#matchoptions>">below.</a>
 </P>
 <P>
 The <i>options</i> argument for <b>pcre2_compile()</b> contains various bit
-settings that affect the compilation. It should be zero if no options are
+settings that affect the compilation. It should be zero if none of them 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
@@ -1311,8 +1335,9 @@ compilation. The PCRE2_ANCHORED, PCRE2_ENDANCHORED, and PCRE2_NO_UTF_CHECK
 options can be set at the time of matching as well as at compile time.
 </P>
 <P>
-Other, less frequently required compile-time parameters (for example, the
-newline setting) can be provided in a compile context (as described
+Some additional options and less frequently required compile-time parameters
+(for example, the newline setting) can be provided in a compile context (as
+described
 <a href="#compilecontext">above).</a>
 </P>
 <P>
@@ -1326,11 +1351,12 @@ and <b>pcre2_compile()</b> returns a non-NULL value.
 <P>
 There are nearly 100 positive error codes that <b>pcre2_compile()</b> 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
-<b>pcre2_match()</b> and <b>pcre2_dfa_match()</b>, and are described in the
+that are used for invalid UTF strings when validity checking is in force. These
+are the same as given by <b>pcre2_match()</b> and <b>pcre2_dfa_match()</b>, and
+are described in the
 <a href="pcre2unicode.html"><b>pcre2unicode</b></a>
-page. There is no separate documentation for the positive error codes, because
-the textual error messages that are obtained by calling the
+documentation. There is no separate documentation for the positive error codes,
+because the textual error messages that are obtained by calling the
 <b>pcre2_get_error_message()</b> function (see "Obtaining a textual error
 message"
 <a href="#geterrormessage">below)</a>
@@ -1365,7 +1391,13 @@ This code fragment shows a typical straightforward call to
     &errorcode,             /* for error code */
     &erroffset,             /* for error offset */
     NULL);                  /* no compile context */
-</pre>
+
+</PRE>
+</P>
+<br><b>
+Main compile options
+</b><br>
+<P>
 The following names for option bits are defined in the <b>pcre2.h</b> header
 file:
 <pre>
@@ -1405,6 +1437,14 @@ 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).
+</P>
+<P>
+ECMAscript 6 added additional functionality to \u. This can be accessed using
+the PCRE2_EXTRA_ALT_BSUX extra option (see "Extra compile options"
+<a href="#extracompileoptions">below).</a>
+Note that this alternative escape handling applies only to patterns. Neither of
+these options affects the processing of replacement strings passed to
+<b>pcre2_substitute()</b>.
 <pre>
   PCRE2_ALT_CIRCUMFLEX
 </pre>
@@ -1471,10 +1511,10 @@ independent of the setting of PCRE2_DOTALL.
 <pre>
   PCRE2_DUPNAMES
 </pre>
-If this bit is set, names used to identify capturing subpatterns need not be
-unique. This can be helpful for certain types of pattern when it is known that
-only one instance of the named subpattern can ever be matched. There are more
-details of named subpatterns below; see also the
+If this bit is set, names used to identify capture groups need not be unique.
+This can be helpful for certain types of pattern when it is known that only one
+instance of the named group can ever be matched. There are more details of
+named capture groups below; see also the
 <a href="pcre2pattern.html"><b>pcre2pattern</b></a>
 documentation.
 <pre>
@@ -1507,11 +1547,11 @@ the end of the subject.
 If this bit is set, most white space characters in the pattern are totally
 ignored except when escaped or inside a character class. However, white space
 is not allowed within sequences such as (?&#62; that introduce various
-parenthesized subpatterns, nor within numerical quantifiers such as {1,3}.
-Ignorable white space is permitted between an item and a following quantifier
-and between a quantifier and a following + that indicates possessiveness.
-PCRE2_EXTENDED is equivalent to Perl's /x option, and it can be changed within
-a pattern by a (?x) option setting.
+parenthesized groups, nor within numerical quantifiers such as {1,3}. Ignorable
+white space is permitted between an item and a following quantifier and between
+a quantifier and a following + that indicates possessiveness. PCRE2_EXTENDED is
+equivalent to Perl's /x option, and it can be changed within a pattern by a
+(?x) option setting.
 </P>
 <P>
 When PCRE2 is compiled without Unicode support, PCRE2_EXTENDED recognizes as
@@ -1580,14 +1620,22 @@ expression engine is not the most efficient way of doing it. If you are doing a
 lot of literal matching and are worried about efficiency, you should consider
 using other approaches. The only other main options that are allowed with
 PCRE2_LITERAL are: PCRE2_ANCHORED, PCRE2_ENDANCHORED, PCRE2_AUTO_CALLOUT,
-PCRE2_CASELESS, PCRE2_FIRSTLINE, PCRE2_NO_START_OPTIMIZE, PCRE2_NO_UTF_CHECK,
-PCRE2_UTF, and PCRE2_USE_OFFSET_LIMIT. The extra options PCRE2_EXTRA_MATCH_LINE
-and PCRE2_EXTRA_MATCH_WORD are also supported. Any other options cause an
-error.
+PCRE2_CASELESS, PCRE2_FIRSTLINE, PCRE2_MATCH_INVALID_UTF,
+PCRE2_NO_START_OPTIMIZE, PCRE2_NO_UTF_CHECK, PCRE2_UTF, and
+PCRE2_USE_OFFSET_LIMIT. The extra options PCRE2_EXTRA_MATCH_LINE and
+PCRE2_EXTRA_MATCH_WORD are also supported. Any other options cause an error.
+<pre>
+  PCRE2_MATCH_INVALID_UTF
+</pre>
+This option forces PCRE2_UTF (see below) and also enables support for matching
+by <b>pcre2_match()</b> in subject strings that contain invalid UTF sequences.
+This facility is not supported for DFA matching. For details, see the
+<a href="pcre2unicode.html"><b>pcre2unicode</b></a>
+documentation.
 <pre>
   PCRE2_MATCH_UNSET_BACKREF
 </pre>
-If this option is set, a backreference to an unset subpattern group matches an
+If this option is set, a backreference to an unset capture group matches an
 empty string (by default this causes the current matching alternative to fail).
 A pattern such as (\1)(a) succeeds when this option is set (assuming it can
 find an "a" in the subject), whereas it fails by default, for Perl
@@ -1649,7 +1697,7 @@ If this option is set, it disables the use of numbered capturing parentheses in
 the pattern. Any opening parenthesis that is not followed by ? behaves as if it
 were followed by ?: but named parentheses can still be used for capturing (and
 they acquire numbers in the usual way). This is the same as Perl's /n option.
-Note that, when this option is set, references to capturing groups
+Note that, when this option is set, references to capture groups
 (backreferences or recursion/subroutine calls) may only refer to named groups,
 though the reference can be by name or by number.
 <pre>
@@ -1668,7 +1716,7 @@ purposes.
 If this option is set, it disables an optimization that is applied when .* is
 the first significant item in a top-level branch of a pattern, and all the
 other branches also start with .* or with \A or \G or ^. The optimization is
-automatically disabled for .* if it is inside an atomic group or a capturing
+automatically disabled for .* if it is inside an atomic group or a capture
 group that is the subject of a backreference, or if the pattern contains
 (*PRUNE) or (*SKIP). When the optimization is not disabled, such a pattern is
 automatically anchored if PCRE2_DOTALL is set for all the .* items and
@@ -1718,17 +1766,22 @@ subject string does not happen. The first match attempt is run starting from
 the overall result is "no match".
 </P>
 <P>
-There are also other start-up optimizations. For example, a minimum length for
-the subject may be recorded. Consider the pattern
+As another start-up optimization makes use of a minimum length for a matching
+subject, which is recorded when possible. Consider the pattern
 <pre>
-  (*MARK:A)(X|Y)
+  (*MARK:1)B(*MARK:2)(X|Y)
 </pre>
-The minimum length for a match is one character. If the subject is "ABC", there
-will be attempts to match "ABC", "BC", and "C". An attempt to match an empty
-string at the end of the subject does not take place, because PCRE2 knows that
-the subject is now too short, and so the (*MARK) is never encountered. In this
-case, the optimization does not affect the overall match result, which is still
-"no match", but it does affect the auxiliary information that is returned.
+The minimum length for a match is two characters. If the subject is "XXBB", the
+"starting character" optimization skips "XX", then tries to match "BB", which
+is long enough. In the process, (*MARK:2) is encountered and remembered. When
+the match attempt fails, the next "B" is found, but there is only one character
+left, so there are no more attempts, and "no match" is returned with the "last
+mark seen" set to "2". If NO_START_OPTIMIZE is set, however, matches are tried
+at every possible starting position, including at the end of the subject, where
+(*MARK:1) is encountered, but there is no "B", so the "last mark seen" that is
+returned is "1". In this case, the optimizations do not affect the overall
+match result, which is still "no match", but they do affect the auxiliary
+information that is returned.
 <pre>
   PCRE2_NO_UTF_CHECK
 </pre>
@@ -1811,9 +1864,8 @@ characters with code points greater than 127.
 Extra compile options
 </b><br>
 <P>
-Unlike the main compile-time options, the extra options are not saved with the
-compiled pattern. The option bits that can be set in a compile context by
-calling the <b>pcre2_set_compile_extra_options()</b> function are as follows:
+The option bits that can be set in a compile context by calling the
+<b>pcre2_set_compile_extra_options()</b> function are as follows:
 <pre>
   PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES
 </pre>
@@ -1838,6 +1890,14 @@ If the extra option PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is set, surrogate code
 point values in UTF-8 and UTF-32 patterns no longer provoke errors and are
 incorporated in the compiled pattern. However, they can only match subject
 characters if the matching function is called with PCRE2_NO_UTF_CHECK set.
+<pre>
+  PCRE2_EXTRA_ALT_BSUX
+</pre>
+The original option PCRE2_ALT_BSUX causes PCRE2 to process \U, \u, and \x in
+the way that ECMAscript (aka JavaScript) does. Additional functionality was
+defined by ECMAscript 6; setting PCRE2_EXTRA_ALT_BSUX has the effect of
+PCRE2_ALT_BSUX, but in addition it recognizes \u{hhh..} as a hexadecimal
+character code, where hhh.. is any number of hexadecimal digits.
 <pre>
   PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL
 </pre>
@@ -1851,11 +1911,22 @@ always causes an error in Perl.
 </P>
 <P>
 If the PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL extra option is passed to
-<b>pcre2_compile()</b>, all unrecognized or erroneous escape sequences are
+<b>pcre2_compile()</b>, all unrecognized or malformed escape sequences are
 treated as single-character escapes. For example, \j is a literal "j" and
 \x{2z} is treated as the literal string "x{2z}". Setting this option means
-that typos in patterns may go undetected and have unexpected results. This is a
-dangerous option. Use with care.
+that typos in patterns may go undetected and have unexpected results. Also note
+that a sequence such as [\N{] is interpreted as a malformed attempt at
+[\N{...}] and so is treated as [N{] whereas [\N] gives an error because an
+unqualified \N is a valid escape sequence but is not supported in a character
+class. To reiterate: this is a dangerous option. Use with great care.
+<pre>
+  PCRE2_EXTRA_ESCAPED_CR_IS_LF
+</pre>
+There are some legacy applications where the escape sequence \r in a pattern
+is expected to match a newline. If this option is set, \r in a pattern is
+converted to \n so that it matches a LF (linefeed) instead of a CR (carriage
+return) character. The option does not affect a literal CR in the pattern, nor
+does it affect CR specified as an explicit code point such as \x{0D}.
 <pre>
   PCRE2_EXTRA_MATCH_LINE
 </pre>
@@ -1915,13 +1986,20 @@ Most (but not all) patterns can be optimized by the JIT compiler.
 <a name="localesupport"></a></P>
 <br><a name="SEC22" href="#TOC1">LOCALE SUPPORT</a><br>
 <P>
+<b>const uint8_t *pcre2_maketables(pcre2_general_context *<i>gcontext</i>);</b>
+<br>
+<br>
+<b>void pcre2_maketables_free(pcre2_general_context *<i>gcontext</i>,</b>
+<b>  const uint8_t *<i>tables</i>);</b>
+</P>
+<P>
 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 Unicode support, all characters can be tested
-with \p and \P, or, alternatively, the PCRE2_UCP option can be set when a
-pattern is compiled; this causes \w and friends to use Unicode property
+point. However, 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. When PCRE2 is built with Unicode support (the default), all characters can
+be tested with \p and \P, or, alternatively, 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.
 </P>
 <P>
@@ -1930,24 +2008,28 @@ with code points greater than 128, you should either use Unicode support, or
 use locales, but not try to mix the two.
 </P>
 <P>
-PCRE2 contains an internal set of character tables that are used by default.
+PCRE2 contains a built-in 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 different.
 </P>
 <P>
-The internal tables can be overridden by tables supplied by the application
+The built-in tables can be overridden by tables supplied by the application
 that calls PCRE2. These may be created in a different locale from the default.
 As more and more applications change to using Unicode, the need for this locale
 support is expected to die away.
 </P>
 <P>
 External tables are built by calling the <b>pcre2_maketables()</b> function, in
-the relevant locale. The result can be passed to <b>pcre2_compile()</b> as often
-as necessary, by creating a compile context and calling
-<b>pcre2_set_character_tables()</b> to set the tables pointer therein. For
-example, to build and use tables that are appropriate for the French locale
+the relevant locale. The only argument to this function is a general context,
+which can be used to pass a custom memory allocator. If the argument is NULL,
+the system <b>malloc()</b> is used. The result can be passed to
+<b>pcre2_compile()</b> as often as necessary, by creating a compile context and
+calling <b>pcre2_set_character_tables()</b> to set the tables pointer therein.
+</P>
+<P>
+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:
 <pre>
@@ -1958,9 +2040,7 @@ letters), the following code could be used:
   re = pcre2_compile(..., ccontext);
 </pre>
 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.
+are using Windows, the name for the French locale is "french".
 </P>
 <P>
 The pointer that is passed (via the compile context) to <b>pcre2_compile()</b>
@@ -1968,6 +2048,13 @@ is saved with the compiled pattern, and the same tables are used by
 <b>pcre2_match()</b> and <b>pcre_dfa_match()</b>. Thus, for any single pattern,
 compilation and matching both happen in the same locale, but different patterns
 can be processed in different locales.
+</P>
+<P>
+It is the caller's responsibility to ensure that the memory containing the
+tables remains available while they are still in use. When they are no longer
+needed, you can discard them using <b>pcre2_maketables_free()</b>, which should
+pass as its first parameter the same global context that was used to create the
+tables.
 <a name="infoaboutpattern"></a></P>
 <br><a name="SEC23" href="#TOC1">INFORMATION ABOUT A COMPILED PATTERN</a><br>
 <P>
@@ -1990,7 +2077,7 @@ the following negative numbers:
   PCRE2_ERROR_BADOPTION      the value of <i>what</i> was invalid
   PCRE2_ERROR_UNSET          the requested field is not set
 </pre>
-The "magic number" is placed at the start of each compiled pattern as an simple
+The "magic number" is placed at the start of each compiled pattern as a simple
 check against passing an arbitrary memory pointer. Here is a typical call of
 <b>pcre2_pattern_info()</b>, to obtain the length of the compiled pattern:
 <pre>
@@ -2036,7 +2123,7 @@ When .* is the first significant item, anchoring is possible only when all the
 following are true:
 <pre>
   .* is not in an atomic group
-  .* is not in a capturing group that is the subject of a backreference
+  .* is not in a capture group that is the subject of a backreference
   PCRE2_DOTALL is in force for .*
   Neither (*PRUNE) nor (*SKIP) appears in the pattern
   PCRE2_NO_DOTSTAR_ANCHOR is not set
@@ -2047,12 +2134,12 @@ options returned for PCRE2_INFO_ALLOPTIONS.
   PCRE2_INFO_BACKREFMAX
 </pre>
 Return the number of the highest backreference in the pattern. The third
-argument should point to an <b>uint32_t</b> variable. Named subpatterns acquire
-numbers as well as names, and these count towards the highest backreference.
-Backreferences such as \4 or \g{12} match the captured 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 backreference. Zero is
-returned if there are no backreferences.
+argument should point to a <b>uint32_t</b> variable. Named capture groups
+acquire numbers as well as names, and these count towards the highest
+backreference. Backreferences such as \4 or \g{12} match the captured
+characters of the given group, but in addition, the check that a capture
+group is set in a conditional group such as (?(3)a|b) is also a backreference.
+Zero is returned if there are no backreferences.
 <pre>
   PCRE2_INFO_BSR
 </pre>
@@ -2063,9 +2150,9 @@ that \R matches only CR, LF, or CRLF.
 <pre>
   PCRE2_INFO_CAPTURECOUNT
 </pre>
-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.
+Return the highest capture group number in the pattern. In patterns where (?|
+is not used, this is also the total number of capture groups. The third
+argument should point to a <b>uint32_t</b> variable.
 <pre>
   PCRE2_INFO_DEPTHLIMIT
 </pre>
@@ -2090,7 +2177,7 @@ returned. Otherwise NULL is returned. The third argument should point to a
   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>
+non-anchored pattern. The third argument should point to a <b>uint32_t</b>
 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 value can be retrieved
 using PCRE2_INFO_FIRSTCODEUNIT. If there is no fixed first value, but it is
@@ -2102,7 +2189,7 @@ is returned.
 </pre>
 Return the value of the first code unit of any matched string for a pattern
 where PCRE2_INFO_FIRSTCODETYPE returns 1; otherwise return 0. The third
-argument should point to an <b>uint32_t</b> variable. In the 8-bit library, the
+argument should point to a <b>uint32_t</b> 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.
@@ -2113,17 +2200,17 @@ Return the size (in bytes) of the data frames that are used to remember
 backtracking positions when the pattern is processed by <b>pcre2_match()</b>
 without the use of JIT. The third argument should point to a <b>size_t</b>
 variable. The frame size depends on the number of capturing parentheses in the
-pattern. Each additional capturing group adds two PCRE2_SIZE variables.
+pattern. Each additional capture group adds two PCRE2_SIZE variables.
 <pre>
   PCRE2_INFO_HASBACKSLASHC
 </pre>
 Return 1 if the pattern contains any instances of \C, otherwise 0. The third
-argument should point to an <b>uint32_t</b> variable.
+argument should point to a <b>uint32_t</b> variable.
 <pre>
   PCRE2_INFO_HASCRORLF
 </pre>
 Return 1 if the pattern contains any explicit matches for CR or LF characters,
-otherwise 0. The third argument should point to an <b>uint32_t</b> variable. An
+otherwise 0. The third argument should point to a <b>uint32_t</b> variable. An
 explicit match is either a literal CR or LF character, or \r or \n or one of
 the equivalent hexadecimal or octal escape sequences.
 <pre>
@@ -2139,7 +2226,7 @@ defaulted by the caller of the match function.
   PCRE2_INFO_JCHANGED
 </pre>
 Return 1 if the (?J) or (?-J) option setting is used in the pattern, otherwise
-0. The third argument should point to an <b>uint32_t</b> variable. (?J) and
+0. The third argument should point to a <b>uint32_t</b> variable. (?J) and
 (?-J) set and unset the local PCRE2_DUPNAMES option, respectively.
 <pre>
   PCRE2_INFO_JITSIZE
@@ -2151,7 +2238,7 @@ return zero. The third argument should point to a <b>size_t</b> variable.
   PCRE2_INFO_LASTCODETYPE
 </pre>
 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
+matched string, other than at its start. The third argument should  point to a
 <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. For anchored patterns, a last literal value is
@@ -2164,12 +2251,12 @@ PCRE2_INFO_LASTCODEUNIT), but for /^a\dz\d/ the returned value is 0.
 Return the value of the rightmost literal code unit that must exist in any
 matched string, other than at its start, for a pattern where
 PCRE2_INFO_LASTCODETYPE returns 1. Otherwise, return 0. The third argument
-should point to an <b>uint32_t</b> variable.
+should point to a <b>uint32_t</b> variable.
 <pre>
   PCRE2_INFO_MATCHEMPTY
 </pre>
 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
+argument should point to a <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.
@@ -2185,26 +2272,34 @@ defaulted by the caller of the match function.
 <pre>
   PCRE2_INFO_MAXLOOKBEHIND
 </pre>
-Return the number of characters (not code units) in the longest lookbehind
-assertion in the pattern. The third argument should point to a uint32_t
-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 processed. Otherwise, if there are no lookbehinds in the
-pattern, \A might match incorrectly at the start of a second or subsequent
-segment.
+A lookbehind assertion moves back a certain number of characters (not code
+units) when it starts to process each of its branches. This request returns the
+largest of these backward moves. The third argument should point to a uint32_t
+integer. The simple assertions \b and \B require a one-character lookbehind
+and cause PCRE2_INFO_MAXLOOKBEHIND to return 1 in the absence of anything
+longer. \A also registers a one-character lookbehind, though it does not
+actually inspect the previous character.
+</P>
+<P>
+Note that this information is useful for multi-segment matching only
+if the pattern contains no nested lookbehinds. For example, the pattern
+(?&#60;=a(?&#60;=ba)c) returns a maximum lookbehind of 2, but when it is processed, the
+first lookbehind moves back by two characters, matches one character, then the
+nested lookbehind also moves back by two characters. This puts the matching
+point three characters earlier than it was at the start.
+PCRE2_INFO_MAXLOOKBEHIND is really only useful as a debugging tool. See the
+<a href="pcre2partial.html"><b>pcre2partial</b></a>
+documentation for a discussion of multi-segment matching.
 <pre>
   PCRE2_INFO_MINLENGTH
 </pre>
 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 number of code units.
-The third argument should point to an <b>uint32_t</b> 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.
+returned. Otherwise the returned value is 0. This value is not computed when
+PCRE2_NO_START_OPTIMIZE is set. The value is a number of characters, which in
+UTF mode may be different from the number of code units. The third argument
+should point to a <b>uint32_t</b> 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.
 <pre>
   PCRE2_INFO_NAMECOUNT
   PCRE2_INFO_NAMEENTRYSIZE
@@ -2237,20 +2332,20 @@ the parenthesis number. The rest of the entry is the corresponding name, zero
 terminated.
 </P>
 <P>
-The names are in alphabetical order. If (?| is used to create multiple groups
-with the same number, as described in the
-<a href="pcre2pattern.html#dupsubpatternnumber">section on duplicate subpattern numbers</a>
+The names are in alphabetical order. If (?| is used to create multiple capture
+groups with the same number, as described in the
+<a href="pcre2pattern.html#dupgroupnumber">section on duplicate group numbers</a>
 in the
 <a href="pcre2pattern.html"><b>pcre2pattern</b></a>
 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.
 </P>
 <P>
-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
+Duplicate names for capture groups 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.
+later capture groups may have lower numbers.
 </P>
 <P>
 As a simple example of the name/number table, consider the following pattern
@@ -2259,16 +2354,16 @@ space - including newlines - is ignored):
 <pre>
   (?&#60;date&#62; (?&#60;year&#62;(\d\d)?\d\d) - (?&#60;month&#62;\d\d) - (?&#60;day&#62;\d\d) )
 </pre>
-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 ??:
+There are four named capture groups, 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 ??:
 <pre>
   00 01 d  a  t  e  00 ??
   00 05 d  a  y  00 ?? ??
   00 04 m  o  n  t  h  00
   00 02 y  e  a  r  00 ??
 </pre>
-When writing code to extract data from named subpatterns using the
+When writing code to extract data from named capture groups using the
 name-to-number map, remember that the length of the entries is likely to be
 different for each compiled pattern.
 <pre>
@@ -2393,9 +2488,13 @@ on the error, and is detailed below.
 <P>
 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.
+referenced by the extraction functions after a successful match. 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,
+unless, in the case of the subject string, you have used the
+PCRE2_COPY_MATCHED_SUBJECT option, which is described in the section entitled
+"Option bits for <b>pcre2_match()</b>"
+<a href="#matchoptions>">below.</a>
 </P>
 <P>
 When a match data block itself is no longer needed, it should be freed by
@@ -2507,10 +2606,10 @@ Option bits for <b>pcre2_match()</b>
 </b><br>
 <P>
 The unused bits of the <i>options</i> argument for <b>pcre2_match()</b> must be
-zero. The only bits that may be set are PCRE2_ANCHORED, PCRE2_ENDANCHORED,
-PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART,
-PCRE2_NO_JIT, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT.
-Their action is described below.
+zero. The only bits that may be set are PCRE2_ANCHORED,
+PCRE2_COPY_MATCHED_SUBJECT, PCRE2_ENDANCHORED, PCRE2_NOTBOL, PCRE2_NOTEOL,
+PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_JIT, PCRE2_NO_UTF_CHECK,
+PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT. Their action is described below.
 </P>
 <P>
 Setting PCRE2_ANCHORED or PCRE2_ENDANCHORED at match time is not supported by
@@ -2525,6 +2624,22 @@ 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.
+<pre>
+  PCRE2_COPY_MATCHED_SUBJECT
+</pre>
+By default, a pointer to the subject is remembered in the match data block so
+that, after a successful match, it can be referenced by the substring
+extraction functions. This means that the subject's memory must not be freed
+until all such operations are complete. For some applications where the
+lifetime of the subject string is not guaranteed, it may be necessary to make a
+copy of the subject string, but it is wasteful to do this unless the match is
+successful. After a successful match, if PCRE2_COPY_MATCHED_SUBJECT is set, the
+subject is copied and the new pointer is remembered in the match data block
+instead of the original subject pointer. The memory allocator that was used for
+the match block itself is used. The copy is automatically freed when
+<b>pcre2_match_data_free()</b> is called to free the match data block. It is also
+automatically freed if the match data block is re-used for another match
+operation.
 <pre>
   PCRE2_ENDANCHORED
 </pre>
@@ -2580,15 +2695,22 @@ of JIT; it forces matching to be done by the interpreter.
   PCRE2_NO_UTF_CHECK
 </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.
-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.
+string is checked unless PCRE2_NO_UTF_CHECK is passed to <b>pcre2_match()</b> or
+PCRE2_MATCH_INVALID_UTF was passed to <b>pcre2_compile()</b>. The latter special
+case is discussed in detail in the
+<a href="pcre2unicode.html"><b>pcre2unicode</b></a>
+documentation.
+</P>
+<P>
+In the default case, 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
@@ -2601,31 +2723,37 @@ and
 <a href="pcre2unicode.html#utf32strings">UTF-32 strings</a>
 in the
 <a href="pcre2unicode.html"><b>pcre2unicode</b></a>
-page.
+documentation.
 </P>
 <P>
-If you know that your subject is valid, and you want to skip these checks for
+If you know that your subject is valid, and you want to skip this check for
 performance reasons, you can set the PCRE2_NO_UTF_CHECK option when calling
 <b>pcre2_match()</b>. You might want to do this for the second and subsequent
-calls to <b>pcre2_match()</b> if you are making repeated calls to find other
+calls to <b>pcre2_match()</b> if you are making repeated calls to find multiple
 matches in the same subject string.
 </P>
 <P>
-<b>Warning:</b> When PCRE2_NO_UTF_CHECK is set, the effect of passing an invalid
+<b>Warning:</b> Unless PCRE2_MATCH_INVALID_UTF was set at compile time, when
+PCRE2_NO_UTF_CHECK is set at match time the effect of passing an invalid
 string as a subject, or an invalid value of <i>startoffset</i>, is undefined.
-Your program may crash or loop indefinitely.
+Your program may crash or loop indefinitely or give wrong results.
 <pre>
   PCRE2_PARTIAL_HARD
   PCRE2_PARTIAL_SOFT
 </pre>
 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 complete match can be found.
+subject characters to complete the match. In addition, either at least one
+character must have been inspected or the pattern must contain a lookbehind, or
+the pattern must be one that could match an empty string.
+</P>
+<P>
+If this situation arises 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 complete match can
+be found.
 </P>
 <P>
 If PCRE2_PARTIAL_HARD is set, it overrides PCRE2_PARTIAL_SOFT. In this case, if
@@ -2691,12 +2819,12 @@ valid newline sequence and explicit \r or \n escapes appear in the pattern.
 In general, a pattern matches a certain portion of the subject, and in
 addition, further substrings from the subject may be picked out by
 parenthesized parts of the pattern. Following the usage in Jeffrey Friedl's
-book, this is called "capturing" in what follows, and the phrase "capturing
-subpattern" or "capturing group" is used for a fragment of a pattern that picks
-out a substring. PCRE2 supports several other kinds of parenthesized subpattern
-that do not cause substrings to be captured. The <b>pcre2_pattern_info()</b>
-function can be used to find out how many capturing subpatterns there are in a
-compiled pattern.
+book, this is called "capturing" in what follows, and the phrase "capture
+group" (Perl terminology) is used for a fragment of a pattern that picks out a
+substring. PCRE2 supports several other kinds of parenthesized group that do
+not cause substrings to be captured. The <b>pcre2_pattern_info()</b> function
+can be used to find out how many capture groups there are in a compiled
+pattern.
 </P>
 <P>
 You can use auxiliary functions for accessing captured substrings
@@ -2745,9 +2873,8 @@ For example, if the pattern (?=ab\K) is matched against "ab", the start and
 end offset values for the match are 2 and 0.
 </P>
 <P>
-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 a capture group is matched repeatedly within a single match operation, it is
+the last portion of the subject that it matched that is returned.
 </P>
 <P>
 If the ovector is too small to hold all the captured substring offsets, as much
@@ -2756,21 +2883,20 @@ substrings are not of interest, <b>pcre2_match()</b> may be called with a match
 data block whose ovector is of minimum length (that is, one pair).
 </P>
 <P>
-It is possible for capturing subpattern number <i>n+1</i> to match some part of
-the subject when subpattern <i>n</i> has not been used at all. For example, 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 corresponding to unused subpatterns
-are set to PCRE2_UNSET.
+It is possible for capture group number <i>n+1</i> to match some part of the
+subject when group <i>n</i> has not been used at all. For example, if the string
+"abc" is matched against the pattern (a|(z))(bc) the return from the function
+is 4, and groups 1 and 3 are matched, but 2 is not. When this happens, both
+values in the offset pairs corresponding to unused groups are set to
+PCRE2_UNSET.
 </P>
 <P>
-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 highest used capturing
-subpattern number is 1. The offsets for for the second and third capturing
-subpatterns (assuming the vector is large enough, of course) are set to
-PCRE2_UNSET.
+Offset values that correspond to unused groups 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)?)? groups 2 and 3 are not matched. The return from the
+function is 2, because the highest used capture group number is 1. The offsets
+for for the second and third capture groupss (assuming the vector is large
+enough, of course) are set to PCRE2_UNSET.
 </P>
 <P>
 Elements in the ovector that do not correspond to capturing parentheses in the
@@ -2794,22 +2920,23 @@ undefined.
 </P>
 <P>
 After a successful match, a partial match (PCRE2_ERROR_PARTIAL), or a failure
-to match (PCRE2_ERROR_NOMATCH), a (*MARK), (*PRUNE), or (*THEN) name may be
-available. The function <b>pcre2_get_mark()</b> can be called to access this
-name. The same function applies to all three verbs. It returns a pointer to the
-zero-terminated name, which is within the compiled pattern. If no name is
+to match (PCRE2_ERROR_NOMATCH), a mark name may be available. The function
+<b>pcre2_get_mark()</b> can be called to access this name, which can be
+specified in the pattern by any of the backtracking control verbs, not just
+(*MARK). The same function applies to all the verbs. It returns a pointer to
+the zero-terminated name, which is within the compiled pattern. If no name is
 available, NULL is returned. The length of the name (excluding the terminating
 zero) is stored in the code unit that precedes the name. You should use this
 length instead of relying on the terminating zero if the name might contain a
 binary zero.
 </P>
 <P>
-After a successful match, the name that is returned is the last (*MARK),
-(*PRUNE), or (*THEN) name encountered on the matching path through the pattern.
-Instances of (*PRUNE) and (*THEN) without names are ignored. Thus, for example,
-if the matching path contains (*MARK:A)(*PRUNE), the name "A" is returned.
-After a "no match" or a partial match, the last encountered name is returned.
-For example, consider this pattern:
+After a successful match, the name that is returned is the last mark name
+encountered on the matching path through the pattern. Instances of backtracking
+verbs without names do not count. Thus, for example, if the matching path
+contains (*MARK:A)(*PRUNE), the name "A" is returned. After a "no match" or a
+partial match, the last encountered name is returned. For example, consider
+this pattern:
 <pre>
   ^(*MARK:A)((*MARK:B)a|b)c
 </pre>
@@ -2824,7 +2951,7 @@ is removed from the pattern above, there is an initial check for the presence
 of "c" in the subject before running the matching engine. This check fails for
 "bx", causing a match failure without seeing any marks. You can disable the
 start-of-match optimizations by setting the PCRE2_NO_START_OPTIMIZE option for
-<b>pcre2_compile()</b> or starting the pattern with (*NO_START_OPT).
+<b>pcre2_compile()</b> or by starting the pattern with (*NO_START_OPT).
 </P>
 <P>
 After a successful match, a partial match, or one of the invalid UTF errors
@@ -2930,7 +3057,8 @@ The backtracking match limit was reached.
 If a pattern contains many nested backtracking points, heap memory is used to
 remember them. This error is given when the memory allocation function (default
 or custom) fails. Note that a different error, PCRE2_ERROR_HEAPLIMIT, is given
-if the amount of memory needed exceeds the heap limit.
+if the amount of memory needed exceeds the heap limit. PCRE2_ERROR_NOMEMORY is
+also returned if PCRE2_COPY_MATCHED_SUBJECT is set and memory allocation fails.
 <pre>
   PCRE2_ERROR_NULL
 </pre>
@@ -2941,11 +3069,11 @@ as NULL.
 </pre>
 This error is returned when <b>pcre2_match()</b> detects a recursion loop within
 the pattern. Specifically, it means that either the whole pattern or a
-subpattern has been called recursively for the second time at the same position
-in the subject string. Some simple patterns that might do this are detected and
-faulted at compile time, but more complicated cases, in particular mutual
-recursions between two different subpatterns, cannot be detected until matching
-is attempted.
+capture group has been called recursively for the second time at the same
+position in the subject string. Some simple patterns that might do this are
+detected and faulted at compile time, but more complicated cases, in particular
+mutual recursions between two different groups, cannot be detected until
+matching is attempted.
 <a name="geterrormessage"></a></P>
 <br><a name="SEC32" href="#TOC1">OBTAINING A TEXTUAL ERROR MESSAGE</a><br>
 <P>
@@ -3022,7 +3150,7 @@ The <b>pcre2_substring_copy_bynumber()</b> function copies a captured substring
 into a supplied buffer, whereas <b>pcre2_substring_get_bynumber()</b> copies it
 into new memory, obtained using the same memory allocation function that was
 used for the match data block. The first two arguments of these functions are a
-pointer to the match data block and a capturing group number.
+pointer to the match data block and a capture group number.
 </P>
 <P>
 The final arguments of <b>pcre2_substring_copy_bynumber()</b> are a pointer to
@@ -3098,9 +3226,9 @@ calling <b>pcre2_substring_list_free()</b>.
 </P>
 <P>
 If this function encounters a substring that is unset, which can happen when
-capturing subpattern number <i>n+1</i> matches some part of the subject, but
-subpattern <i>n</i> has not been used at all, it returns an empty string. This
-can be distinguished from a genuine zero-length substring by inspecting the
+capture group number <i>n+1</i> matches some part of the subject, but group
+<i>n</i> has not been used at all, it returns an empty string. This can be
+distinguished from a genuine zero-length substring by inspecting the
 appropriate offset in the ovector, which contain PCRE2_UNSET for unset
 substrings, or by calling <b>pcre2_substring_length_bynumber()</b>.
 <a name="extractbyname"></a></P>
@@ -3130,21 +3258,21 @@ For example, for this pattern:
 <pre>
   (a+)b(?&#60;xxx&#62;\d+)...
 </pre>
-the number of the subpattern called "xxx" is 2. If the name is known to be
+the number of the capture group called "xxx" is 2. If the name is known to be
 unique (PCRE2_DUPNAMES was not set), you can find the number from the name by
 calling <b>pcre2_substring_number_from_name()</b>. The first argument is the
 compiled pattern, and the second is the name. The yield of the function is the
-subpattern number, PCRE2_ERROR_NOSUBSTRING if there is no subpattern of that
-name, or PCRE2_ERROR_NOUNIQUESUBSTRING if there is more than one subpattern of
-that name. Given the number, you can extract the substring directly from the
-ovector, or use one of the "bynumber" functions described above.
+group number, PCRE2_ERROR_NOSUBSTRING if there is no group with that name, or
+PCRE2_ERROR_NOUNIQUESUBSTRING if there is more than one group with that name.
+Given the number, you can extract the substring directly from the ovector, or
+use one of the "bynumber" functions described above.
 </P>
 <P>
 For convenience, there are also "byname" functions that correspond to the
 "bynumber" functions, the only difference being that the second argument is a
 name instead of a number. If PCRE2_DUPNAMES is set and there are duplicate
 names, these functions scan all the groups with the given name, and return the
-first named string that is set.
+captured substring from the first named group that is set.
 </P>
 <P>
 If there are no groups with the given name, PCRE2_ERROR_NOSUBSTRING is
@@ -3155,34 +3283,38 @@ set, PCRE2_ERROR_UNSET is returned.
 </P>
 <P>
 <b>Warning:</b> If the pattern uses the (?| feature to set up multiple
-subpatterns with the same number, as described in the
-<a href="pcre2pattern.html#dupsubpatternnumber">section on duplicate subpattern numbers</a>
+capture groups with the same number, as described in the
+<a href="pcre2pattern.html#dupgroupnumber">section on duplicate group numbers</a>
 in the
 <a href="pcre2pattern.html"><b>pcre2pattern</b></a>
-page, you cannot use names to distinguish the different subpatterns, because
+page, you cannot use names to distinguish the different capture groups, because
 names are not included in the compiled code. The matching process uses only
-numbers. For this reason, the use of different names for subpatterns of the
+numbers. For this reason, the use of different names for groups with the
 same number causes an error at compile time.
-</P>
+<a name="substitutions"></a></P>
 <br><a name="SEC36" href="#TOC1">CREATING A NEW STRING WITH SUBSTITUTIONS</a><br>
 <P>
 <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 <i>replacement</i>,</b>
-<b>  PCRE2_SIZE <i>rlength</i>, PCRE2_UCHAR *\fIoutputbuffer\zfP,</b>
+<b>  PCRE2_SIZE <i>rlength</i>, PCRE2_UCHAR *<i>outputbuffer</i>,</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. 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. For global
-replacements, matches in which \K in a lookbehind causes the match to start
-earlier than the point that was reached in the previous iteration are also not
-supported.
+string in <i>outputbuffer</i>, replacing one or more parts that were 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.
+The default is to perform just one replacement, but there is an option that
+requests multiple replacements (see PCRE2_SUBSTITUTE_GLOBAL below for details).
+</P>
+<P>
+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. For
+global replacements, matches in which \K in a lookbehind causes the match to
+start earlier than the point that was reached in the previous iteration are
+also not supported.
 </P>
 <P>
 The first seven arguments of <b>pcre2_substitute()</b> are the same as for
@@ -3194,9 +3326,9 @@ allocate memory for the compiled code.
 </P>
 <P>
 If an external <i>match_data</i> block is provided, its contents afterwards
-are those set by the final call to <b>pcre2_match()</b>, which will have
-ended in a matching error. The contents of the ovector within the match data
-block may or may not have been changed.
+are those set by the final call to <b>pcre2_match()</b>. For global changes,
+this will have ended in a matching error. The contents of the ovector within
+the match data block may or may not have been changed.
 </P>
 <P>
 The <i>outlengthptr</i> argument must point to a variable that contains the
@@ -3220,12 +3352,12 @@ 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 specify the insertion of
-characters from capturing groups or (*MARK), (*PRUNE), or (*THEN) items in the
-pattern. The following forms are always recognized:
+characters from capture groups or names from (*MARK) or other control verbs
+in the pattern. The following forms are always recognized:
 <pre>
   $$                  insert a dollar character
   $&#60;n&#62; or ${&#60;n&#62;}      insert the contents of group &#60;n&#62;
-  $*MARK or ${*MARK}  insert a (*MARK), (*PRUNE), or (*THEN) name
+  $*MARK or ${*MARK}  insert a control verb name
 </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
@@ -3234,11 +3366,11 @@ For example, if the pattern a(b)c is matched with "=abc=" and the replacement
 string "+$1$0$1+", the result is "=+babcb+=".
 </P>
 <P>
-$*MARK inserts the name from the last encountered (*MARK), (*PRUNE), or (*THEN)
-on the matching path that has a name. (*MARK) must always include a name, but
-(*PRUNE) and (*THEN) need not. For example, in the case of (*MARK:A)(*PRUNE)
-the name inserted is "A", but for (*MARK:A)(*PRUNE:B) the relevant name is "B".
-This facility can be used to perform simple simultaneous substitutions, as this
+$*MARK inserts the name from the last encountered backtracking control verb on
+the matching path that has a name. (*MARK) must always include a name, but the
+other verbs need not. For example, in the case of (*MARK:A)(*PRUNE) the name
+inserted is "A", but for (*MARK:A)(*PRUNE:B) the relevant name is "B". This
+facility can be used to perform simple simultaneous substitutions, as this
 <b>pcre2test</b> example shows:
 <pre>
   /(*MARK:pear)apple|(*MARK:orange)lemon/g,replace=${*MARK}
@@ -3289,13 +3421,13 @@ 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
+PCRE2_SUBSTITUTE_UNKNOWN_UNSET causes references to capture 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
+PCRE2_SUBSTITUTE_UNSET_EMPTY causes unset capture 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
@@ -3323,16 +3455,18 @@ 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.
+capture 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.
+effect. Note also that the PCRE2_ALT_BSUX and PCRE2_EXTRA_ALT_BSUX options do
+not apply to replacement strings.
 </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:
+flexibility to capture 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;}
@@ -3360,9 +3494,9 @@ 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
-unless PCRE2_SUBSTITUTE_GLOBAL is set.
+If successful, <b>pcre2_substitute()</b> returns the number of successful
+matches. 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
@@ -3399,20 +3533,84 @@ obtained by calling the <b>pcre2_get_error_message()</b> function (see
 "Obtaining a textual error message"
 <a href="#geterrormessage">above).</a>
 </P>
-<br><a name="SEC37" href="#TOC1">DUPLICATE SUBPATTERN NAMES</a><br>
+<br><b>
+Substitution callouts
+</b><br>
+<P>
+<b>int pcre2_set_substitute_callout(pcre2_match_context *<i>mcontext</i>,</b>
+<b>  int (*<i>callout_function</i>)(pcre2_substitute_callout_block *, void *),</b>
+<b>  void *<i>callout_data</i>);</b>
+<br>
+<br>
+The <b>pcre2_set_substitution_callout()</b> function can be used to specify a
+callout function for <b>pcre2_substitute()</b>. This information is passed in
+a match context. The callout function is called after each substitution has
+been processed, but it can cause the replacement not to happen. The callout
+function is not called for simulated substitutions that happen as a result of
+the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option.
+</P>
+<P>
+The first argument of the callout function is a pointer to a substitute callout
+block structure, which contains the following fields, not necessarily in this
+order:
+<pre>
+  uint32_t    <i>version</i>;
+  uint32_t    <i>subscount</i>;
+  PCRE2_SPTR  <i>input</i>;
+  PCRE2_SPTR  <i>output</i>;
+  PCRE2_SIZE <i>*ovector</i>;
+  uint32_t    <i>oveccount</i>;
+  PCRE2_SIZE  <i>output_offsets[2]</i>;
+</pre>
+The <i>version</i> field contains the version number of the block format. The
+current version is 0. The version number will increase in future if more fields
+are added, but the intention is never to remove any of the existing fields.
+</P>
+<P>
+The <i>subscount</i> field is the number of the current match. It is 1 for the
+first callout, 2 for the second, and so on. The <i>input</i> and <i>output</i>
+pointers are copies of the values passed to <b>pcre2_substitute()</b>.
+</P>
+<P>
+The <i>ovector</i> field points to the ovector, which contains the result of the
+most recent match. The <i>oveccount</i> field contains the number of pairs that
+are set in the ovector, and is always greater than zero.
+</P>
+<P>
+The <i>output_offsets</i> vector contains the offsets of the replacement in the
+output string. This has already been processed for dollar and (if requested)
+backslash substitutions as described above.
+</P>
+<P>
+The second argument of the callout function is the value passed as
+<i>callout_data</i> when the function was registered. The value returned by the
+callout function is interpreted as follows:
+</P>
+<P>
+If the value is zero, the replacement is accepted, and, if
+PCRE2_SUBSTITUTE_GLOBAL is set, processing continues with a search for the next
+match. If the value is not zero, the current replacement is not accepted. If
+the value is greater than zero, processing continues when
+PCRE2_SUBSTITUTE_GLOBAL is set. Otherwise (the value is less than zero or
+PCRE2_SUBSTITUTE_GLOBAL is not set), the the rest of the input is copied to the
+output and the call to <b>pcre2_substitute()</b> exits, returning the number of
+matches so far.
+</P>
+<br><a name="SEC37" href="#TOC1">DUPLICATE CAPTURE GROUP NAMES</a><br>
 <P>
 <b>int pcre2_substring_nametable_scan(const pcre2_code *<i>code</i>,</b>
 <b>  PCRE2_SPTR <i>name</i>, PCRE2_SPTR *<i>first</i>, PCRE2_SPTR *<i>last</i>);</b>
 </P>
 <P>
-When a pattern is compiled with the PCRE2_DUPNAMES option, names for
-subpatterns are not required to be unique. Duplicate names are always allowed
-for subpatterns with the same number, created by using the (?| feature. Indeed,
-if such subpatterns are named, they are required to use the same names.
+When a pattern is compiled with the PCRE2_DUPNAMES option, names for capture
+groups are not required to be unique. Duplicate names are always allowed for
+groups with the same number, created by using the (?| feature. Indeed, if such
+groups are named, they are required to use the same names.
 </P>
 <P>
-Normally, patterns with duplicate names are such that in any one match, only
-one of the named subpatterns participates. An example is shown in the
+Normally, patterns that use duplicate names are such that in any one match,
+only one of each set of identically-named groups participates. An example is
+shown in the
 <a href="pcre2pattern.html"><b>pcre2pattern</b></a>
 documentation.
 </P>
@@ -3517,11 +3715,12 @@ Option bits for <b>pcre_dfa_match()</b>
 </b><br>
 <P>
 The unused bits of the <i>options</i> argument for <b>pcre2_dfa_match()</b> must
-be zero. The only bits that may be set are PCRE2_ANCHORED, PCRE2_ENDANCHORED,
-PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART,
-PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, PCRE2_PARTIAL_SOFT, PCRE2_DFA_SHORTEST,
-and PCRE2_DFA_RESTART. All but the last four of these are exactly the same as
-for <b>pcre2_match()</b>, so their description is not repeated here.
+be zero. The only bits that may be set are PCRE2_ANCHORED,
+PCRE2_COPY_MATCHED_SUBJECT, PCRE2_ENDANCHORED, PCRE2_NOTBOL, PCRE2_NOTEOL,
+PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD,
+PCRE2_PARTIAL_SOFT, PCRE2_DFA_SHORTEST, and PCRE2_DFA_RESTART. All but the last
+four of these are exactly the same as for <b>pcre2_match()</b>, so their
+description is not repeated here.
 <pre>
   PCRE2_PARTIAL_HARD
   PCRE2_PARTIAL_SOFT
@@ -3583,9 +3782,8 @@ the three matched strings are
 On success, the yield of the function is a number greater than zero, which is
 the number of matched substrings. The offsets of the substrings are returned in
 the ovector, and can be extracted by number in the same way as for
-<b>pcre2_match()</b>, but the numbers bear no relation to any capturing groups
-that may exist in the pattern, because DFA matching does not support group
-capture.
+<b>pcre2_match()</b>, but the numbers bear no relation to any capture groups
+that may exist in the pattern, because DFA matching does not support capturing.
 </P>
 <P>
 Calls to the convenience functions that extract substrings by name
@@ -3627,7 +3825,13 @@ a backreference.
 </pre>
 This return is given if <b>pcre2_dfa_match()</b> encounters a condition item
 that uses a backreference for the condition, or a test for recursion in a
-specific group. These are not supported.
+specific capture group. These are not supported.
+<pre>
+  PCRE2_ERROR_DFA_UINVALID_UTF
+</pre>
+This return is given if <b>pcre2_dfa_match()</b> is called for a pattern that
+was compiled with PCRE2_MATCH_INVALID_UTF. This is not supported for DFA
+matching.
 <pre>
   PCRE2_ERROR_DFA_WSSIZE
 </pre>
@@ -3636,9 +3840,9 @@ This return is given if <b>pcre2_dfa_match()</b> runs out of space in the
 <pre>
   PCRE2_ERROR_DFA_RECURSE
 </pre>
-When a recursive subpattern is processed, the matching function calls itself
-recursively, using private memory for the ovector and <i>workspace</i>. This
-error is given if the internal ovector is not large enough. This should be
+When a recursion or subroutine call is processed, the matching function calls
+itself recursively, using private memory for the ovector and <i>workspace</i>.
+This error is given if the internal ovector is not large enough. This should be
 extremely rare, as a vector of size 1000 is used.
 <pre>
   PCRE2_ERROR_DFA_BADRESTART
@@ -3665,9 +3869,9 @@ Cambridge, England.
 </P>
 <br><a name="SEC42" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 07 September 2018
+Last updated: 02 September 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index e31b604c155632d1a478fb9278fd06ec3c42370d..13d9da221d4a70a6650cd5c54e16b9a99ab36c76 100644 (file)
@@ -33,11 +33,12 @@ please consult the man page, in case the conversion went wrong.
 <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">SUPPORT FOR FUZZERS</a>
-<li><a name="TOC22" href="#SEC22">OBSOLETE OPTION</a>
-<li><a name="TOC23" href="#SEC23">SEE ALSO</a>
-<li><a name="TOC24" href="#SEC24">AUTHOR</a>
-<li><a name="TOC25" href="#SEC25">REVISION</a>
+<li><a name="TOC21" href="#SEC21">DISABLING THE Z AND T FORMATTING MODIFIERS</a>
+<li><a name="TOC22" href="#SEC22">SUPPORT FOR FUZZERS</a>
+<li><a name="TOC23" href="#SEC23">OBSOLETE OPTION</a>
+<li><a name="TOC24" href="#SEC24">SEE ALSO</a>
+<li><a name="TOC25" href="#SEC25">AUTHOR</a>
+<li><a name="TOC26" href="#SEC26">REVISION</a>
 </ul>
 <br><a name="SEC1" href="#TOC1">BUILDING PCRE2</a><br>
 <P>
@@ -375,12 +376,15 @@ environment.
 </P>
 <br><a name="SEC14" href="#TOC1">PCRE2GREP SUPPORT FOR EXTERNAL SCRIPTS</a><br>
 <P>
-By default, on non-Windows systems, <b>pcre2grep</b> supports the use of
-callouts with string arguments within the patterns it is matching, in order to
-run external scripts. For details, see the
+By default <b>pcre2grep</b> supports the use of callouts with string arguments
+within the patterns it is matching. There are two kinds: one that generates
+output using local code, and another that calls an external program or script.
+If --disable-pcre2grep-callout-fork is added to the <b>configure</b> command,
+only the first kind of callout is supported; if --disable-pcre2grep-callout is
+used, all callouts are completely ignored. For more details of <b>pcre2grep</b>
+callouts, see the
 <a href="pcre2grep.html"><b>pcre2grep</b></a>
-documentation. This support can be disabled by adding
---disable-pcre2grep-callout to the <b>configure</b> command.
+documentation.
 </P>
 <br><a name="SEC15" href="#TOC1">PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT</a><br>
 <P>
@@ -523,7 +527,21 @@ 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="SEC21" href="#TOC1">SUPPORT FOR FUZZERS</a><br>
+<br><a name="SEC21" href="#TOC1">DISABLING THE Z AND T FORMATTING MODIFIERS</a><br>
+<P>
+The C99 standard defines formatting modifiers z and t for size_t and
+ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in
+environments other than Microsoft Visual Studio when __STDC_VERSION__ is
+defined and has a value greater than or equal to 199901L (indicating C99).
+However, there is at least one environment that claims to be C99 but does not
+support these modifiers. If
+<pre>
+  --disable-percent-zt
+</pre>
+is specified, no use is made of the z or t modifiers. Instead or %td or %zu,
+%lu is used, with a cast for size_t values.
+</P>
+<br><a name="SEC22" href="#TOC1">SUPPORT FOR FUZZERS</a><br>
 <P>
 There is a special option for use by people who want to run fuzzing tests on
 PCRE2:
@@ -547,7 +565,7 @@ arguments: if an argument starts with "=" the rest of it is a literal input
 string. Otherwise, it is assumed to be a file name, and the contents of the
 file are the test string.
 </P>
-<br><a name="SEC22" href="#TOC1">OBSOLETE OPTION</a><br>
+<br><a name="SEC23" href="#TOC1">OBSOLETE OPTION</a><br>
 <P>
 In versions of PCRE2 prior to 10.30, there were two ways of handling
 backtracking in the <b>pcre2_match()</b> function. The default was to use the
@@ -559,11 +577,11 @@ was set, memory on the heap was used. From release 10.30 onwards this has
 changed (the stack is no longer used) and this option now does nothing except
 give a warning.
 </P>
-<br><a name="SEC23" href="#TOC1">SEE ALSO</a><br>
+<br><a name="SEC24" href="#TOC1">SEE ALSO</a><br>
 <P>
 <b>pcre2api</b>(3), <b>pcre2-config</b>(3).
 </P>
-<br><a name="SEC24" href="#TOC1">AUTHOR</a><br>
+<br><a name="SEC25" href="#TOC1">AUTHOR</a><br>
 <P>
 Philip Hazel
 <br>
@@ -572,11 +590,11 @@ University Computing Service
 Cambridge, England.
 <br>
 </P>
-<br><a name="SEC25" href="#TOC1">REVISION</a><br>
+<br><a name="SEC26" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 26 April 2018
+Last updated: 03 March 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index 9b6ae6fd7f5244ecd0e338bb5a477fa0eb5206a0..65db9336cb36aefb764ad8d5bc059ace86c1038c 100644 (file)
@@ -44,6 +44,14 @@ a match context (see <b>pcre2_set_callout()</b> in the
 documentation).
 </P>
 <P>
+When using the <b>pcre2_substitute()</b> function, an additional callout feature
+is available. This does a callout after each change to the subject string and
+is described in the
+<a href="pcre2api.html"><b>pcre2api</b></a>
+documentation; the rest of this document is concerned with callouts during
+pattern matching.
+</P>
+<P>
 Within a regular expression, (?C&#60;arg&#62;) indicates a point at which the external
 function is to be called. Different callout points can be identified by putting
 a number less than 256 after the letter C. The default value is zero.
@@ -143,7 +151,7 @@ branch, automatic anchoring occurs if all branches are anchorable.
 </P>
 <P>
 This optimization is disabled, however, if .* is in an atomic group or if there
-is a backreference to the capturing group in which it appears. It is also
+is a backreference to the capture group in which it appears. It is also
 disabled if the pattern contains (*PRUNE) or (*SKIP). However, the presence of
 callouts does not affect it.
 </P>
@@ -346,8 +354,8 @@ callout before an assertion such as (?=ab) the length is 3. For an an
 alternation bar or a closing parenthesis, the length is one, unless a closing
 parenthesis is followed by a quantifier, in which case its length is included.
 (This changed in release 10.23. In earlier releases, before an opening
-parenthesis the length was that of the entire subpattern, and before an
-alternation bar or a closing parenthesis the length was zero.)
+parenthesis the length was that of the entire group, and before an alternation
+bar or a closing parenthesis the length was zero.)
 </P>
 <P>
 The <i>pattern_position</i> and <i>next_item_length</i> fields are intended to
@@ -463,9 +471,9 @@ Cambridge, England.
 </P>
 <br><a name="SEC8" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 26 April 2018
+Last updated: 03 February 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index f59320499cf451ec781244ea741308d7a3ece905..0c72a9a026412176db9844aed494a46d5e35ba24 100644 (file)
@@ -36,10 +36,9 @@ assertion just once). Perl allows some repeat quantifiers on other assertions,
 for example, \b* (but not \b{3}), but these do not seem to have any use.
 </P>
 <P>
-3. Capturing subpatterns that occur inside negative lookaround assertions are
-counted, but their entries in the offsets vector are set only when a negative
-assertion is a condition that has a matching branch (that is, the condition is
-false).
+3. Capture groups that occur inside negative lookaround assertions are counted,
+but their entries in the offsets vector are set only when a negative assertion
+is a condition that has a matching branch (that is, the condition is false).
 </P>
 <P>
 4. The following Perl escape sequences are not supported: \F, \l, \L, \u,
@@ -48,8 +47,9 @@ non-newline character, and \N{U+dd..}, matching a Unicode code point, are
 supported. The escapes that modify the case of following letters are
 implemented by Perl's general string-handling and are not part of its pattern
 matching engine. If any of these are encountered by PCRE2, an error is
-generated by default. However, if the PCRE2_ALT_BSUX option is set, \U and \u
-are interpreted as ECMAScript interprets them.
+generated by default. However, if either of the PCRE2_ALT_BSUX or
+PCRE2_EXTRA_ALT_BSUX options is set, \U and \u are interpreted as ECMAScript
+interprets them.
 </P>
 <P>
 5. The Perl escape sequences \p, \P, and \X are supported only if PCRE2 is
@@ -94,13 +94,13 @@ to PCRE2 release 10.23, but from release 10.30 this changed, and backtracking
 into subroutine calls is now supported, as in Perl.
 </P>
 <P>
-9. If any of the backtracking control verbs are used in a subpattern that is
-called as a subroutine (whether or not recursively), their effect is confined
-to that subpattern; it does not extend to the surrounding pattern. This is not
-always the case in Perl. In particular, if (*THEN) is present in a group that
-is called as a subroutine, its action is limited to that group, even if the
-group does not contain any | characters. Note that such subpatterns are
-processed as anchored at the point where they are tested.
+9. If any of the backtracking control verbs are used in a group that is called
+as a subroutine (whether or not recursively), their effect is confined to that
+group; it does not extend to the surrounding pattern. This is not always the
+case in Perl. In particular, if (*THEN) is present in a group that is called as
+a subroutine, its action is limited to that group, even if the group does not
+contain any | characters. Note that such groups are processed as anchored
+at the point where they are tested.
 </P>
 <P>
 10. If a pattern contains more than one backtracking control verb, the first
@@ -120,22 +120,21 @@ the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE2 it is set to
 "b".
 </P>
 <P>
-13. PCRE2's handling of duplicate subpattern numbers and duplicate subpattern
-names is not as general as Perl's. This is a consequence of the fact the PCRE2
-works internally just with numbers, using an external table to translate
-between numbers and names. In particular, a pattern such as (?|(?&#60;a&#62;A)|(?&#60;b&#62;B),
-where the two capturing parentheses have the same number but different names,
-is not supported, and causes an error at compile time. If it were allowed, it
-would not be possible to distinguish which parentheses matched, because both
-names map to capturing subpattern number 1. To avoid this confusing situation,
-an error is given at compile time.
+13. PCRE2's handling of duplicate capture group numbers and names is not as
+general as Perl's. This is a consequence of the fact the PCRE2 works internally
+just with numbers, using an external table to translate between numbers and
+names. In particular, a pattern such as (?|(?&#60;a&#62;A)|(?&#60;b&#62;B), where the two
+capture groups have the same number but different names, is not supported, and
+causes an error at compile time. If it were allowed, it would not be possible
+to distinguish which group matched, because both names map to capture group
+number 1. To avoid this confusing situation, an error is given at compile time.
 </P>
 <P>
 14. Perl used to recognize comments in some places that PCRE2 does not, for
-example, between the ( and ? at the start of a subpattern. If the /x modifier
-is set, Perl allowed white space between ( and ? though the latest Perls give
-an error (for a while it was just deprecated). There may still be some cases
-where Perl behaves differently.
+example, between the ( and ? at the start of a group. If the /x modifier is
+set, Perl allowed white space between ( and ? though the latest Perls give an
+error (for a while it was just deprecated). There may still be some cases where
+Perl behaves differently.
 </P>
 <P>
 15. Perl, when in warning mode, gives warnings for character classes such as
@@ -206,6 +205,11 @@ different way and is not Perl-compatible.
 (l) PCRE2 recognizes some special sequences such as (*CR) or (*NO_JIT) at
 the start of a pattern that set overall options that cannot be changed within
 the pattern.
+<br>
+<br>
+(m) PCRE2 supports non-atomic positive lookaround assertions. This is an
+extension to the lookaround facilities. The default, Perl-compatible
+lookarounds are atomic.
 </P>
 <P>
 18. The Perl /a modifier restricts /d numbers to pure ascii, and the /aa
@@ -235,9 +239,9 @@ Cambridge, England.
 REVISION
 </b><br>
 <P>
-Last updated: 28 July 2018
+Last updated: 13 July 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index 72754d3e99df602bec60f1a6a2c8c1422c377f46..08b21901594820b0252cec812933f8d71164a864 100644 (file)
@@ -104,12 +104,11 @@ uint32_t newline;
 
 PCRE2_SIZE erroroffset;
 PCRE2_SIZE *ovector;
+PCRE2_SIZE subject_length;
 
-size_t subject_length;
 pcre2_match_data *match_data;
 
 
-
 /**************************************************************************
 * First, sort out the command line. There is only one possible option at  *
 * the moment, "-g" to request repeated matching to find all occurrences,  *
@@ -138,12 +137,14 @@ if (argc - i != 2)
   return 1;
   }
 
-/* As pattern and subject are char arguments, they can be straightforwardly
-cast to PCRE2_SPTR as we are working in 8-bit code units. */
+/* Pattern and subject are char arguments, so they can be straightforwardly
+cast to PCRE2_SPTR because we are working in 8-bit code units. The subject
+length is cast to PCRE2_SIZE for completeness, though PCRE2_SIZE is in fact
+defined to be size_t. */
 
 pattern = (PCRE2_SPTR)argv[i];
 subject = (PCRE2_SPTR)argv[i+1];
-subject_length = strlen((char *)subject);
+subject_length = (PCRE2_SIZE)strlen((char *)subject);
 
 
 /*************************************************************************
@@ -172,17 +173,22 @@ if (re == NULL)
 
 
 /*************************************************************************
-* If the compilation succeeded, we call PCRE again, in order to do a     *
+* If the compilation succeeded, we call PCRE2 again, in order to do a    *
 * pattern match against the subject string. This does just ONE match. If *
 * further matching is needed, it will be done below. Before running the  *
-* match we must set up a match_data block for holding the result.        *
+* match we must set up a match_data block for holding the result. Using  *
+* pcre2_match_data_create_from_pattern() ensures that the block is       *
+* exactly the right size for the number of capturing parentheses in the  *
+* pattern. If you need to know the actual size of a match_data block as  *
+* a number of bytes, you can find it like this:                          *
+*                                                                        *
+* PCRE2_SIZE match_data_size = pcre2_get_match_data_size(match_data);    *
 *************************************************************************/
 
-/* Using this function ensures that the block is exactly the right size for
-the number of capturing parentheses in the pattern. */
-
 match_data = pcre2_match_data_create_from_pattern(re, NULL);
 
+/* Now run the match. */
+
 rc = pcre2_match(
   re,                   /* the compiled pattern */
   subject,              /* the subject string */
@@ -205,7 +211,7 @@ if (rc &lt; 0)
     default: printf("Matching error %d\n", rc); break;
     }
   pcre2_match_data_free(match_data);   /* Release memory used for the match */
-  pcre2_code_free(re);                 /* data and the compiled pattern. */
+  pcre2_code_free(re);                 /*   data and the compiled pattern. */
   return 1;
   }
 
@@ -249,7 +255,7 @@ application you might want to do things other than print them. */
 for (i = 0; i &lt; rc; i++)
   {
   PCRE2_SPTR substring_start = subject + ovector[2*i];
-  size_t substring_length = ovector[2*i+1] - ovector[2*i];
+  PCRE2_SIZE substring_length = ovector[2*i+1] - ovector[2*i];
   printf("%2d: %.*s\n", i, (int)substring_length, (char *)substring_start);
   }
 
index 272b87d174b7af0c5289c036792be3c32a4f761e..f5b72f36af15c6d8d1f8821a0c06b2f7cd27ccf4 100644 (file)
@@ -685,20 +685,32 @@ otherwise empty line. This option is mutually exclusive with <b>--output</b>,
 <P>
 <b>-o</b><i>number</i>, <b>--only-matching</b>=<i>number</i>
 Show only the part of the line that matched the capturing parentheses of the
-given number. Up to 32 capturing parentheses are supported, and -o0 is
-equivalent to <b>-o</b> without a number. Because these options can be given
-without an argument (see above), if an argument is present, it must be given in
-the same shell item, for example, -o3 or --only-matching=2. The comments given
-for the non-argument case above also apply to this option. If the specified
-capturing parentheses do not exist in the pattern, or were not set in the
-match, nothing is output unless the file name or line number are being output.
+given number. Up to 50 capturing parentheses are supported by default. This
+limit can be changed via the <b>--om-capture</b> option. A pattern may contain
+any number of capturing parentheses, but only those whose number is within the
+limit can be accessed by <b>-o</b>. An error occurs if the number specified by
+<b>-o</b> is greater than the limit.
+<br>
+<br>
+-o0 is the same as <b>-o</b> without a number. Because these options can be
+given without an argument (see above), if an argument is present, it must be
+given in the same shell item, for example, -o3 or --only-matching=2. The
+comments given for the non-argument case above also apply to this option. If
+the specified capturing parentheses do not exist in the pattern, or were not
+set in the match, nothing is output unless the file name or line number are
+being output.
 <br>
 <br>
 If this option is given multiple times, multiple substrings are output for each
 match, in the order the options are given, and all on one line. For example,
 -o3 -o1 -o3 causes the substrings matched by capturing parentheses 3 and 1 and
 then 3 again to be output. By default, there is no separator (but see the next
-option).
+but one option).
+</P>
+<P>
+<b>--om-capture</b>=<i>number</i>
+Set the number of capturing parentheses that can be accessed by <b>-o</b>. The
+default is 50.
 </P>
 <P>
 <b>--om-separator</b>=<i>text</i>
@@ -741,13 +753,22 @@ ignored when used with <b>-L</b> (list files without matches), because the grand
 total would always be zero.
 </P>
 <P>
-<b>-u</b>, <b>--utf-8</b>
+<b>-u</b>, <b>--utf</b>
 Operate in UTF-8 mode. This option is available only if PCRE2 has been compiled
 with UTF-8 support. All patterns (including those for any <b>--exclude</b> and
 <b>--include</b> options) and all subject lines that are scanned must be valid
 strings of UTF-8 characters.
 </P>
 <P>
+<b>-U</b>, <b>--utf-allow-invalid</b>
+As <b>--utf</b>, but in addition subject lines may contain invalid UTF-8 code
+unit sequences. These can never form part of any pattern match. This facility
+allows valid UTF-8 strings to be sought in executable or other binary files.
+For more details about matching in non-valid UTF-8 strings, see the
+<a href="pcre2unicode.html"><b>pcre2unicode</b>(3)</a>
+documentation.
+</P>
+<P>
 <b>-V</b>, <b>--version</b>
 Write the version numbers of <b>pcre2grep</b> and the PCRE2 library to the
 standard output and then exit. Anything else on the command line is
@@ -806,9 +827,9 @@ as in the GNU <b>grep</b> program. Any long option of the form
 <b>--file-offsets</b>, <b>--heap-limit</b>, <b>--include-dir</b>,
 <b>--line-offsets</b>, <b>--locale</b>, <b>--match-limit</b>, <b>-M</b>,
 <b>--multiline</b>, <b>-N</b>, <b>--newline</b>, <b>--om-separator</b>,
-<b>--output</b>, <b>-u</b>, and <b>--utf-8</b> options are specific to
-<b>pcre2grep</b>, as is the use of the <b>--only-matching</b> option with a
-capturing parentheses number.
+<b>--output</b>, <b>-u</b>, <b>--utf</b>, <b>-U</b>, and <b>--utf-allow-invalid</b>
+options are specific to <b>pcre2grep</b>, as is the use of the
+<b>--only-matching</b> option with a capturing parentheses number.
 </P>
 <P>
 Although most of the common options work the same way, a few are different in
@@ -853,10 +874,12 @@ character. Otherwise <b>pcre2grep</b> will assume that it has no data.
 <P>
 <b>pcre2grep</b> has, by default, support for calling external programs or
 scripts or echoing specific strings during matching by making use of PCRE2's
-callout facility. However, this support can be disabled when <b>pcre2grep</b> is
-built. You can find out whether your binary has support for callouts by running
-it with the <b>--help</b> option. If the support is not enabled, all callouts in
-patterns are ignored by <b>pcre2grep</b>.
+callout facility. However, this support can be completely or partially disabled
+when <b>pcre2grep</b> is built. You can find out whether your binary has support
+for callouts by running it with the <b>--help</b> option. If callout support is
+completely disabled, all callouts in patterns are ignored by <b>pcre2grep</b>.
+If the facility is partially disabled, calling external programs is not
+supported, and callouts that request it are ignored.
 </P>
 <P>
 A callout in a PCRE2 pattern is of the form (?C&#60;arg&#62;) where the argument is
@@ -869,6 +892,12 @@ only callouts with string arguments are useful.
 Calling external programs or scripts
 </b><br>
 <P>
+This facility can be independently disabled when <b>pcre2grep</b> is built. It
+is supported for Windows, where a call to <b>_spawnvp()</b> is used, for VMS,
+where <b>lib$spawn()</b> is used, and for any other Unix-like environment where
+<b>fork()</b> and <b>execv()</b> are available.
+</P>
+<P>
 If the callout string does not start with a pipe (vertical bar) character, it
 is parsed into a list of substrings separated by pipe characters. The first
 substring must be an executable name, with the following substrings specifying
@@ -897,7 +926,7 @@ a single dollar and $| is replaced by a pipe character. Here is an example:
     Arg1: [1] [234] [4] Arg2: |1| ()
     12345
 </pre>
-The parameters for the <b>execv()</b> system call that is used to run the
+The parameters for the system call that is used to run the
 program or script are zero-terminated strings. This means that binary zero
 characters in the callout argument will cause premature termination of their
 substrings, and therefore should not be present. Any syntax errors in the
@@ -910,14 +939,15 @@ matcher backtracks in the normal way.
 Echoing a specific string
 </b><br>
 <P>
-If the callout string starts with a pipe (vertical bar) character, the rest of
-the string is written to the output, having been passed through the same escape
-processing as text from the --output option. This provides a simple echoing
-facility that avoids calling an external program or script. No terminator is
-added to the string, so if you want a newline, you must include it explicitly.
-Matching continues normally after the string is output. If you want to see only
-the callout output but not any output from an actual match, you should end the
-relevant pattern with (*FAIL).
+This facility is always available, provided that callouts were not completely
+disabled when <b>pcre2grep</b> was built. If the callout string starts with a
+pipe (vertical bar) character, the rest of the string is written to the output,
+having been passed through the same escape processing as text from the --output
+option. This provides a simple echoing facility that avoids calling an external
+program or script. No terminator is added to the string, so if you want a
+newline, you must include it explicitly. Matching continues normally after the
+string is output. If you want to see only the callout output but not any output
+from an actual match, you should end the relevant pattern with (*FAIL).
 </P>
 <br><a name="SEC12" href="#TOC1">MATCHING ERRORS</a><br>
 <P>
@@ -962,9 +992,9 @@ Cambridge, England.
 </P>
 <br><a name="SEC16" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 24 February 2018
+Last updated: 15 June 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index fa007e0b2092fb02fc468e2122447a4e85a31129..47b588e678b1505ec7dd90d7e26954ef17e91e5d 100644 (file)
@@ -16,16 +16,17 @@ please consult the man page, in case the conversion went wrong.
 <li><a name="TOC1" href="#SEC1">PCRE2 JUST-IN-TIME COMPILER SUPPORT</a>
 <li><a name="TOC2" href="#SEC2">AVAILABILITY OF JIT SUPPORT</a>
 <li><a name="TOC3" href="#SEC3">SIMPLE USE OF JIT</a>
-<li><a name="TOC4" href="#SEC4">UNSUPPORTED OPTIONS AND PATTERN ITEMS</a>
-<li><a name="TOC5" href="#SEC5">RETURN VALUES FROM JIT MATCHING</a>
-<li><a name="TOC6" href="#SEC6">CONTROLLING THE JIT STACK</a>
-<li><a name="TOC7" href="#SEC7">JIT STACK FAQ</a>
-<li><a name="TOC8" href="#SEC8">FREEING JIT SPECULATIVE MEMORY</a>
-<li><a name="TOC9" href="#SEC9">EXAMPLE CODE</a>
-<li><a name="TOC10" href="#SEC10">JIT FAST PATH API</a>
-<li><a name="TOC11" href="#SEC11">SEE ALSO</a>
-<li><a name="TOC12" href="#SEC12">AUTHOR</a>
-<li><a name="TOC13" href="#SEC13">REVISION</a>
+<li><a name="TOC4" href="#SEC4">MATCHING SUBJECTS CONTAINING INVALID UTF</a>
+<li><a name="TOC5" href="#SEC5">UNSUPPORTED OPTIONS AND PATTERN ITEMS</a>
+<li><a name="TOC6" href="#SEC6">RETURN VALUES FROM JIT MATCHING</a>
+<li><a name="TOC7" href="#SEC7">CONTROLLING THE JIT STACK</a>
+<li><a name="TOC8" href="#SEC8">JIT STACK FAQ</a>
+<li><a name="TOC9" href="#SEC9">FREEING JIT SPECULATIVE MEMORY</a>
+<li><a name="TOC10" href="#SEC10">EXAMPLE CODE</a>
+<li><a name="TOC11" href="#SEC11">JIT FAST PATH API</a>
+<li><a name="TOC12" href="#SEC12">SEE ALSO</a>
+<li><a name="TOC13" href="#SEC13">AUTHOR</a>
+<li><a name="TOC14" href="#SEC14">REVISION</a>
 </ul>
 <br><a name="SEC1" href="#TOC1">PCRE2 JUST-IN-TIME COMPILER SUPPORT</a><br>
 <P>
@@ -144,12 +145,39 @@ support is not available, or the pattern was not processed by
 <b>pcre2_jit_compile()</b>, or the JIT compiler was not able to handle the
 pattern.
 </P>
-<br><a name="SEC4" href="#TOC1">UNSUPPORTED OPTIONS AND PATTERN ITEMS</a><br>
+<br><a name="SEC4" href="#TOC1">MATCHING SUBJECTS CONTAINING INVALID UTF</a><br>
+<P>
+When a pattern is compiled with the PCRE2_UTF option, subject strings are
+normally expected to be a valid sequence of UTF code units. By default, this is
+checked at the start of matching and an error is generated if invalid UTF is
+detected. The PCRE2_NO_UTF_CHECK option can be passed to <b>pcre2_match()</b> to
+skip the check (for improved performance) if you are sure that a subject string
+is valid. If this option is used with an invalid string, the result is
+undefined.
+</P>
+<P>
+However, a way of running matches on strings that may contain invalid UTF
+sequences is available. Calling <b>pcre2_compile()</b> with the
+PCRE2_MATCH_INVALID_UTF option has two effects: it tells the interpreter in
+<b>pcre2_match()</b> to support invalid UTF, and, if <b>pcre2_jit_compile()</b>
+is called, the compiled JIT code also supports invalid UTF. Details of how this
+support works, in both the JIT and the interpretive cases, is given in the
+<a href="pcre2unicode.html"><b>pcre2unicode</b></a>
+documentation.
+</P>
+<P>
+There is also an obsolete option for <b>pcre2_jit_compile()</b> called
+PCRE2_JIT_INVALID_UTF, which currently exists only for backward compatibility.
+It is superseded by the <b>pcre2_compile()</b> option PCRE2_MATCH_INVALID_UTF
+and should no longer be used. It may be removed in future.
+</P>
+<br><a name="SEC5" href="#TOC1">UNSUPPORTED OPTIONS AND PATTERN ITEMS</a><br>
 <P>
 The <b>pcre2_match()</b> options that are supported for JIT matching are
-PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART,
-PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT. The
-PCRE2_ANCHORED option is not supported at match time.
+PCRE2_COPY_MATCHED_SUBJECT, PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY,
+PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and
+PCRE2_PARTIAL_SOFT. The PCRE2_ANCHORED and PCRE2_ENDANCHORED options are not
+supported at match time.
 </P>
 <P>
 If the PCRE2_NO_JIT option is passed to <b>pcre2_match()</b> it disables the
@@ -160,7 +188,7 @@ The only unsupported pattern items are \C (match a single data unit) when
 running in a UTF mode, and a callout immediately before an assertion condition
 in a conditional group.
 </P>
-<br><a name="SEC5" href="#TOC1">RETURN VALUES FROM JIT MATCHING</a><br>
+<br><a name="SEC6" href="#TOC1">RETURN VALUES FROM JIT MATCHING</a><br>
 <P>
 When a pattern is matched using JIT matching, the return values are the same
 as those given by the interpretive <b>pcre2_match()</b> code, with the addition
@@ -176,7 +204,7 @@ circumstance when JIT is not used, but the details of exactly what is counted
 are not the same. The PCRE2_ERROR_DEPTHLIMIT error code is never returned
 when JIT matching is used.
 <a name="stackcontrol"></a></P>
-<br><a name="SEC6" href="#TOC1">CONTROLLING THE JIT STACK</a><br>
+<br><a name="SEC7" href="#TOC1">CONTROLLING THE JIT STACK</a><br>
 <P>
 When the compiled JIT code runs, it needs a block of memory to use as a stack.
 By default, it uses 32KiB on the machine stack. However, some large or
@@ -269,7 +297,7 @@ non-default JIT stacks might operate:
 </pre>
 All the functions described in this section do nothing if JIT is not available.
 <a name="stackfaq"></a></P>
-<br><a name="SEC7" href="#TOC1">JIT STACK FAQ</a><br>
+<br><a name="SEC8" href="#TOC1">JIT STACK FAQ</a><br>
 <P>
 (1) Why do we need JIT stacks?
 <br>
@@ -348,7 +376,7 @@ stack handling?
 No, thanks to Windows. If POSIX threads were used everywhere, we could throw
 out this complicated API.
 </P>
-<br><a name="SEC8" href="#TOC1">FREEING JIT SPECULATIVE MEMORY</a><br>
+<br><a name="SEC9" href="#TOC1">FREEING JIT SPECULATIVE MEMORY</a><br>
 <P>
 <b>void pcre2_jit_free_unused_memory(pcre2_general_context *<i>gcontext</i>);</b>
 </P>
@@ -360,7 +388,7 @@ all possible memory. You can cause this to happen by calling
 pcre2_jit_free_unused_memory(). Its argument is a general context, for custom
 memory management, or NULL for standard memory management.
 </P>
-<br><a name="SEC9" href="#TOC1">EXAMPLE CODE</a><br>
+<br><a name="SEC10" href="#TOC1">EXAMPLE CODE</a><br>
 <P>
 This is a single-threaded example that specifies a JIT stack without using a
 callback. A real program should include error checking after all the function
@@ -389,7 +417,7 @@ calls.
 
 </PRE>
 </P>
-<br><a name="SEC10" href="#TOC1">JIT FAST PATH API</a><br>
+<br><a name="SEC11" href="#TOC1">JIT FAST PATH API</a><br>
 <P>
 Because the API described above falls back to interpreted matching when JIT is
 not available, it is convenient for programs that are written for general use
@@ -402,10 +430,13 @@ processed by <b>pcre2_jit_compile()</b>).
 </P>
 <P>
 The fast path function is called <b>pcre2_jit_match()</b>, and it takes exactly
-the same arguments as <b>pcre2_match()</b>. The return values are also the same,
-plus PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is
-requested that was not compiled. Unsupported option bits (for example,
-PCRE2_ANCHORED) are ignored, as is the PCRE2_NO_JIT option.
+the same arguments as <b>pcre2_match()</b>. However, the subject string must be
+specified with a length; PCRE2_ZERO_TERMINATED is not supported. Unsupported
+option bits (for example, PCRE2_ANCHORED, PCRE2_ENDANCHORED and
+PCRE2_COPY_MATCHED_SUBJECT) are ignored, as is the PCRE2_NO_JIT option. The
+return values are also the same as for <b>pcre2_match()</b>, plus
+PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is requested
+that was not compiled.
 </P>
 <P>
 When you call <b>pcre2_match()</b>, as well as testing for invalid options, a
@@ -419,11 +450,11 @@ invalid data is passed, the result is undefined.
 Bypassing the sanity checks and the <b>pcre2_match()</b> wrapping can give
 speedups of more than 10%.
 </P>
-<br><a name="SEC11" href="#TOC1">SEE ALSO</a><br>
+<br><a name="SEC12" href="#TOC1">SEE ALSO</a><br>
 <P>
 <b>pcre2api</b>(3)
 </P>
-<br><a name="SEC12" href="#TOC1">AUTHOR</a><br>
+<br><a name="SEC13" href="#TOC1">AUTHOR</a><br>
 <P>
 Philip Hazel (FAQ by Zoltan Herczeg)
 <br>
@@ -432,11 +463,11 @@ University Computing Service
 Cambridge, England.
 <br>
 </P>
-<br><a name="SEC13" href="#TOC1">REVISION</a><br>
+<br><a name="SEC14" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 28 June 2018
+Last updated: 23 May 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index d90cdc3d78e6564b54e2c79187db77f0c70c09bf..c8bc01b806bf656b700db6f81d370a8e8cedaaa6 100644 (file)
@@ -50,17 +50,17 @@ All values in repeating quantifiers must be less than 65536.
 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
-order to limit the amount of system stack used at compile time. The default
-limit can be specified when PCRE2 is built; if not, the default is set to 250.
-An application can change this limit by calling pcre2_set_parens_nest_limit()
-to set the limit in a compile context.
+There is no limit to the number of parenthesized groups, but there can be no
+more than 65535 capture groups, and there is a limit to the depth of nesting of
+parenthesized subpatterns of all kinds. This is imposed in order to limit the
+amount of system stack used at compile time. The default limit can be specified
+when PCRE2 is built; if not, the default is set to 250. An application can
+change this limit by calling pcre2_set_parens_nest_limit() to set the limit in
+a compile context.
 </P>
 <P>
-The maximum length of name for a named subpattern is 32 code units, and the
-maximum number of named subpatterns is 10000.
+The maximum length of name for a named capture group is 32 code units, and the
+maximum number of such groups is 10000.
 </P>
 <P>
 The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or (*THEN) verb
@@ -86,9 +86,9 @@ Cambridge, England.
 REVISION
 </b><br>
 <P>
-Last updated: 30 March 2017
+Last updated: 02 February 2019
 <br>
-Copyright &copy; 1997-2017 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index 602f3b26e83ce77bcfc6184241ae5eb41989c4b3..4b71c8f822ab77750220c53073cfc2709b533eef 100644 (file)
@@ -134,7 +134,8 @@ do want multiple matches in such cases, either use an ungreedy repeat
 </P>
 <P>
 There are a number of features of PCRE2 regular expressions that are not
-supported by the alternative matching algorithm. They are as follows:
+supported or behave differently in the alternative matching function. Those
+that are not supported cause an error if encountered.
 </P>
 <P>
 1. Because the algorithm finds all possible matches, the greedy or ungreedy
@@ -159,31 +160,38 @@ do this. This means that no captured substrings are available.
 </P>
 <P>
 3. Because no substrings are captured, backreferences within the pattern are
-not supported, and cause errors if encountered.
+not supported.
 </P>
 <P>
 4. For the same reason, conditional expressions that use a backreference as the
 condition or test for a specific group recursion are not supported.
 </P>
 <P>
-5. Because many paths through the tree may be active, the \K escape sequence,
+5. Again for the same reason, script runs are not supported.
+</P>
+<P>
+6. Because many paths through the tree may be active, the \K escape sequence,
 which resets the start of the match when encountered (but may be on some paths
-and not on others), is not supported. It causes an error if encountered.
+and not on others), is not supported.
 </P>
 <P>
-6. Callouts are supported, but the value of the <i>capture_top</i> field is
+7. Callouts are supported, but the value of the <i>capture_top</i> field is
 always 1, and the value of the <i>capture_last</i> field is always 0.
 </P>
 <P>
-7. The \C escape sequence, which (in the standard algorithm) always matches a
+8. The \C escape sequence, which (in the standard algorithm) always matches a
 single code unit, even in a UTF mode, is not supported in these modes, because
 the alternative algorithm moves through the subject string one character (not
 code unit) at a time, for all active paths through the tree.
 </P>
 <P>
-8. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not
+9. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not
 supported. (*FAIL) is supported, and behaves like a failing negative assertion.
 </P>
+<P>
+10. The PCRE2_MATCH_INVALID_UTF option for <b>pcre2_compile()</b> is not
+supported by <b>pcre2_dfa_match()</b>.
+</P>
 <br><a name="SEC5" href="#TOC1">ADVANTAGES OF THE ALTERNATIVE ALGORITHM</a><br>
 <P>
 Using the alternative matching algorithm provides the following advantages:
@@ -215,7 +223,8 @@ because it has to search for all possible matches, but is also because it is
 less susceptible to optimization.
 </P>
 <P>
-2. Capturing parentheses and backreferences are not supported.
+2. Capturing parentheses, backreferences, script runs, and matching within
+invalid UTF string are not supported.
 </P>
 <P>
 3. Although atomic groups are supported, their use does not provide the
@@ -232,9 +241,9 @@ Cambridge, England.
 </P>
 <br><a name="SEC8" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 29 September 2014
+Last updated: 23 May 2019
 <br>
-Copyright &copy; 1997-2014 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index 4e156b81e8191143a5f6c62f3d29d7f92d167eb1..438c52c31693b191e76a752d088f82c12358eebd 100644 (file)
@@ -14,78 +14,123 @@ please consult the man page, in case the conversion went wrong.
 <br>
 <ul>
 <li><a name="TOC1" href="#SEC1">PARTIAL MATCHING IN PCRE2</a>
-<li><a name="TOC2" href="#SEC2">PARTIAL MATCHING USING pcre2_match()</a>
-<li><a name="TOC3" href="#SEC3">PARTIAL MATCHING USING pcre2_dfa_match()</a>
-<li><a name="TOC4" href="#SEC4">PARTIAL MATCHING AND WORD BOUNDARIES</a>
-<li><a name="TOC5" href="#SEC5">EXAMPLE OF PARTIAL MATCHING USING PCRE2TEST</a>
+<li><a name="TOC2" href="#SEC2">REQUIREMENTS FOR A PARTIAL MATCH</a>
+<li><a name="TOC3" href="#SEC3">PARTIAL MATCHING USING pcre2_match()</a>
+<li><a name="TOC4" href="#SEC4">MULTI-SEGMENT MATCHING WITH pcre2_match()</a>
+<li><a name="TOC5" href="#SEC5">PARTIAL MATCHING USING pcre2_dfa_match()</a>
 <li><a name="TOC6" href="#SEC6">MULTI-SEGMENT MATCHING WITH pcre2_dfa_match()</a>
-<li><a name="TOC7" href="#SEC7">MULTI-SEGMENT MATCHING WITH pcre2_match()</a>
-<li><a name="TOC8" href="#SEC8">ISSUES WITH MULTI-SEGMENT MATCHING</a>
-<li><a name="TOC9" href="#SEC9">AUTHOR</a>
-<li><a name="TOC10" href="#SEC10">REVISION</a>
+<li><a name="TOC7" href="#SEC7">AUTHOR</a>
+<li><a name="TOC8" href="#SEC8">REVISION</a>
 </ul>
 <br><a name="SEC1" href="#TOC1">PARTIAL MATCHING IN PCRE2</a><br>
 <P>
-In normal use of PCRE2, if the subject string that is passed to a matching
-function matches as far as it goes, but is too short to match the entire
-pattern, PCRE2_ERROR_NOMATCH is returned. There are circumstances where it
-might be helpful to distinguish this case from other cases in which there is no
-match.
+In normal use of PCRE2, if there is a match up to the end of a subject string,
+but more characters are needed to match the entire pattern, PCRE2_ERROR_NOMATCH
+is returned, just like any other failing match. There are circumstances where
+it might be helpful to distinguish this "partial match" case.
 </P>
 <P>
-Consider, for example, an application where a human is required to type in data
-for a field with specific formatting requirements. An example might be a date
-in the form <i>ddmmmyy</i>, defined by this pattern:
-<pre>
-  ^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$
-</pre>
-If the application sees the user's keystrokes one by one, and can check that
-what has been typed so far is potentially valid, it is able to raise an error
-as soon as a mistake is made, by beeping and not reflecting the character that
-has been typed, for example. This immediate feedback is likely to be a better
-user interface than a check that is delayed until the entire string has been
-entered. Partial matching can also be useful when the subject string is very
-long and is not all available at once.
+One example is an application where the subject string is very long, and not
+all available at once. The requirement here is to be able to do the matching
+segment by segment, but special action is needed when a matched substring spans
+the boundary between two segments.
 </P>
 <P>
-PCRE2 supports partial matching by means of the PCRE2_PARTIAL_SOFT and
-PCRE2_PARTIAL_HARD options, which can be set when calling a matching function.
-The difference between the two options is whether or not a partial match is
-preferred to an alternative complete match, though the details differ between
-the two types of matching function. If both options are set, PCRE2_PARTIAL_HARD
-takes precedence.
+Another example is checking a user input string as it is typed, to ensure that
+it conforms to a required format. Invalid characters can be immediately
+diagnosed and rejected, giving instant feedback.
 </P>
 <P>
-If you want to use partial matching with just-in-time optimized code, you must
-call <b>pcre2_jit_compile()</b> with one or both of these options:
+Partial matching is a PCRE2-specific feature; it is not Perl-compatible. It is
+requested by setting one of the PCRE2_PARTIAL_HARD or PCRE2_PARTIAL_SOFT
+options when calling a matching function. The difference between the two
+options is whether or not a partial match is preferred to an alternative
+complete match, though the details differ between the two types of matching
+function. If both options are set, PCRE2_PARTIAL_HARD takes precedence.
+</P>
+<P>
+If you want to use partial matching with just-in-time optimized code, as well
+as setting a partial match option for the matching function, you must also call
+<b>pcre2_jit_compile()</b> with one or both of these options:
 <pre>
-  PCRE2_JIT_PARTIAL_SOFT
   PCRE2_JIT_PARTIAL_HARD
+  PCRE2_JIT_PARTIAL_SOFT
 </pre>
 PCRE2_JIT_COMPLETE should also be set if you are going to run non-partial
-matches on the same pattern. If the appropriate JIT mode has not been compiled,
-interpretive matching code is used.
+matches on the same pattern. Separate code is compiled for each mode. If the
+appropriate JIT mode has not been compiled, interpretive matching code is used.
 </P>
 <P>
 Setting a partial matching option disables two of PCRE2's standard
-optimizations. PCRE2 remembers the last literal code unit in a pattern, and
-abandons matching immediately if it is not present in the subject string. This
-optimization cannot be used for a subject string that might match only
-partially. PCRE2 also knows the minimum length of a matching string, and does
+optimization hints. PCRE2 remembers the last literal code unit in a pattern,
+and abandons matching immediately if it is not present in the subject string.
+This optimization cannot be used for a subject string that might match only
+partially. PCRE2 also remembers a minimum length of a matching string, and does
 not bother to run the matching function on shorter strings. This optimization
 is also disabled for partial matching.
 </P>
-<br><a name="SEC2" href="#TOC1">PARTIAL MATCHING USING pcre2_match()</a><br>
+<br><a name="SEC2" href="#TOC1">REQUIREMENTS FOR A PARTIAL MATCH</a><br>
+<P>
+A possible partial match occurs during matching when the end of the subject
+string is reached successfully, but either more characters are needed to
+complete the match, or the addition of more characters might change what is
+matched.
+</P>
 <P>
-A partial match occurs during a call to <b>pcre2_match()</b> when the end of the
-subject string is reached successfully, but matching cannot continue because
-more characters are needed. However, at least one character in the subject must
-have been inspected. This character need not form part of the final matched
-string; lookbehind assertions and the \K escape sequence provide ways of
-inspecting characters before the start of a matched string. The requirement for
-inspecting at least one character exists because an empty string can always be
-matched; without such a restriction there would always be a partial match of an
-empty string at the end of the subject.
+Example 1: if the pattern is /abc/ and the subject is "ab", more characters are
+definitely needed to complete a match. In this case both hard and soft matching
+options yield a partial match.
+</P>
+<P>
+Example 2: if the pattern is /ab+/ and the subject is "ab", a complete match
+can be found, but the addition of more characters might change what is
+matched. In this case, only PCRE2_PARTIAL_HARD returns a partial match;
+PCRE2_PARTIAL_SOFT returns the complete match.
+</P>
+<P>
+On reaching the end of the subject, when PCRE2_PARTIAL_HARD is set, if the next
+pattern item is \z, \Z, \b, \B, or $ there is always a partial match.
+Otherwise, for both options, the next pattern item must be one that inspects a
+character, and at least one of the following must be true:
+</P>
+<P>
+(1) At least one character has already been inspected. An inspected character
+need not form part of the final matched string; lookbehind assertions and the
+\K escape sequence provide ways of inspecting characters before the start of a
+matched string.
+</P>
+<P>
+(2) The pattern contains one or more lookbehind assertions. This condition
+exists in case there is a lookbehind that inspects characters before the start
+of the match.
+</P>
+<P>
+(3) There is a special case when the whole pattern can match an empty string.
+When the starting point is at the end of the subject, the empty string match is
+a possibility, and if PCRE2_PARTIAL_SOFT is set and neither of the above
+conditions is true, it is returned. However, because adding more characters
+might result in a non-empty match, PCRE2_PARTIAL_HARD returns a partial match,
+which in this case means "there is going to be a match at this point, but until
+some more characters are added, we do not know if it will be an empty string or
+something longer".
+</P>
+<br><a name="SEC3" href="#TOC1">PARTIAL MATCHING USING pcre2_match()</a><br>
+<P>
+When a partial matching option is set, the result of calling
+<b>pcre2_match()</b> can be one of the following:
+</P>
+<P>
+<b>A successful match</b>
+A complete match has been found, starting and ending within this subject.
+</P>
+<P>
+<b>PCRE2_ERROR_NOMATCH</b>
+No match can start anywhere in this subject.
+</P>
+<P>
+<b>PCRE2_ERROR_PARTIAL</b>
+Adding more characters may result in a complete match that uses one or more
+characters from the end of this subject.
 </P>
 <P>
 When a partial match is returned, the first two elements in the ovector point
@@ -103,54 +148,42 @@ these characters are needed for a subsequent re-match with additional
 characters.
 </P>
 <P>
-What happens when a partial match is identified depends on which of the two
-partial matching options are set.
-</P>
-<br><b>
-PCRE2_PARTIAL_SOFT WITH pcre2_match()
-</b><br>
-<P>
-If PCRE2_PARTIAL_SOFT is set when <b>pcre2_match()</b> identifies a partial
-match, the partial match is remembered, but matching continues as normal, and
-other alternatives in the pattern are tried. If no complete match can be found,
-PCRE2_ERROR_PARTIAL is returned instead of PCRE2_ERROR_NOMATCH.
-</P>
-<P>
-This option is "soft" because it prefers a complete match over a partial match.
-All the various matching items in a pattern behave as if the subject string is
-potentially complete. For example, \z, \Z, and $ match at the end of the
-subject, as normal, and for \b and \B the end of the subject is treated as a
-non-alphanumeric.
-</P>
-<P>
 If there is more than one partial match, the first one that was found provides
 the data that is returned. Consider this pattern:
 <pre>
   /123\w+X|dogY/
 </pre>
-If this is matched against the subject string "abc123dog", both
-alternatives fail to match, but the end of the subject is reached during
-matching, so PCRE2_ERROR_PARTIAL is returned. The offsets are set to 3 and 9,
-identifying "123dog" as the first partial match that was found. (In this
-example, there are two partial matches, because "dog" on its own partially
-matches the second alternative.)
+If this is matched against the subject string "abc123dog", both alternatives
+fail to match, but the end of the subject is reached during matching, so
+PCRE2_ERROR_PARTIAL is returned. The offsets are set to 3 and 9, identifying
+"123dog" as the first partial match. (In this example, there are two partial
+matches, because "dog" on its own partially matches the second alternative.)
 </P>
 <br><b>
-PCRE2_PARTIAL_HARD WITH pcre2_match()
+How a partial match is processed by pcre2_match()
 </b><br>
 <P>
-If PCRE2_PARTIAL_HARD is set for <b>pcre2_match()</b>, PCRE2_ERROR_PARTIAL is
-returned as soon as a partial match is found, without continuing to search for
-possible complete matches. This option is "hard" because it prefers an earlier
-partial match over a later complete match. For this reason, the assumption is
-made that the end of the supplied subject string may not be the true end of the
-available data, and so, if \z, \Z, \b, \B, or $ are encountered at the end
-of the subject, the result is PCRE2_ERROR_PARTIAL, provided that at least one
-character in the subject has been inspected.
+What happens when a partial match is identified depends on which of the two
+partial matching options is set.
+</P>
+<P>
+If PCRE2_PARTIAL_HARD is set, PCRE2_ERROR_PARTIAL is returned as soon as a
+partial match is found, without continuing to search for possible complete
+matches. This option is "hard" because it prefers an earlier partial match over
+a later complete match. For this reason, the assumption is made that the end of
+the supplied subject string is not the true end of the available data, which is
+why \z, \Z, \b, \B, and $ always give a partial match.
+</P>
+<P>
+If PCRE2_PARTIAL_SOFT is set, the partial match is remembered, but matching
+continues as normal, and other alternatives in the pattern are tried. If no
+complete match can be found, PCRE2_ERROR_PARTIAL is returned instead of
+PCRE2_ERROR_NOMATCH. This option is "soft" because it prefers a complete match
+over a partial match. All the various matching items in a pattern behave as if
+the subject string is potentially complete; \z, \Z, and $ match at the end of
+the subject, as normal, and for \b and \B the end of the subject is treated
+as a non-alphanumeric.
 </P>
-<br><b>
-Comparing hard and soft partial matching
-</b><br>
 <P>
 The difference between the two partial matching options can be illustrated by a
 pattern such as:
@@ -175,245 +208,167 @@ to follow this explanation by thinking of the two patterns like this:
 The second pattern will never match "dogsbody", because it will always find the
 shorter match first.
 </P>
-<br><a name="SEC3" href="#TOC1">PARTIAL MATCHING USING pcre2_dfa_match()</a><br>
-<P>
-The DFA functions move along the subject string character by character, without
-backtracking, searching for all possible matches simultaneously. If the end of
-the subject is reached before the end of the pattern, there is the possibility
-of a partial match, again provided that at least one character has been
-inspected.
-</P>
-<P>
-When PCRE2_PARTIAL_SOFT is set, PCRE2_ERROR_PARTIAL is returned only if there
-have been no complete matches. Otherwise, the complete matches are returned.
-However, if PCRE2_PARTIAL_HARD is set, a partial match takes precedence over
-any complete matches. The portion of the string that was matched when the
-longest partial match was found is set as the first matching string.
-</P>
-<P>
-Because the DFA functions always search for all possible matches, and there is
-no difference between greedy and ungreedy repetition, their behaviour is
-different from the standard functions when PCRE2_PARTIAL_HARD is set. Consider
-the string "dog" matched against the ungreedy pattern shown above:
-<pre>
-  /dog(sbody)??/
-</pre>
-Whereas the standard function stops as soon as it finds the complete match for
-"dog", the DFA function also finds the partial match for "dogsbody", and so
-returns that when PCRE2_PARTIAL_HARD is set.
-</P>
-<br><a name="SEC4" href="#TOC1">PARTIAL MATCHING AND WORD BOUNDARIES</a><br>
+<br><b>
+Example of partial matching using pcre2test
+</b><br>
 <P>
-If a pattern ends with one of sequences \b or \B, which test for word
-boundaries, partial matching with PCRE2_PARTIAL_SOFT can give counter-intuitive
-results. Consider this pattern:
-<pre>
-  /\bcat\b/
-</pre>
-This matches "cat", provided there is a word boundary at either end. If the
-subject string is "the cat", the comparison of the final "t" with a following
-character cannot take place, so a partial match is found. However, normal
-matching carries on, and \b matches at the end of the subject when the last
-character is a letter, so a complete match is found. The result, therefore, is
-<i>not</i> PCRE2_ERROR_PARTIAL. Using PCRE2_PARTIAL_HARD in this case does yield
-PCRE2_ERROR_PARTIAL, because then the partial match takes precedence.
-</P>
-<br><a name="SEC5" href="#TOC1">EXAMPLE OF PARTIAL MATCHING USING PCRE2TEST</a><br>
-<P>
-If the <b>partial_soft</b> (or <b>ps</b>) modifier is present on a
-<b>pcre2test</b> data line, the PCRE2_PARTIAL_SOFT option is used for the match.
-Here is a run of <b>pcre2test</b> that uses the date example quoted above:
+The <b>pcre2test</b> data modifiers <b>partial_hard</b> (or <b>ph</b>) and
+<b>partial_soft</b> (or <b>ps</b>) set PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT,
+respectively, when calling <b>pcre2_match()</b>. Here is a run of
+<b>pcre2test</b> using a pattern that matches the whole subject in the form of a
+date:
 <pre>
     re&#62; /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
-  data&#62; 25jun04\=ps
-   0: 25jun04
-   1: jun
-  data&#62; 25dec3\=ps
+  data&#62; 25dec3\=ph
   Partial match: 23dec3
-  data&#62; 3ju\=ps
+  data&#62; 3ju\=ph
   Partial match: 3ju
-  data&#62; 3juj\=ps
-  No match
-  data&#62; j\=ps
+  data&#62; 3juj\=ph
   No match
 </pre>
-The first data string is matched completely, so <b>pcre2test</b> shows the
-matched substrings. The remaining four strings do not match the complete
-pattern, but the first two are partial matches. Similar output is obtained
-if DFA matching is used.
-</P>
-<P>
-If the <b>partial_hard</b> (or <b>ph</b>) modifier is present on a
-<b>pcre2test</b> data line, the PCRE2_PARTIAL_HARD option is set for the match.
-</P>
-<br><a name="SEC6" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre2_dfa_match()</a><br>
-<P>
-When a partial match has been found using a DFA matching function, it is
-possible to continue the match by providing additional subject data and calling
-the function again with the same compiled regular expression, this time setting
-the PCRE2_DFA_RESTART option. You must pass the same working space as before,
-because this is where details of the previous partial match are stored. Here is
-an example using <b>pcre2test</b>:
+This example gives the same results for both hard and soft partial matching
+options. Here is an example where there is a difference:
 <pre>
     re&#62; /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
-  data&#62; 23ja\=dfa,ps
-  Partial match: 23ja
-  data&#62; n05\=dfa,dfa_restart
-   0: n05
+  data&#62; 25jun04\=ps
+   0: 25jun04
+   1: jun
+  data&#62; 25jun04\=ph
+  Partial match: 25jun04
 </pre>
-The first call has "23ja" as the subject, and requests partial matching; the
-second call has "n05" as the subject for the continued (restarted) match.
-Notice that when the match is complete, only the last part is shown; PCRE2 does
-not retain the previously partially-matched string. It is up to the calling
-program to do that if it needs to.
-</P>
-<P>
-That means that, for an unanchored pattern, if a continued match fails, it is
-not possible to try again at a new starting point. All this facility is capable
-of doing is continuing with the previous match attempt. In the previous
-example, if the second set of data is "ug23" the result is no match, even
-though there would be a match for "aug23" if the entire string were given at
-once. Depending on the application, this may or may not be what you want.
-The only way to allow for starting again at the next character is to retain the
-matched part of the subject and try a new complete match.
+With PCRE2_PARTIAL_SOFT, the subject is matched completely. For
+PCRE2_PARTIAL_HARD, however, the subject is assumed not to be complete, so
+there is only a partial match.
 </P>
+<br><a name="SEC4" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre2_match()</a><br>
 <P>
-You can set the PCRE2_PARTIAL_SOFT or PCRE2_PARTIAL_HARD options with
-PCRE2_DFA_RESTART to continue partial matching over multiple segments. This
-facility can be used to pass very long subject strings to the DFA matching
-functions.
+PCRE was not originally designed with multi-segment matching in mind. However,
+over time, features (including partial matching) that make multi-segment
+matching possible have been added. A very long string can be searched segment
+by segment by calling <b>pcre2_match()</b> repeatedly, with the aim of achieving
+the same results that would happen if the entire string was available for
+searching all the time. Normally, the strings that are being sought are much
+shorter than each individual segment, and are in the middle of very long
+strings, so the pattern is normally not anchored.
 </P>
-<br><a name="SEC7" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre2_match()</a><br>
 <P>
-Unlike the DFA function, it is not possible to restart the previous match with
-a new segment of data when using <b>pcre2_match()</b>. Instead, new data must be
-added to the previous subject string, and the entire match re-run, starting
-from the point where the partial match occurred. Earlier data can be discarded.
+Special logic must be implemented to handle a matched substring that spans a
+segment boundary. PCRE2_PARTIAL_HARD should be used, because it returns a
+partial match at the end of a segment whenever there is the possibility of
+changing the match by adding more characters. The PCRE2_NOTBOL option should
+also be set for all but the first segment.
 </P>
 <P>
-It is best to use PCRE2_PARTIAL_HARD in this situation, because it does not
-treat the end of a segment as the end of the subject when matching \z, \Z,
-\b, \B, and $. Consider an unanchored pattern that matches dates:
+When a partial match occurs, the next segment must be added to the current
+subject and the match re-run, using the <i>startoffset</i> argument of
+<b>pcre2_match()</b> to begin at the point where the partial match started.
+For example:
 <pre>
     re&#62; /\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d/
-  data&#62; The date is 23ja\=ph
+  data&#62; ...the date is 23ja\=ph
   Partial match: 23ja
+  data&#62; ...the date is 23jan19 and on that day...\=offset=15
+   0: 23jan19
+   1: jan
 </pre>
-At this stage, an application could discard the text preceding "23ja", add on
-text from the next segment, and call the matching function again. Unlike the
-DFA matching function, the entire matching string must always be available,
-and the complete matching process occurs for each call, so more memory and more
-processing time is needed.
-</P>
-<br><a name="SEC8" href="#TOC1">ISSUES WITH MULTI-SEGMENT MATCHING</a><br>
-<P>
-Certain types of pattern may give problems with multi-segment matching,
-whichever matching function is used.
+Note the use of the <b>offset</b> modifier to start the new match where the
+partial match was found. In this example, the next segment was added to the one
+in which the partial match was found. This is the most straightforward
+approach, typically using a memory buffer that is twice the size of each
+segment. After a partial match, the first half of the buffer is discarded, the
+second half is moved to the start of the buffer, and a new segment is added
+before repeating the match as in the example above. After a no match, the
+entire buffer can be discarded.
+</P>
+<P>
+If there are memory constraints, you may want to discard text that precedes a
+partial match before adding the next segment. Unfortunately, this is not at
+present straightforward. In cases such as the above, where the pattern does not
+contain any lookbehinds, it is sufficient to retain only the partially matched
+substring. However, if the pattern contains a lookbehind assertion, characters
+that precede the start of the partial match may have been inspected during the
+matching process. When <b>pcre2test</b> displays a partial match, it indicates
+these characters with '&#60;' if the <b>allusedtext</b> modifier is set:
+<pre>
+    re&#62; "(?&#60;=123)abc"
+  data&#62; xx123ab\=ph,allusedtext
+  Partial match: 123ab
+                 &#60;&#60;&#60;
+</pre>
+However, the \fPallusedtext\fP modifier is not available for JIT matching,
+because JIT matching does not record the first (or last) consulted characters.
+For this reason, this information is not available via the API. It is therefore
+not possible in general to obtain the exact number of characters that must be
+retained in order to get the right match result. If you cannot retain the
+entire segment, you must find some heuristic way of choosing.
 </P>
 <P>
-1. If the pattern contains a test for the beginning of a line, you need to pass
-the PCRE2_NOTBOL option when the subject string for any call does start at the
-beginning of a line. There is also a PCRE2_NOTEOL option, but in practice when
-doing multi-segment matching you should be using PCRE2_PARTIAL_HARD, which
-includes the effect of PCRE2_NOTEOL.
+If you know the approximate length of the matching substrings, you can use that
+to decide how much text to retain. The only lookbehind information that is
+currently available via the API is the length of the longest individual
+lookbehind in a pattern, but this can be misleading if there are nested
+lookbehinds. The value returned by calling <b>pcre2_pattern_info()</b> with the
+PCRE2_INFO_MAXLOOKBEHIND option is the maximum number of characters (not code
+units) that any individual lookbehind moves back when it is processed. A
+pattern such as "(?&#60;=(?&#60;!b)a)" has a maximum lookbehind value of one, but
+inspects two characters before its starting point.
 </P>
 <P>
-2. If a pattern contains a lookbehind assertion, characters that precede the
-start of the partial match may have been inspected during the matching process.
-When using <b>pcre2_match()</b>, sufficient characters must be retained for the
-next match attempt. You can ensure that enough characters are retained by doing
-the following:
+In a non-UTF or a 32-bit case, moving back is just a subtraction, but in
+UTF-8 or UTF-16 you have to count characters while moving back through the code
+units.
 </P>
+<br><a name="SEC5" href="#TOC1">PARTIAL MATCHING USING pcre2_dfa_match()</a><br>
 <P>
-Before doing any matching, find the length of the longest lookbehind in the
-pattern by calling <b>pcre2_pattern_info()</b> with the PCRE2_INFO_MAXLOOKBEHIND
-option. Note that the resulting count is in characters, not code units. After a
-partial match, moving back from the ovector[0] offset in the subject by the
-number of characters given for the maximum lookbehind gets you to the earliest
-character that must be retained. In a non-UTF or a 32-bit situation, moving
-back is just a subtraction, but in UTF-8 or UTF-16 you have to count characters
-while moving back through the code units.
+The DFA function moves along the subject string character by character, without
+backtracking, searching for all possible matches simultaneously. If the end of
+the subject is reached before the end of the pattern, there is the possibility
+of a partial match.
 </P>
 <P>
-Characters before the point you have now reached can be discarded, and after
-the next segment has been added to what is retained, you should run the next
-match with the <b>startoffset</b> argument set so that the match begins at the
-same point as before.
+When PCRE2_PARTIAL_SOFT is set, PCRE2_ERROR_PARTIAL is returned only if there
+have been no complete matches. Otherwise, the complete matches are returned.
+If PCRE2_PARTIAL_HARD is set, a partial match takes precedence over any
+complete matches. The portion of the string that was matched when the longest
+partial match was found is set as the first matching string.
 </P>
 <P>
-For example, if the pattern "(?&#60;=123)abc" is partially matched against the
-string "xx123ab", the ovector offsets are 5 and 7 ("ab"). The maximum
-lookbehind count is 3, so all characters before offset 2 can be discarded. The
-value of <b>startoffset</b> for the next match should be 3. When <b>pcre2test</b>
-displays a partial match, it indicates the lookbehind characters with '&#60;'
-characters:
+Because the DFA function always searches for all possible matches, and there is
+no difference between greedy and ungreedy repetition, its behaviour is
+different from the <b>pcre2_match()</b>. Consider the string "dog" matched
+against this ungreedy pattern:
 <pre>
-    re&#62; "(?&#60;=123)abc"
-  data&#62; xx123ab\=ph
-  Partial match: 123ab
-                 &#60;&#60;&#60;
-</PRE>
+  /dog(sbody)??/
+</pre>
+Whereas the standard function stops as soon as it finds the complete match for
+"dog", the DFA function also finds the partial match for "dogsbody", and so
+returns that when PCRE2_PARTIAL_HARD is set.
 </P>
+<br><a name="SEC6" href="#TOC1">MULTI-SEGMENT MATCHING WITH pcre2_dfa_match()</a><br>
 <P>
-3. Because a partial match must always contain at least one character, what
-might be considered a partial match of an empty string actually gives a "no
-match" result. For example:
-<pre>
-    re&#62; /c(?&#60;=abc)x/
-  data&#62; ab\=ps
-  No match
-</pre>
-If the next segment begins "cx", a match should be found, but this will only
-happen if characters from the previous segment are retained. For this reason, a
-"no match" result should be interpreted as "partial match of an empty string"
-when the pattern contains lookbehinds.
-</P>
-<P>
-4. Matching a subject string that is split into multiple segments may not
-always produce exactly the same result as matching over one single long string,
-especially when PCRE2_PARTIAL_SOFT is used. The section "Partial Matching and
-Word Boundaries" above describes an issue that arises if the pattern ends with
-\b or \B. Another kind of difference may occur when there are multiple
-matching possibilities, because (for PCRE2_PARTIAL_SOFT) a partial match result
-is given only when there are no completed matches. This means that as soon as
-the shortest match has been found, continuation to a new subject segment is no
-longer possible. Consider this <b>pcre2test</b> example:
-<pre>
-    re&#62; /dog(sbody)?/
-  data&#62; dogsb\=ps
-   0: dog
-  data&#62; do\=ps,dfa
-  Partial match: do
-  data&#62; gsb\=ps,dfa,dfa_restart
-   0: g
-  data&#62; dogsbody\=dfa
-   0: dogsbody
-   1: dog
-</pre>
-The first data line passes the string "dogsb" to a standard matching function,
-setting the PCRE2_PARTIAL_SOFT option. Although the string is a partial match
-for "dogsbody", the result is not PCRE2_ERROR_PARTIAL, because the shorter
-string "dog" is a complete match. Similarly, when the subject is presented to
-a DFA matching function in several parts ("do" and "gsb" being the first two)
-the match stops when "dog" has been found, and it is not possible to continue.
-On the other hand, if "dogsbody" is presented as a single string, a DFA
-matching function finds both matches.
-</P>
-<P>
-Because of these problems, it is best to use PCRE2_PARTIAL_HARD when matching
-multi-segment data. The example above then behaves differently:
+When a partial match has been found using the DFA matching function, it is
+possible to continue the match by providing additional subject data and calling
+the function again with the same compiled regular expression, this time setting
+the PCRE2_DFA_RESTART option. You must pass the same working space as before,
+because this is where details of the previous partial match are stored. You can
+set the PCRE2_PARTIAL_SOFT or PCRE2_PARTIAL_HARD options with PCRE2_DFA_RESTART
+to continue partial matching over multiple segments. Here is an example using
+<b>pcre2test</b>:
 <pre>
-    re&#62; /dog(sbody)?/
-  data&#62; dogsb\=ph
-  Partial match: dogsb
-  data&#62; do\=ps,dfa
-  Partial match: do
-  data&#62; gsb\=ph,dfa,dfa_restart
-  Partial match: gsb
+    re&#62; /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+  data&#62; 23ja\=dfa,ps
+  Partial match: 23ja
+  data&#62; n05\=dfa,dfa_restart
+   0: n05
 </pre>
-5. Patterns that contain alternatives at the top level which do not all start
-with the same pattern item may not work as expected when PCRE2_DFA_RESTART is
-used. For example, consider this pattern:
+The first call has "23ja" as the subject, and requests partial matching; the
+second call has "n05" as the subject for the continued (restarted) match.
+Notice that when the match is complete, only the last part is shown; PCRE2 does
+not retain the previously partially-matched string. It is up to the calling
+program to do that if it needs to. This means that, for an unanchored pattern,
+if a continued match fails, it is not possible to try again at a new starting
+point. All this facility is capable of doing is continuing with the previous
+match attempt. For example, consider this pattern:
 <pre>
   1234|3789
 </pre>
@@ -422,30 +377,18 @@ alternative is found at offset 3. There is no partial match for the second
 alternative, because such a match does not start at the same point in the
 subject string. Attempting to continue with the string "7890" does not yield a
 match because only those alternatives that match at one point in the subject
-are remembered. The problem arises because the start of the second alternative
-matches within the first alternative. There is no problem with anchored
-patterns or patterns such as:
-<pre>
-  1234|ABCD
-</pre>
-where no string can be a partial match for both alternatives. This is not a
-problem if a standard matching function is used, because the entire match has
-to be rerun each time:
-<pre>
-    re&#62; /1234|3789/
-  data&#62; ABC123\=ph
-  Partial match: 123
-  data&#62; 1237890
-   0: 3789
-</pre>
-Of course, instead of using PCRE2_DFA_RESTART, the same technique of re-running
-the entire match can also be used with the DFA matching function. Another
-possibility is to work with two buffers. If a partial match at offset <i>n</i>
-in the first buffer is followed by "no match" when PCRE2_DFA_RESTART is used on
-the second buffer, you can then try a new match starting at offset <i>n+1</i> in
-the first buffer.
+are remembered. Depending on the application, this may or may not be what you
+want.
+</P>
+<P>
+If you do want to allow for starting again at the next character, one way of
+doing it is to retain some or all of the segment and try a new complete match,
+as described for <b>pcre2_match()</b> above. Another possibility is to work with
+two buffers. If a partial match at offset <i>n</i> in the first buffer is
+followed by "no match" when PCRE2_DFA_RESTART is used on the second buffer, you
+can then try a new match starting at offset <i>n+1</i> in the first buffer.
 </P>
-<br><a name="SEC9" href="#TOC1">AUTHOR</a><br>
+<br><a name="SEC7" href="#TOC1">AUTHOR</a><br>
 <P>
 Philip Hazel
 <br>
@@ -454,11 +397,11 @@ University Computing Service
 Cambridge, England.
 <br>
 </P>
-<br><a name="SEC10" href="#TOC1">REVISION</a><br>
+<br><a name="SEC8" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 22 December 2014
+Last updated: 04 September 2019
 <br>
-Copyright &copy; 1997-2014 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index e43e98e44f0815d2ab024c6c37118b52a9a358f8..0aa2191d9d9dd11f289b53d0e83546e8ca1c0aa7 100644 (file)
@@ -26,23 +26,25 @@ please consult the man page, in case the conversion went wrong.
 <li><a name="TOC11" href="#SEC11">COMPATIBILITY FEATURE FOR WORD BOUNDARIES</a>
 <li><a name="TOC12" href="#SEC12">VERTICAL BAR</a>
 <li><a name="TOC13" href="#SEC13">INTERNAL OPTION SETTING</a>
-<li><a name="TOC14" href="#SEC14">SUBPATTERNS</a>
-<li><a name="TOC15" href="#SEC15">DUPLICATE SUBPATTERN NUMBERS</a>
-<li><a name="TOC16" href="#SEC16">NAMED SUBPATTERNS</a>
+<li><a name="TOC14" href="#SEC14">GROUPS</a>
+<li><a name="TOC15" href="#SEC15">DUPLICATE GROUP NUMBERS</a>
+<li><a name="TOC16" href="#SEC16">NAMED CAPTURE GROUPS</a>
 <li><a name="TOC17" href="#SEC17">REPETITION</a>
 <li><a name="TOC18" href="#SEC18">ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS</a>
 <li><a name="TOC19" href="#SEC19">BACKREFERENCES</a>
 <li><a name="TOC20" href="#SEC20">ASSERTIONS</a>
-<li><a name="TOC21" href="#SEC21">CONDITIONAL SUBPATTERNS</a>
-<li><a name="TOC22" href="#SEC22">COMMENTS</a>
-<li><a name="TOC23" href="#SEC23">RECURSIVE PATTERNS</a>
-<li><a name="TOC24" href="#SEC24">SUBPATTERNS AS SUBROUTINES</a>
-<li><a name="TOC25" href="#SEC25">ONIGURUMA SUBROUTINE SYNTAX</a>
-<li><a name="TOC26" href="#SEC26">CALLOUTS</a>
-<li><a name="TOC27" href="#SEC27">BACKTRACKING CONTROL</a>
-<li><a name="TOC28" href="#SEC28">SEE ALSO</a>
-<li><a name="TOC29" href="#SEC29">AUTHOR</a>
-<li><a name="TOC30" href="#SEC30">REVISION</a>
+<li><a name="TOC21" href="#SEC21">NON-ATOMIC ASSERTIONS</a>
+<li><a name="TOC22" href="#SEC22">SCRIPT RUNS</a>
+<li><a name="TOC23" href="#SEC23">CONDITIONAL GROUPS</a>
+<li><a name="TOC24" href="#SEC24">COMMENTS</a>
+<li><a name="TOC25" href="#SEC25">RECURSIVE PATTERNS</a>
+<li><a name="TOC26" href="#SEC26">GROUPS AS SUBROUTINES</a>
+<li><a name="TOC27" href="#SEC27">ONIGURUMA SUBROUTINE SYNTAX</a>
+<li><a name="TOC28" href="#SEC28">CALLOUTS</a>
+<li><a name="TOC29" href="#SEC29">BACKTRACKING CONTROL</a>
+<li><a name="TOC30" href="#SEC30">SEE ALSO</a>
+<li><a name="TOC31" href="#SEC31">AUTHOR</a>
+<li><a name="TOC32" href="#SEC32">REVISION</a>
 </ul>
 <br><a name="SEC1" href="#TOC1">PCRE2 REGULAR EXPRESSION DETAILS</a><br>
 <P>
@@ -62,13 +64,13 @@ by O'Reilly, covers regular expressions in great detail. This description of
 PCRE2's regular expressions is intended as reference material.
 </P>
 <P>
-This document discusses the patterns that are supported by PCRE2 when its main
-matching function, <b>pcre2_match()</b>, is used. PCRE2 also has an alternative
-matching function, <b>pcre2_dfa_match()</b>, 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 advantages and disadvantages of
-the alternative function, and how it differs from the normal function, are
-discussed in the
+This document discusses the regular expression patterns that are supported by
+PCRE2 when its main matching function, <b>pcre2_match()</b>, is used. PCRE2 also
+has an alternative matching function, <b>pcre2_dfa_match()</b>, 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 advantages and
+disadvantages of the alternative function, and how it differs from the normal
+function, are discussed in the
 <a href="pcre2matching.html"><b>pcre2matching</b></a>
 page.
 </P>
@@ -90,10 +92,11 @@ 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
+you must either call the compiling function with one or both of the PCRE2_UTF
+or PCRE2_MATCH_INVALID_UTF options, or the pattern must start with the special
+sequence (*UTF), which is equivalent to setting the relevant PCRE2_UTF. How
+setting a UTF mode affects pattern matching is mentioned in several places
+below. There is also a summary of features in the
 <a href="pcre2unicode.html"><b>pcre2unicode</b></a>
 page.
 </P>
@@ -182,8 +185,8 @@ also an explicit memory limit that can be set.
 </P>
 <P>
 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 applied to a long string that does not match). When one of
+patterns with huge matching trees. A common example is a pattern with nested
+unlimited repeats applied to a long string that does not match. When one of
 these limits is reached, <b>pcre2_match()</b> gives an error return. The limits
 can also be set by items at the start of the pattern of the form
 <pre>
@@ -289,10 +292,10 @@ caseless matching is specified (the PCRE2_CASELESS option), letters are matched
 independently of case.
 </P>
 <P>
-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
-<i>metacharacters</i>, which do not stand for themselves but instead are
-interpreted in some special way.
+The power of regular expressions comes from the ability to include wild cards,
+character classes, alternatives, and repetitions in the pattern. These are
+encoded in the pattern by the use of <i>metacharacters</i>, which do not stand
+for themselves but instead are interpreted in some special way.
 </P>
 <P>
 There are two different sets of metacharacters: those that are recognized
@@ -306,14 +309,11 @@ are as follows:
   .      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
+  (      start group or control verb
+  )      end group or control verb
   *      0 or more quantifier
-  +      1 or more quantifier
-         also "possessive quantifier"
+  +      1 or more quantifier; also "possessive quantifier"
+  ?      0 or 1 quantifier; also quantifier minimizer
   {      start min/max quantifier
 </pre>
 Part of a pattern that is in square brackets is called a "character class". In
@@ -322,7 +322,7 @@ 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)
+  [      POSIX character class (if followed by POSIX syntax)
   ]      terminates the character class
 </pre>
 The following sections describe the use of each of the metacharacters.
@@ -330,7 +330,7 @@ The following sections describe the use of each of the metacharacters.
 <br><a name="SEC5" href="#TOC1">BACKSLASH</a><br>
 <P>
 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
+character that is not a digit 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.
 </P>
@@ -342,7 +342,7 @@ precede a non-alphanumeric with backslash to specify that it stands for itself.
 In particular, if you want to match a backslash, you write \\.
 </P>
 <P>
-In a UTF mode, only ASCII numbers and letters have any special meaning after a
+In a UTF mode, only ASCII digits and letters have any special meaning after a
 backslash. All other characters (in particular, those whose code points are
 greater than 127) are treated as literals.
 </P>
@@ -354,13 +354,13 @@ escaping backslash can be used to include a white space or # character as part
 of the pattern.
 </P>
 <P>
-If you want to remove the special meaning from a sequence of characters, you
-can do so by putting them between \Q and \E. This is different from Perl in
-that $ and @ are handled as literals in \Q...\E sequences in PCRE2, whereas
-in Perl, $ and @ cause variable interpolation. Also, Perl does "double-quotish
-backslash interpolation" on any backslashes between \Q and \E which, its
-documentation says, "may lead to confusing results". PCRE2 treats a backslash
-between \Q and \E just like any other character. Note the following examples:
+If you want to treat all characters in a sequence as literals, you can do so by
+putting them between \Q and \E. This is different from Perl in that $ and @
+are handled as literals in \Q...\E sequences in PCRE2, whereas in Perl, $ and
+@ cause variable interpolation. Also, Perl does "double-quotish backslash
+interpolation" on any backslashes between \Q and \E which, its documentation
+says, "may lead to confusing results". PCRE2 treats a backslash between \Q and
+\E just like any other character. Note the following examples:
 <pre>
   Pattern            PCRE2 matches   Perl matches
 
@@ -385,15 +385,15 @@ A second use of backslash provides a way of encoding non-printing characters
 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:
+instead of the binary character it represents. In an ASCII or Unicode
+environment, these escapes are as follows:
 <pre>
   \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)
+  \r          carriage return (hex 0D) (but see below)
   \t          tab (hex 09)
   \0dd        character with octal code 0dd
   \ddd        character with octal code ddd, or backreference
@@ -401,13 +401,46 @@ these escapes are as follows:
   \xhh        character with hex code hh
   \x{hhh..}   character with hex code hhh..
   \N{U+hhh..} character with Unicode hex code point hhh..
-  \uhhhh      character with hex code hhhh (when PCRE2_ALT_BSUX is set)
 </pre>
-The \N{U+hhh..} escape sequence is recognized only when the PCRE2_UTF option
-is set, that is, when PCRE2 is operating in a Unicode mode. Perl also uses
-\N{name} to specify characters by Unicode name; PCRE2 does not support this.
-Note that when \N is not followed by an opening brace (curly bracket) it has
-an entirely different meaning, matching any character that is not a newline.
+By default, after \x that is not followed by {, from zero to two hexadecimal
+digits are read (letters can be in upper or lower case). Any number of
+hexadecimal digits may appear between \x{ and }. If a character other than a
+hexadecimal digit appears between \x{ and }, or if there is no terminating },
+an error occurs.
+</P>
+<P>
+Characters whose code points are less than 256 can be defined by either of the
+two syntaxes for \x or by an octal sequence. There is no difference in the way
+they are handled. For example, \xdc is exactly the same as \x{dc} or \334.
+However, using the braced versions does make such sequences easier to read.
+</P>
+<P>
+Support is available for some ECMAScript (aka JavaScript) escape sequences via
+two compile-time options. If PCRE2_ALT_BSUX is set, the sequence \x followed
+by { is not recognized. Only if \x is followed by two hexadecimal digits is it
+recognized as a character escape. Otherwise it is interpreted as a literal "x"
+character. In this mode, support for code points greater than 256 is provided
+by \u, which must be followed by four hexadecimal digits; otherwise it is
+interpreted as a literal "u" character.
+</P>
+<P>
+PCRE2_EXTRA_ALT_BSUX has the same effect as PCRE2_ALT_BSUX and, in addition,
+\u{hhh..} is recognized as the character specified by hexadecimal code point.
+There may be any number of hexadecimal digits. This syntax is from ECMAScript
+6.
+</P>
+<P>
+The \N{U+hhh..} escape sequence is recognized only when PCRE2 is operating in
+UTF mode. Perl also uses \N{name} to specify characters by Unicode name; PCRE2
+does not support this. Note that when \N is not followed by an opening brace
+(curly bracket) it has an entirely different meaning, matching any character
+that is not a newline.
+</P>
+<P>
+There are some legacy applications where the escape sequence \r is expected to
+match a newline. If the PCRE2_EXTRA_ESCAPED_CR_IS_LF option is set, \r in a
+pattern is converted to \n so that it matches a LF (linefeed) instead of a CR
+(carriage return) character.
 </P>
 <P>
 The precise effect of \cx on ASCII characters is as follows: if x is a lower
@@ -468,12 +501,12 @@ and Perl has changed over time, causing PCRE2 also to change.
 <P>
 Outside a character class, PCRE2 reads the digit and any following digits 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 <i>backreference</i>. A
-description of how this works is given
+if there are at least that many previous capture groups in the expression, the
+entire sequence is taken as a <i>backreference</i>. A description of how this
+works is given
 <a href="#backreferences">later,</a>
 following the discussion of
-<a href="#subpattern">parenthesized subpatterns.</a>
+<a href="#group">parenthesized groups.</a>
 Otherwise, up to three octal digits are read to form a character code.
 </P>
 <P>
@@ -483,7 +516,7 @@ backslash, using them to generate a data character. Any subsequent digits stand
 for themselves. For example, outside a character class:
 <pre>
   \040   is another way of writing an ASCII space
-  \40    is the same, provided there are fewer than 40 previous capturing subpatterns
+  \40    is the same, provided there are fewer than 40 previous capture groups
   \7     is always a backreference
   \11    might be a backreference, or another way of writing a tab
   \011   is always a tab
@@ -496,26 +529,6 @@ 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.
 </P>
-<P>
-By default, after \x that is not followed by {, from zero to two hexadecimal
-digits are read (letters can be in upper or lower case). Any number of
-hexadecimal digits may appear between \x{ and }. If a character other than
-a hexadecimal digit appears between \x{ and }, or if there is no terminating
-}, an error occurs.
-</P>
-<P>
-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. Otherwise, it
-matches a literal "x" character. In this mode, support for code points greater
-than 256 is provided by \u, which must be followed by four hexadecimal digits;
-otherwise it matches a literal "u" character.
-</P>
-<P>
-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 difference in
-the way they are handled. For example, \xdc is exactly the same as \x{dc} (or
-\u00dc in PCRE2_ALT_BSUX mode).
-</P>
 <br><b>
 Constraints on character values
 </b><br>
@@ -554,9 +567,10 @@ Unsupported escape sequences
 <P>
 In Perl, the sequences \F, \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 above.
+does not support these escape sequences in patterns. However, if either of the
+PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX options is set, \U matches a "U"
+character, and \u can be used to define a character by code point, as
+described above.
 </P>
 <br><b>
 Absolute and relative backreferences
@@ -567,7 +581,7 @@ in braces, is an absolute or relative backreference. A named backreference
 can be coded as \g{name}. Backreferences are discussed
 <a href="#backreferences">later,</a>
 following the discussion of
-<a href="#subpattern">parenthesized subpatterns.</a>
+<a href="#group">parenthesized groups.</a>
 </P>
 <br><b>
 Absolute and relative subroutine calls
@@ -575,11 +589,11 @@ Absolute and relative subroutine calls
 <P>
 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
+syntax for referencing a capture group as a subroutine. Details are discussed
 <a href="#onigurumasubroutines">later.</a>
 Note that \g{...} (Perl syntax) and \g&#60;...&#62; (Oniguruma syntax) are <i>not</i>
 synonymous. The former is a backreference; the latter is a
-<a href="#subpatternsassubroutines">subroutine</a>
+<a href="#groupsassubroutines">subroutine</a>
 call.
 <a name="genericchartypes"></a></P>
 <br><b>
@@ -746,21 +760,22 @@ Unicode character properties
 </b><br>
 <P>
 When PCRE2 is built with Unicode support (the default), three additional 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 code points are less than 256, but they do work in this mode.
-In 32-bit non-UTF mode, code points greater than 0x10ffff (the Unicode limit)
-may be encountered. These are all treated as being in the Common script and
-with an unassigned type. The extra escape sequences are:
+sequences that match characters with specific properties are available. They
+can be used in any mode, though in 8-bit and 16-bit non-UTF modes these
+sequences are of course limited to testing characters whose code points are
+less than U+0100 and U+10000, respectively. In 32-bit non-UTF mode, code points
+greater than 0x10ffff (the Unicode limit) may be encountered. These are all
+treated as being in the Unknown script and with an unassigned type. The extra
+escape sequences are:
 <pre>
   \p{<i>xx</i>}   a character with the <i>xx</i> property
   \P{<i>xx</i>}   a character without the <i>xx</i> property
   \X       a Unicode extended grapheme cluster
 </pre>
-The property names represented by <i>xx</i> 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
+The property names represented by <i>xx</i> above are case-sensitive. There is
+support for Unicode script names, Unicode general category properties, "Any",
+which matches any character (including newline), and some special PCRE2
+properties (described in the
 <a href="#extraprops">next section).</a>
 Other Perl properties such as "InMusicalSymbols" are not supported by PCRE2.
 Note that \P{Any} does not match any characters, so always causes a match
@@ -774,8 +789,10 @@ example:
   \p{Greek}
   \P{Han}
 </pre>
-Those that are not part of an identified script are lumped together as
-"Common". The current list of scripts is:
+Unassigned characters (and in non-UTF 32-bit mode, characters with code points
+greater than 0x10FFFF) are assigned the "Unknown" script. Others that are not
+part of an identified script are lumped together as "Common". The current list
+of scripts is:
 </P>
 <P>
 Adlam,
@@ -812,6 +829,7 @@ Dogra,
 Duployan,
 Egyptian_Hieroglyphs,
 Elbasan,
+Elymaic,
 Ethiopic,
 Georgian,
 Glagolitic,
@@ -869,10 +887,12 @@ Mro,
 Multani,
 Myanmar,
 Nabataean,
+Nandinagari,
 New_Tai_Lue,
 Newa,
 Nko,
 Nushu,
+Nyakeng_Puachue_Hmong,
 Ogham,
 Ol_Chiki,
 Old_Hungarian,
@@ -922,7 +942,9 @@ Tibetan,
 Tifinagh,
 Tirhuta,
 Ugaritic,
+Unknown,
 Vai,
+Wancho,
 Warang_Citi,
 Yi,
 Zanabazar_Square.
@@ -993,12 +1015,14 @@ the Lu, Ll, or Lt property, in other words, a letter that is not classified as
 a modifier or "other".
 </P>
 <P>
-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
+The Cs (Surrogate) property applies only to characters whose code points are in
+the range U+D800 to U+DFFF. These characters are no different to any other
+character when PCRE2 is not in UTF mode (using the 16-bit or 32-bit library).
+However, they are not valid in Unicode strings and so cannot be tested by PCRE2
+in UTF mode, unless UTF validity checking has been turned off (see the
+discussion of PCRE2_NO_UTF_CHECK in the
 <a href="pcre2api.html"><b>pcre2api</b></a>
-page). Perl does not support the Cs property.
+page).
 </P>
 <P>
 The long synonyms for property names that Perl supports (such as \p{Letter})
@@ -1128,7 +1152,7 @@ a lookbehind assertion
 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
-<a href="#subpattern">captured substrings.</a>
+<a href="#group">captured substrings.</a>
 For example, when the pattern
 <pre>
   (foo)\Kbar
@@ -1156,7 +1180,7 @@ Simple assertions
 The final use of backslash is for certain simple assertions. An assertion
 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
+groups for more complicated assertions is described
 <a href="#bigassertions">below.</a>
 The backslashed assertions are:
 <pre>
@@ -1176,12 +1200,12 @@ character. If any other of these assertions appears in a character class, an
 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" metasequence. However, whatever follows \b normally
-determines which it is. For example, the fragment \ba matches "a" at the start
-of a word.
+first or last character matches \w, respectively. When PCRE2 is built with
+Unicode support, 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" metasequence. However,
+whatever follows \b normally determines which it is. For example, the fragment
+\ba matches "a" at the start of a word.
 </P>
 <P>
 The \A, \Z, and \z assertions differ from the traditional circumflex and
@@ -1342,7 +1366,7 @@ 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).
+unless the PCRE2_NO_UTF_CHECK or PCRE2_MATCH_INVALID_UTF option is used).
 </P>
 <P>
 An application can lock out the use of \C by setting the
@@ -1376,7 +1400,7 @@ could be used with a UTF-8 string (ignore white space and line breaks):
 </pre>
 In this example, a group that starts with (?| resets the capturing parentheses
 numbers in each alternative (see
-<a href="#dupsubpatternnumber">"Duplicate Subpattern Numbers"</a>
+<a href="#dupgroupnumber">"Duplicate Group Numbers"</a>
 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
@@ -1622,10 +1646,10 @@ the pattern
 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
-<a href="#subpattern">(defined below),</a>
+that succeeds is used. If the alternatives are within a group
+<a href="#group">(defined below),</a>
 "succeeds" means matching the rest of the main pattern as well as the
-alternative in the subpattern.
+alternative in the group.
 </P>
 <br><a name="SEC13" href="#TOC1">INTERNAL OPTION SETTING</a><br>
 <P>
@@ -1668,16 +1692,16 @@ respectively. However, these are not unset by (?^).
 </P>
 <P>
 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. An option change within a subpattern (see below for a description
-of subpatterns) affects only that part of the subpattern that follows it, so
+group parentheses), the change applies to the remainder of the pattern
+that follows. An option change within a group (see below for a description
+of groups) affects only that part of the group that follows it, so
 <pre>
   (a(?i)b)c
 </pre>
 matches abc and aBc and no other strings (assuming PCRE2_CASELESS is not used).
 By this means, options can be made to have different settings in different
 parts of the pattern. Any changes made in one alternative do carry on
-into subsequent branches within the same subpattern. For example,
+into subsequent branches within the same group. For example,
 <pre>
   (a(?i)b|c)
 </pre>
@@ -1688,7 +1712,7 @@ behaviour otherwise.
 </P>
 <P>
 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
+a non-capturing group (see the next section), the option letters may
 appear between the "?" and the ":". Thus the two patterns
 <pre>
   (?i:saturday|sunday)
@@ -1697,21 +1721,22 @@ appear between the "?" and the ":". Thus the two patterns
 match exactly the same set of strings.
 </P>
 <P>
-<b>Note:</b> There are other PCRE2-specific options that can be set by the
-application when the compiling function is called. The pattern can contain
-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
+<b>Note:</b> There are other PCRE2-specific options, applying to the whole
+pattern, which can be set by the application when the compiling function is
+called. In addition, the pattern can contain 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
 <a href="#newlineseq">"Newline sequences"</a>
 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.
-<a name="subpattern"></a></P>
-<br><a name="SEC14" href="#TOC1">SUBPATTERNS</a><br>
+<a name="group"></a></P>
+<br><a name="SEC14" href="#TOC1">GROUPS</a><br>
 <P>
-Subpatterns are delimited by parentheses (round brackets), which can be nested.
-Turning part of a pattern into a subpattern does two things:
+Groups are delimited by parentheses (round brackets), which can be nested.
+Turning part of a pattern into a group does two things:
 <br>
 <br>
 1. It localizes a set of alternatives. For example, the pattern
@@ -1722,16 +1747,16 @@ matches "cataract", "caterpillar", or "cat". Without the parentheses, it would
 match "cataract", "erpillar" or an empty string.
 <br>
 <br>
-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.)
+2. It creates a "capture group". This means that, when the whole pattern
+matches, the portion of the subject string that matched the group 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.)
 </P>
 <P>
 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
+numbers for capture groups. For example, if the string "the red king" is
+matched against the pattern
 <pre>
   the ((red|white) (king|queen))
 </pre>
@@ -1740,36 +1765,35 @@ the captured substrings are "red king", "red", and "king", and are numbered 1,
 </P>
 <P>
 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 capturing, 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
+There are often times when grouping is required without capturing. If an
+opening parenthesis is followed by a question mark and a colon, the group
+does not do any capturing, and is not counted when computing the number of any
+subsequent capture groups. For example, if the string "the white queen"
+is matched against the pattern
 <pre>
   the ((?:red|white) (king|queen))
 </pre>
 the captured substrings are "white queen" and "queen", and are numbered 1 and
-2. The maximum number of capturing subpatterns is 65535.
+2. The maximum number of capture groups is 65535.
 </P>
 <P>
 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
+a non-capturing group, the option letters may appear between the "?" and the
+":". Thus the two patterns
 <pre>
   (?i:saturday|sunday)
   (?:(?i)saturday|sunday)
 </pre>
 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
+from left to right, and options are not reset until the end of the group is
+reached, an option setting in one branch does affect subsequent branches, so
 the above patterns match "SUNDAY" as well as "Saturday".
-<a name="dupsubpatternnumber"></a></P>
-<br><a name="SEC15" href="#TOC1">DUPLICATE SUBPATTERN NUMBERS</a><br>
+<a name="dupgroupnumber"></a></P>
+<br><a name="SEC15" href="#TOC1">DUPLICATE GROUP NUMBERS</a><br>
 <P>
-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:
+Perl 5.10 introduced a feature whereby each alternative in a group uses the
+same numbers for its capturing parentheses. Such a group starts with (?| and is
+itself a non-capturing group. For example, consider this pattern:
 <pre>
   (?|(Sat)ur|(Sun))day
 </pre>
@@ -1779,7 +1803,7 @@ 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, parentheses 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
+parentheses that follow the whole group start after the highest number used in
 any branch. The following example is taken from the Perl documentation. The
 numbers underneath show in which buffer the captured content will be stored.
 <pre>
@@ -1787,13 +1811,12 @@ numbers underneath show in which buffer the captured content will be stored.
   / ( a )  (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x
   # 1            2         2  3        2     3     4
 </pre>
-A backreference 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":
+A backreference to a capture group uses the most recent value that is set for
+the group. The following pattern matches "abcabc" or "defdef":
 <pre>
   /(?|(abc)|(def))\1/
 </pre>
-In contrast, a subroutine call to a numbered subpattern always refers to the
+In contrast, a subroutine call to a capture group always refers to the
 first one in the pattern with the given number. The following pattern matches
 "abcabc" or "defabc":
 <pre>
@@ -1805,29 +1828,35 @@ of computing an absolute group number.
 <P>
 If a
 <a href="#conditions">condition test</a>
-for a subpattern's having matched refers to a non-unique number, the test is
-true if any of the subpatterns of that number have matched.
+for a group's having matched refers to a non-unique number, the test is
+true if any group with that number has matched.
 </P>
 <P>
 An alternative approach to using this "branch reset" feature is to use
-duplicate named subpatterns, as described in the next section.
+duplicate named groups, as described in the next section.
 </P>
-<br><a name="SEC16" href="#TOC1">NAMED SUBPATTERNS</a><br>
+<br><a name="SEC16" href="#TOC1">NAMED CAPTURE GROUPS</a><br>
 <P>
-Identifying capturing parentheses by number is simple, but it can be very hard
-to keep track of the numbers in complicated patterns. Furthermore, if an
-expression is modified, the numbers may change. To help with this difficulty,
-PCRE2 supports the naming of capturing subpatterns. 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.
+Identifying capture groups by number is simple, but it can be very hard to keep
+track of the numbers in complicated patterns. Furthermore, if an expression is
+modified, the numbers may change. To help with this difficulty, PCRE2 supports
+the naming of capture groups. 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.
 </P>
 <P>
-In PCRE2, a capturing subpattern can be named in one of three ways:
-(?&#60;name&#62;...) or (?'name'...) as in Perl, or (?P&#60;name&#62;...) as in Python. Names
-consist of up to 32 alphanumeric characters and underscores, but must start
-with a non-digit. References to capturing parentheses from other parts of the
-pattern, such as
+In PCRE2, a capture group can be named in one of three ways: (?&#60;name&#62;...) or
+(?'name'...) as in Perl, or (?P&#60;name&#62;...) as in Python. Names may be up to 32
+code units long. When PCRE2_UTF is not set, they may contain only ASCII
+alphanumeric characters and underscores, but must start with a non-digit. When
+PCRE2_UTF is set, the syntax of group names is extended to allow any Unicode
+letter or Unicode decimal digit. In other words, group names must match one of
+these patterns:
+<pre>
+  ^[_A-Za-z][_A-Za-z0-9]*\z   when PCRE2_UTF is not set
+  ^[_\p{L}][_\p{L}\p{Nd}]*\z  when PCRE2_UTF is set
+</pre>
+References to capture groups from other parts of the pattern, such as
 <a href="#backreferences">backreferences,</a>
 <a href="#recursion">recursion,</a>
 and
@@ -1835,18 +1864,18 @@ and
 can all be made by name as well as by number.
 </P>
 <P>
-Named capturing parentheses are allocated numbers as well as names, exactly as
-if the names were not present. In both PCRE2 and Perl, capturing subpatterns
+Named capture groups are allocated numbers as well as names, exactly as
+if the names were not present. In both PCRE2 and Perl, capture groups
 are primarily identified by numbers; any names are just aliases for these
 numbers. The PCRE2 API provides function calls for extracting the complete
 name-to-number translation table from a compiled pattern, as well as
 convenience functions for extracting captured substrings by name.
 </P>
 <P>
-<b>Warning:</b> When more than one subpattern has the same number, as described
-in the previous section, a name given to one of them applies to all of them.
-Perl allows identically numbered subpatterns to have different names. Consider
-this pattern, where there are two capturing subpatterns, both numbered 1:
+<b>Warning:</b> When more than one capture group has the same number, as
+described in the previous section, a name given to one of them applies to all
+of them. Perl allows identically numbered groups to have different names.
+Consider this pattern, where there are two capture groups, both numbered 1:
 <pre>
   (?|(?&#60;AA&#62;aa)|(?&#60;BB&#62;bb))
 </pre>
@@ -1861,21 +1890,21 @@ pattern:
 <pre>
   (?|(?&#60;AA&#62;aa)|(bb))
 </pre>
-Although the second subpattern number 1 is not explicitly named, the name AA is
-still an alias for subpattern 1. Whether the pattern matches "aa" or "bb", a
+Although the second group number 1 is not explicitly named, the name AA is
+still an alias for any group 1. Whether the pattern matches "aa" or "bb", a
 reference by name to group AA yields the matched string.
 </P>
 <P>
 By default, a name must be unique within a pattern, except that duplicate names
-are permitted for subpatterns with the same number, for example:
+are permitted for groups with the same number, for example:
 <pre>
   (?|(?&#60;AA&#62;aa)|(?&#60;AA&#62;bb))
 </pre>
 The duplicate name constraint can be disabled by setting the PCRE2_DUPNAMES
 option at compile time, or by the use of (?J) within the pattern. 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
+names can be useful for patterns where only one instance of the named capture
+group 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:
 <pre>
   (?&#60;DN&#62;Mon|Fri|Sun)(?:day)?|
@@ -1884,26 +1913,26 @@ extract the abbreviation. This pattern (ignoring the line breaks) does the job:
   (?&#60;DN&#62;Thu)(?:rsday)?|
   (?&#60;DN&#62;Sat)(?:urday)?
 </pre>
-There are five capturing substrings, but only one is ever set after a match.
-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. (An
-alternative way of solving this problem is to use a "branch reset" subpattern,
-as described in the previous section.)
+There are five capture groups, but only one is ever set after a match. The
+convenience functions for extracting the data by name returns the substring for
+the first (and in this example, the only) group of that name that matched. This
+saves searching to find which numbered group it was. (An alternative way of
+solving this problem is to use a "branch reset" group, as described in the
+previous section.)
 </P>
 <P>
-If you make a backreference 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 pattern matches both "foofoo" and
-"barbar" but not "foobar" or "barfoo":
+If you make a backreference to a non-unique named group from elsewhere in the
+pattern, the groups 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 pattern matches both "foofoo" and "barbar" but not
+"foobar" or "barfoo":
 <pre>
   (?:(?&#60;n&#62;foo)|(?&#60;n&#62;bar))\k&#60;n&#62;
 
 </PRE>
 </P>
 <P>
-If you make a subroutine call to a non-unique named subpattern, the one that
+If you make a subroutine call to a non-unique named group, the one that
 corresponds to the first occurrence of the name is used. In the absence of
 duplicate numbers this is the one with the lowest number.
 </P>
@@ -1911,11 +1940,11 @@ duplicate numbers this is the one with the lowest number.
 If you use a named reference in a condition
 test (see the
 <a href="#conditions">section about conditions</a>
-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
+below), either to check whether a capture group has matched, or to check for
+recursion, all groups 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
+capture groups, see the
 <a href="pcre2api.html"><b>pcre2api</b></a>
 documentation.
 </P>
@@ -1927,18 +1956,18 @@ items:
   a literal data character
   the dot metacharacter
   the \C escape sequence
-  the \X escape sequence
   the \R escape sequence
+  the \X escape sequence
   an escape such as \d or \pL that matches a single character
   a character class
   a backreference
-  a parenthesized subpattern (including most assertions)
-  a subroutine call to a subpattern (recursive or otherwise)
+  a parenthesized group (including most assertions)
+  a subroutine call (recursive or otherwise)
 </pre>
 The general repetition quantifier specifies a minimum and maximum number 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:
+be less than or equal to the second. For example,
 <pre>
   z{2,4}
 </pre>
@@ -1968,12 +1997,12 @@ several code units long (and they may be of different lengths).
 <P>
 The quantifier {0} is permitted, causing the expression to behave as if the
 previous item and the quantifier were not present. This may be useful for
-subpatterns that are referenced as
-<a href="#subpatternsassubroutines">subroutines</a>
+capture groups that are referenced as
+<a href="#groupsassubroutines">subroutines</a>
 from elsewhere in the pattern (but see also the section entitled
-<a href="#subdefine">"Defining subpatterns for use by reference only"</a>
-below). Items other than subpatterns that have a {0} quantifier are omitted
-from the compiled pattern.
+<a href="#subdefine">"Defining capture groups for use by reference only"</a>
+below). Except for parenthesized groups, items that have a {0} quantifier are
+omitted from the compiled pattern.
 </P>
 <P>
 For convenience, the three most common quantifiers have single-character
@@ -1983,23 +2012,25 @@ abbreviations:
   +    is equivalent to {1,}
   ?    is equivalent to {0,1}
 </pre>
-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:
+It is possible to construct infinite loops by following a group that can match
+no characters with a quantifier that has no upper limit, for example:
 <pre>
   (a?)*
 </pre>
 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 broken.
+patterns are now accepted, but whenever an iteration of such a group matches no
+characters, matching moves on to the next item in the pattern instead of
+repeatedly matching an empty string. This does not prevent backtracking into
+any of the iterations if a subsequent item fails to match.
 </P>
 <P>
-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
+By default, 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
 <pre>
   /\*.*\*/
 </pre>
@@ -2008,11 +2039,9 @@ to the string
   /* first comment */  not comment  /* second comment */
 </pre>
 fails, because it matches the entire string owing to the greediness of the .*
-item.
-</P>
-<P>
-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 pattern
+item. However, 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
+pattern
 <pre>
   /\*.*?\*/
 </pre>
@@ -2033,7 +2062,7 @@ greedy by following them with a question mark. In other words, it inverts the
 default behaviour.
 </P>
 <P>
-When a parenthesized subpattern is quantified with a minimum repeat count that
+When a parenthesized group 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.
 </P>
@@ -2073,15 +2102,14 @@ It matches "ab" in the subject "aab". The use of the backtracking control verbs
 PCRE2_NO_DOTSTAR_ANCHOR, to do so explicitly.
 </P>
 <P>
-When a capturing subpattern is repeated, the value captured is the substring
-that matched the final iteration. For example, after
+When a capture group is repeated, the value captured is the substring that
+matched the final iteration. For example, after
 <pre>
   (tweedle[dume]{3}\s*)+
 </pre>
 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 iterations. For
-example, after
+"tweedledee". However, if there are nested capture groups, the corresponding
+captured values may have been set in previous iterations. For example, after
 <pre>
   (a|(b))+
 </pre>
@@ -2105,7 +2133,7 @@ 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.
+that once a group has matched, it is not to be re-evaluated in this way.
 </P>
 <P>
 If we use atomic grouping for the previous example, the matcher gives up
@@ -2114,26 +2142,31 @@ special parenthesis, starting with (?&#62; as in this example:
 <pre>
   (?&#62;\d+)foo
 </pre>
-This kind of parenthesis "locks up" the  part of the pattern it contains 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.
+Perl 5.28 introduced an experimental alphabetic form starting with (* which may
+be easier to remember:
+<pre>
+  (*atomic:\d+)foo
+</pre>
+This kind of parenthesized group "locks up" the  part of the pattern it
+contains 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.
 </P>
 <P>
-An alternative description is that a subpattern of this type matches exactly
-the string of characters that an identical standalone pattern would match, if
+An alternative description is that a group 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.
 </P>
 <P>
-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 prepared to adjust the
-number of digits they match in order to make the rest of the pattern match,
-(?&#62;\d+) can only match an entire sequence of digits.
+Atomic groups are not capture groups. 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 prepared to adjust the number of digits they
+match in order to make the rest of the pattern match, (?&#62;\d+) can only match
+an entire sequence of digits.
 </P>
 <P>
 Atomic groups in general can of course contain arbitrarily complicated
-subpatterns, and can be nested. However, when the subpattern for an atomic
+expressions, and can be nested. However, when the contents of 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
@@ -2156,8 +2189,8 @@ difference; possessive quantifiers should be slightly faster.
 The possessive quantifier syntax is an extension to the Perl 5.8 syntax.
 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.
+package, and PCRE1 copied it from there. It found its way into Perl at release
+5.10.
 </P>
 <P>
 PCRE2 has an optimization that automatically "possessifies" certain simple
@@ -2167,10 +2200,9 @@ This feature can be disabled by the PCRE2_NO_AUTOPOSSESS option, or starting
 the pattern with (*NO_AUTO_POSSESS).
 </P>
 <P>
-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
+When a pattern contains an unlimited repeat inside a group 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
 <pre>
   (\D+|&#60;\d+&#62;)*[!?]
 </pre>
@@ -2196,28 +2228,27 @@ sequences of non-digits cannot be broken, and failure happens quickly.
 <br><a name="SEC19" href="#TOC1">BACKREFERENCES</a><br>
 <P>
 Outside a character class, a backslash followed by a digit greater than 0 (and
-possibly further digits) is a backreference to a capturing subpattern earlier
-(that is, to its left) in the pattern, provided there have been that many
-previous capturing left parentheses.
+possibly further digits) is a backreference to a capture group earlier (that
+is, to its left) in the pattern, provided there have been that many previous
+capture groups.
 </P>
 <P>
 However, if the decimal number following the backslash is less than 8, it is
-always taken as a backreference, and causes an error only if there are not
-that many capturing left parentheses in the entire pattern. In other words, the
-parentheses that are referenced need not be to the left of the reference for
-numbers less than 8. A "forward backreference" of this type can make sense
-when a repetition is involved and the subpattern to the right has participated
-in an earlier iteration.
+always taken as a backreference, and causes an error only if there are not that
+many capture groups in the entire pattern. In other words, the group that is
+referenced need not be to the left of the reference for numbers less than 8. A
+"forward backreference" of this type can make sense when a repetition is
+involved and the group to the right has participated in an earlier iteration.
 </P>
 <P>
-It is not possible to have a numerical "forward backreference" to a subpattern
-whose number is 8 or more using this syntax because a sequence such as \50 is
+It is not possible to have a numerical "forward backreference" to a group 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"
 <a href="#digitsafterbackslash">above</a>
-for further details of the handling of digits following a backslash. There is
-no such problem when named parentheses are used. A backreference to any
-subpattern is possible using named parentheses (see below).
+for further details of the handling of digits following a backslash. Other
+forms of backreferencing do not suffer from this restriction. In particular,
+there is no problem when named capture groups are used (see below).
 </P>
 <P>
 Another way of avoiding the ambiguity inherent in the use of digits following a
@@ -2235,22 +2266,22 @@ the reference. A signed number is a relative reference. Consider this example:
 <pre>
   (abc(def)ghi)\g{-1}
 </pre>
-The sequence \g{-1} is a reference to the most recently started capturing
-subpattern before \g, that is, is it equivalent to \2 in this example.
-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.
+The sequence \g{-1} is a reference to the most recently started capture group
+before \g, that is, is it equivalent to \2 in this example. 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.
 </P>
 <P>
-The sequence \g{+1} is a reference to the next capturing subpattern. This kind
-of forward reference can be useful it patterns that repeat. Perl does not
-support the use of + in this way.
+The sequence \g{+1} is a reference to the next capture group. This kind of
+forward reference can be useful in patterns that repeat. Perl does not support
+the use of + in this way.
 </P>
 <P>
-A backreference matches whatever actually matched the capturing subpattern in
-the current subject string, rather than anything matching the subpattern
-itself (see
-<a href="#subpatternsassubroutines">"Subpatterns as subroutines"</a>
+A backreference matches whatever actually most recently matched the capture
+group in the current subject string, rather than anything at all that matches
+the group (see
+<a href="#groupsassubroutines">"Groups as subroutines"</a>
 below for a way of doing that). So the pattern
 <pre>
   (sens|respons)e and \1ibility
@@ -2262,28 +2293,28 @@ backreference, the case of letters is relevant. For example,
   ((?i)rah)\s+\1
 </pre>
 matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original
-capturing subpattern is matched caselessly.
+capture group is matched caselessly.
 </P>
 <P>
-There are several different ways of writing backreferences to named
-subpatterns. The .NET syntax \k{name} and the Perl syntax \k&#60;name&#62; or
-\k'name' are supported, as is the Python syntax (?P=name). Perl 5.10's unified
+There are several different ways of writing backreferences to named capture
+groups. The .NET syntax \k{name} and the Perl syntax \k&#60;name&#62; or \k'name'
+are supported, as is the Python syntax (?P=name). Perl 5.10's unified
 backreference 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:
+references, is also supported. We could rewrite the above example in any of the
+following ways:
 <pre>
   (?&#60;p1&#62;(?i)rah)\s+\k&#60;p1&#62;
   (?'p1'(?i)rah)\s+\k{p1}
   (?P&#60;p1&#62;(?i)rah)\s+(?P=p1)
   (?&#60;p1&#62;(?i)rah)\s+\g{p1}
 </pre>
-A subpattern that is referenced by name may appear in the pattern before or
+A capture group that is referenced by name may appear in the pattern before or
 after the reference.
 </P>
 <P>
-There may be more than one backreference to the same subpattern. If a
-subpattern has not actually been used in a particular match, any backreferences
-to it always fail by default. For example, the pattern
+There may be more than one backreference to the same group. If a group has not
+actually been used in a particular match, backreferences to it always fail by
+default. For example, the pattern
 <pre>
   (a|(bc))\2
 </pre>
@@ -2292,12 +2323,11 @@ PCRE2_MATCH_UNSET_BACKREF option is set at compile time, a backreference to an
 unset value matches an empty string.
 </P>
 <P>
-Because there may be many capturing parentheses in a pattern, all digits
-following a backslash are taken as part of a potential backreference number.
-If the pattern continues with a digit character, some delimiter must be used to
-terminate the backreference. If the PCRE2_EXTENDED or PCRE2_EXTENDED_MORE
-option is set, this can be white space. Otherwise, the \g{ syntax or an empty
-comment (see
+Because there may be many capture groups in a pattern, all digits following a
+backslash are taken as part of a potential backreference number. If the pattern
+continues with a digit character, some delimiter must be used to terminate the
+backreference. If the PCRE2_EXTENDED or PCRE2_EXTENDED_MORE option is set, this
+can be white space. Otherwise, the \g{} syntax or an empty comment (see
 <a href="#comments">"Comments"</a>
 below) can be used.
 </P>
@@ -2305,19 +2335,18 @@ below) can be used.
 Recursive backreferences
 </b><br>
 <P>
-A backreference 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 subpatterns. For
-example, the pattern
+A backreference that occurs inside the group to which it refers fails when the
+group is first used, so, for example, (a\1) never matches. However, such
+references can be useful inside repeated groups. For example, the pattern
 <pre>
   (a|b\1)+
 </pre>
 matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of
-the subpattern, the backreference 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 backreference. This can be
-done using alternation, as in the example above, or by a quantifier with a
-minimum of zero.
+the group, the backreference 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 backreference. This can be done
+using alternation, as in the example above, or by a quantifier with a minimum
+of zero.
 </P>
 <P>
 Backreferences of this type cause the group that they reference to be treated
@@ -2334,26 +2363,40 @@ coded as \b, \B, \A, \G, \Z, \z, ^ and $ are described
 <a href="#smallassertions">above.</a>
 </P>
 <P>
-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, and in each case an assertion may be positive (must
-succeed for matching to continue) or negative (must not succeed for matching to
-continue). An assertion subpattern is matched in the normal way, except that,
-when matching continues after a successful assertion, the matching position in
-the subject string is as it was before the assertion was processed.
+More complicated assertions are coded as parenthesized groups. There are two
+kinds: those that look ahead of the current position in the subject string, and
+those that look behind it, and in each case an assertion may be positive (must
+match for the assertion to be true) or negative (must not match for the
+assertion to be true). An assertion group is matched in the normal way,
+and if it is true, matching continues after it, but with the matching position
+in the subject string reset to what it was before the assertion was processed.
+</P>
+<P>
+The Perl-compatible lookaround assertions are atomic. If an assertion is true,
+but there is a subsequent matching failure, there is no backtracking into the
+assertion. However, there are some cases where non-atomic assertions can be
+useful. PCRE2 has some support for these, described in the section entitled
+<a href="#nonatomicassertions">"Non-atomic assertions"</a>
+below, but they are not Perl-compatible.
+</P>
+<P>
+A lookaround assertion may appear as the condition in a
+<a href="#conditions">conditional group</a>
+(see below). In this case, the result of matching the assertion determines
+which branch of the condition is followed.
 </P>
 <P>
-Assertion subpatterns are not capturing subpatterns. If an assertion contains
-capturing subpatterns within it, these are counted for the purposes of
-numbering the capturing subpatterns in the whole pattern. Within each branch of
-an assertion, locally captured substrings may be referenced in the usual way.
-For example, a sequence such as (.)\g{-1} can be used to check that two
-adjacent characters are the same.
+Assertion groups are not capture groups. If an assertion contains capture
+groups within it, these are counted for the purposes of numbering the capture
+groups in the whole pattern. Within each branch of an assertion, locally
+captured substrings may be referenced in the usual way. For example, a sequence
+such as (.)\g{-1} can be used to check that two adjacent characters are the
+same.
 </P>
 <P>
 When a branch within an assertion fails to match, any substrings that were
 captured are discarded (as happens with any pattern branch that fails to
-match). A negative assertion succeeds only when all its branches fail to match;
+match). A negative assertion is true only when all its branches fail to match;
 this means that no captured substrings are ever retained after a successful
 negative assertion. When an assertion contains a matching branch, what happens
 depends on the type of assertion.
@@ -2362,25 +2405,25 @@ depends on the type of assertion.
 For a positive assertion, internally captured substrings in the successful
 branch are retained, and matching continues with the next pattern item after
 the assertion. For a negative assertion, a matching branch means that the
-assertion has failed. If the assertion is being used as a condition in a
-<a href="#conditions">conditional subpattern</a>
+assertion is not true. If such an assertion is being used as a condition in a
+<a href="#conditions">conditional group</a>
 (see below), captured substrings are retained, because matching continues with
 the "no" branch of the condition. For other failing negative assertions,
 control passes to the previous backtracking point, thus discarding any captured
 strings within the assertion.
 </P>
 <P>
-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 conditional subpattern may not be quantified. In
-practice, for other assertions, there only three cases:
+For compatibility with Perl, most assertion groups may be repeated; though it
+makes no sense to assert the same thing several times, the side effect of
+capturing may occasionally be useful. However, an assertion that forms the
+condition for a conditional group may not be quantified. In practice, for
+other assertions, there only three cases:
 <br>
 <br>
 (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
-<a href="#subpatternsassubroutines">subroutine mechanism.</a>
+However, it may contain internal capture groups that are called from elsewhere
+via the
+<a href="#groupsassubroutines">subroutine mechanism.</a>
 <br>
 <br>
 (2) If quantifier is {0,n} where n is greater than zero, it is treated as if it
@@ -2392,6 +2435,25 @@ without the assertion, the order depending on the greediness of the quantifier.
 The assertion is obeyed just once when encountered during matching.
 </P>
 <br><b>
+Alphabetic assertion names
+</b><br>
+<P>
+Traditionally, symbolic sequences such as (?= and (?&#60;= have been used to
+specify lookaround assertions. Perl 5.28 introduced some experimental
+alphabetic alternatives which might be easier to remember. They all start with
+(* instead of (? and must be written using lower case letters. PCRE2 supports
+the following synonyms:
+<pre>
+  (*positive_lookahead:  or (*pla: is the same as (?=
+  (*negative_lookahead:  or (*nla: is the same as (?!
+  (*positive_lookbehind: or (*plb: is the same as (?&#60;=
+  (*negative_lookbehind: or (*nlb: is the same as (?&#60;!
+</pre>
+For example, (*pla:foo) is the same assertion as (?=foo). In the following
+sections, the various assertions are described using the original symbolic
+forms.
+</P>
+<br><b>
 Lookahead assertions
 </b><br>
 <P>
@@ -2473,9 +2535,9 @@ because it makes it impossible to calculate the length of the lookbehind. The
 permitted in lookbehinds.
 </P>
 <P>
-<a href="#subpatternsassubroutines">"Subroutine"</a>
+<a href="#groupsassubroutines">"Subroutine"</a>
 calls (see below) such as (?2) or (?&X) are permitted in lookbehinds, as long
-as the subpattern matches a fixed-length string. However,
+as the called capture group matches a fixed-length string. However,
 <a href="#recursion">recursion,</a>
 that is, a "subroutine" call into a group that is already active,
 is not supported.
@@ -2484,10 +2546,10 @@ is not supported.
 Perl does not support backreferences in lookbehinds. PCRE2 does support them,
 but only if certain conditions are met. The PCRE2_MATCH_UNSET_BACKREF option
 must not be set, there must be no use of (?| in the pattern (it creates
-duplicate subpattern numbers), and if the backreference is by name, the name
-must be unique. Of course, the referenced subpattern must itself be of fixed
-length. The following pattern matches words containing at least two characters
-that begin and end with the same character:
+duplicate group numbers), and if the backreference is by name, the name
+must be unique. Of course, the referenced group must itself match a fixed
+length substring. The following pattern matches words containing at least two
+characters that begin and end with the same character:
 <pre>
    \b(\w)\w++(?&#60;=\1)
 </PRE>
@@ -2553,13 +2615,130 @@ preceded by "foo", while
 </pre>
 is another pattern that matches "foo" preceded by three digits and any three
 characters that are not "999".
+<a name="nonatomicassertions"></a></P>
+<br><a name="SEC21" href="#TOC1">NON-ATOMIC ASSERTIONS</a><br>
+<P>
+The traditional Perl-compatible lookaround assertions are atomic. That is, if
+an assertion is true, but there is a subsequent matching failure, there is no
+backtracking into the assertion. However, there are some cases where non-atomic
+positive assertions can be useful. PCRE2 provides these using the following
+syntax:
+<pre>
+  (*non_atomic_positive_lookahead:  or (*napla:
+  (*non_atomic_positive_lookbehind: or (*naplb:
+</pre>
+Consider the problem of finding the right-most word in a string that also
+appears earlier in the string, that is, it must appear at least twice in total.
+This pattern returns the required result as captured substring 1:
+<pre>
+  ^(?x)(*napla: .* \b(\w++)) (?&#62; .*? \b\1\b ){2}
+</pre>
+For a subject such as "word1 word2 word3 word2 word3 word4" the result is
+"word3". How does it work? At the start, ^(?x) anchors the pattern and sets the
+"x" option, which causes white space (introduced for readability) to be
+ignored. Inside the assertion, the greedy .* at first consumes the entire
+string, but then has to backtrack until the rest of the assertion can match a
+word, which is captured by group 1. In other words, when the assertion first
+succeeds, it captures the right-most word in the string.
+</P>
+<P>
+The current matching point is then reset to the start of the subject, and the
+rest of the pattern match checks for two occurrences of the captured word,
+using an ungreedy .*? to scan from the left. If this succeeds, we are done, but
+if the last word in the string does not occur twice, this part of the pattern
+fails. If a traditional atomic lookhead (?= or (*pla: had been used, the
+assertion could not be re-entered, and the whole match would fail. The pattern
+would succeed only if the very last word in the subject was found twice.
+</P>
+<P>
+Using a non-atomic lookahead, however, means that when the last word does not
+occur twice in the string, the lookahead can backtrack and find the second-last
+word, and so on, until either the match succeeds, or all words have been
+tested.
+</P>
+<P>
+Two conditions must be met for a non-atomic assertion to be useful: the
+contents of one or more capturing groups must change after a backtrack into the
+assertion, and there must be a backreference to a changed group later in the
+pattern. If this is not the case, the rest of the pattern match fails exactly
+as before because nothing has changed, so using a non-atomic assertion just
+wastes resources.
+</P>
+<P>
+Non-atomic assertions are not supported by the alternative matching function
+<b>pcre2_dfa_match()</b>. They are also not supported by JIT (but may be in
+future). Note that assertions that appear as conditions for
+<a href="#conditions">conditional groups</a>
+(see below) must be atomic.
+</P>
+<br><a name="SEC22" href="#TOC1">SCRIPT RUNS</a><br>
+<P>
+In concept, a script run is a sequence of characters that are all from the same
+Unicode script such as Latin or Greek. However, because some scripts are
+commonly used together, and because some diacritical and other marks are used
+with multiple scripts, it is not that simple. There is a full description of
+the rules that PCRE2 uses in the section entitled
+<a href="pcre2unicode.html#scriptruns">"Script Runs"</a>
+in the
+<a href="pcre2unicode.html"><b>pcre2unicode</b></a>
+documentation.
+</P>
+<P>
+If part of a pattern is enclosed between (*script_run: or (*sr: and a closing
+parenthesis, it fails if the sequence of characters that it matches are not a
+script run. After a failure, normal backtracking occurs. Script runs can be
+used to detect spoofing attacks using characters that look the same, but are
+from different scripts. The string "paypal.com" is an infamous example, where
+the letters could be a mixture of Latin and Cyrillic. This pattern ensures that
+the matched characters in a sequence of non-spaces that follow white space are
+a script run:
+<pre>
+  \s+(*sr:\S+)
+</pre>
+To be sure that they are all from the Latin script (for example), a lookahead
+can be used:
+<pre>
+  \s+(?=\p{Latin})(*sr:\S+)
+</pre>
+This works as long as the first character is expected to be a character in that
+script, and not (for example) punctuation, which is allowed with any script. If
+this is not the case, a more creative lookahead is needed. For example, if
+digits, underscore, and dots are permitted at the start:
+<pre>
+  \s+(?=[0-9_.]*\p{Latin})(*sr:\S+)
+
+</PRE>
+</P>
+<P>
+In many cases, backtracking into a script run pattern fragment is not
+desirable. The script run can employ an atomic group to prevent this. Because
+this is a common requirement, a shorthand notation is provided by
+(*atomic_script_run: or (*asr:
+<pre>
+  (*asr:...) is the same as (*sr:(?&#62;...))
+</pre>
+Note that the atomic group is inside the script run. Putting it outside would
+not prevent backtracking into the script run pattern.
+</P>
+<P>
+Support for script runs is not available if PCRE2 is compiled without Unicode
+support. A compile-time error is given if any of the above constructs is
+encountered. Script runs are not supported by the alternate matching function,
+<b>pcre2_dfa_match()</b> because they use the same mechanism as capturing
+parentheses.
+</P>
+<P>
+<b>Warning:</b> The (*ACCEPT) control verb
+<a href="#acceptverb">(see below)</a>
+should not be used within a script run group, because it causes an immediate
+exit from the group, bypassing the script run checking.
 <a name="conditions"></a></P>
-<br><a name="SEC21" href="#TOC1">CONDITIONAL SUBPATTERNS</a><br>
+<br><a name="SEC23" href="#TOC1">CONDITIONAL GROUPS</a><br>
 <P>
-It is possible to cause the matching process to obey a subpattern
-conditionally or to choose between two alternative subpatterns, depending on
-the result of an assertion, or whether a specific capturing subpattern has
-already been matched. The two possible forms of conditional subpattern are:
+It is possible to cause the matching process to obey a pattern fragment
+conditionally or to choose between two alternative fragments, depending on
+the result of an assertion, or whether a specific capture group has
+already been matched. The two possible forms of conditional group are:
 <pre>
   (?(condition)yes-pattern)
   (?(condition)yes-pattern|no-pattern)
@@ -2567,36 +2746,34 @@ already been matched. The two possible forms of conditional subpattern are:
 If the condition is satisfied, the yes-pattern is used; otherwise the
 no-pattern (if present) is used. An absent no-pattern is equivalent to an empty
 string (it always matches). If there are more than two alternatives in the
-subpattern, a compile-time error occurs. Each of the two alternatives may
-itself contain nested subpatterns of any form, including 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:
+group, a compile-time error occurs. Each of the two alternatives may itself
+contain nested groups of any form, including conditional groups; the
+restriction to two alternatives applies only at the level of the condition
+itself. This pattern fragment is an example where the alternatives are complex:
 <pre>
   (?(1) (A|B|C) | (D | (?(2)E|F) | E) )
 
 </PRE>
 </P>
 <P>
-There are five kinds of condition: references to subpatterns, references to
+There are five kinds of condition: references to capture groups, references to
 recursion, two pseudo-conditions called DEFINE and VERSION, and assertions.
 </P>
 <br><b>
-Checking for a used subpattern by number
+Checking for a used capture group by number
 </b><br>
 <P>
 If the text between the parentheses consists of a sequence of digits, the
-condition is true if a capturing subpattern of that number has previously
-matched. If there is more than one capturing subpattern with the same number
-(see the earlier
-<a href="#recursion">section about duplicate subpattern numbers),</a>
+condition is true if a capture group of that number has previously matched. If
+there is more than one capture group with the same number (see the earlier
+<a href="#recursion">section about duplicate group numbers),</a>
 the condition is true if any of them have matched. An alternative 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.)
+to precede the digits with a plus or minus sign. In this case, the group number
+is relative rather than absolute. The most recently opened capture group 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 capture group
+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.)
 </P>
 <P>
 Consider the following pattern, which contains non-significant white space to
@@ -2608,12 +2785,12 @@ three parts for ease of discussion:
 The first part matches an optional opening parenthesis, and if that
 character is present, sets it as the first captured substring. The second 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,
+conditional group that tests whether or not the first capture group
+matched. If it 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. Otherwise, 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.
+conditional group matches nothing. In other words, this pattern matches a
+sequence of non-parentheses, optionally enclosed in parentheses.
 </P>
 <P>
 If you were embedding this pattern in a larger one, you could use a relative
@@ -2624,22 +2801,20 @@ reference:
 This makes the fragment independent of the parentheses in the larger pattern.
 </P>
 <br><b>
-Checking for a used subpattern by name
+Checking for a used capture group by name
 </b><br>
 <P>
 Perl uses the syntax (?(&#60;name&#62;)...) 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. Note,
-however, that undelimited names consisting of the letter R followed by digits
-are ambiguous (see the following section).
-</P>
-<P>
-Rewriting the above example to use a named subpattern gives this:
+capture group by name. For compatibility with earlier versions of PCRE1, which
+had this facility before Perl, the syntax (?(name)...) is also recognized.
+Note, however, that undelimited names consisting of the letter R followed by
+digits are ambiguous (see the following section). Rewriting the above example
+to use a named group gives this:
 <pre>
   (?&#60;OPEN&#62; \( )?    [^()]+    (?(&#60;OPEN&#62;) \) )
 </pre>
 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
+applied to all groups of the same name, and is true if any one of them has
 matched.
 </P>
 <br><b>
@@ -2651,20 +2826,20 @@ the pattern to another, whether or not it is actually recursive. See the
 sections entitled
 <a href="#recursion">"Recursive patterns"</a>
 and
-<a href="#subpatternsassubroutines">"Subpatterns as subroutines"</a>
-below for details of recursion and subpattern calls.
+<a href="#groupsassubroutines">"Groups as subroutines"</a>
+below for details of recursion and subroutine calls.
 </P>
 <P>
-If a condition is the string (R), and there is no subpattern with the name R,
-the condition is true if matching is currently in a recursion or subroutine
-call to the whole pattern or any subpattern. If digits follow the letter R, and
-there is no subpattern with that name, the condition is true if the most recent
-call is into a subpattern with the given number, which must exist somewhere in
-the overall pattern. This is a contrived example that is equivalent to a+b:
+If a condition is the string (R), and there is no capture group with the name
+R, the condition is true if matching is currently in a recursion or subroutine
+call to the whole pattern or any capture group. If digits follow the letter R,
+and there is no group with that name, the condition is true if the most recent
+call is into a group with the given number, which must exist somewhere in the
+overall pattern. This is a contrived example that is equivalent to a+b:
 <pre>
   ((?(R1)a+|(?1)b))
 </pre>
-However, in both cases, if there is a subpattern with a matching name, the
+However, in both cases, if there is a capture group with a matching name, the
 condition tests for its being set, as described in the section above, instead
 of testing for recursion. For example, creating a group with the name R1 by
 adding (?&#60;R1&#62;) to the above pattern completely changes its meaning.
@@ -2674,28 +2849,28 @@ If a name preceded by ampersand follows the letter R, for example:
 <pre>
   (?(R&name)...)
 </pre>
-the condition is true if the most recent recursion is into a subpattern of that
-name (which must exist within the pattern).
+the condition is true if the most recent recursion is into a group of that name
+(which must exist within the pattern).
 </P>
 <P>
 This condition does not check the entire recursion stack. It tests only the
 current level. 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
+test is applied to all groups of the same name, and is true if any one of
 them is the most recent recursion.
 </P>
 <P>
 At "top level", all these recursion test conditions are false.
 <a name="subdefine"></a></P>
 <br><b>
-Defining subpatterns for use by reference only
+Defining capture groups for use by reference only
 </b><br>
 <P>
 If the condition is the string (DEFINE), the condition is always false, even if
 there is a group with the name DEFINE. 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 referenced from elsewhere. (The use of
-<a href="#subpatternsassubroutines">subroutines</a>
+alternative in the rest of the conditional group. 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 referenced from elsewhere. (The use of
+<a href="#groupsassubroutines">subroutines</a>
 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):
@@ -2732,10 +2907,15 @@ than two digits.
 Assertion conditions
 </b><br>
 <P>
-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:
+If the condition is not in any of the above formats, it must be a parenthesized
+assertion. This may be a positive or negative lookahead or lookbehind
+assertion. However, it must be a traditional atomic assertion, not one of the
+PCRE2-specific
+<a href="#nonatomicassertions">non-atomic assertions.</a>
+</P>
+<P>
+Consider this pattern, again containing non-significant white space, and with
+the two alternatives on the second line:
 <pre>
   (?(?=[^a-z]*[a-z])
   \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} )
@@ -2748,18 +2928,18 @@ 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.
 </P>
 <P>
-When an assertion that is a condition contains capturing subpatterns, any
+When an assertion that is a condition contains capture groups, any
 capturing that occurs in a matching branch is retained afterwards, for both
 positive and negative assertions, because matching always continues after the
 assertion, whether it succeeds or fails. (Compare non-conditional assertions,
-when captures are retained only for positive assertions that succeed.)
+for which captures are retained only for positive assertions that succeed.)
 <a name="comments"></a></P>
-<br><a name="SEC22" href="#TOC1">COMMENTS</a><br>
+<br><a name="SEC24" href="#TOC1">COMMENTS</a><br>
 <P>
 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
+(?: or a group name or number. The characters that make up a comment play
 no part in the pattern matching.
 </P>
 <P>
@@ -2784,7 +2964,7 @@ 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.
 <a name="recursion"></a></P>
-<br><a name="SEC23" href="#TOC1">RECURSIVE PATTERNS</a><br>
+<br><a name="SEC25" href="#TOC1">RECURSIVE PATTERNS</a><br>
 <P>
 Consider the problem of matching a string in parentheses, allowing for
 unlimited nested parentheses. Without the use of recursion, the best that can
@@ -2806,14 +2986,14 @@ recursively to the pattern in which it appears.
 <P>
 Obviously, PCRE2 cannot support the interpolation of Perl code. Instead, it
 supports special syntax for recursion of the entire pattern, and also for
-individual subpattern recursion. After its introduction in PCRE1 and Python,
+individual capture group recursion. After its introduction in PCRE1 and Python,
 this kind of recursion was subsequently introduced into Perl at release 5.10.
 </P>
 <P>
 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
-<a href="#subpatternsassubroutines">non-recursive subroutine</a>
+closing parenthesis is a recursive subroutine call of the capture group of the
+given number, provided that it occurs inside that group. (If not, it is a
+<a href="#groupsassubroutines">non-recursive subroutine</a>
 call, which is described in the next section.) The special item (?R) or (?0) is
 a recursive call of the entire regular expression.
 </P>
@@ -2847,13 +3027,13 @@ 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
+<a href="#dupgroupnumber">duplicate capture group numbers</a>
+are in use, relative references refer to the earliest group 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)
+The first two capture 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
@@ -2861,10 +3041,10 @@ 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
+It is also possible to refer to subsequent capture groups, 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
-<a href="#subpatternsassubroutines">non-recursive subroutine</a>
+<a href="#groupsassubroutines">non-recursive subroutine</a>
 calls, as described in the next section.
 </P>
 <P>
@@ -2874,7 +3054,7 @@ rewrite the above example as follows:
 <pre>
   (?&#60;pn&#62; \( ( [^()]++ | (?&pn) )* \) )
 </pre>
-If there is more than one subpattern with the same name, the earliest one is
+If there is more than one group with the same name, the earliest one is
 used.
 </P>
 <P>
@@ -2900,9 +3080,9 @@ documentation). If the pattern above is matched against
   (ab(cd)ef)
 </pre>
 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 subpattern 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.
+the last value taken on at the top level. If a capture group 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.
 </P>
 <P>
 Do not confuse the (?R) item with the condition (R), which tests for recursion.
@@ -2912,9 +3092,9 @@ recursing), whereas any characters are permitted at the outer level.
 <pre>
   &#60; (?: (?(R) \d++  | [^&#60;&#62;]*+) | (?R)) * &#62;
 </pre>
-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.
+In this pattern, (?(R) is the start of a conditional group, with two different
+alternatives for the recursive and non-recursive cases. The (?R) item is the
+actual recursive call.
 <a name="recursiondifference"></a></P>
 <br><b>
 Differences in recursion processing between PCRE2 and Perl
@@ -2924,7 +3104,7 @@ Some former differences between PCRE2 and Perl no longer exist.
 </P>
 <P>
 Before release 10.30, recursion processing in PCRE2 differed from Perl in that
-a recursive subpattern call was always treated as an atomic group. That is,
+a recursive subroutine call was always treated as an atomic group. That is,
 once it had matched some of the subject string, it was never re-entered, even
 if it contained untried alternatives and there was a subsequent matching
 failure. (Historical note: PCRE implemented recursion before Perl did.)
@@ -2960,7 +3140,7 @@ Perl takes so long that you think it has gone into a loop.
 <P>
 Another way in which PCRE2 and Perl used to differ in their recursion
 processing is in the handling of captured values. Formerly in Perl, when a
-subpattern was called recursively or as a subpattern (see the next section), it
+group was called recursively or as a subroutine (see the next section), it
 had no access to any values that were captured outside the recursion, whereas
 in PCRE2 these values can be referenced. Consider this pattern:
 <pre>
@@ -2971,16 +3151,15 @@ the second group, when the backreference \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. This match used to fail in Perl, but in
 later versions (I tried 5.024) it now works.
-<a name="subpatternsassubroutines"></a></P>
-<br><a name="SEC24" href="#TOC1">SUBPATTERNS AS SUBROUTINES</a><br>
+<a name="groupsassubroutines"></a></P>
+<br><a name="SEC26" href="#TOC1">GROUPS AS SUBROUTINES</a><br>
 <P>
-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 a bit
-like a subroutine in a programming language. More accurately, PCRE2 treats the
-referenced subpattern as an independent subpattern which it tries to match at
-the current matching position. The called subpattern may be defined before or
-after the reference. A numbered reference can be absolute or relative, as in
-these examples:
+If the syntax for a recursive group call (either by number or by name) is used
+outside the parentheses to which it refers, it operates a bit like a subroutine
+in a programming language. More accurately, PCRE2 treats the referenced group
+as an independent subpattern which it tries to match at the current matching
+position. The called group may be defined before or after the reference. A
+numbered reference can be absolute or relative, as in these examples:
 <pre>
   (...(absolute)...)...(?2)...
   (...(relative)...)...(?-1)...
@@ -3005,28 +3184,28 @@ occur. However, any capturing parentheses that are set during the subroutine
 call revert to their previous values afterwards.
 </P>
 <P>
-Processing options such as case-independence are fixed when a subpattern is
+Processing options such as case-independence are fixed when a group is
 defined, so if it is used as a subroutine, such options cannot be changed for
 different calls. For example, consider this pattern:
 <pre>
   (abc)(?i:(?-1))
 </pre>
 It matches "abcabc". It does not match "abcABC" because the change of
-processing option does not affect the called subpattern.
+processing option does not affect the called group.
 </P>
 <P>
 The behaviour of
 <a href="#backtrackcontrol">backtracking control verbs</a>
-in subpatterns when called as subroutines is described in the section entitled
+in groups when called as subroutines is described in the section entitled
 <a href="#btsub">"Backtracking verbs in subroutines"</a>
 below.
 <a name="onigurumasubroutines"></a></P>
-<br><a name="SEC25" href="#TOC1">ONIGURUMA SUBROUTINE SYNTAX</a><br>
+<br><a name="SEC27" href="#TOC1">ONIGURUMA SUBROUTINE SYNTAX</a><br>
 <P>
 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, rewritten using this syntax:
+syntax for calling a group as a subroutine, possibly recursively. Here are two
+of the examples used above, rewritten using this syntax:
 <pre>
   (?&#60;pn&#62; \( ( (?&#62;[^()]+) | \g&#60;pn&#62; )* \) )
   (sens|respons)e and \g'1'ibility
@@ -3039,7 +3218,7 @@ plus or a minus sign it is taken as a relative reference. For example:
 Note that \g{...} (Perl syntax) and \g&#60;...&#62; (Oniguruma syntax) are <i>not</i>
 synonymous. The former is a backreference; the latter is a subroutine call.
 </P>
-<br><a name="SEC26" href="#TOC1">CALLOUTS</a><br>
+<br><a name="SEC28" href="#TOC1">CALLOUTS</a><br>
 <P>
 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
@@ -3115,12 +3294,13 @@ example:
 </pre>
 The doubling is removed before the string is passed to the callout function.
 <a name="backtrackcontrol"></a></P>
-<br><a name="SEC27" href="#TOC1">BACKTRACKING CONTROL</a><br>
+<br><a name="SEC29" href="#TOC1">BACKTRACKING CONTROL</a><br>
 <P>
 There are a number of special "Backtracking Control Verbs" (to use Perl's
 terminology) that modify the behaviour of backtracking during matching. 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.
+and may behave differently depending on whether or not a name argument is
+present. The names are not required to be unique within the pattern.
 </P>
 <P>
 By default, for compatibility with Perl, a name is any sequence of characters
@@ -3148,7 +3328,8 @@ PCRE2_ALT_VERBNAMES is also set.
 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.
+not there. Any number of these verbs may occur in a pattern. Except for
+(*ACCEPT), they may not be quantified.
 </P>
 <P>
 Since these verbs are specifically related to backtracking, most of them can be
@@ -3162,7 +3343,7 @@ The behaviour of these verbs in
 <a href="#btrepeat">repeated groups,</a>
 <a href="#btassert">assertions,</a>
 and in
-<a href="#btsub">subpatterns called as subroutines</a>
+<a href="#btsub">capture groups called as subroutines</a>
 (whether or not recursively) is documented below.
 <a name="nooptimize"></a></P>
 <br><b>
@@ -3186,7 +3367,7 @@ documentation.
 <P>
 Experiments with Perl suggest that it too has similar optimizations, and like
 PCRE2, turning them off can change the result of a match.
-</P>
+<a name="acceptverb"></a></P>
 <br><b>
 Verbs that act immediately
 </b><br>
@@ -3196,8 +3377,8 @@ The following verbs act as soon as they are encountered.
    (*ACCEPT) or (*ACCEPT:NAME)
 </pre>
 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
+pattern. However, when it is inside a capture group that is called as a
+subroutine, only that group is ended successfully. Matching then continues
 at the outer level. If (*ACCEPT) in triggered in a positive assertion, the
 assertion succeeds; in a negative assertion, the assertion fails.
 </P>
@@ -3209,6 +3390,23 @@ example:
 </pre>
 This matches "AB", "AAD", or "ACD"; when it matches "AB", "B" is captured by
 the outer parentheses.
+</P>
+<P>
+(*ACCEPT) is the only backtracking verb that is allowed to be quantified
+because an ungreedy quantification with a minimum of zero acts only when a
+backtrack happens. Consider, for example,
+<pre>
+  (A(*ACCEPT)??B)C
+</pre>
+where A, B, and C may be complex expressions. After matching "A", the matcher
+processes "BC"; if that fails, causing a backtrack, (*ACCEPT) is triggered and
+the match succeeds. In both cases, all but C is captured. Whereas (*COMMIT)
+(see below) means "fail on backtrack", a repeated (*ACCEPT) of this type means
+"succeed on backtrack".
+</P>
+<P>
+<b>Warning:</b> (*ACCEPT) should not be used within a script run group, because
+it causes an immediate exit from the group, bypassing the script run checking.
 <pre>
   (*FAIL) or (*FAIL:NAME)
 </pre>
@@ -3224,8 +3422,9 @@ A match with the string "aaaa" always fails, but the callout is taken before
 each backtrack happens (in this example, 10 times).
 </P>
 <P>
-(*ACCEPT:NAME) and (*FAIL:NAME) behave exactly the same as
-(*MARK:NAME)(*ACCEPT) and (*MARK:NAME)(*FAIL), respectively.
+(*ACCEPT:NAME) and (*FAIL:NAME) behave the same as (*MARK:NAME)(*ACCEPT) and
+(*MARK:NAME)(*FAIL), respectively, that is, a (*MARK) is recorded just before
+the verb acts.
 </P>
 <br><b>
 Recording which path was taken
@@ -3237,27 +3436,25 @@ starting point (see (*SKIP) below).
 <pre>
   (*MARK:NAME) or (*:NAME)
 </pre>
-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.
+A name is always required with this verb. For all the other backtracking
+control verbs, a NAME argument is optional.
 </P>
 <P>
-When a match succeeds, the name of the last-encountered (*MARK:NAME) on the
+When a match succeeds, the name of the last-encountered mark name on the
 matching path is passed back to the caller as described in the section entitled
 <a href="pcre2api.html#matchotherdata">"Other information about the match"</a>
 in the
 <a href="pcre2api.html"><b>pcre2api</b></a>
-documentation. This applies to all instances of (*MARK), including those inside
-assertions and atomic groups. (There are differences in those cases when
-(*MARK) is used in conjunction with (*SKIP) as described below.)
+documentation. This applies to all instances of (*MARK) and other verbs,
+including those inside assertions and atomic groups. However, there are
+differences in those cases when (*MARK) is used in conjunction with (*SKIP) as
+described below.
 </P>
 <P>
-As well as (*MARK), the (*COMMIT), (*PRUNE) and (*THEN) verbs may have
-associated NAME arguments. Whichever is last on the matching path is passed
-back. See below for more details of these other verbs.
-</P>
-<P>
-Here is an example of <b>pcre2test</b> output, where the "mark" modifier
-requests the retrieval and outputting of (*MARK) data:
+The mark name that was last encountered on the matching path is passed back. A
+verb without a NAME argument is ignored for this purpose. Here is an example of
+<b>pcre2test</b> output, where the "mark" modifier requests the retrieval and
+outputting of (*MARK) data:
 <pre>
     re&#62; /X(*MARK:A)Y|X(*MARK:B)Z/mark
   data&#62; XY
@@ -3307,7 +3504,7 @@ to the left of the verb. However, when one of these verbs appears inside an
 atomic group or in a lookaround assertion that is true, its effect is confined
 to that group, because once the group has been matched, there is never any
 backtracking into it. Backtracking from beyond an assertion or an atomic group
-ignores the entire group, and seeks a preceeding backtracking point.
+ignores the entire group, and seeks a preceding backtracking point.
 </P>
 <P>
 These verbs differ in exactly what kind of failure occurs when backtracking
@@ -3332,8 +3529,8 @@ dynamic anchor, or "I've started, so I must finish."
 <P>
 The behaviour of (*COMMIT:NAME) is not the same as (*MARK:NAME)(*COMMIT). 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 (*COMMIT), (*PRUNE) and (*THEN).
+caller. However, (*SKIP:NAME) searches only for names that are set with
+(*MARK), ignoring those set by any of the other backtracking verbs.
 </P>
 <P>
 If there is more than one backtracking verb in a pattern, a different one that
@@ -3377,7 +3574,7 @@ as (*COMMIT).
 The behaviour of (*PRUNE:NAME) is 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 (*COMMIT), (*PRUNE) or (*THEN).
+ignoring those set by other backtracking verbs.
 <pre>
   (*SKIP)
 </pre>
@@ -3395,6 +3592,12 @@ next attempt at "c". Note that a possessive quantifer 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".
+</P>
+<P>
+If (*SKIP) is used to specify a new starting position that is the same as the
+starting position of the current match, or (by being inside a lookbehind)
+earlier, the position specified by (*SKIP) is ignored, and instead the normal
+"bumpalong" occurs.
 <pre>
   (*SKIP:NAME)
 </pre>
@@ -3432,7 +3635,7 @@ the second branch of the pattern.
 </P>
 <P>
 Note that (*SKIP:NAME) searches only for names set by (*MARK:NAME). It ignores
-names that are set by (*COMMIT:NAME), (*PRUNE:NAME) or (*THEN:NAME).
+names that are set by other backtracking verbs.
 <pre>
   (*THEN) or (*THEN:NAME)
 </pre>
@@ -3454,34 +3657,32 @@ group. If (*THEN) is not inside an alternation, it acts like (*PRUNE).
 The behaviour of (*THEN:NAME) is 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 (*COMMIT), (*PRUNE) and (*THEN).
+ignoring those set by other backtracking verbs.
 </P>
 <P>
-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 group 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 group to the enclosing alternative.
+Consider this pattern, where A, B, etc. are complex pattern fragments that do
+not contain any | characters at this level:
 <pre>
   A (B(*THEN)C) | D
 </pre>
 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
+However, if the group containing (*THEN) is given an alternative, it
 behaves differently:
 <pre>
   A (B(*THEN)C | (*FAIL)) | D
 </pre>
-The effect of (*THEN) is now confined to the inner subpattern. After a failure
-in C, matching moves to (*FAIL), which causes the whole subpattern to fail
-because there are no more alternatives to try. In this case, matching does now
-backtrack into A.
+The effect of (*THEN) is now confined to the inner group. After a failure in C,
+matching moves to (*FAIL), which causes the whole group to fail because there
+are no more alternatives to try. In this case, matching does backtrack into A.
 </P>
 <P>
-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:
+Note that a conditional group is not considered as having two alternatives,
+because only one is ever used. In other words, the | character in a conditional
+group has a different meaning. Ignoring white space, consider:
 <pre>
   ^.*? (?(?=a) a | b(*THEN)c )
 </pre>
@@ -3489,7 +3690,7 @@ 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
+character. The conditional group 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.)
 </P>
@@ -3545,14 +3746,14 @@ Backtracking verbs in assertions
 (*FAIL) in any assertion has its normal effect: it forces an immediate
 backtrack. The behaviour of the other backtracking verbs depends on whether or
 not the assertion is standalone or acting as the condition in a conditional
-subpattern.
+group.
 </P>
 <P>
 (*ACCEPT) in a standalone positive assertion causes the assertion to succeed
-without any further processing; captured strings and a (*MARK) name (if set)
-are retained. In a standalone negative assertion, (*ACCEPT) causes the
-assertion to fail without any further processing; captured substrings and any
-(*MARK) name are discarded.
+without any further processing; captured strings and a mark name (if set) are
+retained. In a standalone negative assertion, (*ACCEPT) causes the assertion to
+fail without any further processing; captured substrings and any mark name are
+discarded.
 </P>
 <P>
 If the assertion is a condition, (*ACCEPT) causes the condition to be true for
@@ -3561,11 +3762,20 @@ retained in both cases.
 </P>
 <P>
 The remaining verbs act only when a later failure causes a backtrack to
-reach them. This means that their effect is confined to the assertion,
-because lookaround assertions are atomic. A backtrack that occurs after an
-assertion is complete does not jump back into the assertion. Note in particular
-that a (*MARK) name that is set in an assertion is not "seen" by an instance of
-(*SKIP:NAME) latter in the pattern.
+reach them. This means that, for the Perl-compatible assertions, their effect
+is confined to the assertion, because Perl lookaround assertions are atomic. A
+backtrack that occurs after such an assertion is complete does not jump back
+into the assertion. Note in particular that a (*MARK) name that is set in an
+assertion is not "seen" by an instance of (*SKIP:NAME) later in the pattern.
+</P>
+<P>
+PCRE2 now supports non-atomic positive assertions, as described in the section
+entitled
+<a href="#nonatomicassertions">"Non-atomic assertions"</a>
+above. These assertions must be standalone (not used as conditions). They are
+not Perl-compatible. For these assertions, a later backtrack does jump back
+into the assertion, and therefore verbs such as (*COMMIT) can be triggered by
+backtracks from later in the pattern.
 </P>
 <P>
 The effect of (*THEN) is not allowed to escape beyond an assertion. If there
@@ -3584,36 +3794,35 @@ the assertion to be true, without considering any further alternative branches.
 Backtracking verbs in subroutines
 </b><br>
 <P>
-These behaviours occur whether or not the subpattern is called recursively.
+These behaviours occur whether or not the group is called recursively.
 </P>
 <P>
-(*ACCEPT) in a subpattern called as a subroutine causes the subroutine match to
+(*ACCEPT) in a group called as a subroutine causes the subroutine match to
 succeed without any further processing. Matching then continues after the
 subroutine call. Perl documents this behaviour. Perl's treatment of the other
 verbs in subroutines is different in some cases.
 </P>
 <P>
-(*FAIL) in a subpattern called as a subroutine has its normal effect: it forces
+(*FAIL) in a group called as a subroutine has its normal effect: it forces
 an immediate backtrack.
 </P>
 <P>
 (*COMMIT), (*SKIP), and (*PRUNE) cause the subroutine match to fail when
-triggered by being backtracked to in a subpattern called as a subroutine. There
-is then a backtrack at the outer level.
+triggered by being backtracked to in a group called as a subroutine. There is
+then a backtrack at the outer level.
 </P>
 <P>
 (*THEN), when triggered, skips to the next alternative in the innermost
-enclosing group within the subpattern that has alternatives (its normal
-behaviour). However, if there is no such group within the subroutine
-subpattern, the subroutine match fails and there is a backtrack at the outer
-level.
+enclosing group that has alternatives (its normal behaviour). However, if there
+is no such group within the subroutine's group, the subroutine match fails and
+there is a backtrack at the outer level.
 </P>
-<br><a name="SEC28" href="#TOC1">SEE ALSO</a><br>
+<br><a name="SEC30" href="#TOC1">SEE ALSO</a><br>
 <P>
 <b>pcre2api</b>(3), <b>pcre2callout</b>(3), <b>pcre2matching</b>(3),
 <b>pcre2syntax</b>(3), <b>pcre2</b>(3).
 </P>
-<br><a name="SEC29" href="#TOC1">AUTHOR</a><br>
+<br><a name="SEC31" href="#TOC1">AUTHOR</a><br>
 <P>
 Philip Hazel
 <br>
@@ -3622,11 +3831,11 @@ University Computing Service
 Cambridge, England.
 <br>
 </P>
-<br><a name="SEC30" href="#TOC1">REVISION</a><br>
+<br><a name="SEC32" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 04 September 2018
+Last updated: 29 July 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index f823c12f3ffa3e15f7cac4067f0e59febeb2c4b2..80d716c79316da85cb68127fa2bad8f800b41735 100644 (file)
@@ -31,9 +31,9 @@ of them.
 Patterns are compiled by PCRE2 into a reasonably efficient interpretive code,
 so that most simple patterns do not use much memory for storing the compiled
 version. 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
+pattern can be unexpectedly large. If a parenthesized group has a quantifier
+with a minimum greater than 1 and/or a limited maximum, the whole group is
+repeated in the compiled code. For example, the pattern
 <pre>
   (abc|def){2,4}
 </pre>
@@ -252,9 +252,9 @@ Cambridge, England.
 </P>
 <br><a name="SEC6" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 25 April 2018
+Last updated: 03 February 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index 1da246017f6dfebeebeaf2b41c53caf47c62d7ba..20a2009b947bfd209a60ffc5cca3ddc306fcf10d 100644 (file)
@@ -15,51 +15,75 @@ please consult the man page, in case the conversion went wrong.
 <ul>
 <li><a name="TOC1" href="#SEC1">SYNOPSIS</a>
 <li><a name="TOC2" href="#SEC2">DESCRIPTION</a>
-<li><a name="TOC3" href="#SEC3">COMPILING A PATTERN</a>
-<li><a name="TOC4" href="#SEC4">MATCHING NEWLINE CHARACTERS</a>
-<li><a name="TOC5" href="#SEC5">MATCHING A PATTERN</a>
-<li><a name="TOC6" href="#SEC6">ERROR MESSAGES</a>
-<li><a name="TOC7" href="#SEC7">MEMORY USAGE</a>
-<li><a name="TOC8" href="#SEC8">AUTHOR</a>
-<li><a name="TOC9" href="#SEC9">REVISION</a>
+<li><a name="TOC3" href="#SEC3">USING THE POSIX FUNCTIONS</a>
+<li><a name="TOC4" href="#SEC4">COMPILING A PATTERN</a>
+<li><a name="TOC5" href="#SEC5">MATCHING NEWLINE CHARACTERS</a>
+<li><a name="TOC6" href="#SEC6">MATCHING A PATTERN</a>
+<li><a name="TOC7" href="#SEC7">ERROR MESSAGES</a>
+<li><a name="TOC8" href="#SEC8">MEMORY USAGE</a>
+<li><a name="TOC9" href="#SEC9">AUTHOR</a>
+<li><a name="TOC10" href="#SEC10">REVISION</a>
 </ul>
 <br><a name="SEC1" href="#TOC1">SYNOPSIS</a><br>
 <P>
 <b>#include &#60;pcre2posix.h&#62;</b>
 </P>
 <P>
-<b>int regcomp(regex_t *<i>preg</i>, const char *<i>pattern</i>,</b>
+<b>int pcre2_regcomp(regex_t *<i>preg</i>, const char *<i>pattern</i>,</b>
 <b>     int <i>cflags</i>);</b>
 <br>
 <br>
-<b>int regexec(const regex_t *<i>preg</i>, const char *<i>string</i>,</b>
+<b>int pcre2_regexec(const regex_t *<i>preg</i>, const char *<i>string</i>,</b>
 <b>     size_t <i>nmatch</i>, regmatch_t <i>pmatch</i>[], int <i>eflags</i>);</b>
 <br>
 <br>
-<b>size_t regerror(int <i>errcode</i>, const regex_t *<i>preg</i>,</b>
+<b>size_t pcre2_regerror(int <i>errcode</i>, const regex_t *<i>preg</i>,</b>
 <b>     char *<i>errbuf</i>, size_t <i>errbuf_size</i>);</b>
 <br>
 <br>
-<b>void regfree(regex_t *<i>preg</i>);</b>
+<b>void pcre2_regfree(regex_t *<i>preg</i>);</b>
 </P>
 <br><a name="SEC2" href="#TOC1">DESCRIPTION</a><br>
 <P>
 This set of functions provides a POSIX-style API for the PCRE2 regular
-expression 8-bit library. See the
+expression 8-bit library. There are no POSIX-style wrappers for PCRE2's 16-bit
+and 32-bit libraries. See the
 <a href="pcre2api.html"><b>pcre2api</b></a>
 documentation for a description of PCRE2's native API, which contains much
-additional functionality. There are no POSIX-style wrappers for PCRE2's 16-bit
-and 32-bit libraries.
+additional functionality.
 </P>
 <P>
-The functions described here are just wrapper functions that ultimately call
-the PCRE2 native API. Their prototypes are defined in the <b>pcre2posix.h</b>
-header file, and on Unix systems the library itself is called
-<b>libpcre2-posix.a</b>, so can be accessed by adding <b>-lpcre2-posix</b> to the
-command for linking an application that uses them. Because the POSIX functions
-call the native ones, it is also necessary to add <b>-lpcre2-8</b>.
+The functions described here are wrapper functions that ultimately call the
+PCRE2 native API. Their prototypes are defined in the <b>pcre2posix.h</b> header
+file, and they all have unique names starting with <b>pcre2_</b>. However, the
+<b>pcre2posix.h</b> header also contains macro definitions that convert the
+standard POSIX names such <b>regcomp()</b> into <b>pcre2_regcomp()</b> etc. This
+means that a program can use the usual POSIX names without running the risk of
+accidentally linking with POSIX functions from a different library.
 </P>
 <P>
+On Unix-like systems the PCRE2 POSIX library is called <b>libpcre2-posix</b>, so
+can be accessed by adding <b>-lpcre2-posix</b> to the command for linking an
+application. Because the POSIX functions call the native ones, it is also
+necessary to add <b>-lpcre2-8</b>.
+</P>
+<P>
+Although they are not defined as protypes in <b>pcre2posix.h</b>, the library
+does contain functions with the POSIX names <b>regcomp()</b> etc. These simply
+pass their arguments to the PCRE2 functions. These functions are provided for
+backwards compatibility with earlier versions of PCRE2, so that existing
+programs do not have to be recompiled.
+</P>
+<P>
+Calling the header file <b>pcre2posix.h</b> avoids any conflict with other POSIX
+libraries. It can, of course, be renamed or aliased as <b>regex.h</b>, which is
+the "correct" name, if there is no clash. It provides two structure types,
+<i>regex_t</i> for compiled internal forms, and <i>regmatch_t</i> for returning
+captured substrings. It also defines some constants whose names start with
+"REG_"; these are used for setting options and identifying error codes.
+</P>
+<br><a name="SEC3" href="#TOC1">USING THE POSIX FUNCTIONS</a><br>
+<P>
 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
@@ -80,17 +104,13 @@ POSIX definition; it is not fully POSIX-compatible, and in multi-unit encoding
 domains it is probably even less compatible.
 </P>
 <P>
-The header for these functions is supplied as <b>pcre2posix.h</b> to avoid any
-potential clash with other POSIX libraries. It can, of course, be renamed or
-aliased as <b>regex.h</b>, which is the "correct" name. It provides two
-structure types, <i>regex_t</i> for compiled internal forms, and
-<i>regmatch_t</i> for returning captured substrings. It also defines some
-constants whose names start with "REG_"; these are used for setting options and
-identifying error codes.
+The descriptions below use the actual names of the functions, but, as described
+above, the standard POSIX names (without the <b>pcre2_</b> prefix) may also be
+used.
 </P>
-<br><a name="SEC3" href="#TOC1">COMPILING A PATTERN</a><br>
+<br><a name="SEC4" href="#TOC1">COMPILING A PATTERN</a><br>
 <P>
-The function <b>regcomp()</b> is called to compile a pattern into an
+The function <b>pcre2_regcomp()</b> is called to compile a pattern into an
 internal form. By default, the pattern is a C string terminated by a binary
 zero (but see REG_PEND below). The <i>preg</i> argument is a pointer to a
 <b>regex_t</b> structure that is used as a base for storing information about
@@ -128,18 +148,18 @@ REG_UTF. Note that REG_NOSPEC is not part of the POSIX standard.
 <pre>
   REG_NOSUB
 </pre>
-When a pattern that is compiled with this flag is passed to <b>regexec()</b> for
-matching, the <i>nmatch</i> and <i>pmatch</i> arguments are ignored, and no
-captured strings are returned. Versions of the PCRE library prior to 10.22 used
-to set the PCRE2_NO_AUTO_CAPTURE compile option, but this no longer happens
-because it disables the use of backreferences.
+When a pattern that is compiled with this flag is passed to
+<b>pcre2_regexec()</b> for matching, the <i>nmatch</i> and <i>pmatch</i> arguments
+are ignored, and no captured strings are returned. Versions of the PCRE library
+prior to 10.22 used to set the PCRE2_NO_AUTO_CAPTURE compile option, but this
+no longer happens because it disables the use of backreferences.
 <pre>
   REG_PEND
 </pre>
 If this option is set, the <b>reg_endp</b> field in the <i>preg</i> structure
 (which has the type const char *) must be set to point to the character beyond
-the end of the pattern before calling <b>regcomp()</b>. The pattern itself may
-now contain binary zeros, which are treated as data characters. Without
+the end of the pattern before calling <b>pcre2_regcomp()</b>. The pattern itself
+may now contain binary zeros, which are treated as data characters. Without
 REG_PEND, a binary zero terminates the pattern and the <b>re_endp</b> field is
 ignored. This is a GNU extension to the POSIX standard and should be used with
 caution in software intended to be portable to other systems.
@@ -174,18 +194,19 @@ newlines are matched by the dot metacharacter (they are not) or by a negative
 class such as [^a] (they are).
 </P>
 <P>
-The yield of <b>regcomp()</b> is zero on success, and non-zero otherwise. The
-<i>preg</i> structure is filled in on success, and one other member of the
+The yield of <b>pcre2_regcomp()</b> is zero on success, and non-zero otherwise.
+The <i>preg</i> structure is filled in on success, and one other member of the
 structure (as well as <i>re_endp</i>) is public: <i>re_nsub</i> contains the
 number of capturing subpatterns in the regular expression. Various error codes
 are defined in the header file.
 </P>
 <P>
-NOTE: If the yield of <b>regcomp()</b> is non-zero, you must not attempt to
-use the contents of the <i>preg</i> structure. If, for example, you pass it to
-<b>regexec()</b>, the result is undefined and your program is likely to crash.
+NOTE: If the yield of <b>pcre2_regcomp()</b> is non-zero, you must not attempt
+to use the contents of the <i>preg</i> structure. If, for example, you pass it
+to <b>pcre2_regexec()</b>, the result is undefined and your program is likely to
+crash.
 </P>
-<br><a name="SEC4" href="#TOC1">MATCHING NEWLINE CHARACTERS</a><br>
+<br><a name="SEC5" href="#TOC1">MATCHING NEWLINE CHARACTERS</a><br>
 <P>
 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
@@ -219,16 +240,16 @@ 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 <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
+the POSIX API, passing REG_NEWLINE to PCRE2's <b>pcre2_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>
+<br><a name="SEC6" href="#TOC1">MATCHING A PATTERN</a><br>
 <P>
-The function <b>regexec()</b> is called to match a compiled pattern <i>preg</i>
-against a given <i>string</i>, which is by default terminated by a zero byte
-(but see REG_STARTEND below), subject to the options in <i>eflags</i>. These can
-be:
+The function <b>pcre2_regexec()</b> is called to match a compiled pattern
+<i>preg</i> against a given <i>string</i>, which is by default terminated by a
+zero byte (but see REG_STARTEND below), subject to the options in <i>eflags</i>.
+These can be:
 <pre>
   REG_NOTBOL
 </pre>
@@ -272,7 +293,7 @@ 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 <i>nmatch</i> and <i>pmatch</i> arguments of
-<b>regexec()</b> are ignored (except possibly as input for REG_STARTEND).
+<b>pcre2_regexec()</b> are ignored (except possibly as input for REG_STARTEND).
 </P>
 <P>
 The value of <i>nmatch</i> may be zero, and the value <i>pmatch</i> may be NULL
@@ -294,24 +315,25 @@ 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.
 </P>
-<br><a name="SEC6" href="#TOC1">ERROR MESSAGES</a><br>
+<br><a name="SEC7" href="#TOC1">ERROR MESSAGES</a><br>
 <P>
-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>. 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.
+The <b>pcre2_regerror()</b> function maps a non-zero errorcode from either
+<b>pcre2_regcomp()</b> or <b>pcre2_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>. 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>
+<br><a name="SEC8" href="#TOC1">MEMORY USAGE</a><br>
 <P>
 Compiling a regular expression causes memory to be allocated and associated
-with the <i>preg</i> structure. The function <b>regfree()</b> frees all such
-memory, after which <i>preg</i> may no longer be used as a compiled expression.
+with the <i>preg</i> structure. The function <b>pcre2_regfree()</b> frees all
+such memory, after which <i>preg</i> may no longer be used as a compiled
+expression.
 </P>
-<br><a name="SEC8" href="#TOC1">AUTHOR</a><br>
+<br><a name="SEC9" href="#TOC1">AUTHOR</a><br>
 <P>
 Philip Hazel
 <br>
@@ -320,11 +342,11 @@ University Computing Service
 Cambridge, England.
 <br>
 </P>
-<br><a name="SEC9" href="#TOC1">REVISION</a><br>
+<br><a name="SEC10" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 15 June 2017
+Last updated: 30 January 2019
 <br>
-Copyright &copy; 1997-2017 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index 7d332a10d2e4dfd84270b5e66063b5b8fac96484..00f051313c49328b9076a4ff18890d97438740a0 100644 (file)
@@ -32,14 +32,16 @@ please consult the man page, in case the conversion went wrong.
 <li><a name="TOC17" href="#SEC17">NEWLINE CONVENTION</a>
 <li><a name="TOC18" href="#SEC18">WHAT \R MATCHES</a>
 <li><a name="TOC19" href="#SEC19">LOOKAHEAD AND LOOKBEHIND ASSERTIONS</a>
-<li><a name="TOC20" href="#SEC20">BACKREFERENCES</a>
-<li><a name="TOC21" href="#SEC21">SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)</a>
-<li><a name="TOC22" href="#SEC22">CONDITIONAL PATTERNS</a>
-<li><a name="TOC23" href="#SEC23">BACKTRACKING CONTROL</a>
-<li><a name="TOC24" href="#SEC24">CALLOUTS</a>
-<li><a name="TOC25" href="#SEC25">SEE ALSO</a>
-<li><a name="TOC26" href="#SEC26">AUTHOR</a>
-<li><a name="TOC27" href="#SEC27">REVISION</a>
+<li><a name="TOC20" href="#SEC20">NON-ATOMIC LOOKAROUND ASSERTIONS</a>
+<li><a name="TOC21" href="#SEC21">SCRIPT RUNS</a>
+<li><a name="TOC22" href="#SEC22">BACKREFERENCES</a>
+<li><a name="TOC23" href="#SEC23">SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)</a>
+<li><a name="TOC24" href="#SEC24">CONDITIONAL PATTERNS</a>
+<li><a name="TOC25" href="#SEC25">BACKTRACKING CONTROL</a>
+<li><a name="TOC26" href="#SEC26">CALLOUTS</a>
+<li><a name="TOC27" href="#SEC27">SEE ALSO</a>
+<li><a name="TOC28" href="#SEC28">AUTHOR</a>
+<li><a name="TOC29" href="#SEC29">REVISION</a>
 </ul>
 <br><a name="SEC1" href="#TOC1">PCRE2 REGULAR EXPRESSION SYNTAX SUMMARY</a><br>
 <P>
@@ -57,7 +59,8 @@ documentation. This document contains a quick-reference summary of the syntax.
 </P>
 <br><a name="SEC3" href="#TOC1">ESCAPED CHARACTERS</a><br>
 <P>
-This table applies to ASCII and Unicode environments.
+This table applies to ASCII and Unicode environments. An unrecognized escape
+sequence causes an error.
 <pre>
   \a         alarm, that is, the BEL character (hex 07)
   \cx        "control-x", where x is any ASCII printing character
@@ -69,12 +72,25 @@ This table applies to ASCII and Unicode environments.
   \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)
   \N{U+hh..} character with Unicode code point hh.. (Unicode mode only)
-  \uhhhh     character with hex code hhhh (if PCRE2_ALT_BSUX is set)
   \xhh       character with hex code hh
   \x{hh..}   character with hex code hh..
 </pre>
+If PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set ("ALT_BSUX mode"), the
+following are also recognized:
+<pre>
+  \U         the character "U"
+  \uhhhh     character with hex code hhhh
+  \u{hh..}   character with hex code hh.. but only for EXTRA_ALT_BSUX
+</pre>
+When \x is not followed by {, from zero to two hexadecimal digits are read,
+but in ALT_BSUX mode \x must be followed by two hexadecimal digits to be
+recognized as a hexadecimal escape; otherwise it matches a literal "x".
+Likewise, if \u (in ALT_BSUX mode) is not followed by four hexadecimal digits
+or (in EXTRA_ALT_BSUX mode) a sequence of hex digits in curly brackets, it
+matches a literal "u".
+</P>
+<P>
 Note that \0dd is always an octal code. The treatment of backslash followed by
 a non-zero digit is complicated; for details see the section
 <a href="pcre2pattern.html#digitsafterbackslash">"Non-printing characters"</a>
@@ -85,13 +101,6 @@ also given. \N{U+hh..} is synonymous with \x{hh..} in PCRE2 but is not
 supported in EBCDIC environments. Note that \N not followed by an opening
 curly bracket has a different meaning (see below).
 </P>
-<P>
-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 hexadecimal digits to
-be recognized as a hexadecimal escape; otherwise it matches a literal "x".
-Likewise, if \u (in ALT_BSUX mode) is not followed by four hexadecimal digits,
-it matches a literal "u".
-</P>
 <br><a name="SEC4" href="#TOC1">CHARACTER TYPES</a><br>
 <P>
 <pre>
@@ -225,6 +234,7 @@ Dogra,
 Duployan,
 Egyptian_Hieroglyphs,
 Elbasan,
+Elymaic,
 Ethiopic,
 Georgian,
 Glagolitic,
@@ -282,10 +292,12 @@ Mro,
 Multani,
 Myanmar,
 Nabataean,
+Nandinagari,
 New_Tai_Lue,
 Newa,
 Nko,
 Nushu,
+Nyakeng_Puachue_Hmong,
 Ogham,
 Ol_Chiki,
 Old_Hungarian,
@@ -336,6 +348,7 @@ Tifinagh,
 Tirhuta,
 Ugaritic,
 Vai,
+Wancho,
 Warang_Citi,
 Yi,
 Zanabazar_Square.
@@ -423,19 +436,23 @@ but some of them use Unicode properties if PCRE2_UCP is set. You can use
 <br><a name="SEC13" href="#TOC1">CAPTURING</a><br>
 <P>
 <pre>
-  (...)           capturing group
-  (?&#60;name&#62;...)    named capturing group (Perl)
-  (?'name'...)    named capturing group (Perl)
-  (?P&#60;name&#62;...)   named capturing group (Python)
-  (?:...)         non-capturing group
-  (?|...)         non-capturing group; reset group numbers for
-                   capturing groups in each alternative
-</PRE>
+  (...)           capture group
+  (?&#60;name&#62;...)    named capture group (Perl)
+  (?'name'...)    named capture group (Perl)
+  (?P&#60;name&#62;...)   named capture group (Python)
+  (?:...)         non-capture group
+  (?|...)         non-capture group; reset group numbers for
+                   capture groups in each alternative
+</pre>
+In non-UTF modes, names may contain underscores and ASCII letters and digits;
+in UTF modes, any Unicode letters and Unicode decimal digits are permitted. In
+both cases, a name must not start with a digit.
 </P>
 <br><a name="SEC14" href="#TOC1">ATOMIC GROUPS</a><br>
 <P>
 <pre>
-  (?&#62;...)         atomic, non-capturing group
+  (?&#62;...)         atomic non-capture group
+  (*atomic:...)   atomic non-capture group
 </PRE>
 </P>
 <br><a name="SEC15" href="#TOC1">COMMENT</a><br>
@@ -463,7 +480,7 @@ of the group.
 Unsetting x or xx unsets both. Several options may be set at once, and a
 mixture of setting and unsetting such as (?i-x) is allowed, but there may be
 only one hyphen. Setting (but no unsetting) is allowed after (?^ for example
-(?^in). An option setting may appear at the start of a non-capturing group, for
+(?^in). An option setting may appear at the start of a non-capture group, for
 example (?i:...).
 </P>
 <P>
@@ -514,14 +531,46 @@ setting with a similar syntax.
 <br><a name="SEC19" href="#TOC1">LOOKAHEAD AND LOOKBEHIND ASSERTIONS</a><br>
 <P>
 <pre>
-  (?=...)         positive look ahead
-  (?!...)         negative look ahead
-  (?&#60;=...)        positive look behind
-  (?&#60;!...)        negative look behind
+  (?=...)                     )
+  (*pla:...)                  ) positive lookahead
+  (*positive_lookahead:...)   )
+
+  (?!...)                     )
+  (*nla:...)                  ) negative lookahead
+  (*negative_lookahead:...)   )
+
+  (?&#60;=...)                    )
+  (*plb:...)                  ) positive lookbehind
+  (*positive_lookbehind:...)  )
+
+  (?&#60;!...)                    )
+  (*nlb:...)                  ) negative lookbehind
+  (*negative_lookbehind:...)  )
 </pre>
-Each top-level branch of a look behind must be of a fixed length.
+Each top-level branch of a lookbehind must be of a fixed length.
+</P>
+<br><a name="SEC20" href="#TOC1">NON-ATOMIC LOOKAROUND ASSERTIONS</a><br>
+<P>
+These assertions are specific to PCRE2 and are not Perl-compatible.
+<pre>
+  (*napla:...)
+  (*non_atomic_positive_lookahead:...)
+
+  (*naplb:...)
+  (*non_atomic_positive_lookbehind:...)
+</PRE>
+</P>
+<br><a name="SEC21" href="#TOC1">SCRIPT RUNS</a><br>
+<P>
+<pre>
+  (*script_run:...)           ) script run, can be backtracked into
+  (*sr:...)                   )
+
+  (*atomic_script_run:...)    ) atomic script run
+  (*asr:...)                  )
+</PRE>
 </P>
-<br><a name="SEC20" href="#TOC1">BACKREFERENCES</a><br>
+<br><a name="SEC22" href="#TOC1">BACKREFERENCES</a><br>
 <P>
 <pre>
   \n              reference by number (can be ambiguous)
@@ -538,26 +587,26 @@ Each top-level branch of a look behind must be of a fixed length.
   (?P=name)       reference by name (Python)
 </PRE>
 </P>
-<br><a name="SEC21" href="#TOC1">SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)</a><br>
+<br><a name="SEC23" href="#TOC1">SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)</a><br>
 <P>
 <pre>
   (?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&#62;name)       call subpattern by name (Python)
-  \g&#60;name&#62;        call subpattern by name (Oniguruma)
-  \g'name'        call subpattern by name (Oniguruma)
-  \g&#60;n&#62;           call subpattern by absolute number (Oniguruma)
-  \g'n'           call subpattern by absolute number (Oniguruma)
-  \g&#60;+n&#62;          call subpattern by relative number (PCRE2 extension)
-  \g'+n'          call subpattern by relative number (PCRE2 extension)
-  \g&#60;-n&#62;          call subpattern by relative number (PCRE2 extension)
-  \g'-n'          call subpattern by relative number (PCRE2 extension)
+  (?n)            call subroutine by absolute number
+  (?+n)           call subroutine by relative number
+  (?-n)           call subroutine by relative number
+  (?&name)        call subroutine by name (Perl)
+  (?P&#62;name)       call subroutine by name (Python)
+  \g&#60;name&#62;        call subroutine by name (Oniguruma)
+  \g'name'        call subroutine by name (Oniguruma)
+  \g&#60;n&#62;           call subroutine by absolute number (Oniguruma)
+  \g'n'           call subroutine by absolute number (Oniguruma)
+  \g&#60;+n&#62;          call subroutine by relative number (PCRE2 extension)
+  \g'+n'          call subroutine by relative number (PCRE2 extension)
+  \g&#60;-n&#62;          call subroutine by relative number (PCRE2 extension)
+  \g'-n'          call subroutine by relative number (PCRE2 extension)
 </PRE>
 </P>
-<br><a name="SEC22" href="#TOC1">CONDITIONAL PATTERNS</a><br>
+<br><a name="SEC24" href="#TOC1">CONDITIONAL PATTERNS</a><br>
 <P>
 <pre>
   (?(condition)yes-pattern)
@@ -572,7 +621,7 @@ Each top-level branch of a look behind must be of a fixed length.
   (?(R)               overall recursion condition
   (?(Rn)              specific numbered group recursion condition
   (?(R&name)          specific named group recursion condition
-  (?(DEFINE)          define subpattern for reference
+  (?(DEFINE)          define groups for reference
   (?(VERSION[&#62;]=n.m)  test PCRE2 version
   (?(assert)          assertion condition
 </pre>
@@ -580,7 +629,7 @@ Note the ambiguity of (?(R) and (?(Rn) which might be named reference
 conditions or recursion tests. Such a condition is interpreted as a reference
 condition if the relevant named group exists.
 </P>
-<br><a name="SEC23" href="#TOC1">BACKTRACKING CONTROL</a><br>
+<br><a name="SEC25" href="#TOC1">BACKTRACKING CONTROL</a><br>
 <P>
 All backtracking control verbs may be in the form (*VERB:NAME). For (*MARK) the
 name is mandatory, for the others it is optional. (*SKIP) changes its behaviour
@@ -607,7 +656,7 @@ pattern is not anchored.
 The effect of one of these verbs in a group called as a subroutine is confined
 to the subroutine call.
 </P>
-<br><a name="SEC24" href="#TOC1">CALLOUTS</a><br>
+<br><a name="SEC26" href="#TOC1">CALLOUTS</a><br>
 <P>
 <pre>
   (?C)            callout (assumed number 0)
@@ -618,12 +667,12 @@ 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.
 </P>
-<br><a name="SEC25" href="#TOC1">SEE ALSO</a><br>
+<br><a name="SEC27" href="#TOC1">SEE ALSO</a><br>
 <P>
 <b>pcre2pattern</b>(3), <b>pcre2api</b>(3), <b>pcre2callout</b>(3),
 <b>pcre2matching</b>(3), <b>pcre2</b>(3).
 </P>
-<br><a name="SEC26" href="#TOC1">AUTHOR</a><br>
+<br><a name="SEC28" href="#TOC1">AUTHOR</a><br>
 <P>
 Philip Hazel
 <br>
@@ -632,11 +681,11 @@ University Computing Service
 Cambridge, England.
 <br>
 </P>
-<br><a name="SEC27" href="#TOC1">REVISION</a><br>
+<br><a name="SEC29" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 02 September 2018
+Last updated: 29 July 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index af2b18cb5490f2e69a2900a6fcf7002cfe0261f1..e387315d5818c29f5d0b8f4cadadfe4b8990e1a2 100644 (file)
@@ -242,10 +242,17 @@ Behave as if each pattern line has the <b>jit</b> modifier; after successful
 compilation, each pattern is passed to the just-in-time compiler, if available.
 </P>
 <P>
+<b>-jitfast</b>
+Behave as if each pattern line has the <b>jitfast</b> modifier; after
+successful compilation, each pattern is passed to the just-in-time compiler, if
+available, and each subject line is passed directly to the JIT matcher via its
+"fast path".
+</P>
+<P>
 <b>-jitverify</b>
 Behave as if each pattern line has the <b>jitverify</b> modifier; after
 successful compilation, each pattern is passed to the just-in-time compiler, if
-available, and the use of JIT is verified.
+available, and the use of JIT for matching is verified.
 </P>
 <P>
 <b>-LM</b>
@@ -606,11 +613,14 @@ for a description of the effects of these options.
   /s  dotall                    set PCRE2_DOTALL
       dupnames                  set PCRE2_DUPNAMES
       endanchored               set PCRE2_ENDANCHORED
+      escaped_cr_is_lf          set PCRE2_EXTRA_ESCAPED_CR_IS_LF
   /x  extended                  set PCRE2_EXTENDED
   /xx extended_more             set PCRE2_EXTENDED_MORE
+      extra_alt_bsux            set PCRE2_EXTRA_ALT_BSUX
       firstline                 set PCRE2_FIRSTLINE
       literal                   set PCRE2_LITERAL
       match_line                set PCRE2_EXTRA_MATCH_LINE
+      match_invalid_utf         set PCRE2_MATCH_INVALID_UTF
       match_unset_backref       set PCRE2_MATCH_UNSET_BACKREF
       match_word                set PCRE2_EXTRA_MATCH_WORD
   /m  multiline                 set PCRE2_MULTILINE
@@ -715,14 +725,14 @@ information is obtained from the <b>pcre2_pattern_info()</b> function. Here are
 some typical examples:
 <pre>
     re&#62; /(?i)(^a|^b)/m,info
-  Capturing subpattern count = 1
+  Capture group count = 1
   Compile options: multiline
   Overall options: caseless multiline
   First code unit at start or follows newline
   Subject length lower bound = 1
 
     re&#62; /(?i)abc/info
-  Capturing subpattern count = 0
+  Capture group count = 0
   Compile options: &#60;none&#62;
   Overall options: caseless
   First code unit = 'a' (caseless)
@@ -736,7 +746,9 @@ 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.
+ending code units are recorded. The subject length line is omitted when
+<b>no_start_optimize</b> is set because the minimum length is not calculated
+when it can never be used.
 </P>
 <P>
 The <b>framesize</b> modifier shows the size, in bytes, of the storage frames
@@ -1041,6 +1053,7 @@ process.
       aftertext                  show text after match
       allaftertext               show text after captures
       allcaptures                show all captures
+      allvector                  show the entire ovector
       allusedtext                show all consulted text
       altglobal                  alternative global matching
   /g  global                     global matching
@@ -1048,8 +1061,11 @@ process.
       mark                       show mark values
       replace=&#60;string&#62;           specify a replacement string
       startchar                  show starting character when relevant
+      substitute_callout         use substitution callouts
       substitute_extended        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_skip=&#60;n&#62;        skip substitution number n
       substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_stop=&#60;n&#62;        skip substitution number n and greater
       substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
       substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
 </pre>
@@ -1185,6 +1201,7 @@ pattern.
       aftertext                  show text after match
       allaftertext               show text after captures
       allcaptures                show all captures
+      allvector                  show the entire ovector
       allusedtext                show all consulted text (non-JIT only)
       altglobal                  alternative global matching
       callout_capture            show captures at callout time
@@ -1214,8 +1231,11 @@ pattern.
       replace=&#60;string&#62;           specify a replacement string
       startchar                  show startchar when relevant
       startoffset=&#60;n&#62;            same as offset=&#60;n&#62;
+      substitute_callout         use substitution callouts
       substitute_extedded        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_skip=&#60;n&#62;        skip substitution number n
       substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_stop=&#60;n&#62;        skip substitution number n and greater
       substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
       substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
       zero_terminate             pass the subject as zero-terminated
@@ -1239,22 +1259,27 @@ following line with a plus character following the capture number.
 </P>
 <P>
 The <b>allusedtext</b> modifier requests that all the text that was consulted
-during a successful pattern match by the interpreter should be shown. This
-feature is not supported for JIT matching, and if requested with JIT it is
-ignored (with a warning message). Setting this modifier affects the output if
-there is a lookbehind at the start of a match, or a lookahead at the end, or if
-\K is used in the pattern. Characters that precede or follow the start and end
-of the actual match are indicated in the output by '&#60;' or '&#62;' characters
-underneath them. Here is an example:
+during a successful pattern match by the interpreter should be shown, for both
+full and partial matches. This feature is not supported for JIT matching, and
+if requested with JIT it is ignored (with a warning message). Setting this
+modifier affects the output if there is a lookbehind at the start of a match,
+or, for a complete match, a lookahead at the end, or if \K is used in the
+pattern. Characters that precede or follow the start and end of the actual
+match are indicated in the output by '&#60;' or '&#62;' characters underneath them.
+Here is an example:
 <pre>
     re&#62; /(?&#60;=pqr)abc(?=xyz)/
   data&#62; 123pqrabcxyz456\=allusedtext
    0: pqrabcxyz
       &#60;&#60;&#60;   &#62;&#62;&#62;
+  data&#62; 123pqrabcxy\=ph,allusedtext
+  Partial match: pqrabcxy
+                 &#60;&#60;&#60;
 </pre>
-This shows that the matched string is "abc", with the preceding and following
-strings "pqr" and "xyz" having been consulted during the match (when processing
-the assertions).
+The first, complete match shows that the matched string is "abc", with the
+preceding and following strings "pqr" and "xyz" having been consulted during
+the match (when processing the assertions). The partial match can indicate only
+the preceding string.
 </P>
 <P>
 The <b>startchar</b> modifier requests that the starting character for the match
@@ -1281,10 +1306,28 @@ captured parentheses be output after a match. By default, only those up to the
 highest one actually used in the match are output (corresponding to the return
 code from <b>pcre2_match()</b>). Groups that did not take part in the match
 are output as "&#60;unset&#62;". This modifier is not relevant for DFA matching (which
-does no capturing); it is ignored, with a warning message, if present.
+does no capturing) and does not apply when <b>replace</b> is specified; it is
+ignored, with a warning message, if present.
+</P>
+<br><b>
+Showing the entire ovector, for all outcomes
+</b><br>
+<P>
+The <b>allvector</b> modifier requests that the entire ovector be shown,
+whatever the outcome of the match. Compare <b>allcaptures</b>, which shows only
+up to the maximum number of capture groups for the pattern, and then only for a
+successful complete non-DFA match. This modifier, which acts after any match
+result, and also for DFA matching, provides a means of checking that there are
+no unexpected modifications to ovector fields. Before each match attempt, the
+ovector is filled with a special value, and if this is found in both elements
+of a capturing pair, "&#60;unchanged&#62;" is output. After a successful match, this
+applies to all groups after the maximum capture group for the pattern. In other
+cases it applies to the entire ovector. After a partial match, the first two
+elements are the only ones that should be set. After a DFA match, the amount of
+ovector that is used depends on the number of matches that were found.
 </P>
 <br><b>
-Testing callouts
+Testing pattern callouts
 </b><br>
 <P>
 A callout function is supplied when <b>pcre2test</b> calls the library matching
@@ -1292,6 +1335,9 @@ functions, unless <b>callout_none</b> is specified. Its behaviour can be
 controlled by various modifiers listed above whose names begin with
 <b>callout_</b>. Details are given in the section entitled "Callouts"
 <a href="#callouts">below.</a>
+Testing callouts from <b>pcre2_substitute()</b> is decribed separately in
+"Testing the substitution function"
+<a href="#substitution">below.</a>
 </P>
 <br><b>
 Finding all matches in a string
@@ -1323,8 +1369,8 @@ Testing substring extraction functions
 <P>
 The <b>copy</b> and <b>get</b> modifiers can be used to test the
 <b>pcre2_substring_copy_xxx()</b> and <b>pcre2_substring_get_xxx()</b> functions.
-They can be given more than once, and each can specify a group name or number,
-for example:
+They can be given more than once, and each can specify a capture group name or
+number, for example:
 <pre>
    abcd\=copy=1,copy=3,get=G1
 </pre>
@@ -1343,7 +1389,7 @@ instead of a colon. This is in addition to the normal full list. The string
 length (that is, the return from the extraction function) is given in
 parentheses after each substring, followed by the name when the extraction was
 by name.
-</P>
+<a name="substitution"></a></P>
 <br><b>
 Testing the substitution function
 </b><br>
@@ -1401,10 +1447,10 @@ 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:
+to go through the motions of matching and substituting (but not doing any
+callouts), 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
@@ -1415,6 +1461,49 @@ matching provokes an error return ("bad option value") from
 <b>pcre2_substitute()</b>.
 </P>
 <br><b>
+Testing substitute callouts
+</b><br>
+<P>
+If the <b>substitute_callout</b> modifier is set, a substitution callout
+function is set up. The <b>null_context</b> modifier must not be set, because
+the address of the callout function is passed in a match context. When the
+callout function is called (after each substitution), details of the the input
+and output strings are output. For example:
+<pre>
+  /abc/g,replace=&#60;$0&#62;,substitute_callout
+      abcdefabcpqr
+   1(1) Old 0 3 "abc" New 0 5 "&#60;abc&#62;"
+   2(1) Old 6 9 "abc" New 8 13 "&#60;abc&#62;"
+   2: &#60;abc&#62;def&#60;abc&#62;pqr
+</pre>
+The first number on each callout line is the count of matches. The
+parenthesized number is the number of pairs that are set in the ovector (that
+is, one more than the number of capturing groups that were set). Then are
+listed the offsets of the old substring, its contents, and the same for the
+replacement.
+</P>
+<P>
+By default, the substitution callout function returns zero, which accepts the
+replacement and causes matching to continue if /g was used. Two further
+modifiers can be used to test other return values. If <b>substitute_skip</b> is
+set to a value greater than zero the callout function returns +1 for the match
+of that number, and similarly <b>substitute_stop</b> returns -1. These cause the
+replacement to be rejected, and -1 causes no further matching to take place. If
+either of them are set, <b>substitute_callout</b> is assumed. For example:
+<pre>
+  /abc/g,replace=&#60;$0&#62;,substitute_skip=1
+      abcdefabcpqr
+   1(1) Old 0 3 "abc" New 0 5 "&#60;abc&#62; SKIPPED"
+   2(1) Old 6 9 "abc" New 6 11 "&#60;abc&#62;"
+   2: abcdef&#60;abc&#62;pqr
+      abcdefabcpqr\=substitute_stop=1
+   1(1) Old 0 3 "abc" New 0 5 "&#60;abc&#62; STOPPED"
+   1: abcdefabcpqr
+</pre>
+If both are set for the same number, stop takes precedence. Only a single skip
+or stop is supported, which is sufficient for testing that the feature works.
+</P>
+<br><b>
 Setting the JIT stack size
 </b><br>
 <P>
@@ -1554,11 +1643,11 @@ 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.
+<b>pcre2_dfa_match()</b>, <b>pcre2_jit_match()</b> or <b>pcre2_substitute()</b>.
+If the <b>null_context</b> modifier is set, however, NULL is passed. This is for
+testing that the matching and substitution functions behave correctly in this
+case (they use default values). This modifier cannot be used with the
+<b>find_limits</b> or <b>substitute_callout</b> modifiers.
 </P>
 <br><a name="SEC12" href="#TOC1">THE ALTERNATIVE MATCHING FUNCTION</a><br>
 <P>
@@ -1705,7 +1794,7 @@ restart the match with additional subject data by means of the
 <b>dfa_restart</b> modifier. For example:
 <pre>
     re&#62; /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
-  data&#62; 23ja\=P,dfa
+  data&#62; 23ja\=ps,dfa
   Partial match: 23ja
   data&#62; n05\=dfa,dfa_restart
    0: n05
@@ -2004,9 +2093,9 @@ Cambridge, England.
 </P>
 <br><a name="SEC21" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 21 July 2018
+Last updated: 30 July 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index 24f6d9368c27263b990718caa2653edbb1f1349b..3d4e6b4b138bb0109eaea9b870c67aa0762bdef9 100644 (file)
@@ -16,32 +16,44 @@ please consult the man page, in case the conversion went wrong.
 UNICODE AND UTF SUPPORT
 </b><br>
 <P>
-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 is normally built with Unicode support, though if you do not need it, you
+can build it without, in which case the library will be smaller. With Unicode
+support, PCRE2 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), but this is not the default. Unless specifically requested, PCRE2
+treats each code unit in a string as one character.
+</P>
+<P>
+There are two ways of telling PCRE2 to switch to UTF mode, where characters may
+consist of more than one code unit and the range of values is constrained. The
+program can call
 <a href="pcre2_compile.html"><b>pcre2_compile()</b></a>
-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 subject
-strings that are matched against it are treated as UTF strings instead of
-strings of individual one-code-unit characters. There are also some other
-changes to the way characters are handled, as documented below.
+with the PCRE2_UTF option, or the pattern may start with the sequence (*UTF).
+However, the latter facility can be locked out by the PCRE2_NEVER_UTF option.
+That is, the programmer can prevent the supplier of the pattern from switching
+to UTF mode.
+</P>
+<P>
+Note that the PCRE2_MATCH_INVALID_UTF option (see
+<a href="#matchinvalid">below)</a>
+forces PCRE2_UTF to be set.
 </P>
 <P>
-If you do not need Unicode support you can build PCRE2 without it, in which
-case the library will be smaller.
+In UTF mode, both the pattern and any subject strings that are matched against
+it are treated as UTF strings instead of strings of individual one-code-unit
+characters. There are also some other changes to the way characters are
+handled, as documented below.
 </P>
 <br><b>
 UNICODE PROPERTY SUPPORT
 </b><br>
 <P>
 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
+\P{..}, and \X can be used. This is not dependent on the PCRE2_UTF setting.
+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
 <a href="pcre2pattern.html"><b>pcre2pattern</b></a>
 and
 <a href="pcre2syntax.html"><b>pcre2syntax</b></a>
@@ -62,22 +74,28 @@ also recognized; larger ones can be coded using \o{...}.
 <P>
 The escape sequence \N{U+&#60;hex digits&#62;} is recognized as another way of
 specifying a Unicode character by code point in a UTF mode. It is not allowed
-in non-UTF modes.
+in non-UTF mode.
 </P>
 <P>
-In UTF modes, repeat quantifiers apply to complete UTF characters, not to
+In UTF mode, repeat quantifiers apply to complete UTF characters, not to
 individual code units.
 </P>
 <P>
-In UTF modes, the dot metacharacter matches one UTF character instead of a
+In UTF mode, the dot metacharacter matches one UTF character instead of a
 single code unit.
 </P>
 <P>
-The escape sequence \C can be used to match a single code unit in a UTF mode,
+In UTF mode, capture group names are not restricted to ASCII, and may contain
+any Unicode letters and decimal digits, as well as underscore.
+</P>
+<P>
+The escape sequence \C can be used to match a single code unit in 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).
+documentation). For this reason, there is a build-time option that disables
+support for \C completely. There is also a less draconian compile-time option
+for locking out the use of \C when a pattern is compiled.
 </P>
 <P>
 The use of \C is not supported by the alternative matching function
@@ -86,7 +104,7 @@ may consist of more than one code unit. The use of \C in these modes provokes
 a match-time error. Also, the JIT optimization does not support \C in these
 modes. If JIT optimization is requested for a UTF-8 or UTF-16 pattern that
 contains \C, it will not succeed, and so when <b>pcre2_match()</b> is called,
-the matching will be carried out by the normal interpretive function.
+the matching will be carried out by the interpretive function.
 </P>
 <P>
 The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly test
@@ -116,25 +134,157 @@ However, the special horizontal and vertical white space matching escapes (\h,
 not PCRE2_UCP is set.
 </P>
 <br><b>
-CASE-EQUIVALENCE IN UTF MODES
+CASE-EQUIVALENCE IN UTF MODE
 </b><br>
 <P>
-Case-insensitive matching in UTF mode makes use of Unicode properties except
+Case-insensitive matching in UTF mode makes use of Unicode properties except
 for characters whose code points are less than 128 and that have at most two
 case-equivalent values. For these, a direct table lookup is used for speed. A
 few Unicode characters such as Greek sigma have more than two code points that
-are case-equivalent, and these are treated as such.
+are case-equivalent, and these are treated specially.
+<a name="scriptruns"></a></P>
+<br><b>
+SCRIPT RUNS
+</b><br>
+<P>
+The pattern constructs (*script_run:...) and (*atomic_script_run:...), with
+synonyms (*sr:...) and (*asr:...), verify that the string matched within the
+parentheses is a script run. In concept, a script run is a sequence of
+characters that are all from the same Unicode script. However, because some
+scripts are commonly used together, and because some diacritical and other
+marks are used with multiple scripts, it is not that simple.
+</P>
+<P>
+Every Unicode character has a Script property, mostly with a value
+corresponding to the name of a script, such as Latin, Greek, or Cyrillic. There
+are also three special values:
+</P>
+<P>
+"Unknown" is used for code points that have not been assigned, and also for the
+surrogate code points. In the PCRE2 32-bit library, characters whose code
+points are greater than the Unicode maximum (U+10FFFF), which are accessible
+only in non-UTF mode, are assigned the Unknown script.
+</P>
+<P>
+"Common" is used for characters that are used with many scripts. These include
+punctuation, emoji, mathematical, musical, and currency symbols, and the ASCII
+digits 0 to 9.
+</P>
+<P>
+"Inherited" is used for characters such as diacritical marks that modify a
+previous character. These are considered to take on the script of the character
+that they modify.
+</P>
+<P>
+Some Inherited characters are used with many scripts, but many of them are only
+normally used with a small number of scripts. For example, U+102E0 (Coptic
+Epact thousands mark) is used only with Arabic and Coptic. In order to make it
+possible to check this, a Unicode property called Script Extension exists. Its
+value is a list of scripts that apply to the character. For the majority of
+characters, the list contains just one script, the same one as the Script
+property. However, for characters such as U+102E0 more than one Script is
+listed. There are also some Common characters that have a single, non-Common
+script in their Script Extension list.
+</P>
+<P>
+The next section describes the basic rules for deciding whether a given string
+of characters is a script run. Note, however, that there are some special cases
+involving the Chinese Han script, and an additional constraint for decimal
+digits. These are covered in subsequent sections.
+</P>
+<br><b>
+Basic script run rules
+</b><br>
+<P>
+A string that is less than two characters long is a script run. This is the
+only case in which an Unknown character can be part of a script run. Longer
+strings are checked using only the Script Extensions property, not the basic
+Script property.
+</P>
+<P>
+If a character's Script Extension property is the single value "Inherited", it
+is always accepted as part of a script run. This is also true for the property
+"Common", subject to the checking of decimal digits described below. All the
+remaining characters in a script run must have at least one script in common in
+their Script Extension lists. In set-theoretic terminology, the intersection of
+all the sets of scripts must not be empty.
+</P>
+<P>
+A simple example is an Internet name such as "google.com". The letters are all
+in the Latin script, and the dot is Common, so this string is a script run.
+However, the Cyrillic letter "o" looks exactly the same as the Latin "o"; a
+string that looks the same, but with Cyrillic "o"s is not a script run.
+</P>
+<P>
+More interesting examples involve characters with more than one script in their
+Script Extension. Consider the following characters:
+<pre>
+  U+060C  Arabic comma
+  U+06D4  Arabic full stop
+</pre>
+The first has the Script Extension list Arabic, Hanifi Rohingya, Syriac, and
+Thaana; the second has just Arabic and Hanifi Rohingya. Both of them could
+appear in script runs of either Arabic or Hanifi Rohingya. The first could also
+appear in Syriac or Thaana script runs, but the second could not.
+</P>
+<br><b>
+The Chinese Han script
+</b><br>
+<P>
+The Chinese Han script is commonly used in conjunction with other scripts for
+writing certain languages. Japanese uses the Hiragana and Katakana scripts
+together with Han; Korean uses Hangul and Han; Taiwanese Mandarin uses Bopomofo
+and Han. These three combinations are treated as special cases when checking
+script runs and are, in effect, "virtual scripts". Thus, a script run may
+contain a mixture of Hiragana, Katakana, and Han, or a mixture of Hangul and
+Han, or a mixture of Bopomofo and Han, but not, for example, a mixture of
+Hangul and Bopomofo and Han. PCRE2 (like Perl) follows Unicode's Technical
+Standard 39 ("Unicode Security Mechanisms", http://unicode.org/reports/tr39/)
+in allowing such mixtures.
+</P>
+<br><b>
+Decimal digits
+</b><br>
+<P>
+Unicode contains many sets of 10 decimal digits in different scripts, and some
+scripts (including the Common script) contain more than one set. Some of these
+decimal digits them are visually indistinguishable from the common ASCII
+digits. In addition to the script checking described above, if a script run
+contains any decimal digits, they must all come from the same set of 10
+adjacent characters.
 </P>
 <br><b>
 VALIDITY OF UTF STRINGS
 </b><br>
 <P>
 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 <b>pcre2_get_startchar()</b>, which is used for this
-purpose after a UTF error.
+are (by default) checked for validity on entry to the relevant functions. If an
+invalid UTF string is passed, a negative error code is returned. The code unit
+offset to the offending character can be extracted from the match data block by
+calling <b>pcre2_get_startchar()</b>, which is used for this purpose after a UTF
+error.
+</P>
+<P>
+In some situations, you may already know that your strings are valid, and
+therefore want to skip these checks in order to improve performance, 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 compile time or at match time,
+PCRE2 assumes that the pattern or subject it is given (respectively) contains
+only valid UTF code unit sequences.
+</P>
+<P>
+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 or give incorrect
+results. There is, however, one mode of matching that can handle invalid UTF
+subject strings. This is enabled by passing PCRE2_MATCH_INVALID_UTF to
+<b>pcre2_compile()</b> and is discussed below in the next section. The rest of
+this section covers the case when PCRE2_MATCH_INVALID_UTF is not set.
+</P>
+<P>
+Passing PCRE2_NO_UTF_CHECK to <b>pcre2_compile()</b> just disables the UTF 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 same option to
+<b>pcre2_match()</b> or <b>pcre2_dfa_match()</b>.
 </P>
 <P>
 UTF-16 and UTF-32 strings can indicate their endianness by special code knows
@@ -142,13 +292,14 @@ as a byte-order mark (BOM). The PCRE2 functions do not handle this, expecting
 strings to be in host byte order.
 </P>
 <P>
-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
+Unless PCRE2_NO_UTF_CHECK is set, 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.
@@ -168,31 +319,12 @@ surrogate thing is a fudge for UTF-16 which unfortunately messes up UTF-8 and
 UTF-32.)
 </P>
 <P>
-In some situations, you may already know that your strings are valid, and
-therefore want to skip these checks in order to improve performance, 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 compile time or at match time,
-PCRE2 assumes that the pattern or subject it is given (respectively) contains
-only valid UTF code unit sequences.
-</P>
-<P>
-Passing PCRE2_NO_UTF_CHECK to <b>pcre2_compile()</b> 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 <b>pcre2_match()</b>
-or <b>pcre2_dfa_match()</b>.
-</P>
-<P>
-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.
-</P>
-<P>
-Note that setting PCRE2_NO_UTF_CHECK at compile time does not disable the error
-that is given if an escape sequence for an invalid Unicode code point is
-encountered in the pattern. If you want to allow escape sequences such as
-\x{d800} (a surrogate code point) you can set the
-PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES extra option. However, this is possible
-only in UTF-8 and UTF-32 modes, because these values are not representable in
-UTF-16.
+Setting PCRE2_NO_UTF_CHECK at compile time does not disable the error that is
+given if an escape sequence for an invalid Unicode code point is encountered in
+the pattern. If you want to allow escape sequences such as \x{d800} (a
+surrogate code point) you can set the PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES extra
+option. However, this is possible only in UTF-8 and UTF-32 modes, because these
+values are not representable in UTF-16.
 <a name="utf8strings"></a></P>
 <br><b>
 Errors in UTF-8 strings
@@ -230,7 +362,7 @@ these code points are excluded by RFC 3629.
 <pre>
   PCRE2_ERROR_UTF8_ERR13
 </pre>
-A 4-byte character has a value greater than 0x10fff; these code points are
+A 4-byte character has a value greater than 0x10ffff; these code points are
 excluded by RFC 3629.
 <pre>
   PCRE2_ERROR_UTF8_ERR14
@@ -283,7 +415,59 @@ The following negative error codes are given for invalid UTF-32 strings:
   PCRE2_ERROR_UTF32_ERR1  Surrogate character (0xd800 to 0xdfff)
   PCRE2_ERROR_UTF32_ERR2  Code point is greater than 0x10ffff
 
-</PRE>
+<a name="matchinvalid"></a></PRE>
+</P>
+<br><b>
+MATCHING IN INVALID UTF STRINGS
+</b><br>
+<P>
+You can run pattern matches on subject strings that may contain invalid UTF
+sequences if you call <b>pcre2_compile()</b> with the PCRE2_MATCH_INVALID_UTF
+option. This is supported by <b>pcre2_match()</b>, including JIT matching, but
+not by <b>pcre2_dfa_match()</b>. When PCRE2_MATCH_INVALID_UTF is set, it forces
+PCRE2_UTF to be set as well. Note, however, that the pattern itself must be a
+valid UTF string.
+</P>
+<P>
+Setting PCRE2_MATCH_INVALID_UTF does not affect what <b>pcre2_compile()</b>
+generates, but if <b>pcre2_jit_compile()</b> is subsequently called, it does
+generate different code. If JIT is not used, the option affects the behaviour
+of the interpretive code in <b>pcre2_match()</b>. When PCRE2_MATCH_INVALID_UTF
+is set at compile time, PCRE2_NO_UTF_CHECK is ignored at match time.
+</P>
+<P>
+In this mode, an invalid code unit sequence in the subject never matches any
+pattern item. It does not match dot, it does not match \p{Any}, it does not
+even match negative items such as [^X]. A lookbehind assertion fails if it
+encounters an invalid sequence while moving the current point backwards. In
+other words, an invalid UTF code unit sequence acts as a barrier which no match
+can cross.
+</P>
+<P>
+You can also think of this as the subject being split up into fragments of
+valid UTF, delimited internally by invalid code unit sequences. The pattern is
+matched fragment by fragment. The result of a successful match, however, is
+given as code unit offsets in the entire subject string in the usual way. There
+are a few points to consider:
+</P>
+<P>
+The internal boundaries are not interpreted as the beginnings or ends of lines
+and so do not match circumflex or dollar characters in the pattern.
+</P>
+<P>
+If <b>pcre2_match()</b> is called with an offset that points to an invalid
+UTF-sequence, that sequence is skipped, and the match starts at the next valid
+UTF character, or the end of the subject.
+</P>
+<P>
+At internal fragment boundaries, \b and \B behave in the same way as at the
+beginning and end of the subject. For example, a sequence such as \bWORD\b
+would match an instance of WORD that is surrounded by invalid UTF code units.
+</P>
+<P>
+Using PCRE2_MATCH_INVALID_UTF, an application can run matches on arbitrary
+data, knowing that any matched strings that are returned are valid UTF. This
+can be useful when searching for UTF text in executable or other binary files.
 </P>
 <br><b>
 AUTHOR
@@ -300,9 +484,9 @@ Cambridge, England.
 REVISION
 </b><br>
 <P>
-Last updated: 02 September 2018
+Last updated: 24 May 2019
 <br>
-Copyright &copy; 1997-2018 University of Cambridge.
+Copyright &copy; 1997-2019 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE2 index page</a>.
index 82b43c352caa77b5f83816aa0e091437ff02e599..2c7c5fb2e280f9f4669771a80743511113499fed 100644 (file)
@@ -146,6 +146,9 @@ in the library.
 <tr><td><a href="pcre2_get_mark.html">pcre2_get_mark</a></td>
     <td>&nbsp;&nbsp;Get a (*MARK) name</td></tr>
 
+<tr><td><a href="pcre2_get_match_data_size.html">pcre2_get_match_data_size</a></td>
+    <td>&nbsp;&nbsp;Get the size of a match data block</td></tr>
+
 <tr><td><a href="pcre2_get_ovector_count.html">pcre2_get_ovector_count</a></td>
     <td>&nbsp;&nbsp;Get the ovector count</td></tr>
 
@@ -176,6 +179,9 @@ in the library.
 <tr><td><a href="pcre2_maketables.html">pcre2_maketables</a></td>
     <td>&nbsp;&nbsp;Build character tables in current locale</td></tr>
 
+<tr><td><a href="pcre2_maketables_free.html">pcre2_maketables_free</a></td>
+    <td>&nbsp;&nbsp;Free character tables</td></tr>
+
 <tr><td><a href="pcre2_match.html">pcre2_match</a></td>
     <td>&nbsp;&nbsp;Match a compiled pattern to a subject string
     (Perl compatible)</td></tr>
index 8ddea2a3a5b2f744c09d559aaa1079e740d38a7f..33785f4b386ebe7b3679a60016db93f424d413f5 100644 (file)
@@ -16,8 +16,8 @@ DESCRIPTION
 
        pcre2-config returns the configuration of the installed PCRE2 libraries
        and the options required to compile a program to use them. Some of  the
-       options  apply  only  to  the  8-bit,  or  16-bit, or 32-bit libraries,
-       respectively, and are not available for libraries that  have  not  been
+       options  apply  only  to the 8-bit, or 16-bit, or 32-bit libraries, re-
+       spectively, and are not available for  libraries  that  have  not  been
        built. If an unavailable option is encountered, the "usage" information
        is output.
 
@@ -36,30 +36,30 @@ OPTIONS
        --version Writes the version number of the installed PCRE2 libraries to
                  the standard output.
 
-       --libs8   Writes  to  the  standard  output  the  command  line options
-                 required to link with the 8-bit PCRE2 library  (-lpcre2-8  on
+       --libs8   Writes  to  the  standard output the command line options re-
+                 quired to link with the 8-bit  PCRE2  library  (-lpcre2-8  on
                  many systems).
 
-       --libs16  Writes  to  the  standard  output  the  command  line options
-                 required to link with the 16-bit PCRE2 library (-lpcre2-16 on
+       --libs16  Writes  to  the  standard output the command line options re-
+                 quired to link with the 16-bit PCRE2 library  (-lpcre2-16  on
                  many systems).
 
-       --libs32  Writes  to  the  standard  output  the  command  line options
-                 required to link with the 32-bit PCRE2 library (-lpcre2-32 on
+       --libs32  Writes  to  the  standard output the command line options re-
+                 quired to link with the 32-bit PCRE2 library  (-lpcre2-32  on
                  many systems).
 
        --libs-posix
-                 Writes  to  the  standard  output  the  command  line options
-                 required to link  with  PCRE2's  POSIX  API  wrapper  library
+                 Writes  to  the  standard output the command line options re-
+                 quired  to  link  with  PCRE2's  POSIX  API  wrapper  library
                  (-lpcre2-posix -lpcre2-8 on many systems).
 
-       --cflags  Writes  to  the  standard  output  the  command  line options
-                 required to compile files that use PCRE2  (this  may  include
-                 some -I options, but is blank on many systems).
+       --cflags  Writes  to  the  standard output the command line options re-
+                 quired to compile files that use PCRE2 (this may include some
+                 -I options, but is blank on many systems).
 
        --cflags-posix
-                 Writes  to  the  standard  output  the  command  line options
-                 required to compile files that use PCRE2's POSIX API  wrapper
+                 Writes  to  the  standard output the command line options re-
+                 quired to compile files that use PCRE2's  POSIX  API  wrapper
                  library  (this  may  include some -I options, but is blank on
                  many systems).
 
index 2f836585cb2a747204639eb308e99f0d56bfb9bb..75450ecd7eec7db761390ddd3c732d5e556740a5 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2 3 "11 July 2018" "PCRE2 10.32"
+.TH PCRE2 3 "17 September 2018" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH INTRODUCTION
@@ -156,7 +156,7 @@ listing), and the short pages for individual functions, are concatenated in
   pcre2-config       show PCRE2 installation configuration information
   pcre2api           details of PCRE2's native C API
   pcre2build         building PCRE2
-  pcre2callout       details of the callout feature
+  pcre2callout       details of the pattern callout feature
   pcre2compat        discussion of Perl compatibility
   pcre2convert       details of pattern conversion functions
   pcre2demo          a demonstration C program that uses PCRE2
@@ -197,6 +197,6 @@ use my two initials, followed by the two digits 10, at the domain cam.ac.uk.
 .rs
 .sp
 .nf
-Last updated: 11 July 2018
+Last updated: 17 September 2018
 Copyright (c) 1997-2018 University of Cambridge.
 .fi
index 30ba2f9e53fe8be659c5d8958628bd78abbf9bf4..948b91a9772fe290ad5888e0dd99454098a917d8 100644 (file)
@@ -31,8 +31,8 @@ INTRODUCTION
        appeared in Python and the original PCRE before they appeared  in  Perl
        are  available  using the Python syntax. There is also some support for
        one or two .NET and Oniguruma syntax items, and there are  options  for
-       requesting   some  minor  changes  that  give  better  ECMAScript  (aka
-       JavaScript) compatibility.
+       requesting  some  minor  changes that give better ECMAScript (aka Java-
+       Script) compatibility.
 
        The source code for PCRE2 can be compiled to support 8-bit, 16-bit,  or
        32-bit  code units, which means that up to three separate libraries may
@@ -111,9 +111,9 @@ 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 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
+       middle of a multi-code-unit character. The PCRE2_NEVER_BACKSLASH_C  op-
+       tion 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
@@ -141,7 +141,7 @@ USER DOCUMENTATION
          pcre2-config       show PCRE2 installation configuration information
          pcre2api           details of PCRE2's native C API
          pcre2build         building PCRE2
-         pcre2callout       details of the callout feature
+         pcre2callout       details of the pattern callout feature
          pcre2compat        discussion of Perl compatibility
          pcre2convert       details of pattern conversion functions
          pcre2demo          a demonstration C program that uses PCRE2
@@ -177,7 +177,7 @@ AUTHOR
 
 REVISION
 
-       Last updated: 11 July 2018
+       Last updated: 17 September 2018
        Copyright (c) 1997-2018 University of Cambridge.
 ------------------------------------------------------------------------------
 
@@ -261,7 +261,7 @@ PCRE2 NATIVE API COMPILE CONTEXT FUNCTIONS
          uint32_t value);
 
        int pcre2_set_character_tables(pcre2_compile_context *ccontext,
-         const unsigned char *tables);
+         const uint8_t *tables);
 
        int pcre2_set_compile_extra_options(pcre2_compile_context *ccontext,
          uint32_t extra_options);
@@ -293,6 +293,10 @@ PCRE2 NATIVE API MATCH CONTEXT FUNCTIONS
          int (*callout_function)(pcre2_callout_block *, void *),
          void *callout_data);
 
+       int pcre2_set_substitute_callout(pcre2_match_context *mcontext,
+         int (*callout_function)(pcre2_substitute_callout_block *, void *),
+         void *callout_data);
+
        int pcre2_set_offset_limit(pcre2_match_context *mcontext,
          PCRE2_SIZE value);
 
@@ -396,9 +400,13 @@ PCRE2 NATIVE API AUXILIARY FUNCTIONS
        int pcre2_get_error_message(int errorcode, PCRE2_UCHAR *buffer,
          PCRE2_SIZE bufflen);
 
-       const unsigned char *pcre2_maketables(pcre2_general_context *gcontext);
+       const uint8_t *pcre2_maketables(pcre2_general_context *gcontext);
 
-       int pcre2_pattern_info(const pcre2 *code, uint32_t what, void *where);
+       void pcre2_maketables_free(pcre2_general_context *gcontext,
+         const uint8_t *tables);
+
+       int pcre2_pattern_info(const pcre2_code *code, uint32_t what,
+         void *where);
 
        int pcre2_callout_enumerate(const pcre2_code *code,
          int (*callback)(pcre2_callout_enumerate_block *, void *),
@@ -446,8 +454,8 @@ PCRE2 EXPERIMENTAL PATTERN CONVERSION FUNCTIONS
        void pcre2_converted_pattern_free(PCRE2_UCHAR *converted_pattern);
 
        These functions provide a way of  converting  non-PCRE2  patterns  into
-       patterns  that  can  be  processed by pcre2_compile(). This facility is
-       experimental and may be changed in future releases. At present, "globs"
+       patterns that can be processed by pcre2_compile(). This facility is ex-
+       perimental and may be changed in future releases. At  present,  "globs"
        and  POSIX  basic  and  extended patterns can be converted. Details are
        given in the pcre2convert documentation.
 
@@ -538,22 +546,22 @@ PCRE2 API OVERVIEW
 
        The compiling and matching functions recognize various options that are
        passed as bits in an options argument. There are also some more compli-
-       cated  parameters  such  as  custom  memory  management  functions  and
-       resource  limits  that  are passed in "contexts" (which are just memory
+       cated parameters such as custom memory  management  functions  and  re-
+       source  limits  that  are  passed  in "contexts" (which are just memory
        blocks, described below). Simple applications do not need to  make  use
        of contexts.
 
        Just-in-time  (JIT)  compiler  support  is an optional feature of PCRE2
        that can be built in  appropriate  hardware  environments.  It  greatly
-       speeds  up  the  matching  performance  of  many patterns. Programs can
-       request that it be used if  available  by  calling  pcre2_jit_compile()
-       after a pattern has been successfully compiled by pcre2_compile(). This
-       does nothing if JIT support is not available.
+       speeds  up  the matching performance of many patterns. Programs can re-
+       quest that it be used if available by calling pcre2_jit_compile() after
+       a  pattern has been successfully compiled by pcre2_compile(). This does
+       nothing if JIT support is not available.
 
        More complicated programs might need to  make  use  of  the  specialist
        functions    pcre2_jit_stack_create(),    pcre2_jit_stack_free(),   and
-       pcre2_jit_stack_assign() in order to  control  the  JIT  code's  memory
-       usage.
+       pcre2_jit_stack_assign() in order to control the JIT code's memory  us-
+       age.
 
        JIT matching is automatically used by pcre2_match() if it is available,
        unless the PCRE2_NO_JIT option is set. There is also a direct interface
@@ -565,13 +573,12 @@ PCRE2 API OVERVIEW
        patible, is also provided. This uses  a  different  algorithm  for  the
        matching.  The  alternative  algorithm finds all possible matches (at a
        given point in the subject), and scans the subject  just  once  (unless
-       there  are  lookaround  assertions).  However,  this algorithm does not
-       return captured substrings. A description of  the  two  matching  algo-
-       rithms   and  their  advantages  and  disadvantages  is  given  in  the
-       pcre2matching   documentation.   There   is   no   JIT   support    for
-       pcre2_dfa_match().
+       there  are lookaround assertions). However, this algorithm does not re-
+       turn captured substrings. A description of the two matching  algorithms
+       and  their  advantages  and disadvantages is given in the pcre2matching
+       documentation. There is no JIT support for pcre2_dfa_match().
 
-       In  addition  to  the  main compiling and matching functions, there are
+       In addition to the main compiling and  matching  functions,  there  are
        convenience functions for extracting captured substrings from a subject
        string that has been matched by pcre2_match(). They are:
 
@@ -585,97 +592,97 @@ PCRE2 API OVERVIEW
          pcre2_substring_nametable_scan()
          pcre2_substring_number_from_name()
 
-       pcre2_substring_free()  and  pcre2_substring_list_free()  are also pro-
-       vided, to free memory used for extracted strings. If  either  of  these
-       functions  is called with a NULL argument, the function returns immedi-
+       pcre2_substring_free() and pcre2_substring_list_free()  are  also  pro-
+       vided,  to  free  memory used for extracted strings. If either of these
+       functions is called with a NULL argument, the function returns  immedi-
        ately without doing anything.
 
-       The function pcre2_substitute() can be called to match  a  pattern  and
-       return  a  copy of the subject string with substitutions for parts that
+       The  function  pcre2_substitute()  can be called to match a pattern and
+       return a copy of the subject string with substitutions for  parts  that
        were matched.
 
-       Functions whose names begin with pcre2_serialize_ are used  for  saving
+       Functions  whose  names begin with pcre2_serialize_ are used for saving
        compiled patterns on disc or elsewhere, and reloading them later.
 
-       Finally,  there  are functions for finding out information about a com-
-       piled pattern (pcre2_pattern_info()) and about the  configuration  with
+       Finally, there are functions for finding out information about  a  com-
+       piled  pattern  (pcre2_pattern_info()) and about the configuration with
        which PCRE2 was built (pcre2_config()).
 
-       Functions  with  names  ending with _free() are used for freeing memory
-       blocks of various sorts. In all cases, if one  of  these  functions  is
+       Functions with names ending with _free() are used  for  freeing  memory
+       blocks  of  various  sorts.  In all cases, if one of these functions is
        called with a NULL argument, it does nothing.
 
 
 STRING LENGTHS AND OFFSETS
 
-       The  PCRE2  API  uses  string  lengths and offsets into strings of code
-       units in several places. These values are always  of  type  PCRE2_SIZE,
-       which  is an unsigned integer type, currently always defined as size_t.
-       The largest  value  that  can  be  stored  in  such  a  type  (that  is
-       ~(PCRE2_SIZE)0)  is reserved as a special indicator for zero-terminated
-       strings and unset offsets.  Therefore, the longest string that  can  be
+       The PCRE2 API uses string lengths and  offsets  into  strings  of  code
+       units  in  several  places. These values are always of type PCRE2_SIZE,
+       which is an unsigned integer type, currently always defined as  size_t.
+       The  largest  value  that  can  be  stored  in  such  a  type  (that is
+       ~(PCRE2_SIZE)0) is reserved as a special indicator for  zero-terminated
+       strings  and  unset offsets.  Therefore, the longest string that can be
        handled is one less than this maximum.
 
 
 NEWLINES
 
        PCRE2 supports five different conventions for indicating line breaks in
-       strings: a single CR (carriage return) character, a  single  LF  (line-
+       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 Unicode newline  sequences
-       are  the  three just mentioned, plus the single characters VT (vertical
+       ceding,  or any Unicode newline sequence. The Unicode newline sequences
+       are the three just mentioned, plus the single characters  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+2029).
 
-       Each  of  the first three conventions is used by at least one operating
+       Each of the first three conventions is used by at least  one  operating
        system as its standard newline sequence. When PCRE2 is built, a default
        can be specified.  If it is not, the default is set to LF, which is the
-       Unix standard. However, the newline convention can  be  changed  by  an
-       application  when  calling  pcre2_compile(),  or it can be specified by
-       special text at the start of the pattern  itself;  this  overrides  any
-       other  settings.  See  the pcre2pattern page for details of the special
-       character sequences.
+       Unix standard. However, the newline convention can be changed by an ap-
+       plication when calling pcre2_compile(), or it can be specified by  spe-
+       cial  text at the start of the pattern itself; this overrides any other
+       settings. See the pcre2pattern page for details of the special  charac-
+       ter sequences.
 
-       In the PCRE2 documentation the word "newline"  is  used  to  mean  "the
+       In  the  PCRE2  documentation  the  word "newline" is used to mean "the
        character or pair of characters that indicate a line break". The choice
-       of newline convention affects the handling of the dot, circumflex,  and
+       of  newline convention affects the handling of the dot, circumflex, and
        dollar metacharacters, the handling of #-comments in /x mode, and, when
-       CRLF is a recognized line ending sequence, the match position  advance-
+       CRLF  is a recognized line ending sequence, the match position advance-
        ment for a non-anchored pattern. There is more detail about this in the
        section on pcre2_match() options below.
 
-       The choice of newline convention does not affect the interpretation  of
+       The  choice of newline convention does not affect the interpretation of
        the \n or \r escape sequences, nor does it affect what \R matches; this
        has its own separate convention.
 
 
 MULTITHREADING
 
-       In a multithreaded application it is important to keep  thread-specific
-       data  separate  from data that can be shared between threads. The PCRE2
-       library code itself is thread-safe: it contains  no  static  or  global
-       variables.  The  API  is  designed to be fairly simple for non-threaded
-       applications while at the same time ensuring that multithreaded  appli-
-       cations can use it.
+       In  a multithreaded application it is important to keep thread-specific
+       data separate from data that can be shared between threads.  The  PCRE2
+       library  code  itself  is  thread-safe: it contains no static or global
+       variables. The API is designed to be fairly simple for non-threaded ap-
+       plications  while at the same time ensuring that multithreaded applica-
+       tions can use it.
 
        There are several different blocks of data that are used to pass infor-
        mation between the application and the PCRE2 libraries.
 
    The compiled pattern
 
-       A pointer to the compiled form of a pattern is  returned  to  the  user
+       A  pointer  to  the  compiled form of a pattern is returned to the user
        when pcre2_compile() is successful. The data in the compiled pattern is
-       fixed, and does not change when the pattern is matched.  Therefore,  it
-       is  thread-safe, that is, the same compiled pattern can be used by more
+       fixed,  and  does not change when the pattern is matched. Therefore, it
+       is thread-safe, that is, the same compiled pattern can be used by  more
        than one thread simultaneously. For example, an application can compile
        all its patterns at the start, before forking off multiple threads that
-       use them. However, if the just-in-time (JIT)  optimization  feature  is
-       being  used,  it needs separate memory stack areas for each thread. See
+       use  them.  However,  if the just-in-time (JIT) optimization feature is
+       being used, it needs separate memory stack areas for each  thread.  See
        the pcre2jit documentation for more details.
 
-       In a more complicated situation, where patterns are compiled only  when
-       they  are  first needed, but are still shared between threads, pointers
-       to compiled patterns must be protected  from  simultaneous  writing  by
+       In  a more complicated situation, where patterns are compiled only when
+       they are first needed, but are still shared between  threads,  pointers
+       to  compiled  patterns  must  be protected from simultaneous writing by
        multiple threads, at least until a pattern has been compiled. The logic
        can be something like this:
 
@@ -688,72 +695,72 @@ MULTITHREADING
          Release the lock
          Use pointer in pcre2_match()
 
-       Of course, testing for compilation errors should also  be  included  in
+       Of  course,  testing  for compilation errors should also be included in
        the code.
 
        If JIT is being used, but the JIT compilation is not being done immedi-
-       ately, (perhaps waiting to see if the pattern  is  used  often  enough)
+       ately,  (perhaps  waiting  to  see if the pattern is used often enough)
        similar logic is required. JIT compilation updates a pointer within the
-       compiled code block, so a thread must gain unique write access  to  the
-       pointer     before    calling    pcre2_jit_compile().    Alternatively,
-       pcre2_code_copy()  or  pcre2_code_copy_with_tables()  can  be  used  to
-       obtain  a private copy of the compiled code before calling the JIT com-
+       compiled  code  block, so a thread must gain unique write access to the
+       pointer    before    calling    pcre2_jit_compile().     Alternatively,
+       pcre2_code_copy()  or  pcre2_code_copy_with_tables() can be used to ob-
+       tain a private copy of the compiled code before calling  the  JIT  com-
        piler.
 
    Context blocks
 
-       The next main section below introduces the idea of "contexts" in  which
+       The  next main section below introduces the idea of "contexts" in which
        PCRE2 functions are called. A context is nothing more than a collection
        of parameters that control the way PCRE2 operates. Grouping a number of
        parameters together in a context is a convenient way of passing them to
-       a PCRE2 function without using lots of arguments. The  parameters  that
-       are  stored  in  contexts  are in some sense "advanced features" of the
+       a  PCRE2  function without using lots of arguments. The parameters that
+       are stored in contexts are in some sense  "advanced  features"  of  the
        API. Many straightforward applications will not need to use contexts.
 
        In a multithreaded application, if the parameters in a context are val-
-       ues  that  are  never  changed, the same context can be used by all the
+       ues that are never changed, the same context can be  used  by  all  the
        threads. However, if any thread needs to change any value in a context,
        it must make its own thread-specific copy.
 
    Match blocks
 
-       The  matching  functions need a block of memory for storing the results
+       The matching functions need a block of memory for storing  the  results
        of a match. This includes details of what was matched, as well as addi-
-       tional  information  such as the name of a (*MARK) setting. Each thread
+       tional information such as the name of a (*MARK) setting.  Each  thread
        must provide its own copy of this memory.
 
 
 PCRE2 CONTEXTS
 
-       Some PCRE2 functions have a lot of parameters, many of which  are  used
-       only  by  specialist  applications,  for example, those that use custom
-       memory management or non-standard character tables.  To  keep  function
-       argument  lists  at a reasonable size, and at the same time to keep the
-       API extensible, "uncommon" parameters are passed to  certain  functions
-       in  a  context instead of directly. A context is just a block of memory
-       that holds the parameter values.  Applications  that  do  not  need  to
-       adjust  any  of  the  context  parameters  can pass NULL when a context
-       pointer is required.
-
-       There are three different types of context: a general context  that  is
-       relevant  for  several  PCRE2 operations, a compile-time context, and a
+       Some  PCRE2  functions have a lot of parameters, many of which are used
+       only by specialist applications, for example,  those  that  use  custom
+       memory  management  or  non-standard character tables. To keep function
+       argument lists at a reasonable size, and at the same time to  keep  the
+       API  extensible,  "uncommon" parameters are passed to certain functions
+       in a context instead of directly. A context is just a block  of  memory
+       that  holds the parameter values.  Applications that do not need to ad-
+       just any of the context parameters can pass NULL when a context pointer
+       is required.
+
+       There  are  three different types of context: a general context that is
+       relevant for several PCRE2 operations, a compile-time  context,  and  a
        match-time context.
 
    The general context
 
-       At present, this context just  contains  pointers  to  (and  data  for)
-       external  memory  management  functions  that  are  called from several
-       places in the PCRE2 library. The context is named `general' rather than
-       specifically  `memory'  because in future other fields may be added. If
-       you do not want to supply your own custom memory management  functions,
-       you  do not need to bother with a general context. A general context is
+       At  present,  this context just contains pointers to (and data for) ex-
+       ternal memory management functions that are called from several  places
+       in  the  PCRE2  library.  The  context  is  named `general' rather than
+       specifically `memory' because in future other fields may be  added.  If
+       you  do not want to supply your own custom memory management functions,
+       you do not need to bother with a general context. A general context  is
        created by:
 
        pcre2_general_context *pcre2_general_context_create(
          void *(*private_malloc)(PCRE2_SIZE, void *),
          void (*private_free)(void *, void *), void *memory_data);
 
-       The two function pointers specify custom memory  management  functions,
+       The  two  function pointers specify custom memory management functions,
        whose prototypes are:
 
          void *private_malloc(PCRE2_SIZE, void *);
@@ -761,16 +768,16 @@ PCRE2 CONTEXTS
 
        Whenever code in PCRE2 calls these functions, the final argument is the
        value of memory_data. Either of the first two arguments of the creation
-       function  may be NULL, in which case the system memory management func-
-       tions malloc() and free() are used. (This is not currently  useful,  as
-       there  are  no  other  fields in a general context, but in future there
-       might be.)  The private_malloc() function  is  used  (if  supplied)  to
-       obtain  memory  for storing the context, and all three values are saved
-       as part of the context.
-
-       Whenever PCRE2 creates a data block of any kind, the block  contains  a
-       pointer  to the free() function that matches the malloc() function that
-       was used. When the time comes to  free  the  block,  this  function  is
+       function may be NULL, in which case the system memory management  func-
+       tions  malloc()  and free() are used. (This is not currently useful, as
+       there are no other fields in a general context,  but  in  future  there
+       might  be.)  The private_malloc() function is used (if supplied) to ob-
+       tain memory for storing the context, and all three values are saved  as
+       part of the context.
+
+       Whenever  PCRE2  creates a data block of any kind, the block contains a
+       pointer to the free() function that matches the malloc() function  that
+       was  used.  When  the  time  comes  to free the block, this function is
        called.
 
        A general context can be copied by calling:
@@ -782,13 +789,13 @@ PCRE2 CONTEXTS
 
        void pcre2_general_context_free(pcre2_general_context *gcontext);
 
-       If  this  function  is  passed  a NULL argument, it returns immediately
+       If this function is passed a  NULL  argument,  it  returns  immediately
        without doing anything.
 
    The compile context
 
-       A compile context is required if you want to provide an external  func-
-       tion  for  stack  checking  during compilation or to change the default
+       A  compile context is required if you want to provide an external func-
+       tion for stack checking during compilation or  to  change  the  default
        values of any of the following compile-time parameters:
 
          What \R matches (Unicode newlines or CR, LF, CRLF only)
@@ -798,11 +805,11 @@ PCRE2 CONTEXTS
          The maximum length of the pattern string
          The extra options bits (none set by default)
 
-       A compile context is also required if you are using custom memory  man-
-       agement.   If  none of these apply, just pass NULL as the context argu-
+       A  compile context is also required if you are using custom memory man-
+       agement.  If none of these apply, just pass NULL as the  context  argu-
        ment of pcre2_compile().
 
-       A compile context is created, copied, and freed by the following  func-
+       A  compile context is created, copied, and freed by the following func-
        tions:
 
        pcre2_compile_context *pcre2_compile_context_create(
@@ -813,91 +820,91 @@ PCRE2 CONTEXTS
 
        void pcre2_compile_context_free(pcre2_compile_context *ccontext);
 
-       A  compile  context  is created with default values for its parameters.
+       A compile 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.
 
        int pcre2_set_bsr(pcre2_compile_context *ccontext,
          uint32_t value);
 
-       The  value  must  be PCRE2_BSR_ANYCRLF, to specify that \R matches only
-       CR, LF, or CRLF, or PCRE2_BSR_UNICODE, to specify that \R  matches  any
+       The value must be PCRE2_BSR_ANYCRLF, to specify that  \R  matches  only
+       CR,  LF,  or CRLF, or PCRE2_BSR_UNICODE, to specify that \R matches any
        Unicode line ending sequence. The value is used by the JIT compiler and
-       by  the  two  interpreted   matching   functions,   pcre2_match()   and
+       by   the   two   interpreted   matching  functions,  pcre2_match()  and
        pcre2_dfa_match().
 
        int pcre2_set_character_tables(pcre2_compile_context *ccontext,
-         const unsigned char *tables);
+         const uint8_t *tables);
 
-       The  value  must  be  the result of a call to pcre2_maketables(), whose
+       The value must be the result of a  call  to  pcre2_maketables(),  whose
        only argument is a general context. This function builds a set of char-
        acter tables in the current locale.
 
        int pcre2_set_compile_extra_options(pcre2_compile_context *ccontext,
          uint32_t extra_options);
 
-       As  PCRE2  has developed, almost all the 32 option bits that are avail-
-       able in the options argument of pcre2_compile() have been used  up.  To
-       avoid  running  out, the compile context contains a set of extra option
-       bits which are used for some newer, assumed rarer, options. This  func-
-       tion  sets  those bits. It always sets all the bits (either on or off).
-       It does not modify any existing  setting.  The  available  options  are
-       defined in the section entitled "Extra compile options" below.
+       As PCRE2 has developed, almost all the 32 option bits that  are  avail-
+       able  in  the options argument of pcre2_compile() have been used up. To
+       avoid running out, the compile context contains a set of  extra  option
+       bits  which are used for some newer, assumed rarer, options. This func-
+       tion sets those bits. It always sets all the bits (either on  or  off).
+       It  does not modify any existing setting. The available options are de-
+       fined in the section entitled "Extra compile options" below.
 
        int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext,
          PCRE2_SIZE value);
 
-       This  sets a maximum length, in code units, for any pattern string that
-       is compiled with this context. If the pattern is longer,  an  error  is
-       generated.   This facility is provided so that applications that accept
+       This sets a maximum length, in code units, for any pattern string  that
+       is  compiled  with  this context. 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 effec-
+       largest number that a PCRE2_SIZE variable can  hold,  which  is  effec-
        tively unlimited.
 
        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
-       of the above), PCRE2_NEWLINE_ANY (any  Unicode  newline  sequence),  or
+       two-character sequence CR followed by LF),  PCRE2_NEWLINE_ANYCRLF  (any
+       of  the  above),  PCRE2_NEWLINE_ANY  (any Unicode newline sequence), or
        PCRE2_NEWLINE_NUL (the NUL character, that is a binary zero).
 
        A pattern can override the value set in the compile context by starting
        with a sequence such as (*CRLF). See the pcre2pattern page for details.
 
-       When   a   pattern   is   compiled   with   the    PCRE2_EXTENDED    or
-       PCRE2_EXTENDED_MORE option, the newline convention affects the recogni-
-       tion of 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  interpreted  matching  functions,  pcre2_match()  and
+       When  a  pattern  is  compiled  with  the  PCRE2_EXTENDED  or PCRE2_EX-
+       TENDED_MORE option, the newline convention affects the  recognition  of
+       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     interpreted     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
-       rogue  patterns using up too much system stack when being compiled. The
-       limit applies to parentheses of all kinds, not just capturing parenthe-
-       ses.
+       This parameter adjusts the limit, set  when  PCRE2  is  built  (default
+       250),  on  the  depth  of  parenthesis nesting in a pattern. This limit
+       stops rogue patterns using up too much system  stack  when  being  com-
+       piled.  The limit applies to parentheses of all kinds, not just captur-
+       ing parentheses.
 
        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 during compilation. 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
+       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 during compilation. 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
@@ -911,10 +918,10 @@ PCRE2 CONTEXTS
          Change the backtracking depth limit
          Set custom memory management specifically for the match
 
-       If  none  of  these  apply,  just  pass NULL as the context argument of
+       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(
@@ -925,7 +932,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.
 
@@ -933,36 +940,42 @@ PCRE2 CONTEXTS
          int (*callout_function)(pcre2_callout_block *, void *),
          void *callout_data);
 
-       This sets up a "callout" function for PCRE2 to call at specified points
+       This sets up a callout function for PCRE2 to call at  specified  points
        during a matching operation. Details are given in the pcre2callout doc-
        umentation.
 
+       int pcre2_set_substitute_callout(pcre2_match_context *mcontext,
+         int (*callout_function)(pcre2_substitute_callout_block *, void *),
+         void *callout_data);
+
+       This sets up a callout function for PCRE2 to call after each  substitu-
+       tion made by pcre2_substitute(). Details are given in the section enti-
+       tled "Creating a new string with substitutions" below.
+
        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. The pcre2_substitute() function makes no
-       more substitutions.
+       The offset_limit parameter limits how far an unanchored search can  ad-
+       vance  in  the  subject  string.  The default value is PCRE2_UNSET. The
+       pcre2_match() and pcre2_dfa_match()  functions  return  PCRE2_ERROR_NO-
+       MATCH if a match with a starting point before or at the given offset is
+       not found. The pcre2_substitute() function makes no more substitutions.
 
        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
+       offset  limit  less  than 3, the result is PCRE2_ERROR_NOMATCH. A match
        can never be  found  if  the  startoffset  argument  of  pcre2_match(),
        pcre2_dfa_match(),  or  pcre2_substitute()  is  greater than the offset
        limit set in the match context.
 
-       When using this  facility,  you  must  set  the  PCRE2_USE_OFFSET_LIMIT
-       option when calling pcre2_compile() so that when JIT is in use, differ-
-       ent 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 gener-
-       ated.
+       When using this facility, you must set the  PCRE2_USE_OFFSET_LIMIT  op-
+       tion 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 or to limit the extent of global substitutions.
-       See also the PCRE2_FIRSTLINE option, which requires a  match  to  start
-       before  or  at  the first newline that follows the start of matching in
+       The  offset limit facility can be used to track progress when searching
+       large subject strings or to limit the extent of  global  substitutions.
+       See  also  the  PCRE2_FIRSTLINE option, which requires a match to start
+       before or at the first newline that follows the start  of  matching  in
        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, which-
        ever limit comes first is used.
@@ -971,15 +984,15 @@ PCRE2 CONTEXTS
          uint32_t value);
 
        The heap_limit parameter specifies, in units of kibibytes (1024 bytes),
-       the  maximum  amount  of heap memory that pcre2_match() may use to hold
+       the maximum amount of heap memory that pcre2_match() may  use  to  hold
        backtracking information when running an interpretive match. This limit
        also applies to pcre2_dfa_match(), which may use the heap when process-
-       ing patterns with a lot of nested pattern recursion or  lookarounds  or
+       ing  patterns  with a lot of nested pattern recursion or lookarounds or
        atomic groups. This limit does not apply to matching with the JIT opti-
-       mization, which has  its  own  memory  control  arrangements  (see  the
-       pcre2jit  documentation for more details). If the limit is reached, the
-       negative error code  PCRE2_ERROR_HEAPLIMIT  is  returned.  The  default
-       limit  can be set when PCRE2 is built; if it is not, the default is set
+       mization,  which  has  its  own  memory  control  arrangements (see the
+       pcre2jit documentation for more details). If the limit is reached,  the
+       negative  error  code  PCRE2_ERROR_HEAPLIMIT  is  returned. The default
+       limit can be set when PCRE2 is built; if it is not, the default is  set
        very large and is essentially "unlimited".
 
        A value for the heap limit may also be supplied by an item at the start
@@ -987,101 +1000,101 @@ PCRE2 CONTEXTS
 
          (*LIMIT_HEAP=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()
-       or, if no such limit is set, less than the default.
+       where ddd is a decimal number. However, such a setting is  ignored  un-
+       less  ddd is less than the limit set by the caller of pcre2_match() or,
+       if no such limit is set, less than the default.
 
-       The  pcre2_match() function starts out using a 20KiB vector on the sys-
+       The pcre2_match() function starts out using a 20KiB vector on the  sys-
        tem stack for recording backtracking points. The more nested backtrack-
-       ing  points  there  are (that is, the deeper the search tree), the more
-       memory is needed.  Heap memory is used only if the  initial  vector  is
+       ing points there are (that is, the deeper the search  tree),  the  more
+       memory  is  needed.   Heap memory is used only if the initial vector is
        too small. If the heap limit is set to a value less than 21 (in partic-
-       ular, zero) no heap memory will be used. In this  case,  only  patterns
-       that  do not have a lot of nested backtracking can be successfully pro-
+       ular,  zero)  no  heap memory will be used. In this case, only patterns
+       that do not have a lot of nested backtracking can be successfully  pro-
        cessed.
 
-       Similarly, for pcre2_dfa_match(), a vector on the system stack is  used
-       when  processing pattern recursions, lookarounds, or atomic groups, and
-       only if this is not big enough is heap memory used. In this case,  too,
+       Similarly,  for pcre2_dfa_match(), a vector on the system stack is used
+       when processing pattern recursions, lookarounds, or atomic groups,  and
+       only  if this is not big enough is heap memory used. In this case, too,
        setting a value of zero disables the use of the heap.
 
        int pcre2_set_match_limit(pcre2_match_context *mcontext,
          uint32_t value);
 
-       The  match_limit  parameter  provides  a means of preventing PCRE2 from
-       using up too many computing resources when processing patterns that are
+       The match_limit parameter provides a means of preventing PCRE2 from us-
+       ing  up  too many computing 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
+       in  their  search  trees.  The  classic  example is a pattern that uses
        nested unlimited repeats.
 
-       There  is an internal counter in pcre2_match() that is incremented each
-       time round its main matching loop. If  this  value  reaches  the  match
+       There is an internal counter in pcre2_match() that is incremented  each
+       time  round  its  main  matching  loop. If this value reaches the match
        limit, pcre2_match() returns the negative value PCRE2_ERROR_MATCHLIMIT.
-       This has the effect of limiting the amount  of  backtracking  that  can
+       This  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  also  applies
+       zero  for  each position in the subject string. This limit also applies
        to pcre2_dfa_match(), though the counting is done in a different way.
 
-       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. A value for the match limit may also be supplied by an  item  at
+       The default value for the limit can be set when PCRE2 is built; the de-
+       fault default is 10 million, which handles all  but  the  most  extreme
+       cases.  A  value for the match limit may also be supplied 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() or
+       where ddd is a decimal number. However, such a setting is  ignored  un-
+       less  ddd  is less than the limit set by the caller of pcre2_match() or
        pcre2_dfa_match() or, if no such limit is set, less than the default.
 
        int pcre2_set_depth_limit(pcre2_match_context *mcontext,
          uint32_t value);
 
-       This   parameter   limits   the   depth   of   nested  backtracking  in
-       pcre2_match().  Each time a nested backtracking point is passed, a  new
+       This  parameter  limits   the   depth   of   nested   backtracking   in
+       pcre2_match().   Each time a nested backtracking point is passed, a new
        memory "frame" is used to remember the state of matching at that point.
-       Thus, this parameter indirectly limits the amount  of  memory  that  is
-       used  in  a  match.  However,  because  the size of each memory "frame"
-       depends on the number of capturing parentheses, the actual memory limit
-       varies  from pattern to pattern. This limit was more useful in versions
+       Thus,  this  parameter  indirectly  limits the amount of memory that is
+       used in a match. However, because the size of each memory  "frame"  de-
+       pends  on  the number of capturing parentheses, the actual memory limit
+       varies from pattern to pattern. This limit was more useful in  versions
        before 10.30, where function recursion was used for backtracking.
 
-       The depth limit is not relevant, and is ignored, when matching is  done
+       The  depth limit is not relevant, and is ignored, when matching is done
        using JIT compiled code. However, it is supported by pcre2_dfa_match(),
-       which uses it to limit the depth of nested internal recursive  function
-       calls  that implement atomic groups, lookaround assertions, and pattern
+       which  uses it to limit the depth of nested internal recursive function
+       calls that implement atomic groups, lookaround assertions, and  pattern
        recursions. This limits, indirectly, the amount of system stack that is
-       used.  It  was  more useful in versions before 10.32, when stack memory
+       used. It was more useful in versions before 10.32,  when  stack  memory
        was used for local workspace vectors for recursive function calls. From
-       version  10.32,  only local variables are allocated on the stack and as
+       version 10.32, only local variables are allocated on the stack  and  as
        each call uses only a few hundred bytes, even a small stack can support
        quite a lot of recursion.
 
-       If  the  depth  of  internal  recursive function calls is great enough,
-       local workspace vectors are allocated on the heap  from  version  10.32
-       onwards,  so  the depth limit also indirectly limits the amount of heap
+       If the depth of internal recursive function calls is great enough,  lo-
+       cal  workspace vectors are allocated on the heap from version 10.32 on-
+       wards, so the depth limit also indirectly limits  the  amount  of  heap
        memory that is used. A recursive pattern such as /(.(?2))((?1)|)/, when
-       matched  to a very long string using pcre2_dfa_match(), can use a great
-       deal of memory. However, it is probably  better  to  limit  heap  usage
-       directly by calling pcre2_set_heap_limit().
+       matched to a very long string using pcre2_dfa_match(), can use a  great
+       deal  of memory. However, it is probably better to limit heap usage di-
+       rectly by calling pcre2_set_heap_limit().
 
-       The  default  value for the depth limit can be set when PCRE2 is built;
-       if it is not, the default is set to the same value as the  default  for
-       the   match   limit.   If  the  limit  is  exceeded,  pcre2_match()  or
+       The default value for the depth limit can be set when PCRE2  is  built;
+       if  it  is not, the default is set to the same value as the default for
+       the  match  limit.   If  the  limit  is  exceeded,   pcre2_match()   or
        pcre2_dfa_match() returns PCRE2_ERROR_DEPTHLIMIT. A value for the depth
-       limit  may also be supplied by an item at the start of a pattern of the
+       limit may also be supplied by an item at the start of a pattern of  the
        form
 
          (*LIMIT_DEPTH=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() or
+       where  ddd  is a decimal number. However, such a setting is ignored un-
+       less ddd is less than the limit set by the caller of  pcre2_match()  or
        pcre2_dfa_match() or, if no such limit is set, less than the default.
 
 
@@ -1089,96 +1102,96 @@ 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
-       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
-       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-
+       The  function  pcre2_config()  makes  it possible for a PCRE2 client to
+       discover which optional features have been compiled into the PCRE2  li-
+       brary.  The  pcre2build  documentation has more details about these op-
+       tional features.
+
+       The first argument for pcre2_config() specifies  which  information  is
+       required. The second argument is a pointer to memory into which the in-
+       formation 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-
        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
-       PCRE2_BSR_UNICODE  means  that  \R  matches  any  Unicode  line  ending
-       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.
+       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  se-
+       quence; 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_COMPILED_WIDTHS
 
-       The  output  is a uint32_t integer whose lower bits indicate which code
-       unit widths were selected when PCRE2 was  built.  The  1-bit  indicates
-       8-bit  support, and the 2-bit and 4-bit indicate 16-bit and 32-bit sup-
+       The output is a uint32_t integer whose lower bits indicate  which  code
+       unit  widths  were  selected  when PCRE2 was built. The 1-bit indicates
+       8-bit support, and the 2-bit and 4-bit indicate 16-bit and 32-bit  sup-
        port, respectively.
 
          PCRE2_CONFIG_DEPTHLIMIT
 
-       The output is a uint32_t integer that gives the default limit  for  the
-       depth  of  nested  backtracking in pcre2_match() or the depth of nested
-       recursions, lookarounds, and atomic groups in  pcre2_dfa_match().  Fur-
+       The  output  is a uint32_t integer that gives the default limit for the
+       depth of nested backtracking in pcre2_match() or the  depth  of  nested
+       recursions,  lookarounds,  and atomic groups in pcre2_dfa_match(). Fur-
        ther details are given with pcre2_set_depth_limit() above.
 
          PCRE2_CONFIG_HEAPLIMIT
 
-       The  output is a uint32_t integer that gives, in kibibytes, the default
-       limit  for  the  amount  of  heap  memory  used  by  pcre2_match()   or
-       pcre2_dfa_match().      Further      details     are     given     with
+       The output is a uint32_t integer that gives, in kibibytes, the  default
+       limit   for  the  amount  of  heap  memory  used  by  pcre2_match()  or
+       pcre2_dfa_match().     Further     details     are      given      with
        pcre2_set_heap_limit() above.
 
          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  +  un-
+       aligned)".  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
-       compiled pattern to be up to 65535  code  units.  Larger  values  allow
-       larger  regular  expressions to be compiled by those two libraries, but
+       for all but the most massive patterns, since it allows the size of  the
+       compiled  pattern  to  be  up  to 65535 code units. Larger values allow
+       larger 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 match limit for
-       pcre2_match().  Further  details are given with pcre2_set_match_limit()
+       pcre2_match(). Further details are given  with  pcre2_set_match_limit()
        above.
 
          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)
@@ -1188,23 +1201,23 @@ CHECKING BUILD-TIME OPTIONS
          PCRE2_NEWLINE_ANYCRLF  Any of CR, LF, or CRLF
          PCRE2_NEWLINE_NUL      The NUL character (binary zero)
 
-       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_NEVER_BACKSLASH_C
 
-       The  output  is  a uint32_t integer that is set to one if the use of \C
-       was permanently disabled when PCRE2 was built; otherwise it is  set  to
+       The output is a uint32_t integer that is set to one if the  use  of  \C
+       was  permanently  disabled when PCRE2 was built; otherwise it is set to
        zero.
 
          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 ap-
+       plication.   For  finer  control  over  compilation  stack  usage,  see
        pcre2_set_compile_recursion_guard().
 
          PCRE2_CONFIG_STACKRECURSE
@@ -1214,25 +1227,25 @@ CHECKING BUILD-TIME OPTIONS
 
          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,
-       "8.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  24  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 24 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.
@@ -1250,56 +1263,59 @@ COMPILING A PATTERN
 
        pcre2_code *pcre2_code_copy_with_tables(const 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  (in  code units). 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, or NULL if an error occurred.
-
-       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  caller must free the memory by calling pcre2_code_free()
-       when it is no longer needed.  If pcre2_code_free()  is  called  with  a
-       NULL argument, it returns immediately, without doing anything.
+       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 (in code units). 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 re-
+       lated data, or NULL if an error occurred.
+
+       If  the  compile context argument ccontext is NULL, memory for the com-
+       piled pattern is obtained by calling malloc().  Otherwise,  it  is  ob-
+       tained from the same memory function that was used for the compile con-
+       text. The caller must free the memory by calling pcre2_code_free() when
+       it is no longer needed.  If pcre2_code_free() is called with a NULL ar-
+       gument, it returns immediately, without doing anything.
 
        The function pcre2_code_copy() makes a copy of the compiled code in new
-       memory, using the same memory allocator as was used for  the  original.
-       However,  if  the  code  has  been  processed  by the JIT compiler (see
-       below), the JIT information cannot be copied (because it  is  position-
-       dependent).  The new copy can initially be used only for non-JIT match-
-       ing, though it can be passed to  pcre2_jit_compile()  if  required.  If
+       memory,  using  the same memory allocator as was used for the original.
+       However, if the code has been processed by the JIT  compiler  (see  be-
+       low),  the JIT information cannot be copied (because it is position-de-
+       pendent).  The new copy can initially be used only for  non-JIT  match-
+       ing,  though  it  can  be passed to pcre2_jit_compile() if required. If
        pcre2_code_copy() is called with a NULL argument, it returns NULL.
 
        The pcre2_code_copy() function provides a way for individual threads in
-       a multithreaded application to acquire a private copy  of  shared  com-
-       piled  code.   However, it does not make a copy of the character tables
-       used by the compiled pattern; the new pattern code points to  the  same
-       tables  as  the original code.  (See "Locale Support" below for details
-       of these character tables.) In many applications the  same  tables  are
-       used  throughout, so this behaviour is appropriate. Nevertheless, there
+       a  multithreaded  application  to acquire a private copy of shared com-
+       piled code.  However, it does not make a copy of the  character  tables
+       used  by  the compiled pattern; the new pattern code points to the same
+       tables as the original code.  (See "Locale Support" below  for  details
+       of  these  character  tables.) In many applications the same tables are
+       used throughout, so this behaviour is appropriate. Nevertheless,  there
        are occasions when a copy of a compiled pattern and the relevant tables
-       are  needed.  The pcre2_code_copy_with_tables() provides this facility.
-       Copies of both the code and the tables are  made,  with  the  new  code
-       pointing  to the new tables. The memory for the new tables is automati-
-       cally freed when pcre2_code_free() is called for the new  copy  of  the
-       compiled  code. If pcre2_code_copy_withy_tables() is called with a NULL
+       are needed. The pcre2_code_copy_with_tables() provides  this  facility.
+       Copies  of  both  the  code  and the tables are made, with the new code
+       pointing to the new tables. The memory for the new tables is  automati-
+       cally  freed  when  pcre2_code_free() is called for the new copy of the
+       compiled code. If pcre2_code_copy_with_tables() is called with  a  NULL
        argument, it returns NULL.
 
-       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 substring  extraction  functions.
-       After  running a match, you must not free a compiled pattern (or a sub-
-       ject string) until after all operations on the match  data  block  have
-       taken place.
+       so  that  they  can be referenced by the substring extraction functions
+       after a successful match.  After running 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, unless, in the case of  the  subject
+       string,  you  have used the PCRE2_COPY_MATCHED_SUBJECT option, which is
+       described in the section entitled "Option bits for  pcre2_match()"  be-
+       low.
 
        The  options argument for pcre2_compile() contains various bit settings
-       that affect the compilation. It  should  be  zero  if  no  options  are
-       required.  The  available options are described below. Some of them (in
+       that affect the compilation. It should be zero if none of them are  re-
+       quired.  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).
+       well)  can  also  be set and unset from within the pattern (see the de-
+       tailed 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
@@ -1307,42 +1323,43 @@ COMPILING A PATTERN
        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,
-       the newline setting) can be provided in a compile context (as described
-       above).
+       Some additional options and less frequently required  compile-time  pa-
+       rameters  (for  example, the newline setting) can be provided in a com-
+       pile context (as described above).
 
        If errorcode or erroroffset is NULL, pcre2_compile() returns NULL imme-
        diately.  Otherwise,  the  variables to which these point are set to an
-       error code and an offset (number of code  units)  within  the  pattern,
-       respectively,  when  pcre2_compile() returns NULL because a compilation
-       error has occurred. The values are not defined when compilation is suc-
+       error code and an offset (number of code units) within the pattern, re-
+       spectively, when pcre2_compile() returns NULL because a compilation er-
+       ror has occurred. The values are not defined when compilation  is  suc-
        cessful and pcre2_compile() returns a non-NULL value.
 
-       There  are  nearly  100  positive  error codes that pcre2_compile() may
-       return if it finds an error in the pattern. There are also  some  nega-
-       tive  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  pcre2unicode  page. There is no separate documentation for the
-       positive error codes, because  the  textual  error  messages  that  are
-       obtained   by   calling  the  pcre2_get_error_message()  function  (see
-       "Obtaining a textual error message" below) should be  self-explanatory.
-       Macro  names  starting  with PCRE2_ERROR_ are defined for both positive
-       and negative error codes in pcre2.h.
+       There  are nearly 100 positive error codes that pcre2_compile() may re-
+       turn if it finds an error in the pattern. There are also some  negative
+       error  codes that are used for invalid UTF strings when validity check-
+       ing is in force. These are the  same  as  given  by  pcre2_match()  and
+       pcre2_dfa_match(), and are described in the pcre2unicode documentation.
+       There is no separate documentation for the positive  error  codes,  be-
+       cause  the  textual  error  messages  that  are obtained by calling the
+       pcre2_get_error_message() function (see "Obtaining a textual error mes-
+       sage"  below)  should  be  self-explanatory.  Macro names starting with
+       PCRE2_ERROR_ are defined for both positive and negative error codes  in
+       pcre2.h.
 
        The value returned in erroroffset is an indication of where in the pat-
-       tern  the  error  occurred. It is not necessarily the furthest point in
-       the pattern that was read. For example,  after  the  error  "lookbehind
-       assertion is not fixed length", the error offset points to the start of
-       the failing assertion. For an invalid UTF-8 or UTF-16 string, the  off-
+       tern the error occurred. It is not necessarily the  furthest  point  in
+       the pattern that was read. For example, after the error "lookbehind as-
+       sertion is not fixed length", the error offset points to the  start  of
+       the  failing assertion. For an invalid UTF-8 or UTF-16 string, the off-
        set 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;
@@ -1356,151 +1373,159 @@ COMPILING A PATTERN
            &erroffset,             /* for error offset */
            NULL);                  /* no compile context */
 
-       The following names for option bits are defined in the  pcre2.h  header
+
+   Main compile options
+
+       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).
 
+       ECMAscript 6 added additional functionality to \u. This can be accessed
+       using the PCRE2_EXTRA_ALT_BSUX extra option  (see  "Extra  compile  op-
+       tions" below).  Note that this alternative escape handling applies only
+       to patterns. Neither of these options affects  the  processing  of  re-
+       placement strings passed to pcre2_substitute().
+
          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  or
-       PCRE2_EXTENDED_MORE  option  is set with PCRE2_ALT_VERBNAMES, unescaped
-       whitespace in verb names is  skipped  and  #-comments  are  recognized,
-       exactly as in the rest of the pattern.
+       By default, for compatibility with Perl, the name in any verb  sequence
+       such  as  (*MARK:NAME)  is any sequence of characters that does not in-
+       clude a closing parenthesis. The name is not processed in any way,  and
+       it  is  not possible to include a closing parenthesis in the name. How-
+       ever, if the PCRE2_ALT_VERBNAMES option is set, normal  backslash  pro-
+       cessing  is  applied to verb names and only an unescaped closing paren-
+       thesis terminates the name. A closing parenthesis can be included in  a
+       name  either  as  \)  or  between  \Q  and \E. If the PCRE2_EXTENDED or
+       PCRE2_EXTENDED_MORE option is set with  PCRE2_ALT_VERBNAMES,  unescaped
+       whitespace  in verb names is skipped and #-comments are recognized, ex-
+       actly as in the rest of the pattern.
 
          PCRE2_AUTO_CALLOUT
 
-       If  this  bit  is  set,  pcre2_compile()  automatically inserts callout
-       items, all with number 255, before each pattern  item,  except  immedi-
-       ately  before  or after an explicit callout in the pattern. For discus-
+       If this bit  is  set,  pcre2_compile()  automatically  inserts  callout
+       items,  all  with  number 255, before each pattern item, except immedi-
+       ately before or after an explicit callout in the pattern.  For  discus-
        sion of the callout facility, see the pcre2callout documentation.
 
          PCRE2_CASELESS
 
-       If this bit is set, letters in the pattern match both upper  and  lower
-       case  letters in the subject. It is equivalent to Perl's /i option, and
-       it can be changed within  a  pattern  by  a  (?i)  option  setting.  If
-       PCRE2_UTF  is  set, Unicode properties are used for all characters with
-       more than one other case, and for all characters whose code points  are
-       greater  than  U+007F.  For lower valued characters with only one other
-       case, a lookup table is used for speed. When PCRE2_UTF is  not  set,  a
+       If  this  bit is set, letters in the pattern match both upper and lower
+       case letters in the subject. It is equivalent to Perl's /i option,  and
+       it  can  be  changed  within  a  pattern  by  a (?i) option setting. If
+       PCRE2_UTF is set, Unicode properties are used for all  characters  with
+       more  than one other case, and for all characters whose code points are
+       greater than U+007F. For lower valued characters with  only  one  other
+       case,  a  lookup  table is used for speed. When PCRE2_UTF is not set, a
        lookup table is used for all code points less than 256, and higher code
-       points (available only in 16-bit or 32-bit mode)  are  treated  as  not
+       points  (available  only  in  16-bit or 32-bit mode) are treated as not
        having another case.
 
          PCRE2_DOLLAR_ENDONLY
 
-       If  this bit is set, a dollar metacharacter in the pattern matches only
-       at the end of the subject string. Without this option,  a  dollar  also
-       matches  immediately before a newline at the end of the string (but not
-       before any other newlines). The PCRE2_DOLLAR_ENDONLY option is  ignored
-       if  PCRE2_MULTILINE  is  set.  There is no equivalent to this option in
+       If this bit is set, a dollar metacharacter in the pattern matches  only
+       at  the  end  of the subject string. Without this option, a dollar also
+       matches immediately before a newline at the end of the string (but  not
+       before  any other newlines). The PCRE2_DOLLAR_ENDONLY option is ignored
+       if PCRE2_MULTILINE is set. There is no equivalent  to  this  option  in
        Perl, and no way to set it within a pattern.
 
          PCRE2_DOTALL
 
-       If this bit is set, a dot metacharacter  in  the  pattern  matches  any
-       character,  including  one  that  indicates a newline. However, it only
+       If  this  bit  is  set,  a dot metacharacter in the pattern matches any
+       character, including one that indicates a  newline.  However,  it  only
        ever matches one character, even if newlines are coded as CRLF. Without
        this option, a dot does not match when the current position in the sub-
-       ject is at a newline. This option is equivalent to  Perl's  /s  option,
+       ject  is  at  a newline. This option is equivalent to Perl's /s option,
        and it can be changed within a pattern by a (?s) option setting. A neg-
-       ative class such as [^a] always matches newline characters, and the  \N
-       escape  sequence always matches a non-newline character, independent of
+       ative  class such as [^a] always matches newline characters, and the \N
+       escape sequence always matches a non-newline character, independent  of
        the setting of PCRE2_DOTALL.
 
          PCRE2_DUPNAMES
 
-       If this bit is set, names used to identify capturing  subpatterns  need
-       not be unique. This can be helpful for certain types of pattern when it
-       is known that only one instance of the named  subpattern  can  ever  be
-       matched.  There  are  more details of named subpatterns below; see also
-       the pcre2pattern documentation.
+       If  this  bit is set, names used to identify capture groups need not be
+       unique.  This can be helpful for certain types of pattern  when  it  is
+       known  that  only  one instance of the named group can ever be matched.
+       There are more details of named capture  groups  below;  see  also  the
+       pcre2pattern documentation.
 
          PCRE2_ENDANCHORED
 
-       If this bit is set, the end of any pattern match must be right  at  the
+       If  this  bit is set, the end of any pattern match must be right at the
        end of the string being searched (the "subject string"). If the pattern
        match succeeds by reaching (*ACCEPT), but does not reach the end of the
-       subject,  the match fails at the current starting point. For unanchored
-       patterns, a new match is then tried at the next  starting  point.  How-
+       subject, the match fails at the current starting point. For  unanchored
+       patterns,  a  new  match is then tried at the next starting point. How-
        ever, if the match succeeds by reaching the end of the pattern, but not
-       the end of the subject, backtracking occurs and  an  alternative  match
+       the  end  of  the subject, backtracking occurs and an alternative match
        may be found. Consider these two patterns:
 
          .(*ACCEPT)|..
          .|..
 
-       If  matched against "abc" with PCRE2_ENDANCHORED set, the first matches
-       "c" whereas the second matches "bc". The  effect  of  PCRE2_ENDANCHORED
-       can  also  be achieved by appropriate constructs in the pattern itself,
+       If matched against "abc" with PCRE2_ENDANCHORED set, the first  matches
+       "c"  whereas  the  second matches "bc". The effect of PCRE2_ENDANCHORED
+       can also be achieved by appropriate constructs in the  pattern  itself,
        which is the only way to do it in Perl.
 
        For DFA matching with pcre2_dfa_match(), PCRE2_ENDANCHORED applies only
-       to  the  first  (that  is,  the longest) matched string. Other parallel
-       matches, which are necessarily substrings of the first one, must  obvi-
+       to the first (that is, the  longest)  matched  string.  Other  parallel
+       matches,  which are necessarily substrings of the first one, must obvi-
        ously end before the end of the subject.
 
          PCRE2_EXTENDED
 
-       If  this  bit  is  set,  most white space characters in the pattern are
-       totally ignored except when escaped or inside a character  class.  How-
-       ever,  white  space  is  not  allowed within sequences such as (?> that
-       introduce various parenthesized subpatterns, nor within numerical quan-
-       tifiers  such  as {1,3}.  Ignorable white space is permitted between an
-       item and a following quantifier and between a quantifier and a  follow-
-       ing  +  that indicates possessiveness.  PCRE2_EXTENDED is equivalent to
-       Perl's /x option, and it can be changed within  a  pattern  by  a  (?x)
-       option setting.
+       If this bit is set, most white space characters in the pattern are  to-
+       tally ignored except when escaped or inside a character class. However,
+       white space is not allowed within sequences such as (?> that  introduce
+       various  parenthesized groups, nor within numerical quantifiers such as
+       {1,3}. Ignorable white space is permitted between an item and a follow-
+       ing  quantifier  and  between a quantifier and a following + that indi-
+       cates possessiveness. PCRE2_EXTENDED is equivalent to Perl's /x option,
+       and it can be changed within a pattern by a (?x) option setting.
 
        When  PCRE2  is compiled without Unicode support, PCRE2_EXTENDED recog-
        nizes as white space only those characters with code points  less  than
@@ -1535,48 +1560,54 @@ COMPILING A PATTERN
 
          PCRE2_EXTENDED_MORE
 
-       This option  has  the  effect  of  PCRE2_EXTENDED,  but,  in  addition,
-       unescaped  space  and  horizontal  tab  characters are ignored inside a
-       character class. Note: only these two characters are ignored,  not  the
-       full  set  of pattern white space characters that are ignored outside a
-       character  class.  PCRE2_EXTENDED_MORE  is  equivalent  to  Perl's  /xx
-       option,  and  it can be changed within a pattern by a (?xx) option set-
-       ting.
+       This option has the effect of PCRE2_EXTENDED,  but,  in  addition,  un-
+       escaped  space and horizontal tab characters are ignored inside a char-
+       acter class. Note: only these two characters are ignored, not the  full
+       set  of pattern white space characters that are ignored outside a char-
+       acter class. PCRE2_EXTENDED_MORE is equivalent to  Perl's  /xx  option,
+       and it can be changed within a pattern by a (?xx) option setting.
 
          PCRE2_FIRSTLINE
 
        If this option is set, the start of an unanchored pattern match must be
-       before  or  at  the  first  newline in the subject string following the
-       start of matching, though the matched text may continue over  the  new-
+       before or at the first newline in  the  subject  string  following  the
+       start  of  matching, though the matched text may continue over the new-
        line. If startoffset is non-zero, the limiting newline is not necessar-
-       ily the first newline in the  subject.  For  example,  if  the  subject
+       ily  the  first  newline  in  the  subject. For example, if the subject
        string is "abc\nxyz" (where \n represents a single-character newline) a
-       pattern match for "yz" succeeds with PCRE2_FIRSTLINE if startoffset  is
-       greater  than 3. 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
+       pattern  match for "yz" succeeds with PCRE2_FIRSTLINE if startoffset is
+       greater than 3. 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.
 
          PCRE2_LITERAL
 
        If this option is set, all meta-characters in the pattern are disabled,
-       and  it is treated as a literal string. Matching literal strings with a
+       and it is treated as a literal string. Matching literal strings with  a
        regular expression engine is not the most efficient way of doing it. If
-       you  are  doing  a  lot of literal matching and are worried about effi-
+       you are doing a lot of literal matching and  are  worried  about  effi-
        ciency, you should consider using other approaches. The only other main
        options  that  are  allowed  with  PCRE2_LITERAL  are:  PCRE2_ANCHORED,
        PCRE2_ENDANCHORED, PCRE2_AUTO_CALLOUT, PCRE2_CASELESS, PCRE2_FIRSTLINE,
-       PCRE2_NO_START_OPTIMIZE,     PCRE2_NO_UTF_CHECK,     PCRE2_UTF,     and
-       PCRE2_USE_OFFSET_LIMIT. The extra  options  PCRE2_EXTRA_MATCH_LINE  and
-       PCRE2_EXTRA_MATCH_WORD  are  also supported. Any other options cause an
-       error.
+       PCRE2_MATCH_INVALID_UTF,  PCRE2_NO_START_OPTIMIZE,  PCRE2_NO_UTF_CHECK,
+       PCRE2_UTF,  and  PCRE2_USE_OFFSET_LIMIT.  The  extra  options PCRE2_EX-
+       TRA_MATCH_LINE and PCRE2_EXTRA_MATCH_WORD are also supported. Any other
+       options cause an error.
+
+         PCRE2_MATCH_INVALID_UTF
+
+       This  option  forces PCRE2_UTF (see below) and also enables support for
+       matching by pcre2_match() in subject strings that contain  invalid  UTF
+       sequences.   This  facility  is not supported for DFA matching. For de-
+       tails, see the pcre2unicode documentation.
 
          PCRE2_MATCH_UNSET_BACKREF
 
-       If this option is set, a backreference to  an  unset  subpattern  group
+       If this option is set,  a  backreference  to  an  unset  capture  group
        matches  an  empty  string (by default this causes the current matching
-       alternative to fail).  A pattern such as  (\1)(a)  succeeds  when  this
-       option  is set (assuming it can find an "a" in the subject), whereas it
+       alternative to fail).  A pattern such as (\1)(a) succeeds when this op-
+       tion  is  set  (assuming it can find an "a" in the subject), whereas it
        fails by default, for Perl compatibility.  Setting  this  option  makes
        PCRE2 behave more like ECMAscript (aka JavaScript).
 
@@ -1587,10 +1618,10 @@ COMPILING A PATTERN
        of  characters,  even  if  it actually contains newlines. The "start of
        line" metacharacter (^) matches only at the start of  the  string,  and
        the  "end  of  line"  metacharacter  ($) matches only at the end of the
-       string,  or  before  a  terminating  newline  (except  when  PCRE2_DOL-
-       LAR_ENDONLY  is  set).  Note, however, that unless PCRE2_DOTALL is set,
-       the "any character" metacharacter (.) does not match at a newline. This
-       behaviour (for ^, $, and dot) is the same as Perl.
+       string, or before a terminating newline (except  when  PCRE2_DOLLAR_EN-
+       DONLY is set). Note, however, that unless PCRE2_DOTALL is set, the "any
+       character" metacharacter (.) does not match at a newline.  This  behav-
+       iour (for ^, $, and dot) is the same as Perl.
 
        When  PCRE2_MULTILINE  it is set, the "start of line" and "end of line"
        constructs match immediately following or immediately  before  internal
@@ -1608,118 +1639,122 @@ COMPILING A PATTERN
        This option locks out the use of \C in the pattern that is  being  com-
        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.  Note  that
-       there is also a build-time option that permanently locks out the use of
-       \C.
+       middle of a multi-code-unit character. This option may be useful in ap-
+       plications 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
 
-       This option locks out the use of Unicode properties  for  handling  \B,
+       This  option  locks  out the use of Unicode properties for handling \B,
        \b, \D, \d, \S, \s, \W, \w, and some of the POSIX character classes, as
-       described for the PCRE2_UCP option below. In  particular,  it  prevents
-       the  creator of the pattern from enabling this facility by starting the
-       pattern with (*UCP). This option may be  useful  in  applications  that
+       described  for  the  PCRE2_UCP option below. In particular, it prevents
+       the creator of the pattern from enabling this facility by starting  the
+       pattern  with  (*UCP).  This  option may be useful in applications that
        process patterns from external sources. The option combination PCRE_UCP
        and PCRE_NEVER_UCP causes an error.
 
          PCRE2_NEVER_UTF
 
-       This option locks out interpretation of the pattern as  UTF-8,  UTF-16,
+       This  option  locks out interpretation of the pattern as UTF-8, UTF-16,
        or UTF-32, depending on which library is in use. In particular, it pre-
-       vents the creator of the pattern from switching to  UTF  interpretation
-       by  starting  the  pattern  with  (*UTF).  This option may be useful in
-       applications that process patterns from external sources. The  combina-
-       tion of PCRE2_UTF and PCRE2_NEVER_UTF causes an error.
+       vents  the  creator of the pattern from switching to UTF interpretation
+       by starting the pattern with (*UTF). This option may be useful  in  ap-
+       plications that process patterns from external sources. The combination
+       of PCRE2_UTF and PCRE2_NEVER_UTF causes an error.
 
          PCRE2_NO_AUTO_CAPTURE
 
        If this option is set, it disables the use of numbered capturing paren-
-       theses in the pattern. Any opening parenthesis that is not followed  by
-       ?  behaves as if it were followed by ?: but named parentheses can still
+       theses  in the pattern. Any opening parenthesis that is not followed by
+       ? behaves as if it were followed by ?: but named parentheses can  still
        be used for capturing (and they acquire numbers in the usual way). This
-       is  the  same as Perl's /n option.  Note that, when this option is set,
-       references to capturing groups (backreferences or  recursion/subroutine
-       calls)  may  only refer to named groups, though the reference can be by
+       is the same as Perl's /n option.  Note that, when this option  is  set,
+       references  to  capture  groups (backreferences or recursion/subroutine
+       calls) may only refer to named groups, though the reference can  be  by
        name or by number.
 
          PCRE2_NO_AUTO_POSSESS
 
        If this option is set, it disables "auto-possessification", which is an
-       optimization  that,  for example, turns a+b into a++b in order to avoid
-       backtracks into a+ that can never be successful. However,  if  callouts
-       are  in  use,  auto-possessification means that some callouts are never
+       optimization that, for example, turns a+b into a++b in order  to  avoid
+       backtracks  into  a+ that can never be successful. However, if callouts
+       are in use, auto-possessification means that some  callouts  are  never
        taken. You can set this option if you want the matching functions to do
-       a  full  unoptimized  search and run all the callouts, but it is mainly
+       a full unoptimized search and run all the callouts, but  it  is  mainly
        provided for testing purposes.
 
          PCRE2_NO_DOTSTAR_ANCHOR
 
        If this option is set, it disables an optimization that is applied when
-       .*  is  the  first significant item in a top-level branch of a pattern,
-       and all the other branches also start with .* or with \A or  \G  or  ^.
-       The  optimization  is  automatically disabled for .* if it is inside an
-       atomic group or a capturing group that is the subject of  a  backrefer-
-       ence,  or  if  the pattern contains (*PRUNE) or (*SKIP). When the opti-
-       mization is not disabled, such a pattern is automatically  anchored  if
+       .* is the first significant item in a top-level branch  of  a  pattern,
+       and  all  the  other branches also start with .* or with \A or \G or ^.
+       The optimization is automatically disabled for .* if it  is  inside  an
+       atomic group or a capture group that is the subject of a backreference,
+       or if the pattern contains (*PRUNE) or (*SKIP). When  the  optimization
+       is   not   disabled,  such  a  pattern  is  automatically  anchored  if
        PCRE2_DOTALL is set for all the .* items and PCRE2_MULTILINE is not set
-       for any ^ items. Otherwise, the fact that any match must  start  either
-       at  the start of the subject or following a newline is remembered. Like
+       for  any  ^ items. Otherwise, the fact that any match must start either
+       at the start of the subject or following a newline is remembered.  Like
        other optimizations, this can cause callouts to be skipped.
 
          PCRE2_NO_START_OPTIMIZE
 
-       This is an option whose main effect is at matching time.  It  does  not
+       This  is  an  option whose main effect is at matching time. It does not
        change what pcre2_compile() generates, but it does affect the output of
        the JIT compiler.
 
-       There are a number of optimizations that may occur at the  start  of  a
-       match,  in  order  to speed up the process. For example, if it is known
-       that an unanchored match must start with a specific  code  unit  value,
-       the  matching code searches the subject for that value, and fails imme-
-       diately if it cannot find it, without actually running the main  match-
-       ing  function.  This means that a special item such as (*COMMIT) at the
-       start of a pattern is not considered until after  a  suitable  starting
-       point  for  the  match  has  been found. Also, when callouts or (*MARK)
-       items are in use, these "start-up" optimizations can cause them  to  be
-       skipped  if  the pattern is never actually used. The start-up optimiza-
-       tions are in effect a pre-scan of the subject that takes  place  before
+       There  are  a  number of optimizations that may occur at the start of a
+       match, in order to speed up the process. For example, if  it  is  known
+       that  an  unanchored  match must start with a specific code unit value,
+       the matching code searches the subject for that value, and fails  imme-
+       diately  if it cannot find it, without actually running the main match-
+       ing function. This means that a special item such as (*COMMIT)  at  the
+       start  of  a  pattern is not considered until after a suitable starting
+       point for the match has been found.  Also,  when  callouts  or  (*MARK)
+       items  are  in use, these "start-up" optimizations can cause them to be
+       skipped if the pattern is never actually used. The  start-up  optimiza-
+       tions  are  in effect a pre-scan of the subject that takes place before
        the pattern is run.
 
        The PCRE2_NO_START_OPTIMIZE option disables the start-up optimizations,
-       possibly causing performance to suffer,  but  ensuring  that  in  cases
-       where  the  result is "no match", the callouts do occur, and that items
+       possibly  causing  performance  to  suffer,  but ensuring that in cases
+       where the result is "no match", the callouts do occur, and  that  items
        such as (*COMMIT) and (*MARK) are considered at every possible starting
        position in the subject string.
 
-       Setting  PCRE2_NO_START_OPTIMIZE  may  change the outcome of a matching
+       Setting PCRE2_NO_START_OPTIMIZE may change the outcome  of  a  matching
        operation.  Consider the pattern
 
          (*COMMIT)ABC
 
-       When this is compiled, PCRE2 records the fact that a match  must  start
-       with  the  character  "A".  Suppose the subject string is "DEFABC". The
-       start-up optimization scans along the subject, finds "A" and  runs  the
-       first  match attempt from there. The (*COMMIT) item means that the pat-
-       tern must match the current starting position, which in this  case,  it
-       does.  However,  if  the same match is run with PCRE2_NO_START_OPTIMIZE
-       set, the initial scan along the subject string  does  not  happen.  The
-       first  match  attempt  is  run  starting  from "D" and when this fails,
-       (*COMMIT) prevents any further matches  being  tried,  so  the  overall
-       result is "no match".
-
-       There  are  also  other  start-up optimizations. For example, a minimum
-       length for the subject may be recorded. Consider the pattern
-
-         (*MARK:A)(X|Y)
-
-       The minimum length for a match is one  character.  If  the  subject  is
-       "ABC", there will be attempts to match "ABC", "BC", and "C". An attempt
-       to match an empty string at the end of the subject does not take place,
-       because  PCRE2  knows  that  the  subject  is now too short, and so the
-       (*MARK) is never encountered. In this case, the optimization  does  not
-       affect the overall match result, which is still "no match", but it does
-       affect the auxiliary information that is returned.
+       When  this  is compiled, PCRE2 records the fact that a match must start
+       with the character "A". Suppose the subject  string  is  "DEFABC".  The
+       start-up  optimization  scans along the subject, finds "A" and runs the
+       first match attempt from there. The (*COMMIT) item means that the  pat-
+       tern  must  match the current starting position, which in this case, it
+       does. However, if the same match is  run  with  PCRE2_NO_START_OPTIMIZE
+       set,  the  initial  scan  along the subject string does not happen. The
+       first match attempt is run starting  from  "D"  and  when  this  fails,
+       (*COMMIT)  prevents any further matches being tried, so the overall re-
+       sult is "no match".
+
+       As another start-up optimization makes use of a minimum  length  for  a
+       matching subject, which is recorded when possible. Consider the pattern
+
+         (*MARK:1)B(*MARK:2)(X|Y)
+
+       The  minimum  length  for  a match is two characters. If the subject is
+       "XXBB", the "starting character" optimization skips "XX", then tries to
+       match  "BB", which is long enough. In the process, (*MARK:2) is encoun-
+       tered and remembered. When the match attempt fails,  the  next  "B"  is
+       found,  but  there is only one character left, so there are no more at-
+       tempts, and "no match" is returned with the "last  mark  seen"  set  to
+       "2".  If  NO_START_OPTIMIZE is set, however, matches are tried at every
+       possible starting position, including at the end of the subject,  where
+       (*MARK:1)  is encountered, but there is no "B", so the "last mark seen"
+       that is returned is "1". In this case, the optimizations do not  affect
+       the overall match result, which is still "no match", but they do affect
+       the auxiliary information that is returned.
 
          PCRE2_NO_UTF_CHECK
 
@@ -1731,8 +1766,8 @@ COMPILING A PATTERN
 
        If you know that your pattern is a valid UTF string, and  you  want  to
        skip   this   check   for   performance   reasons,   you  can  set  the
-       PCRE2_NO_UTF_CHECK option. When it is set, the  effect  of  passing  an
-       invalid UTF string as a pattern is undefined. It may cause your program
+       PCRE2_NO_UTF_CHECK option. When it is set, the effect of passing an in-
+       valid  UTF  string as a pattern is undefined. It may cause your program
        to crash or loop.
 
        Note  that  this  option  can  also  be  passed  to  pcre2_match()  and
@@ -1772,8 +1807,8 @@ COMPILING A PATTERN
        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
+       offset  limit is set without this option. For more details, see the de-
+       scription of pcre2_set_offset_limit() in  the  section  that  describes
        match contexts. See also the PCRE2_FIRSTLINE option above.
 
          PCRE2_UTF
@@ -1782,17 +1817,15 @@ COMPILING A PATTERN
        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 PCRE2_UTF changes the behaviour of PCRE2  are  given  in
-       the  pcre2unicode  page.  In  particular,  note that it changes the way
+       support is not available, the use of this option provokes an error. De-
+       tails of how PCRE2_UTF changes the behaviour of PCRE2 are given in  the
+       pcre2unicode  page.  In  particular,  note  that  it  changes  the  way
        PCRE2_CASELESS handles characters with code points greater than 127.
 
    Extra compile options
 
-       Unlike the main compile-time options, the extra options are  not  saved
-       with the compiled pattern. The option bits that can be set in a compile
-       context by calling the pcre2_set_compile_extra_options()  function  are
-       as follows:
+       The option bits that can be set in a compile  context  by  calling  the
+       pcre2_set_compile_extra_options() function are as follows:
 
          PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES
 
@@ -1807,18 +1840,26 @@ COMPILING A PATTERN
 
        These values also cause errors if encountered in escape sequences  such
        as \x{d912} within a pattern. However, it seems that some applications,
-       when using PCRE2 to check for unwanted  characters  in  UTF-8  strings,
-       explicitly   test  for  the  surrogates  using  escape  sequences.  The
-       PCRE2_NO_UTF_CHECK option does  not  disable  the  error  that  occurs,
-       because  it applies only to the testing of input strings for UTF valid-
-       ity.
-
-       If the extra option PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is set,  surro-
-       gate  code  point values in UTF-8 and UTF-32 patterns no longer provoke
-       errors and are incorporated in the compiled pattern. However, they  can
-       only  match  subject characters if the matching function is called with
+       when using PCRE2 to check for unwanted characters in UTF-8 strings, ex-
+       plicitly   test   for   the  surrogates  using  escape  sequences.  The
+       PCRE2_NO_UTF_CHECK option does not disable the error that  occurs,  be-
+       cause it applies only to the testing of input strings for UTF validity.
+
+       If  the extra option PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is set, surro-
+       gate code point values in UTF-8 and UTF-32 patterns no  longer  provoke
+       errors  and are incorporated in the compiled pattern. However, they can
+       only match subject characters if the matching function is  called  with
        PCRE2_NO_UTF_CHECK set.
 
+         PCRE2_EXTRA_ALT_BSUX
+
+       The  original option PCRE2_ALT_BSUX causes PCRE2 to process \U, \u, and
+       \x in the way that ECMAscript (aka JavaScript) does.  Additional  func-
+       tionality was defined by ECMAscript 6; setting PCRE2_EXTRA_ALT_BSUX has
+       the effect of PCRE2_ALT_BSUX, but in addition it  recognizes  \u{hhh..}
+       as a hexadecimal character code, where hhh.. is any number of hexadeci-
+       mal digits.
+
          PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL
 
        This is a dangerous option. Use with care. By default, an  unrecognized
@@ -1831,28 +1872,41 @@ COMPILING A PATTERN
        Perl.
 
        If  the  PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL  extra  option  is passed to
-       pcre2_compile(), all unrecognized or  erroneous  escape  sequences  are
+       pcre2_compile(), all unrecognized or  malformed  escape  sequences  are
        treated  as  single-character escapes. For example, \j is a literal "j"
-       and \x{2z} is treated as  the  literal  string  "x{2z}".  Setting  this
-       option  means  that  typos in patterns may go undetected and have unex-
-       pected results. This is a dangerous option. Use with care.
+       and \x{2z} is treated as the literal string "x{2z}". Setting  this  op-
+       tion means that typos in patterns may go undetected and have unexpected
+       results. Also note that a sequence such as [\N{] is  interpreted  as  a
+       malformed  attempt  at [\N{...}] and so is treated as [N{] whereas [\N]
+       gives an error because an unqualified \N is a valid escape sequence but
+       is  not supported in a character class. To reiterate: this is a danger-
+       ous option. Use with great care.
+
+         PCRE2_EXTRA_ESCAPED_CR_IS_LF
+
+       There are some legacy applications where the escape sequence  \r  in  a
+       pattern  is expected to match a newline. If this option is set, \r in a
+       pattern is converted to \n so that it matches a LF  (linefeed)  instead
+       of  a CR (carriage return) character. The option does not affect a lit-
+       eral CR in the pattern, nor does it affect CR specified as an  explicit
+       code point such as \x{0D}.
 
          PCRE2_EXTRA_MATCH_LINE
 
-       This option is provided for use by  the  -x  option  of  pcre2grep.  It
-       causes  the  pattern  only to match complete lines. This is achieved by
-       automatically inserting the code for "^(?:" at the start  of  the  com-
-       piled  pattern  and ")$" at the end. Thus, when PCRE2_MULTILINE is set,
-       the matched line may be in the  middle  of  the  subject  string.  This
-       option can be used with PCRE2_LITERAL.
+       This  option  is  provided  for  use  by the -x option of pcre2grep. It
+       causes the pattern only to match complete lines. This  is  achieved  by
+       automatically  inserting  the  code for "^(?:" at the start of the com-
+       piled pattern and ")$" at the end. Thus, when PCRE2_MULTILINE  is  set,
+       the  matched  line may be in the middle of the subject string. This op-
+       tion can be used with PCRE2_LITERAL.
 
          PCRE2_EXTRA_MATCH_WORD
 
-       This  option  is  provided  for  use  by the -w option of pcre2grep. It
-       causes the pattern only to match strings that have a word  boundary  at
-       the  start and the end. This is achieved by automatically inserting the
-       code for "\b(?:" at the start of the compiled pattern and ")\b" at  the
-       end.  The option may be used with PCRE2_LITERAL. However, it is ignored
+       This option is provided for use by  the  -w  option  of  pcre2grep.  It
+       causes  the  pattern only to match strings that have a word boundary at
+       the start and the end. This is achieved by automatically inserting  the
+       code  for "\b(?:" at the start of the compiled pattern and ")\b" at the
+       end. The option may be used with PCRE2_LITERAL. However, it is  ignored
        if PCRE2_EXTRA_MATCH_LINE is also set.
 
 
@@ -1875,54 +1929,63 @@ 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  Uni-
-       code 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
+       const uint8_t *pcre2_maketables(pcre2_general_context *gcontext);
+
+       void pcre2_maketables_free(pcre2_general_context *gcontext,
+         const uint8_t *tables);
+
+       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. However, 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. When PCRE2 is built with Unicode
+       support (the default), all characters can be tested with \p and \P, or,
+       alternatively,  the  PCRE2_UCP option can be set when a pattern is com-
+       piled; this causes \w and friends to use Unicode property  support  in-
+       stead 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
        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
-       internal tables recognize only ASCII characters. However, when PCRE2 is
+       PCRE2  contains a built-in set of character tables that are used by de-
+       fault.  These are sufficient for many applications. Normally,  the  in-
+       ternal  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 built-in 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
-       treated as letters), the following code could be used:
+       External  tables  are built by calling the pcre2_maketables() function,
+       in the relevant locale. The only argument to this function is a general
+       context,  which  can  be used to pass a custom memory allocator. If the
+       argument is NULL, the system malloc() is used. 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");
          tables = pcre2_maketables(NULL);
@@ -1930,29 +1993,33 @@ 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 tables remains available for as long as it is needed.
+       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".
 
        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 both 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  both  happen in the same locale, but different
        patterns can be processed in different locales.
 
+       It is the caller's responsibility to ensure that the memory  containing
+       the tables remains available while they are still in use. When they are
+       no longer needed, you can discard them  using  pcre2_maketables_free(),
+       which  should  pass as its first parameter the same global context that
+       was used to create the tables.
+
 
 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  re-
+       ceive  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:
@@ -1962,9 +2029,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 a
+       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;
@@ -1982,22 +2049,22 @@ INFORMATION ABOUT A COMPILED PATTERN
          PCRE2_INFO_EXTRAOPTIONS
 
        Return copies 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 (*XXX)
-       option settings such as (*UTF) at the  start  of  the  pattern  itself.
-       PCRE2_INFO_EXTRAOPTIONS  returns the extra options that were set in the
-       compile context by calling the pcre2_set_compile_extra_options()  func-
+       to a uint32_t variable. PCRE2_INFO_ARGOPTIONS returns exactly  the  op-
+       tions  that  were  passed to pcre2_compile(), whereas PCRE2_INFO_ALLOP-
+       TIONS returns the compile options as modified by any  top-level  (*XXX)
+       option  settings  such  as  (*UTF)  at the start of the pattern itself.
+       PCRE2_INFO_EXTRAOPTIONS returns the extra options that were set in  the
+       compile  context by calling the pcre2_set_compile_extra_options() func-
        tion.
 
-       For   example,   if  the  pattern  /(*UTF)abc/  is  compiled  with  the
-       PCRE2_EXTENDED  option,  the  result   for   PCRE2_INFO_ALLOPTIONS   is
-       PCRE2_EXTENDED  and  PCRE2_UTF.   Option settings such as (?i) that can
-       change within a pattern do not affect the result  of  PCRE2_INFO_ALLOP-
-       TIONS, even if they appear right at the start of the pattern. (This was
-       different in some earlier releases.)
+       For example, if the pattern /(*UTF)abc/ is compiled with the  PCRE2_EX-
+       TENDED  option,  the result for PCRE2_INFO_ALLOPTIONS is PCRE2_EXTENDED
+       and PCRE2_UTF.  Option settings such as (?i) that can change  within  a
+       pattern do not affect the result of PCRE2_INFO_ALLOPTIONS, even if they
+       appear right at the start of the pattern. (This was different  in  some
+       earlier releases.)
 
-       A pattern compiled without PCRE2_ANCHORED is automatically anchored  by
+       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:
 
@@ -2006,187 +2073,196 @@ 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
-         .* is not in a capturing group that is the subject
+         .* is not in a capture group that is the subject
               of a backreference
          PCRE2_DOTALL is in force for .*
          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  backreference  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
-       backreference.   Backreferences such as \4 or \g{12} match the captured
-       characters of the given group, but in addition, the check that  a  cap-
-       turing  group  is  set in a conditional subpattern such as (?(3)a|b) is
-       also a backreference. Zero is returned if there are no backreferences.
+       Return  the  number  of  the  highest backreference in the pattern. The
+       third argument should point  to  a  uint32_t  variable.  Named  capture
+       groups  acquire  numbers  as well as names, and these count towards the
+       highest backreference. Backreferences such as \4 or  \g{12}  match  the
+       captured characters of the given group, but in addition, the check that
+       a capture group is set in a conditional group such as (?(3)a|b) is also
+       a backreference.  Zero is returned if there are no backreferences.
 
          PCRE2_INFO_BSR
 
-       The output is a uint32_t integer 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
+       The  output  is a uint32_t integer 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_ANYCRLF means that \R matches only CR, LF, or CRLF.
 
          PCRE2_INFO_CAPTURECOUNT
 
-       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.
+       Return the highest capture group number in  the  pattern.  In  patterns
+       where (?| is not used, this is also the total number of capture groups.
+       The third argument should point to a uint32_t variable.
 
          PCRE2_INFO_DEPTHLIMIT
 
-       If  the  pattern set a backtracking depth limit by including an item of
-       the form (*LIMIT_DEPTH=nnnn) at the start, the value is  returned.  The
+       If the pattern set a backtracking depth limit by including an  item  of
+       the  form  (*LIMIT_DEPTH=nnnn) at the start, the value is returned. The
        third argument should point to a uint32_t integer. If no such value has
-       been  set,  the  call  to  pcre2_pattern_info()   returns   the   error
-       PCRE2_ERROR_UNSET. Note that this limit will only be used during match-
-       ing if it is less than the limit set or defaulted by the caller of  the
-       match function.
+       been  set, the call to pcre2_pattern_info() returns the error PCRE2_ER-
+       ROR_UNSET. Note that this limit will only be used during matching if it
+       is  less  than  the  limit  set or defaulted by the caller of the match
+       function.
 
          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
+       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 a 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 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.
+       a non-anchored pattern. The third argument should point to  a  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  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 for a
-       pattern 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
+       Return the value of the first code unit of any  matched  string  for  a
+       pattern  where  PCRE2_INFO_FIRSTCODETYPE returns 1; otherwise return 0.
+       The third argument should point to a 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_FRAMESIZE
 
        Return the size (in bytes) of the data frames that are used to remember
-       backtracking positions when the pattern is processed  by  pcre2_match()
-       without  the  use  of  JIT. The third argument should point to a size_t
+       backtracking  positions  when the pattern is processed by pcre2_match()
+       without the use of JIT. The third argument should  point  to  a  size_t
        variable. The frame size depends on the number of capturing parentheses
-       in  the  pattern.  Each  additional capturing group adds two PCRE2_SIZE
-       variables.
+       in the pattern. Each additional capture group adds two PCRE2_SIZE vari-
+       ables.
 
          PCRE2_INFO_HASBACKSLASHC
 
-       Return 1 if the pattern contains any instances of \C, otherwise 0.  The
-       third argument should point to an uint32_t variable.
+       Return  1 if the pattern contains any instances of \C, otherwise 0. The
+       third argument should point to a uint32_t variable.
 
          PCRE2_INFO_HASCRORLF
 
-       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
-       \r or  \n  or  one  of  the  equivalent  hexadecimal  or  octal  escape
-       sequences.
+       Return 1 if the pattern contains any explicit  matches  for  CR  or  LF
+       characters,  otherwise 0. The third argument should point to a uint32_t
+       variable. An explicit match is either a literal CR or LF character,  or
+       \r  or  \n  or  one  of  the equivalent hexadecimal or octal escape se-
+       quences.
 
          PCRE2_INFO_HEAPLIMIT
 
        If the pattern set a heap memory limit by including an item of the form
        (*LIMIT_HEAP=nnnn) at the start, the value is returned. The third argu-
        ment should point to a uint32_t integer. If no such value has been set,
-       the call to pcre2_pattern_info() returns the  error  PCRE2_ERROR_UNSET.
-       Note  that  this  limit will only be used during matching if it is less
+       the  call  to pcre2_pattern_info() returns the error PCRE2_ERROR_UNSET.
+       Note that this limit will only be used during matching if  it  is  less
        than the limit set or defaulted by the caller of the match function.
 
          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  a  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  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.
+       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 a 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
 
-       Return  the value of the rightmost literal code unit that must exist in
-       any matched string, other than  at  its  start,  for  a  pattern  where
+       Return the value of the rightmost literal code unit that must exist  in
+       any  matched  string,  other  than  at  its  start, for a pattern where
        PCRE2_INFO_LASTCODETYPE returns 1. Otherwise, return 0. The third argu-
-       ment should point to an uint32_t variable.
+       ment should point to a uint32_t variable.
 
          PCRE2_INFO_MATCHEMPTY
 
-       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.
+       Return  1  if the pattern might match an empty string, otherwise 0. The
+       third argument should point to a uint32_t variable. When a pattern con-
+       tains recursive subroutine calls it is not always possible to determine
+       whether or not it can match an empty string. PCRE2 takes a cautious ap-
+       proach 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 a uint32_t integer. If no such value has  been
-       set,    the    call   to   pcre2_pattern_info()   returns   the   error
-       PCRE2_ERROR_UNSET. Note that this limit will only be used during match-
-       ing  if it is less than the limit set or defaulted by the caller of the
-       match function.
+       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  ar-
+       gument  should  point  to a uint32_t integer. If no such value has been
+       set, the call to pcre2_pattern_info() returns the error PCRE2_ERROR_UN-
+       SET.  Note  that  this limit will only be used during matching if it is
+       less than the limit set or defaulted by the caller of the  match  func-
+       tion.
 
          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 a
-       uint32_t 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 regis-
-       ters  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 processed. Oth-
-       erwise, if there are no lookbehinds in  the  pattern,  \A  might  match
-       incorrectly at the start of a second or subsequent segment.
+       A  lookbehind  assertion moves back a certain number of characters (not
+       code units) when it starts to process each of its  branches.  This  re-
+       quest  returns  the largest of these backward moves. The third argument
+       should point to a uint32_t integer. The simple assertions \b and \B re-
+       quire  a one-character lookbehind and cause PCRE2_INFO_MAXLOOKBEHIND to
+       return 1 in the absence of anything longer. \A also  registers  a  one-
+       character  lookbehind, though it does not actually inspect the previous
+       character.
+
+       Note that this information is useful for multi-segment matching only if
+       the  pattern  contains  no nested lookbehinds. For example, the pattern
+       (?<=a(?<=ba)c) returns a maximum lookbehind of 2, but when it  is  pro-
+       cessed,  the first lookbehind moves back by two characters, matches one
+       character, then the nested lookbehind also moves back  by  two  charac-
+       ters. This puts the matching point three characters earlier than it was
+       at the start.  PCRE2_INFO_MAXLOOKBEHIND is really only useful as a  de-
+       bugging  tool.  See  the pcre2partial documentation for a discussion of
+       multi-segment matching.
 
          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
-       match, but every string that does match is at least that long.
+       If a minimum length for matching  subject  strings  was  computed,  its
+       value is returned. Otherwise the returned value is 0. This value is not
+       computed when PCRE2_NO_START_OPTIMIZE is set. The value is a number  of
+       characters,  which in UTF mode may be different from the number of code
+       units. The third argument should point  to  a  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
          PCRE2_INFO_NAMEENTRYSIZE
@@ -2199,8 +2275,8 @@ INFORMATION ABOUT A COMPILED PATTERN
        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.
+       do the conversion, you need to use the name-to-number map, which is de-
+       scribed 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
@@ -2208,35 +2284,36 @@ INFORMATION ABOUT A COMPILED PATTERN
        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-
-       turing parenthesis, most significant byte first. In the 16-bit library,
+       This is a PCRE2_SPTR pointer to a block of code units. In the 8-bit li-
+       brary, the first two bytes of each entry are the number of the  captur-
+       ing  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 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
+       capture groups with the same number, as described in the section on du-
+       plicate group 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
+       Duplicate  names  for capture groups with different numbers are permit-
+       ted, 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.
+       necessarily  the  case because later capture groups may have lower num-
+       bers.
 
-       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 capture groups, 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 ??:
 
@@ -2245,8 +2322,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 capture groups 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
@@ -2265,15 +2342,15 @@ INFORMATION ABOUT A COMPILED PATTERN
 
          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
-       alter the value returned by this option.
+       Return the size of the compiled pattern in bytes  (for  all  three  li-
+       braries).  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, be-
+       cause there are cases where the code that calculates the  size  has  to
+       over-estimate.  Processing a pattern with the JIT compiler does not al-
+       ter the value returned by this option.
 
 
 INFORMATION ABOUT A PATTERN'S CALLOUTS
@@ -2283,30 +2360,30 @@ 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  host  on
-       which  the  patterns  are  reloaded must be running the same version of
+       It is possible to save compiled patterns  on  disc  or  elsewhere,  and
+       reload  them  later,  subject  to a number of restrictions. 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 endi-
-       anness,  pointer  width,  and PCRE2_SIZE type. Before compiled patterns
-       can be saved, they must be converted to a "serialized" form,  which  in
-       the  case of PCRE2 is really just a bytecode dump.  The functions whose
-       names begin with pcre2_serialize_ are used for converting to  and  from
-       the  serialized form. They are described in the pcre2serialize documen-
-       tation. Note that PCRE2 serialization does not  convert  compiled  pat-
+       anness, pointer width, and PCRE2_SIZE type.  Before  compiled  patterns
+       can  be  saved, they must be converted to a "serialized" form, which in
+       the case of PCRE2 is really just a bytecode dump.  The functions  whose
+       names  begin  with pcre2_serialize_ are used for converting to and from
+       the serialized form. They are described in the pcre2serialize  documen-
+       tation.  Note  that  PCRE2 serialization does not convert compiled pat-
        terns to an abstract format like Java or .NET serialization.
 
 
@@ -2320,54 +2397,55 @@ THE MATCH DATA BLOCK
 
        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 known 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  known  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 an
-       additional  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  re-
+       quired  to  identify the string that matched the whole pattern, with an
+       additional 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
-       after  a  match  operation  has  finished,  using  functions  that  are
-       described in the sections on  matched  strings  and  other  match  data
-       below.
+       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  de-
+       scribed 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
-       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
-       taken place.
+       match block only  when  the  error  is  PCRE2_ERROR_NOMATCH,  PCRE2_ER-
+       ROR_PARTIAL,  or  one of the error codes for an invalid UTF string. Ex-
+       actly 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  a  successful
+       match. 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,  unless,  in  the case of the subject
+       string, you have used the PCRE2_COPY_MATCHED_SUBJECT option,  which  is
+       described  in  the section entitled "Option bits for pcre2_match()" be-
+       low.
 
        When a match data block itself is no longer needed, it should be  freed
        by  calling  pcre2_match_data_free(). If this function is called with a
@@ -2387,9 +2465,9 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
        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  op-
+       erates  in  a Perl-like manner. For specialist use there is also an al-
+       ternative 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():
@@ -2424,8 +2502,8 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
        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
-       binary zeros.
+       sets  are  valid). Like the pattern string, the subject may contain bi-
+       nary zeros.
 
        A non-zero starting offset is useful when searching for  another  match
        in  the  same  subject  by calling pcre2_match() again after a previous
@@ -2439,8 +2517,8 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
        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,
-       because \B is always false at the start of the subject, which is deemed
+       the remainder of the subject, namely "issipi", it does not  match,  be-
+       cause  \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
        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
@@ -2467,25 +2545,43 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
    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_ENDANCHORED,
-       PCRE2_NOTBOL,   PCRE2_NOTEOL,  PCRE2_NOTEMPTY,  PCRE2_NOTEMPTY_ATSTART,
-       PCRE2_NO_JIT, PCRE2_NO_UTF_CHECK,  PCRE2_PARTIAL_HARD,  and  PCRE2_PAR-
-       TIAL_SOFT.  Their action is described below.
-
-       Setting  PCRE2_ANCHORED  or PCRE2_ENDANCHORED at match time is not sup-
-       ported by the just-in-time (JIT) compiler. If it is set,  JIT  matching
-       is  disabled  and  the interpretive code in pcre2_match() is run. Apart
-       from PCRE2_NO_JIT (obviously), the remaining options are supported  for
+       The   only   bits    that    may    be    set    are    PCRE2_ANCHORED,
+       PCRE2_COPY_MATCHED_SUBJECT,  PCRE2_ENDANCHORED, PCRE2_NOTBOL, PCRE2_NO-
+       TEOL,     PCRE2_NOTEMPTY,     PCRE2_NOTEMPTY_ATSTART,     PCRE2_NO_JIT,
+       PCRE2_NO_UTF_CHECK,  PCRE2_PARTIAL_HARD,  and PCRE2_PARTIAL_SOFT. Their
+       action is described below.
+
+       Setting PCRE2_ANCHORED or PCRE2_ENDANCHORED at match time is  not  sup-
+       ported  by  the just-in-time (JIT) compiler. If it is set, JIT matching
+       is disabled and the interpretive code in pcre2_match()  is  run.  Apart
+       from  PCRE2_NO_JIT (obviously), 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_COPY_MATCHED_SUBJECT
+
+       By default, a pointer to the subject is remembered in  the  match  data
+       block  so  that,  after a successful match, it can be referenced by the
+       substring extraction functions. This means that  the  subject's  memory
+       must  not be freed until all such operations are complete. For some ap-
+       plications where the lifetime of the subject string is not  guaranteed,
+       it  may  be  necessary  to make a copy of the subject string, but it is
+       wasteful to do this unless the match is successful. After a  successful
+       match,  if PCRE2_COPY_MATCHED_SUBJECT is set, the subject is copied and
+       the new pointer is remembered in the match data block  instead  of  the
+       original  subject  pointer.  The memory allocator that was used for the
+       match block itself is  used.  The  copy  is  automatically  freed  when
+       pcre2_match_data_free()  is  called to free the match data block. It is
+       also automatically freed if the match data block is re-used for another
+       match operation.
+
          PCRE2_ENDANCHORED
 
        If  the  PCRE2_ENDANCHORED option is set, any string that pcre2_match()
@@ -2528,8 +2624,8 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
        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
-       occur only if the pattern contains \K.
+       subject is permitted.  If the pattern is anchored, such a match can oc-
+       cur only if the pattern contains \K.
 
          PCRE2_NO_JIT
 
@@ -2541,46 +2637,56 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
          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.   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.
+       UTF  string  is  checked  unless  PCRE2_NO_UTF_CHECK   is   passed   to
+       pcre2_match() or PCRE2_MATCH_INVALID_UTF was passed to pcre2_compile().
+       The latter special case is discussed in detail in the pcre2unicode doc-
+       umentation.
+
+       In  the default case, 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.
 
        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.
+       pcre2unicode documentation.
 
-       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 other matches in the same subject string.
+       If you know that your subject is valid, and you want to skip this check
+       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 multiple matches in the same subject string.
 
-       Warning: 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.
+       Warning: Unless PCRE2_MATCH_INVALID_UTF was set at compile  time,  when
+       PCRE2_NO_UTF_CHECK  is  set  at match time the effect of passing an in-
+       valid string as a subject, or an invalid value of startoffset, is unde-
+       fined.   Your  program may crash or loop indefinitely or give wrong re-
+       sults.
 
          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-
-       plete match can be found.
+       These options turn on the partial matching feature. A partial match oc-
+       curs  if  the  end  of  the subject string is reached successfully, but
+       there are not enough subject characters to complete the match. In addi-
+       tion,  either  at  least  one character must have been inspected or the
+       pattern must contain a lookbehind, or the  pattern  must  be  one  that
+       could match an empty string.
+
+       If  this  situation  arises when PCRE2_PARTIAL_SOFT (but not PCRE2_PAR-
+       TIAL_HARD) is set, matching continues by testing any remaining alterna-
+       tives.  Only  if  no complete match can be found is PCRE2_ERROR_PARTIAL
+       returned instead of PCRE2_ERROR_NOMATCH.  In  other  words,  PCRE2_PAR-
+       TIAL_SOFT  specifies  that  the  caller is prepared to handle a partial
+       match, but only if no complete 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
@@ -2612,8 +2718,8 @@ NEWLINE HANDLING WHEN MATCHING
        other words, to after the CRLF.
 
        The above rule is a compromise that makes the most common cases work as
-       expected.  For  example,  if  the  pattern is .+A (and the PCRE2_DOTALL
-       option is not set), it does not match the string "\r\nA" because, after
+       expected.  For example, if the pattern is .+A (and the PCRE2_DOTALL op-
+       tion is not set), it does not match the string "\r\nA"  because,  after
        failing  at the start, it skips both the CR and the LF before retrying.
        However, the pattern [\r\n]A does match that string,  because  it  con-
        tains an explicit CR or LF reference, and so advances only by one char-
@@ -2640,11 +2746,11 @@ HOW PCRE2_MATCH() RETURNS A STRING AND CAPTURED SUBSTRINGS
        addition,  further  substrings  from  the  subject may be picked out by
        parenthesized parts of the pattern.  Following  the  usage  in  Jeffrey
        Friedl's  book,  this  is  called  "capturing" in what follows, and the
-       phrase "capturing subpattern" or "capturing group" is used for a  frag-
-       ment  of  a  pattern that picks out a substring. PCRE2 supports several
-       other kinds of parenthesized subpattern that do not cause substrings to
-       be  captured. The pcre2_pattern_info() function can be used to find out
-       how many capturing subpatterns there are in a compiled pattern.
+       phrase "capture group" (Perl terminology) is used for a fragment  of  a
+       pattern  that picks out a substring. PCRE2 supports several other kinds
+       of parenthesized group that do not cause substrings to be captured. The
+       pcre2_pattern_info()  function can be used to find out how many capture
+       groups there are in a compiled pattern.
 
        You can use auxiliary functions for accessing  captured  substrings  by
        number or by name, as described in sections below.
@@ -2660,8 +2766,8 @@ HOW PCRE2_MATCH() RETURNS A STRING AND CAPTURED SUBSTRINGS
        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
-       library, and 32-bit offsets in the 32-bit library.
+       are byte offsets in the 8-bit library, 16-bit offsets in the 16-bit li-
+       brary, 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.
@@ -2682,9 +2788,9 @@ HOW PCRE2_MATCH() RETURNS A STRING AND CAPTURED SUBSTRINGS
        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
-       that is returned.
+       If a capture group is matched repeatedly within a single  match  opera-
+       tion, it is the last portion of the subject that it matched that is re-
+       turned.
 
        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
@@ -2692,20 +2798,20 @@ HOW PCRE2_MATCH() RETURNS A STRING AND CAPTURED SUBSTRINGS
        called with a match data block whose ovector is of minimum length (that
        is, one pair).
 
-       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
-       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-
-       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
-       "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-
-       est used capturing subpattern number is 1. The offsets for for the sec-
-       ond and third capturing  subpatterns  (assuming  the  vector  is  large
-       enough, of course) are set to PCRE2_UNSET.
+       It is possible for capture group number n+1 to match some part  of  the
+       subject  when  group  n  has  not been used at all. For example, if the
+       string "abc" is matched against the pattern (a|(z))(bc) the return from
+       the  function  is 4, and groups 1 and 3 are matched, but 2 is not. When
+       this happens, both values in the offset pairs corresponding  to  unused
+       groups are set to PCRE2_UNSET.
+
+       Offset  values  that  correspond to unused groups at the end of the ex-
+       pression are also set to PCRE2_UNSET. For example, if the string  "abc"
+       is  matched  against  the pattern (abc)(x(yz)?)? groups 2 and 3 are not
+       matched. The return from the function is 2, because  the  highest  used
+       capture  group  number  is  1. The offsets for for the second and third
+       capture groupss (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-
@@ -2727,22 +2833,22 @@ OTHER INFORMATION ABOUT A MATCH
        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), (*PRUNE), or (*THEN)
-       name  may  be available. The function pcre2_get_mark() can be called to
-       access this name. The same function applies  to  all  three  verbs.  It
+       failure to match (PCRE2_ERROR_NOMATCH), a mark name may  be  available.
+       The  function pcre2_get_mark() can be called to access this name, which
+       can be specified in the pattern by  any  of  the  backtracking  control
+       verbs, not just (*MARK). The same function applies to all the verbs. It
        returns a pointer to the zero-terminated name, which is within the com-
        piled pattern. If no name is available, NULL is returned. The length of
-       the  name  (excluding  the terminating zero) is stored in the code unit
-       that precedes the name. You should use this length instead  of  relying
+       the name (excluding the terminating zero) is stored in  the  code  unit
+       that  precedes  the name. You should use this length instead of relying
        on the terminating zero if the name might contain a binary zero.
 
-       After  a  successful  match,  the  name  that  is  returned is the last
-       (*MARK), (*PRUNE), or (*THEN) name encountered  on  the  matching  path
-       through  the  pattern.  Instances of (*PRUNE) and (*THEN) without names
-       are  ignored.  Thus,  for  example,  if  the  matching  path   contains
-       (*MARK:A)(*PRUNE),  the  name "A" is returned.  After a "no match" or a
-       partial match, the last encountered name  is  returned.   For  example,
-       consider this pattern:
+       After a successful match, the name that is returned is  the  last  mark
+       name encountered on the matching path through the pattern. Instances of
+       backtracking verbs without names do not count. Thus,  for  example,  if
+       the matching path contains (*MARK:A)(*PRUNE), the name "A" is returned.
+       After a "no match" or a partial match, the last encountered name is re-
+       turned. For example, consider this pattern:
 
          ^(*MARK:A)((*MARK:B)a|b)c
 
@@ -2754,10 +2860,10 @@ OTHER INFORMATION ABOUT A MATCH
        Warning: By default, certain start-of-match optimizations are  used  to
        give  a  fast "no match" result in some situations. For example, if the
        anchoring is removed from the pattern above, there is an initial  check
-       for  the  presence  of  "c"  in the subject before running the matching
-       engine. This check fails for "bx", causing a match failure without see-
-       ing any marks. You can disable the start-of-match optimizations by set-
-       ting the PCRE2_NO_START_OPTIMIZE option for pcre2_compile() or starting
+       for  the presence of "c" in the subject before running the matching en-
+       gine. This check fails for "bx", causing a match failure without seeing
+       any  marks. You can disable the start-of-match optimizations by setting
+       the PCRE2_NO_START_OPTIMIZE option for pcre2_compile() or  by  starting
        the pattern with (*NO_START_OPT).
 
        After  a  successful  match, a partial match, or one of the invalid UTF
@@ -2845,10 +2951,10 @@ ERROR RETURNS FROM pcre2_match()
 
          PCRE2_ERROR_JIT_STACKLIMIT
 
-       This  error  is  returned  when a pattern that was successfully studied
-       using JIT is being matched, but the memory available for  the  just-in-
-       time  processing stack is not large enough. See the pcre2jit documenta-
-       tion for more details.
+       This error is returned when a pattern that was successfully studied us-
+       ing JIT is being matched, but the memory available for the just-in-time
+       processing  stack  is  not large enough. See the pcre2jit documentation
+       for more details.
 
          PCRE2_ERROR_MATCHLIMIT
 
@@ -2860,7 +2966,8 @@ ERROR RETURNS FROM pcre2_match()
        used  to  remember them. This error is given when the memory allocation
        function (default or  custom)  fails.  Note  that  a  different  error,
        PCRE2_ERROR_HEAPLIMIT,  is given if the amount of memory needed exceeds
-       the heap limit.
+       the   heap   limit.   PCRE2_ERROR_NOMEMORY   is   also   returned    if
+       PCRE2_COPY_MATCHED_SUBJECT is set and memory allocation fails.
 
          PCRE2_ERROR_NULL
 
@@ -2868,13 +2975,13 @@ ERROR RETURNS FROM pcre2_match()
 
          PCRE2_ERROR_RECURSELOOP
 
-       This error is returned when  pcre2_match()  detects  a  recursion  loop
-       within  the  pattern. Specifically, it means that either the whole pat-
-       tern or a subpattern has been called recursively for the second time at
-       the  same  position  in  the  subject string. Some simple patterns that
-       might do this are detected and faulted at compile time, but  more  com-
-       plicated  cases,  in particular mutual recursions between two different
-       subpatterns, cannot be detected until matching is attempted.
+       This  error  is  returned  when  pcre2_match() detects a recursion loop
+       within the pattern. Specifically, it means that either the  whole  pat-
+       tern or a capture group has been called recursively for the second time
+       at the same position in the subject string. Some simple  patterns  that
+       might  do  this are detected and faulted at compile time, but more com-
+       plicated cases, in particular mutual recursions between  two  different
+       groups, cannot be detected until matching is attempted.
 
 
 OBTAINING A TEXTUAL ERROR MESSAGE
@@ -2882,21 +2989,21 @@ OBTAINING A TEXTUAL ERROR MESSAGE
        int pcre2_get_error_message(int errorcode, PCRE2_UCHAR *buffer,
          PCRE2_SIZE bufflen);
 
-       A text message for an error code  from  any  PCRE2  function  (compile,
-       match,  or  auxiliary)  can be obtained by calling pcre2_get_error_mes-
-       sage(). The code is passed as the first argument,  with  the  remaining
-       two  arguments  specifying  a  code  unit buffer and its length in code
-       units, into which the text message is placed. The message  is  returned
-       in  code  units  of the appropriate width for the library that is being
+       A  text  message  for  an  error code from any PCRE2 function (compile,
+       match, or auxiliary) can be obtained  by  calling  pcre2_get_error_mes-
+       sage().  The  code  is passed as the first argument, with the remaining
+       two arguments specifying a code unit buffer  and  its  length  in  code
+       units,  into  which the text message is placed. The message is returned
+       in code units of the appropriate width for the library  that  is  being
        used.
 
-       The returned message is terminated with a trailing zero, and the  func-
-       tion  returns  the  number  of  code units used, excluding the trailing
-       zero.  If  the  error  number  is  unknown,  the  negative  error  code
-       PCRE2_ERROR_BADDATA  is  returned. If the buffer is too small, the mes-
-       sage is truncated (but still with a trailing zero),  and  the  negative
-       error  code PCRE2_ERROR_NOMEMORY is returned.  None of the messages are
-       very long; a buffer size of 120 code units is ample.
+       The  returned message is terminated with a trailing zero, and the func-
+       tion returns the number of code  units  used,  excluding  the  trailing
+       zero. If the error number is unknown, the negative error code PCRE2_ER-
+       ROR_BADDATA is returned. If the buffer is too  small,  the  message  is
+       truncated (but still with a trailing zero), and the negative error code
+       PCRE2_ERROR_NOMEMORY is returned.  None of the messages are very  long;
+       a buffer size of 120 code units is ample.
 
 
 EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
@@ -2914,40 +3021,40 @@ EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
 
        void pcre2_substring_free(PCRE2_UCHAR *buffer);
 
-       Captured substrings can be accessed directly by using  the  ovector  as
+       Captured  substrings  can  be accessed directly by using the ovector as
        described above.  For convenience, auxiliary functions are provided for
-       extracting  captured  substrings  as  new,  separate,   zero-terminated
+       extracting   captured  substrings  as  new,  separate,  zero-terminated
        strings. A substring that contains a binary zero is correctly extracted
-       and has a further zero added on the end, but  the  result  is  not,  of
+       and  has  a  further  zero  added on the end, but the result is not, of
        course, a C string.
 
        The functions in this section identify substrings by number. The number
        zero refers to the entire matched substring, with higher numbers refer-
-       ring  to  substrings  captured by parenthesized groups. After a partial
-       match, only substring zero is available.  An  attempt  to  extract  any
-       other  substring  gives the error PCRE2_ERROR_PARTIAL. The next section
+       ring to substrings captured by parenthesized groups.  After  a  partial
+       match,  only  substring  zero  is  available. An attempt to extract any
+       other substring gives the error PCRE2_ERROR_PARTIAL. The  next  section
        describes similar functions for extracting captured substrings by name.
 
-       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
-       "ab",  the  start  and  end offset values for the match are 2 and 0. In
-       this situation, calling these functions with a  zero  substring  number
+       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.  In
+       this  situation,  calling  these functions with a zero substring number
        extracts a zero-length empty string.
 
-       You  can  find the length in code units of a captured substring without
-       extracting it by calling pcre2_substring_length_bynumber().  The  first
-       argument  is a pointer to the match data block, the second is the group
-       number, and the third is a pointer to a variable into which the  length
-       is  placed.  If  you just want to know whether or not the substring has
+       You can find the length in code units of a captured  substring  without
+       extracting  it  by calling pcre2_substring_length_bynumber(). The first
+       argument is a pointer to the match data block, the second is the  group
+       number,  and the third is a pointer to a variable into which the length
+       is placed. If you just want to know whether or not  the  substring  has
        been captured, you can pass the third argument as NULL.
 
-       The pcre2_substring_copy_bynumber() function  copies  a  captured  sub-
-       string  into  a supplied buffer, whereas pcre2_substring_get_bynumber()
-       copies it into new memory, obtained using the  same  memory  allocation
-       function  that  was  used for the match data block. The first two argu-
-       ments of these functions are a pointer to the match data  block  and  a
-       capturing group number.
+       The  pcre2_substring_copy_bynumber()  function  copies  a captured sub-
+       string into a supplied buffer,  whereas  pcre2_substring_get_bynumber()
+       copies  it  into  new memory, obtained using the same memory allocation
+       function that was used for the match data block. The  first  two  argu-
+       ments  of  these  functions are a pointer to the match data block and a
+       capture group number.
 
        The final arguments of pcre2_substring_copy_bynumber() are a pointer to
        the buffer and a pointer to a variable that contains its length in code
@@ -2955,25 +3062,25 @@ EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
        for the extracted substring, excluding the terminating zero.
 
        For pcre2_substring_get_bynumber() the third and fourth arguments point
-       to  variables that are updated with a pointer to the new memory and the
-       number of code units that comprise the substring, again  excluding  the
-       terminating  zero.  When  the substring is no longer needed, the memory
+       to variables that are updated with a pointer to the new memory and  the
+       number  of  code units that comprise the substring, again excluding the
+       terminating zero. When the substring is no longer  needed,  the  memory
        should be freed by calling pcre2_substring_free().
 
-       The return value from all these functions is zero  for  success,  or  a
-       negative  error  code.  If  the pattern match failed, the match failure
-       code is returned.  If a substring number  greater  than  zero  is  used
-       after  a partial match, PCRE2_ERROR_PARTIAL is returned. Other possible
+       The  return  value  from  all these functions is zero for success, or a
+       negative error code. If the pattern match  failed,  the  match  failure
+       code  is returned.  If a substring number greater than zero is used af-
+       ter a partial match, PCRE2_ERROR_PARTIAL is  returned.  Other  possible
        error codes are:
 
          PCRE2_ERROR_NOMEMORY
 
-       The buffer was too small for  pcre2_substring_copy_bynumber(),  or  the
+       The  buffer  was  too small for pcre2_substring_copy_bynumber(), or the
        attempt to get memory failed for pcre2_substring_get_bynumber().
 
          PCRE2_ERROR_NOSUBSTRING
 
-       There  is  no  substring  with that number in the pattern, that is, the
+       There is no substring with that number in the  pattern,  that  is,  the
        number is greater than the number of capturing parentheses.
 
          PCRE2_ERROR_UNAVAILABLE
@@ -2984,8 +3091,8 @@ EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
 
          PCRE2_ERROR_UNSET
 
-       The substring did not participate in the match.  For  example,  if  the
-       pattern  is  (abc)|(def) and the subject is "def", and the ovector con-
+       The  substring  did  not  participate in the match. For example, if the
+       pattern is (abc)|(def) and the subject is "def", and the  ovector  con-
        tains at least two capturing slots, substring number 1 is unset.
 
 
@@ -2996,33 +3103,32 @@ EXTRACTING A LIST OF ALL CAPTURED SUBSTRINGS
 
        void pcre2_substring_list_free(PCRE2_SPTR *list);
 
-       The pcre2_substring_list_get() function  extracts  all  available  sub-
-       strings  and  builds  a  list of pointers to them. It also (optionally)
-       builds a second list that  contains  their  lengths  (in  code  units),
-       excluding a terminating zero that is added to each of them. All this is
+       The  pcre2_substring_list_get()  function  extracts  all available sub-
+       strings and builds a list of pointers to  them.  It  also  (optionally)
+       builds  a  second list that contains their lengths (in code units), ex-
+       cluding a terminating zero that is added to each of them. All  this  is
        done in a single block of memory that is obtained using the same memory
        allocation function that was used to get the match data block.
 
-       This  function  must be called only after a successful match. If called
+       This function must be called only after a successful match.  If  called
        after a partial match, the error code PCRE2_ERROR_PARTIAL is returned.
 
-       The address of the memory block is returned via listptr, which is  also
+       The  address of the memory block is returned via listptr, which is also
        the start of the list of string pointers. The end of the list is marked
-       by a NULL pointer. The address of the list of lengths is  returned  via
-       lengthsptr.  If your strings do not contain binary zeros and you do not
+       by  a  NULL pointer. The address of the list of lengths is returned via
+       lengthsptr. If your strings do not contain binary zeros and you do  not
        therefore need the lengths, you may supply NULL as the lengthsptr argu-
-       ment  to  disable  the  creation of a list of lengths. The yield of the
-       function is zero if all went well, or PCRE2_ERROR_NOMEMORY if the  mem-
-       ory  block could not be obtained. When the list is no longer needed, it
+       ment to disable the creation of a list of lengths.  The  yield  of  the
+       function  is zero if all went well, or PCRE2_ERROR_NOMEMORY if the mem-
+       ory block could not be obtained. When the list is no longer needed,  it
        should be freed by calling pcre2_substring_list_free().
 
        If this function encounters a substring that is unset, which can happen
-       when  capturing subpattern number n+1 matches some part of the subject,
-       but subpattern n has not been used at all, it returns an empty  string.
-       This  can  be  distinguished  from  a  genuine zero-length substring by
-       inspecting  the  appropriate  offset  in  the  ovector,  which  contain
-       PCRE2_UNSET   for   unset   substrings,   or   by   calling  pcre2_sub-
-       string_length_bynumber().
+       when capture group number n+1 matches some part  of  the  subject,  but
+       group  n has not been used at all, it returns an empty string. This can
+       be distinguished from a genuine zero-length substring by inspecting the
+       appropriate  offset in the ovector, which contain PCRE2_UNSET for unset
+       substrings, or by calling pcre2_substring_length_bynumber().
 
 
 EXTRACTING CAPTURED SUBSTRINGS BY NAME
@@ -3046,34 +3152,35 @@ EXTRACTING CAPTURED SUBSTRINGS BY NAME
 
          (a+)b(?<xxx>\d+)...
 
-       the number of the subpattern called "xxx" is 2. If the name is known to
-       be unique (PCRE2_DUPNAMES was not set), you can find  the  number  from
+       the number of the capture group called "xxx" is 2. If the name is known
+       to be unique (PCRE2_DUPNAMES was not set), you can find the number from
        the name by calling pcre2_substring_number_from_name(). The first argu-
        ment is the compiled pattern, and the second is the name. The yield  of
-       the function is the subpattern number, PCRE2_ERROR_NOSUBSTRING if there
-       is no subpattern of  that  name,  or  PCRE2_ERROR_NOUNIQUESUBSTRING  if
-       there  is  more than one subpattern of that name. Given the number, you
-       can extract the substring directly from the ovector, or use one of  the
-       "bynumber" functions described above.
+       the  function  is the group number, PCRE2_ERROR_NOSUBSTRING if there is
+       no group with that name, or PCRE2_ERROR_NOUNIQUESUBSTRING if  there  is
+       more  than one group with that name.  Given the number, you can extract
+       the substring directly from the ovector, or use one of  the  "bynumber"
+       functions described above.
 
        For  convenience,  there are also "byname" functions that correspond to
-       the "bynumber" functions, the only difference  being  that  the  second
-       argument  is  a  name instead of a number. If PCRE2_DUPNAMES is set and
+       the "bynumber" functions, the only difference being that the second ar-
+       gument  is  a  name  instead  of a number. If PCRE2_DUPNAMES is set and
        there are duplicate names, these functions scan all the groups with the
-       given name, and return the first named string that is set.
-
-       If  there are no groups with the given name, PCRE2_ERROR_NOSUBSTRING is
-       returned. If all groups with the name have  numbers  that  are  greater
-       than  the  number  of  slots in the ovector, PCRE2_ERROR_UNAVAILABLE is
-       returned. If there is at least one group with a slot  in  the  ovector,
-       but no group is found to be set, PCRE2_ERROR_UNSET is returned.
-
-       Warning: If the pattern uses the (?| feature to set up multiple subpat-
-       terns with the same number, as described in the  section  on  duplicate
-       subpattern  numbers  in  the pcre2pattern page, you cannot use names to
-       distinguish the different subpatterns, because names are  not  included
-       in  the compiled code. The matching process uses only numbers. For this
-       reason, the use of different names for subpatterns of the  same  number
+       given  name,  and  return  the  captured substring from the first named
+       group that is set.
+
+       If there are no groups with the given name, PCRE2_ERROR_NOSUBSTRING  is
+       returned.  If  all  groups  with the name have numbers that are greater
+       than the number of slots in the ovector, PCRE2_ERROR_UNAVAILABLE is re-
+       turned.  If there is at least one group with a slot in the ovector, but
+       no group is found to be set, PCRE2_ERROR_UNSET is returned.
+
+       Warning: If the pattern uses the (?| feature to set up multiple capture
+       groups  with  the same number, as described in the section on duplicate
+       group numbers in the pcre2pattern page, you cannot use names to distin-
+       guish  the  different capture groups, because names are not included in
+       the compiled code. The matching process uses  only  numbers.  For  this
+       reason,  the  use  of  different  names for groups with the same number
        causes an error at compile time.
 
 
@@ -3083,73 +3190,76 @@ CREATING A NEW STRING WITH SUBSTITUTIONS
          PCRE2_SIZE length, PCRE2_SIZE startoffset,
          uint32_t options, pcre2_match_data *match_data,
          pcre2_match_context *mcontext, PCRE2_SPTR replacement,
-         PCRE2_SIZE rlength, PCRE2_UCHAR *outputbufferP,
+         PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer,
          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. 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.
-       For global replacements, matches in which \K in a lookbehind causes the
-       match to start earlier than the point that was reached in the  previous
-       iteration are also not supported.
-
-       The  first  seven  arguments  of pcre2_substitute() are the same as for
+       This function calls pcre2_match() and then makes a copy of the  subject
+       string  in  outputbuffer, replacing one or more parts that were matched
+       with the replacement string, whose length is supplied in rlength.  This
+       can  be  given  as  PCRE2_ZERO_TERMINATED for a zero-terminated string.
+       The default is to perform just one replacement, but there is an  option
+       that  requests multiple replacements (see PCRE2_SUBSTITUTE_GLOBAL below
+       for details).
+
+       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. For global replacements, matches in which \K in a lookbe-
+       hind  causes the match to start earlier than the point that was reached
+       in the previous iteration are also not supported.
+
+       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
+       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.
 
-       If an external match_data block is provided,  its  contents  afterwards
-       are those set by the final call to pcre2_match(), which will have ended
-       in a matching error. The contents of the ovector within the match  data
-       block may or may not have been changed.
+       If  an  external  match_data block is provided, its contents afterwards
+       are those set by the final call to pcre2_match(). For  global  changes,
+       this  will  have ended in a matching error. The contents of the ovector
+       within the match data block may or may not have been changed.
 
-       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,
+       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 or (*MARK),
-       (*PRUNE), or (*THEN) items in the  pattern.  The  following  forms  are
-       always recognized:
+       If  the  function is not successful, the value set via outlengthptr de-
+       pends on the type of  error.  For  syntax  errors  in  the  replacement
+       string, the value is the offset in the replacement string where the er-
+       ror was detected. For other errors, the value  is  PCRE2_UNSET  by  de-
+       fault. This includes the case of the output buffer being too small, un-
+       less PCRE2_SUBSTITUTE_OVERFLOW_LENGTH is set (see below), in which case
+       the  value is the minimum length needed, including space for the trail-
+       ing zero. Note that in order to compute the required length, pcre2_sub-
+       stitute() has to simulate all the matching and copying, instead of giv-
+       ing 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 op-
+       tion is set, a dollar character is an escape character that can specify
+       the insertion of characters from capture groups or names  from  (*MARK)
+       or  other  control verbs in the pattern. The following forms are always
+       recognized:
 
          $$                  insert a dollar character
          $<n> or ${<n>}      insert the contents of group <n>
-         $*MARK or ${*MARK}  insert a (*MARK), (*PRUNE), or (*THEN) name
+         $*MARK or ${*MARK}  insert a control verb name
 
-       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-
+       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
+       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+=".
 
-       $*MARK inserts the name from the last encountered (*MARK), (*PRUNE), or
-       (*THEN)  on  the  matching  path  that  has a name. (*MARK) must always
-       include a name, but (*PRUNE) and (*THEN) need not. For example, in  the
-       case   of   (*MARK:A)(*PRUNE)   the  name  inserted  is  "A",  but  for
-       (*MARK:A)(*PRUNE:B) the relevant name is "B".   This  facility  can  be
-       used  to  perform  simple simultaneous substitutions, as this pcre2test
-       example shows:
+       $*MARK  inserts the name from the last encountered backtracking control
+       verb on the matching path that has a name. (*MARK) must always  include
+       a  name,  but  the  other  verbs  need not. For example, in the case of
+       (*MARK:A)(*PRUNE) the name inserted is "A", but for (*MARK:A)(*PRUNE:B)
+       the  relevant  name is "B". This facility can be used to perform simple
+       simultaneous substitutions, as this pcre2test example shows:
 
          /(*MARK:pear)apple|(*MARK:orange)lemon/g,replace=${*MARK}
              apple lemon
@@ -3188,8 +3298,8 @@ CREATING A NEW STRING WITH SUBSTITUTIONS
        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.
+       variable,  with  the  result  of  the  function  still  being PCRE2_ER-
+       ROR_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
@@ -3198,48 +3308,48 @@ CREATING A NEW STRING WITH SUBSTITUTIONS
        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.
+       PCRE2_SUBSTITUTE_UNKNOWN_UNSET causes references to capture 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 capture groups (including un-
+       known  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_UN-
+       SET 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
+       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
+       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,
+       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
+       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-
+       all inserted  characters, including those from capture 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.
+       ple, the result of processing "\Uaa\LBB\Ecc\E" is "AAbbcc";  the  final
+       \E  has  no  effect.  Note  also  that the PCRE2_ALT_BSUX and PCRE2_EX-
+       TRA_ALT_BSUX options do not apply to replacement strings.
 
        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:
+       flexibility  to  capture  group  substitution. The syntax is similar to
+       that used by Bash:
 
          ${<n>:-<string>}
          ${<n>:+<string1>:<string2>}
@@ -3265,11 +3375,11 @@ CREATING A NEW STRING WITH SUBSTITUTIONS
           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.
+       substitutions.  However,  PCRE2_SUBSTITUTE_UNKNOWN_UNSET does cause un-
+       known 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
+       If successful, pcre2_substitute()  returns  the  number  of  successful
+       matches.  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
@@ -3281,8 +3391,8 @@ CREATING A NEW STRING WITH SUBSTITUTIONS
 
        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.
+       when  the simple (non-extended) syntax is used and PCRE2_SUBSTITUTE_UN-
+       SET_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
@@ -3290,74 +3400,129 @@ CREATING A NEW STRING WITH SUBSTITUTIONS
        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-
-       MISSINGBRACE (closing curly bracket not found),  PCRE2_ERROR_BADSUBSTI-
-       TUTION   (syntax   error   in   extended   group   substitution),   and
-       PCRE2_ERROR_BADSUBSPATTERN (the pattern match ended before  it  started
-       or  the match started earlier than the current position in the subject,
-       which can happen if \K is used in an assertion).
+       the replacement string, with more  particular  errors  being  PCRE2_ER-
+       ROR_BADREPESCAPE (invalid escape sequence), PCRE2_ERROR_REPMISSINGBRACE
+       (closing curly bracket not found), PCRE2_ERROR_BADSUBSTITUTION  (syntax
+       error  in  extended group substitution), and PCRE2_ERROR_BADSUBSPATTERN
+       (the pattern match ended before it started or the match started earlier
+       than  the  current  position  in the subject, 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  the  pcre2_get_error_message()  function  (see
-       "Obtaining a textual error message" above).
+       obtained  by  calling  the pcre2_get_error_message() function (see "Ob-
+       taining a textual error message" above).
 
+   Substitution callouts
+
+       int pcre2_set_substitute_callout(pcre2_match_context *mcontext,
+         int (*callout_function)(pcre2_substitute_callout_block *, void *),
+         void *callout_data);
 
-DUPLICATE SUBPATTERN NAMES
+       The pcre2_set_substitution_callout() function can be used to specify  a
+       callout  function for pcre2_substitute(). This information is passed in
+       a match context. The callout function is called after each substitution
+       has been processed, but it can cause the replacement not to happen. The
+       callout function is not called for simulated substitutions that  happen
+       as a result of the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option.
+
+       The first argument of the callout function is a pointer to a substitute
+       callout block structure, which contains the following fields, not  nec-
+       essarily in this order:
+
+         uint32_t    version;
+         uint32_t    subscount;
+         PCRE2_SPTR  input;
+         PCRE2_SPTR  output;
+         PCRE2_SIZE *ovector;
+         uint32_t    oveccount;
+         PCRE2_SIZE  output_offsets[2];
+
+       The  version field contains the version number of the block format. The
+       current version is 0. The version number will  increase  in  future  if
+       more  fields are added, but the intention is never to remove any of the
+       existing fields.
+
+       The subscount field is the number of the current match. It is 1 for the
+       first callout, 2 for the second, and so on. The input and output point-
+       ers are copies of the values passed to pcre2_substitute().
+
+       The ovector field points to the ovector, which contains the  result  of
+       the most recent match. The oveccount field contains the number of pairs
+       that are set in the ovector, and is always greater than zero.
+
+       The output_offsets vector contains the offsets of  the  replacement  in
+       the  output  string. This has already been processed for dollar and (if
+       requested) backslash substitutions as described above.
+
+       The second argument of the callout function  is  the  value  passed  as
+       callout_data  when  the  function was registered. The value returned by
+       the callout function is interpreted as follows:
+
+       If the value is zero, the replacement is accepted, and,  if  PCRE2_SUB-
+       STITUTE_GLOBAL  is set, processing continues with a search for the next
+       match. If the value is not zero, the current  replacement  is  not  ac-
+       cepted.  If  the  value is greater than zero, processing continues when
+       PCRE2_SUBSTITUTE_GLOBAL is set. Otherwise (the value is less than  zero
+       or  PCRE2_SUBSTITUTE_GLOBAL  is  not set), the the rest of the input is
+       copied to the output and the call to pcre2_substitute() exits,  return-
+       ing the number of matches so far.
+
+
+DUPLICATE CAPTURE GROUP NAMES
 
        int pcre2_substring_nametable_scan(const pcre2_code *code,
          PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last);
 
-       When a pattern is compiled with the PCRE2_DUPNAMES  option,  names  for
-       subpatterns  are  not required to be unique. Duplicate names are always
-       allowed for subpatterns with the same number, created by using the  (?|
-       feature.  Indeed,  if  such subpatterns are named, they are required to
-       use the same names.
-
-       Normally, patterns with duplicate names are such that in any one match,
-       only  one of the named subpatterns participates. An example is shown in
-       the pcre2pattern documentation.
-
-       When  duplicates   are   present,   pcre2_substring_copy_byname()   and
-       pcre2_substring_get_byname()  return  the first substring corresponding
-       to  the  given  name  that  is  set.  Only   if   none   are   set   is
-       PCRE2_ERROR_UNSET  is  returned. The pcre2_substring_number_from_name()
-       function returns the error PCRE2_ERROR_NOUNIQUESUBSTRING when there are
-       duplicate names.
-
-       If  you want to get full details of all captured substrings for a given
-       name, you must use the pcre2_substring_nametable_scan()  function.  The
-       first  argument is the compiled pattern, and the second is the name. If
-       the third and fourth arguments are NULL, the function returns  a  group
+       When  a  pattern  is compiled with the PCRE2_DUPNAMES option, names for
+       capture groups are not required to be unique. Duplicate names  are  al-
+       ways  allowed for groups with the same number, created by using the (?|
+       feature. Indeed, if such groups are named, they are required to use the
+       same names.
+
+       Normally,  patterns  that  use duplicate names are such that in any one
+       match, only one of each set of identically-named  groups  participates.
+       An example is shown in the pcre2pattern documentation.
+
+       When   duplicates   are   present,   pcre2_substring_copy_byname()  and
+       pcre2_substring_get_byname() return the first  substring  corresponding
+       to  the given name that is set. Only if none are set is PCRE2_ERROR_UN-
+       SET is returned. The  pcre2_substring_number_from_name()  function  re-
+       turns  the error PCRE2_ERROR_NOUNIQUESUBSTRING when there are duplicate
+       names.
+
+       If you want to get full details of all captured substrings for a  given
+       name,  you  must use the pcre2_substring_nametable_scan() function. The
+       first argument is the compiled pattern, and the second is the name.  If
+       the  third  and fourth arguments are NULL, the function returns a group
        number for a unique name, or PCRE2_ERROR_NOUNIQUESUBSTRING otherwise.
 
        When the third and fourth arguments are not NULL, they must be pointers
-       to variables that are updated by the function. After it has  run,  they
+       to  variables  that are updated by the function. After it has run, they
        point to the 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
+       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.
 
        The format of the name table is described above in the section entitled
-       Information  about  a  pattern.  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.
 
 
 FINDING ALL POSSIBLE MATCHES AT ONE POSITION
 
-       The  traditional  matching  function  uses a similar algorithm to Perl,
-       which stops when it finds the first match at a given point in the  sub-
+       The traditional matching function uses a  similar  algorithm  to  Perl,
+       which  stops when it finds the first match at a given point in the sub-
        ject. If you want to find all possible matches, or the longest possible
-       match at a given position,  consider  using  the  alternative  matching
-       function  (see  below) instead. If you cannot use the alternative func-
+       match  at  a  given  position,  consider using the alternative matching
+       function (see below) instead. If you cannot use the  alternative  func-
        tion, you can kludge it up by making use of the callout facility, which
        is described in the pcre2callout documentation.
 
        What you have to do is to insert a callout right at the end of the pat-
-       tern.  When your callout function is called, extract and save the  cur-
-       rent  matched  substring.  Then return 1, which forces pcre2_match() to
-       backtrack and try other alternatives. Ultimately, when it runs  out  of
+       tern.   When your callout function is called, extract and save the cur-
+       rent matched substring. Then return 1, which  forces  pcre2_match()  to
+       backtrack  and  try other alternatives. Ultimately, when it runs out of
        matches, pcre2_match() will yield PCRE2_ERROR_NOMATCH.
 
 
@@ -3369,26 +3534,26 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
          pcre2_match_context *mcontext,
          int *workspace, PCRE2_SIZE wscount);
 
-       The  function  pcre2_dfa_match()  is  called  to match a subject string
-       against a compiled pattern, using a matching algorithm that  scans  the
+       The function pcre2_dfa_match() is called  to  match  a  subject  string
+       against  a  compiled pattern, using a matching algorithm that scans the
        subject string just once (not counting lookaround assertions), and does
-       not backtrack.  This has different characteristics to the normal  algo-
-       rithm,  and  is not compatible with Perl. Some of the features of PCRE2
-       patterns are not supported.  Nevertheless, there are  times  when  this
-       kind  of  matching  can be useful. For a discussion of the two matching
+       not  backtrack.  This has different characteristics to the normal algo-
+       rithm, and is not compatible with Perl. Some of the features  of  PCRE2
+       patterns  are  not  supported.  Nevertheless, there are times when this
+       kind of matching can be useful. For a discussion of  the  two  matching
        algorithms, and a list of features that pcre2_dfa_match() does not sup-
        port, see the pcre2matching documentation.
 
-       The  arguments  for  the pcre2_dfa_match() function are the same as for
+       The arguments for the pcre2_dfa_match() function are the  same  as  for
        pcre2_match(), plus two extras. The ovector within the match data block
        is used in a different way, and this is described below. The other com-
-       mon arguments are used in the same way as for pcre2_match(),  so  their
+       mon  arguments  are used in the same way as for pcre2_match(), so their
        description is not repeated here.
 
-       The  two  additional  arguments provide workspace for the function. The
-       workspace vector should contain at least 20 elements. It  is  used  for
+       The two additional arguments provide workspace for  the  function.  The
+       workspace  vector  should  contain at least 20 elements. It is used for
        keeping  track  of  multiple  paths  through  the  pattern  tree.  More
-       workspace is needed for patterns and subjects where there are a lot  of
+       workspace  is needed for patterns and subjects where there are a lot of
        potential matches.
 
        Here is an example of a simple call to pcre2_dfa_match():
@@ -3408,45 +3573,45 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
 
    Option bits for pcre_dfa_match()
 
-       The  unused  bits of the options argument for pcre2_dfa_match() must be
-       zero. The only bits that may be set  are  PCRE2_ANCHORED,  PCRE2_ENDAN-
-       CHORED,        PCRE2_NOTBOL,        PCRE2_NOTEOL,       PCRE2_NOTEMPTY,
-       PCRE2_NOTEMPTY_ATSTART,     PCRE2_NO_UTF_CHECK,     PCRE2_PARTIAL_HARD,
-       PCRE2_PARTIAL_SOFT,  PCRE2_DFA_SHORTEST, and PCRE2_DFA_RESTART. All but
-       the last four of these are exactly the same as  for  pcre2_match(),  so
-       their description is not repeated here.
+       The unused bits of the options argument for pcre2_dfa_match()  must  be
+       zero.   The   only   bits   that   may   be   set  are  PCRE2_ANCHORED,
+       PCRE2_COPY_MATCHED_SUBJECT, PCRE2_ENDANCHORED, PCRE2_NOTBOL,  PCRE2_NO-
+       TEOL,   PCRE2_NOTEMPTY,   PCRE2_NOTEMPTY_ATSTART,   PCRE2_NO_UTF_CHECK,
+       PCRE2_PARTIAL_HARD,   PCRE2_PARTIAL_SOFT,    PCRE2_DFA_SHORTEST,    and
+       PCRE2_DFA_RESTART.  All but the last four of these are exactly the same
+       as for pcre2_match(), so their description is not repeated here.
 
          PCRE2_PARTIAL_HARD
          PCRE2_PARTIAL_SOFT
 
-       These  have  the  same general effect as they do for pcre2_match(), but
-       the details are slightly different. When PCRE2_PARTIAL_HARD is set  for
-       pcre2_dfa_match(),  it  returns  PCRE2_ERROR_PARTIAL  if the end of the
+       These have the same general effect as they do  for  pcre2_match(),  but
+       the  details are slightly different. When PCRE2_PARTIAL_HARD is set for
+       pcre2_dfa_match(), it returns PCRE2_ERROR_PARTIAL if  the  end  of  the
        subject is reached and there is still at least one matching possibility
        that requires additional characters. This happens even if some complete
-       matches have already been found. When PCRE2_PARTIAL_SOFT  is  set,  the
-       return  code  PCRE2_ERROR_NOMATCH is converted into PCRE2_ERROR_PARTIAL
-       if the end of the subject is  reached,  there  have  been  no  complete
+       matches  have  already  been found. When PCRE2_PARTIAL_SOFT is set, the
+       return code PCRE2_ERROR_NOMATCH is converted  into  PCRE2_ERROR_PARTIAL
+       if  the  end  of  the  subject  is reached, there have been no complete
        matches, but there is still at least one matching possibility. The por-
-       tion of the string that was inspected when the  longest  partial  match
+       tion  of  the  string that was inspected when the longest partial match
        was found is set as the first matching string in both cases. There is a
-       more detailed discussion of partial and  multi-segment  matching,  with
+       more  detailed  discussion  of partial and multi-segment matching, with
        examples, in the pcre2partial documentation.
 
          PCRE2_DFA_SHORTEST
 
-       Setting  the PCRE2_DFA_SHORTEST option causes the matching algorithm to
+       Setting the PCRE2_DFA_SHORTEST option causes the matching algorithm  to
        stop as soon as it has found one match. Because of the way the alterna-
-       tive  algorithm  works, this is necessarily the shortest possible match
+       tive algorithm works, this is necessarily the shortest  possible  match
        at the first possible matching point in the subject string.
 
          PCRE2_DFA_RESTART
 
-       When pcre2_dfa_match() returns a partial match, it is possible to  call
+       When  pcre2_dfa_match() returns a partial match, it is possible to call
        it again, with additional subject characters, and have it continue with
        the same match. The PCRE2_DFA_RESTART option requests this action; when
-       it  is  set,  the workspace and wscount options must reference the same
-       vector as before because data about the match so far is  left  in  them
+       it is set, the workspace and wscount options must  reference  the  same
+       vector  as  before  because data about the match so far is left in them
        after a partial match. There is more discussion of this facility in the
        pcre2partial documentation.
 
@@ -3454,8 +3619,8 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
 
        When pcre2_dfa_match() succeeds, it may have matched more than one sub-
        string in the subject. Note, however, that all the matches from one run
-       of the function start at the same point in  the  subject.  The  shorter
-       matches  are all initial substrings of the longer matches. For example,
+       of  the  function  start  at the same point in the subject. The shorter
+       matches are all initial substrings of the longer matches. For  example,
        if the pattern
 
          <.*>
@@ -3470,61 +3635,68 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
          <something> <something else>
          <something>
 
-       On success, the yield of the function is a number  greater  than  zero,
-       which  is  the  number  of  matched substrings. The offsets of the sub-
-       strings are returned in the ovector, and can be extracted by number  in
-       the  same way as for pcre2_match(), but the numbers bear no relation to
-       any capturing groups that may exist in the pattern, because DFA  match-
-       ing does not support group capture.
+       On  success,  the  yield of the function is a number greater than zero,
+       which is the number of matched substrings.  The  offsets  of  the  sub-
+       strings  are returned in the ovector, and can be extracted by number in
+       the same way as for pcre2_match(), but the numbers bear no relation  to
+       any  capture groups that may exist in the pattern, because DFA matching
+       does not support capturing.
 
-       Calls  to  the  convenience  functions  that extract substrings by name
-       return the error PCRE2_ERROR_DFA_UFUNC (unsupported function)  if  used
-       after a DFA match. The convenience functions that extract substrings by
+       Calls to the convenience functions that extract substrings by name  re-
+       turn the error PCRE2_ERROR_DFA_UFUNC (unsupported function) if used af-
+       ter a DFA match. The convenience functions that extract  substrings  by
        number never return PCRE2_ERROR_NOSUBSTRING.
 
-       The matched strings are stored in  the  ovector  in  reverse  order  of
-       length;  that  is,  the longest matching string is first. If there were
-       too many matches to fit into the ovector, the yield of the function  is
+       The  matched  strings  are  stored  in  the ovector in reverse order of
+       length; that is, the longest matching string is first.  If  there  were
+       too  many matches to fit into the ovector, the yield of the function is
        zero, and the vector is filled with the longest matches.
 
-       NOTE:  PCRE2's  "auto-possessification" optimization usually applies to
-       character repeats at the end of a pattern (as well as internally).  For
-       example,  the pattern "a\d+" is compiled as if it were "a\d++". For DFA
-       matching, this means that only one possible  match  is  found.  If  you
-       really  do  want multiple matches in such cases, either use an ungreedy
-       repeat such as "a\d+?" or set  the  PCRE2_NO_AUTO_POSSESS  option  when
-       compiling.
+       NOTE: PCRE2's "auto-possessification" optimization usually  applies  to
+       character  repeats at the end of a pattern (as well as internally). For
+       example, the pattern "a\d+" is compiled as if it were "a\d++". For  DFA
+       matching,  this means that only one possible match is found. If you re-
+       ally do want multiple matches in such cases, either use an ungreedy re-
+       peat  such as "a\d+?" or set the PCRE2_NO_AUTO_POSSESS option when com-
+       piling.
 
    Error returns from pcre2_dfa_match()
 
        The pcre2_dfa_match() function returns a negative number when it fails.
-       Many of the errors are the same  as  for  pcre2_match(),  as  described
+       Many  of  the  errors  are  the same as for pcre2_match(), as described
        above.  There are in addition the following errors that are specific to
        pcre2_dfa_match():
 
          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 in a UTF
+       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 in a  UTF
        mode or a backreference.
 
          PCRE2_ERROR_DFA_UCOND
 
-       This return is given if pcre2_dfa_match() encounters a  condition  item
+       This  return  is given if pcre2_dfa_match() encounters a condition item
        that uses a backreference for the condition, or a test for recursion in
-       a specific group. These are not supported.
+       a specific capture group. These are not supported.
+
+         PCRE2_ERROR_DFA_UINVALID_UTF
+
+       This  return is given if pcre2_dfa_match() is called for a pattern that
+       was compiled with PCRE2_MATCH_INVALID_UTF. This is  not  supported  for
+       DFA matching.
 
          PCRE2_ERROR_DFA_WSSIZE
 
-       This return is given if pcre2_dfa_match() runs  out  of  space  in  the
+       This  return  is  given  if  pcre2_dfa_match() runs out of space in the
        workspace vector.
 
          PCRE2_ERROR_DFA_RECURSE
 
-       When  a  recursive subpattern is processed, the matching function calls
-       itself recursively, using private memory for the ovector and workspace.
-       This  error  is given if the internal ovector is not large enough. This
-       should be extremely rare, as a vector of size 1000 is used.
+       When a recursion or subroutine call is processed, the matching function
+       calls  itself  recursively,  using  private  memory for the ovector and
+       workspace.  This error is given if the internal ovector  is  not  large
+       enough.  This  should  be  extremely  rare, as a vector of size 1000 is
+       used.
 
          PCRE2_ERROR_DFA_BADRESTART
 
@@ -3549,8 +3721,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 07 September 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 02 September 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -3566,9 +3738,9 @@ BUILDING PCRE2
        PCRE2  is distributed with a configure script that can be used to build
        the library in Unix-like environments using the applications  known  as
        Autotools. Also in the distribution are files to support building using
-       CMake instead of configure.  The  text  file  README  contains  general
-       information  about  building  with Autotools (some of which is repeated
-       below), and also has some comments about building on various  operating
+       CMake instead of configure. The text file README contains  general  in-
+       formation  about building with Autotools (some of which is repeated be-
+       low), and also has some comments about building  on  various  operating
        systems.  There  is a lot more information about building PCRE2 without
        using Autotools (including information about using CMake  and  building
        "by  hand")  in  the  text file called NON-AUTOTOOLS-BUILD.  You should
@@ -3591,8 +3763,8 @@ PCRE2 BUILD-TIME OPTIONS
        compiler, as described in NON-AUTOTOOLS-BUILD.
 
        The complete list of options for configure (which includes the standard
-       ones such as the  selection  of  the  installation  directory)  can  be
-       obtained by running
+       ones such as the selection of the installation directory)  can  be  ob-
+       tained by running
 
          ./configure --help
 
@@ -3649,8 +3821,8 @@ UNICODE AND UTF SUPPORT
          --disable-unicode
 
        to the configure command. This setting applies to all three  libraries.
-       It  is  not  possible  to  build  one library with Unicode support, and
-       another without, in the same configuration.
+       It  is  not possible to build one library with Unicode support, and an-
+       other without, in the same configuration.
 
        Of itself, Unicode support does not make PCRE2 treat strings as  UTF-8,
        UTF-16 or UTF-32. To do that, applications that use the library can set
@@ -3676,8 +3848,8 @@ 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.  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
+       application  can lock it out by setting the PCRE2_NEVER_BACKSLASH_C op-
+       tion when calling pcre2_compile(). There is also a build-time option
 
          --enable-never-backslash-C
 
@@ -3723,8 +3895,8 @@ NEWLINE RECOGNITION
 
          --enable-newline-is-cr
 
-       to the configure  command.  There  is  also  an  --enable-newline-is-lf
-       option, which explicitly specifies linefeed as the newline character.
+       to the configure command. There is also an  --enable-newline-is-lf  op-
+       tion, which explicitly specifies linefeed as the newline character.
 
        Alternatively, you can specify that line endings are to be indicated by
        the two-character sequence CRLF (CR immediately followed by LF). If you
@@ -3836,8 +4008,8 @@ LIMITING PCRE2 RESOURCE USAGE
        used,  but because the size of each backtracking "frame" depends on the
        number of capturing parentheses in a pattern, the amount of  heap  that
        is  used  before  the  limit is reached varies from pattern to pattern.
-       This limit was more useful in versions  before  10.30,  where  function
-       recursion was used for backtracking.
+       This limit was more useful in versions before 10.30, where function re-
+       cursion was used for backtracking.
 
        As well as applying to pcre2_match(), the depth limit also controls the
        depth of recursive function calls in pcre2_dfa_match(). These are  used
@@ -3873,8 +4045,8 @@ USING EBCDIC CODE
          --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
-       environment (for example, an IBM mainframe operating system).
+       bles.  You should only use it if you know that you are in an EBCDIC en-
+       vironment (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-
@@ -3898,45 +4070,48 @@ USING EBCDIC CODE
 
 PCRE2GREP SUPPORT FOR EXTERNAL SCRIPTS
 
-       By default, on non-Windows systems, pcre2grep supports the use of call-
-       outs with string arguments within the patterns it is matching, in order
-       to  run external scripts. For details, see the pcre2grep documentation.
-       This support can be disabled by adding  --disable-pcre2grep-callout  to
-       the configure command.
+       By default pcre2grep supports the use of callouts with string arguments
+       within the patterns it is matching. There are two kinds: one that  gen-
+       erates output using local code, and another that calls an external pro-
+       gram or script.  If --disable-pcre2grep-callout-fork is  added  to  the
+       configure  command,  only  the  first  kind of callout is supported; if
+       --disable-pcre2grep-callout is used, all callouts  are  completely  ig-
+       nored.  For more details of pcre2grep callouts, see the pcre2grep docu-
+       mentation.
 
 
 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 default starting size of the buffer is 20KiB. The
-       buffer itself is three times this size, but because of the  way  it  is
+       buffer  itself  is  three times this size, but because of the way it is
        used for holding "before" lines, the longest line that is guaranteed to
        be processable is the notional buffer size. If a longer line is encoun-
-       tered,  pcre2grep  automatically  expands the buffer, up to a specified
-       maximum size, whose default is 1MiB or the starting size, whichever  is
-       the  larger. You can change the default parameter values by adding, for
+       tered, pcre2grep automatically expands the buffer, up  to  a  specified
+       maximum  size, whose default is 1MiB or the starting size, whichever is
+       the larger. You can change the default parameter values by adding,  for
        example,
 
          --with-pcre2grep-bufsize=51200
          --with-pcre2grep-max-bufsize=2097152
 
-       to the configure command. The caller of pcre2grep  can  override  these
-       values  by  using  --buffer-size  and  --max-buffer-size on the command
+       to  the  configure  command. The caller of pcre2grep can override these
+       values by using --buffer-size  and  --max-buffer-size  on  the  command
        line.
 
 
@@ -3947,26 +4122,26 @@ PCRE2TEST OPTION FOR LIBREADLINE SUPPORT
          --enable-pcre2test-libreadline
          --enable-pcre2test-libedit
 
-       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
+       to  the configure command, pcre2test is linked with the libreadline or-
+       libedit 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
        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"
@@ -3980,7 +4155,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.
 
 
@@ -3990,10 +4165,9 @@ 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
-       itself.
+       to the configure command, PCRE2 will use valgrind annotations  to  mark
+       certain  memory  regions as unaddressable. This allows it to detect in-
+       valid memory accesses, and is mostly useful for debugging PCRE2 itself.
 
 
 CODE COVERAGE REPORTING
@@ -4052,6 +4226,21 @@ CODE COVERAGE REPORTING
        mentation.
 
 
+DISABLING THE Z AND T FORMATTING MODIFIERS
+
+       The  C99  standard  defines formatting modifiers z and t for size_t and
+       ptrdiff_t values, respectively. By default, PCRE2 uses these  modifiers
+       in  environments  other  than  Microsoft Visual Studio when __STDC_VER-
+       SION__ is defined and has a value greater than or equal to 199901L (in-
+       dicating  C99).  However, there is at least one environment that claims
+       to be C99 but does not support these modifiers. If
+
+         --disable-percent-zt
+
+       is specified, no use is made of the z or t modifiers. Instead or %td or
+       %zu, %lu is used, with a cast for size_t values.
+
+
 SUPPORT FOR FUZZERS
 
        There  is  a  special  option for use by people who want to run fuzzing
@@ -4060,8 +4249,8 @@ SUPPORT FOR FUZZERS
          --enable-fuzz-support
 
        At present this applies only to the 8-bit library. If set, it causes an
-       extra  library  called  libpcre2-fuzzsupport.a  to  be  built,  but not
-       installed. This contains a single function called  LLVMFuzzerTestOneIn-
+       extra  library  called  libpcre2-fuzzsupport.a to be built, but not in-
+       stalled. This contains a single  function  called  LLVMFuzzerTestOneIn-
        put()  whose  arguments are a pointer to a string and the length of the
        string. When called, this function tries to compile  the  string  as  a
        pattern,  and if that succeeds, to match it.  This is done both with no
@@ -4104,8 +4293,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 26 April 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 03 March 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -4135,21 +4324,26 @@ DESCRIPTION
        its entry point in a match  context  (see  pcre2_set_callout()  in  the
        pcre2api documentation).
 
-       Within  a  regular expression, (?C<arg>) indicates a point at which the
-       external function is to be called.  Different  callout  points  can  be
-       identified  by  putting  a number less than 256 after the letter C. The
-       default value is zero.  Alternatively, the argument may be a  delimited
-       string.  The  starting delimiter must be one of ` ' " ^ % # $ { and the
+       When  using the pcre2_substitute() function, an additional callout fea-
+       ture is available. This does a callout after each change to the subject
+       string and is described in the pcre2api documentation; the rest of this
+       document is concerned with callouts during pattern matching.
+
+       Within a regular expression, (?C<arg>) indicates a point at  which  the
+       external  function  is  to  be  called. Different callout points can be
+       identified by putting a number less than 256 after the  letter  C.  The
+       default  value is zero.  Alternatively, the argument may be a delimited
+       string. 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, this pattern has  two  callout
+       ing delimiter is }. If  the  ending  delimiter  is  needed  within  the
+       string,  it  must be doubled. For example, this pattern has two callout
        points:
 
          (?C1)abc(?C"some ""arbitrary"" text")def
 
        If the PCRE2_AUTO_CALLOUT option bit is set when a pattern is compiled,
-       PCRE2 automatically inserts callouts, all with number 255, before  each
-       item  in the pattern except for immediately before or after an explicit
+       PCRE2  automatically inserts callouts, all with number 255, before each
+       item in the pattern except for immediately before or after an  explicit
        callout. For example, if PCRE2_AUTO_CALLOUT is used with the pattern
 
          A(?C3)B
@@ -4166,36 +4360,36 @@ DESCRIPTION
 
          (?C255)A(?C255)((?C255)\d{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255)
 
-       Notice that there is a callout before and after  each  parenthesis  and
+       Notice  that  there  is a callout before and after each parenthesis and
        alternation bar. If the pattern contains a conditional group whose con-
-       dition is an assertion, an automatic callout  is  inserted  immediately
-       before  the  condition. Such a callout may also be inserted explicitly,
+       dition  is  an  assertion, an automatic callout is inserted immediately
+       before the condition. Such a callout may also be  inserted  explicitly,
        for example:
 
          (?(?C9)(?=a)ab|de)  (?(?C%text%)(?!=d)ab|de)
 
-       This applies only to assertion conditions (because they are  themselves
+       This  applies only to assertion conditions (because they are themselves
        independent groups).
 
-       Callouts  can  be useful for tracking the progress of pattern matching.
+       Callouts can be useful for tracking the progress of  pattern  matching.
        The pcre2test program has a pattern qualifier (/auto_callout) that sets
-       automatic  callouts.   When  any  callouts are present, the output from
-       pcre2test indicates how the pattern is being matched.  This  is  useful
-       information  when  you are trying to optimize the performance of a par-
+       automatic callouts.  When any callouts are  present,  the  output  from
+       pcre2test  indicates  how  the pattern is being matched. This is useful
+       information when you are trying to optimize the performance of  a  par-
        ticular pattern.
 
 
 MISSING CALLOUTS
 
-       You should be aware that, because of optimizations  in  the  way  PCRE2
+       You  should  be  aware  that, because of optimizations in the way PCRE2
        compiles and matches patterns, callouts sometimes do not happen exactly
        as you might expect.
 
    Auto-possessification
 
        At compile time, PCRE2 "auto-possessifies" repeated items when it knows
-       that  what follows cannot be part of the repeat. For example, a+[bc] is
-       compiled as if it were a++[bc]. The pcre2test output when this  pattern
+       that what follows cannot be part of the repeat. For example, a+[bc]  is
+       compiled  as if it were a++[bc]. The pcre2test output when this pattern
        is compiled with PCRE2_ANCHORED and PCRE2_AUTO_CALLOUT and then applied
        to the string "aaaa" is:
 
@@ -4204,11 +4398,11 @@ MISSING CALLOUTS
           +2 ^   ^    [bc]
          No match
 
-       This indicates that when matching [bc] fails, there is no  backtracking
+       This  indicates that when matching [bc] fails, there is no backtracking
        into a+ (because it is being treated as a++) and therefore the callouts
-       that would be taken for the backtracks do not occur.  You  can  disable
-       the   auto-possessify   feature  by  passing  PCRE2_NO_AUTO_POSSESS  to
-       pcre2_compile(), or starting the pattern  with  (*NO_AUTO_POSSESS).  In
+       that  would  be  taken for the backtracks do not occur. You can disable
+       the  auto-possessify  feature  by  passing   PCRE2_NO_AUTO_POSSESS   to
+       pcre2_compile(),  or  starting  the pattern with (*NO_AUTO_POSSESS). In
        this case, the output changes to this:
 
          --->aaaa
@@ -4225,19 +4419,19 @@ MISSING CALLOUTS
    Automatic .* anchoring
 
        By default, an optimization is applied when .* is the first significant
-       item  in  a  pattern. If PCRE2_DOTALL is set, so that the dot can match
-       any character, the pattern is automatically anchored.  If  PCRE2_DOTALL
-       is  not set, a match can start only after an internal newline or at the
+       item in a pattern. If PCRE2_DOTALL is set, so that the  dot  can  match
+       any  character,  the pattern is automatically anchored. If PCRE2_DOTALL
+       is not set, a match can start only after an internal newline or at  the
        beginning of the subject, and pcre2_compile() remembers this. If a pat-
-       tern  has more than one top-level branch, automatic anchoring occurs if
+       tern has more than one top-level branch, automatic anchoring occurs  if
        all branches are anchorable.
 
-       This optimization is disabled, however, if .* is in an atomic group  or
-       if there is a backreference to the capturing group in which it appears.
-       It is also disabled if the pattern contains (*PRUNE) or  (*SKIP).  How-
+       This  optimization is disabled, however, if .* is in an atomic group or
+       if there is a backreference to the capture group in which  it  appears.
+       It  is  also disabled if the pattern contains (*PRUNE) or (*SKIP). How-
        ever, the presence of callouts does not affect it.
 
-       For  example,  if  the pattern .*\d is compiled with PCRE2_AUTO_CALLOUT
+       For example, if the pattern .*\d is  compiled  with  PCRE2_AUTO_CALLOUT
        and applied to the string "aa", the pcre2test output is:
 
          --->aa
@@ -4247,10 +4441,10 @@ MISSING CALLOUTS
           +2 ^      \d
          No match
 
-       This shows that all match attempts start at the beginning of  the  sub-
-       ject.  In  other  words,  the pattern is anchored. You can disable this
-       optimization by passing PCRE2_NO_DOTSTAR_ANCHOR to pcre2_compile(),  or
-       starting  the pattern with (*NO_DOTSTAR_ANCHOR). In this case, the out-
+       This  shows  that all match attempts start at the beginning of the sub-
+       ject. In other words, the pattern is anchored. You can disable this op-
+       timization  by  passing  PCRE2_NO_DOTSTAR_ANCHOR to pcre2_compile(), or
+       starting the pattern with (*NO_DOTSTAR_ANCHOR). In this case, the  out-
        put changes to:
 
          --->aa
@@ -4263,42 +4457,42 @@ MISSING CALLOUTS
           +2  ^     \d
          No match
 
-       This shows more match attempts, starting at the second subject  charac-
-       ter.   Another  optimization, described in the next section, means that
+       This  shows more match attempts, starting at the second subject charac-
+       ter.  Another optimization, described in the next section,  means  that
        there is no subsequent attempt to match with an empty subject.
 
    Other optimizations
 
-       Other optimizations that provide fast "no match"  results  also  affect
+       Other  optimizations  that  provide fast "no match" results also affect
        callouts.  For example, if the pattern is
 
          ab(?C4)cd
 
-       PCRE2  knows  that  any matching string must contain the letter "d". If
-       the subject string is "abyz", the  lack  of  "d"  means  that  matching
-       doesn't  ever  start,  and  the callout is never reached. However, with
+       PCRE2 knows that any matching string must contain the  letter  "d".  If
+       the  subject  string  is  "abyz",  the  lack of "d" means that matching
+       doesn't ever start, and the callout is  never  reached.  However,  with
        "abyd", though the result is still no match, the callout is obeyed.
 
-       For most patterns PCRE2 also knows the minimum  length  of  a  matching
-       string,  and will immediately give a "no match" return without actually
-       running a match if the subject is not long enough, or,  for  unanchored
+       For  most  patterns  PCRE2  also knows the minimum length of a matching
+       string, and will immediately give a "no match" return without  actually
+       running  a  match if the subject is not long enough, or, for unanchored
        patterns, if it has been scanned far enough.
 
        You can disable these optimizations by passing the PCRE2_NO_START_OPTI-
-       MIZE option  to  pcre2_compile(),  or  by  starting  the  pattern  with
-       (*NO_START_OPT).  This slows down the matching process, but does ensure
+       MIZE  option  to  pcre2_compile(),  or  by  starting  the  pattern with
+       (*NO_START_OPT). This slows down the matching process, but does  ensure
        that callouts such as the example above are obeyed.
 
 
 THE CALLOUT INTERFACE
 
-       During matching, when PCRE2 reaches a callout  point,  if  an  external
-       function  is  provided in the match context, it is called. This applies
-       to both normal, DFA, and JIT matching. The first argument to the  call-
+       During  matching,  when  PCRE2  reaches a callout point, if an external
+       function is provided in the match context, it is called.  This  applies
+       to  both normal, DFA, and JIT matching. The first argument to the call-
        out function is a pointer to a pcre2_callout block. The second argument
-       is the void * callout data that was supplied when the callout  was  set
+       is  the  void * callout data that was supplied when the callout was set
        up by calling pcre2_set_callout() (see the pcre2api documentation). The
-       callout block structure contains the following fields, not  necessarily
+       callout  block structure contains the following fields, not necessarily
        in this order:
 
          uint32_t      version;
@@ -4318,118 +4512,118 @@ THE CALLOUT INTERFACE
          PCRE2_SIZE    callout_string_length;
          PCRE2_SPTR    callout_string;
 
-       The  version field contains the version number of the block format. The
-       current version is 2; the three callout string fields  were  added  for
-       version  1, and the callout_flags field for version 2. If you are writ-
-       ing an application that might use an  earlier  release  of  PCRE2,  you
-       should  check  the version number before accessing any of these fields.
-       The version number will increase in future if more  fields  are  added,
+       The version field contains the version number of the block format.  The
+       current  version  is  2; the three callout string fields were added for
+       version 1, and the callout_flags field for version 2. If you are  writ-
+       ing  an  application  that  might  use an earlier release of PCRE2, you
+       should check the version number before accessing any of  these  fields.
+       The  version  number  will increase in future if more fields are added,
        but the intention is never to remove any of the existing fields.
 
    Fields for numerical callouts
 
-       For  a  numerical  callout,  callout_string is NULL, and callout_number
-       contains the number of the callout, in the range  0-255.  This  is  the
-       number  that  follows  (?C for callouts that part of the pattern; it is
+       For a numerical callout, callout_string  is  NULL,  and  callout_number
+       contains  the  number  of  the callout, in the range 0-255. This is the
+       number that follows (?C for callouts that part of the  pattern;  it  is
        255 for automatically generated callouts.
 
    Fields for string callouts
 
-       For callouts with string arguments, callout_number is always zero,  and
-       callout_string  points  to the string that is contained within the com-
+       For  callouts with string arguments, callout_number is always zero, and
+       callout_string points to the string that is contained within  the  com-
        piled pattern. Its length is given by callout_string_length. Duplicated
        ending delimiters that were present in the original pattern string have
        been turned into single characters, but there is no other processing of
-       the  callout string argument. An additional code unit containing binary
-       zero is present after the string, but is not included  in  the  length.
-       The  delimiter  that was used to start the string is also stored within
-       the pattern, immediately before the string itself. You can access  this
+       the callout string argument. An additional code unit containing  binary
+       zero  is  present  after the string, but is not included in the length.
+       The delimiter that was used to start the string is also  stored  within
+       the  pattern, immediately before the string itself. You can access this
        delimiter as callout_string[-1] if you need it.
 
        The callout_string_offset field is the code unit offset to the start of
        the callout argument string within the original pattern string. This is
-       provided  for the benefit of applications such as script languages that
+       provided for the benefit of applications such as script languages  that
        might need to report errors in the callout string within the pattern.
 
    Fields for all callouts
 
-       The remaining fields in the callout block are the same for  both  kinds
+       The  remaining  fields in the callout block are the same for both kinds
        of callout.
 
-       The  offset_vector  field is a pointer to a vector of capturing offsets
+       The offset_vector field is a pointer to a vector of  capturing  offsets
        (the "ovector"). You may read the elements in this vector, but you must
        not change any of them.
 
-       For  calls  to  pcre2_match(),  the  offset_vector  field is not (since
-       release 10.30) a pointer to the actual ovector that was passed  to  the
-       matching  function  in  the  match  data block. Instead it points to an
-       internal ovector of a size large enough to hold all  possible  captured
+       For calls to pcre2_match(), the offset_vector field is not  (since  re-
+       lease  10.30)  a  pointer  to the actual ovector that was passed to the
+       matching function in the match data block. Instead it points to an  in-
+       ternal  ovector  of  a  size large enough to hold all possible captured
        substrings in the pattern. Note that whenever a recursion or subroutine
-       call within a pattern completes, the capturing state is reset  to  what
+       call  within  a pattern completes, the capturing state is reset to what
        it was before.
 
-       The  capture_last  field  contains the number of the most recently cap-
-       tured substring, and the capture_top field contains one more  than  the
-       number  of  the  highest numbered captured substring so far. If no sub-
-       strings have yet been captured, the value of capture_last is 0 and  the
-       value  of  capture_top  is  1. The values of these fields do not always
-       differ  by  one;  for  example,  when  the  callout  in   the   pattern
+       The capture_last field contains the number of the  most  recently  cap-
+       tured  substring,  and the capture_top field contains one more than the
+       number of the highest numbered captured substring so far.  If  no  sub-
+       strings  have yet been captured, the value of capture_last is 0 and the
+       value of capture_top is 1. The values of these  fields  do  not  always
+       differ   by   one;  for  example,  when  the  callout  in  the  pattern
        ((a)(b))(?C2) is taken, capture_last is 1 but capture_top is 4.
 
-       The   contents  of  ovector[2]  to  ovector[<capture_top>*2-1]  can  be
-       inspected in order to extract substrings that have been matched so far,
-       in  the  same way as extracting substrings after a match has completed.
-       The values in ovector[0] and ovector[1] are always PCRE2_UNSET  because
-       the  match is by definition not complete. Substrings that have not been
-       captured but whose numbers are less than capture_top also have both  of
+       The contents of ovector[2] to  ovector[<capture_top>*2-1]  can  be  in-
+       spected  in  order to extract substrings that have been matched so far,
+       in the same way as extracting substrings after a match  has  completed.
+       The  values in ovector[0] and ovector[1] are always PCRE2_UNSET because
+       the match is by definition not complete. Substrings that have not  been
+       captured  but whose numbers are less than capture_top also have both of
        their ovector slots set to PCRE2_UNSET.
 
-       For  DFA  matching,  the offset_vector field points to the ovector that
-       was passed to the matching function in the match data block  for  call-
+       For DFA matching, the offset_vector field points to  the  ovector  that
+       was  passed  to the matching function in the match data block for call-
        outs at the top level, but to an internal ovector during the processing
-       of pattern recursions, lookarounds, and atomic groups.  However,  these
-       ovectors  hold no useful information because pcre2_dfa_match() does not
-       support substring capturing. The value of capture_top is always  1  and
+       of  pattern  recursions, lookarounds, and atomic groups. However, these
+       ovectors hold no useful information because pcre2_dfa_match() does  not
+       support  substring  capturing. The value of capture_top is always 1 and
        the value of capture_last is always 0 for DFA matching.
 
        The subject and subject_length fields contain copies of the values that
        were passed to the matching function.
 
-       The start_match field normally contains the offset within  the  subject
-       at  which  the  current  match  attempt started. However, if the escape
-       sequence \K has been encountered, this value is changed to reflect  the
-       modified  starting  point.  If the pattern is not anchored, the callout
+       The  start_match  field normally contains the offset within the subject
+       at which the current match attempt started. However, if the escape  se-
+       quence  \K  has  been encountered, this value is changed to reflect the
+       modified starting point. If the pattern is not  anchored,  the  callout
        function may be called several times from the same point in the pattern
        for different starting points in the subject.
 
-       The  current_position  field  contains the offset within the subject of
+       The current_position field contains the offset within  the  subject  of
        the current match pointer.
 
        The pattern_position field contains the offset in the pattern string to
        the next item to be matched.
 
-       The  next_item_length  field contains the length of the next item to be
-       processed in the pattern string. When the callout is at the end of  the
-       pattern,  the  length  is  zero.  When  the callout precedes an opening
+       The next_item_length field contains the length of the next item  to  be
+       processed  in the pattern string. When the callout is at the end of the
+       pattern, the length is zero.  When  the  callout  precedes  an  opening
        parenthesis, the length includes meta characters that follow the paren-
-       thesis.  For  example,  in a callout before an assertion such as (?=ab)
-       the length is 3. For an an alternation bar or  a  closing  parenthesis,
-       the  length is one, unless a closing parenthesis is followed by a quan-
+       thesis. For example, in a callout before an assertion  such  as  (?=ab)
+       the  length  is  3. For an an alternation bar or a closing parenthesis,
+       the length is one, unless a closing parenthesis is followed by a  quan-
        tifier, in which case its length is included.  (This changed in release
-       10.23.  In  earlier  releases, before an opening parenthesis the length
-       was that of the entire subpattern, and before an alternation bar  or  a
-       closing parenthesis the length was zero.)
+       10.23. In earlier releases, before an opening  parenthesis  the  length
+       was  that of the entire group, and before an alternation bar or a clos-
+       ing parenthesis the length was zero.)
 
-       The  pattern_position  and next_item_length fields are intended to help
-       in distinguishing between different automatic callouts, which all  have
-       the  same  callout  number. However, they are set for all callouts, and
+       The pattern_position and next_item_length fields are intended  to  help
+       in  distinguishing between different automatic callouts, which all have
+       the same callout number. However, they are set for  all  callouts,  and
        are used by pcre2test to show the next item to be matched when display-
        ing callout information.
 
        In callouts from pcre2_match() the mark field contains a pointer to the
-       zero-terminated name of the most recently passed (*MARK), (*PRUNE),  or
-       (*THEN)  item  in the match, or NULL if no such items have been passed.
-       Instances of (*PRUNE) or (*THEN) without a name  do  not  obliterate  a
+       zero-terminated  name of the most recently passed (*MARK), (*PRUNE), or
+       (*THEN) item in the match, or NULL if no such items have  been  passed.
+       Instances  of  (*PRUNE)  or  (*THEN) without a name do not obliterate a
        previous (*MARK). In callouts from the DFA matching function this field
        always contains NULL.
 
@@ -4439,25 +4633,25 @@ THE CALLOUT INTERFACE
 
          PCRE2_CALLOUT_STARTMATCH
 
-       This is set for the first callout after the start of matching for  each
+       This  is set for the first callout after the start of matching for each
        new starting position in the subject.
 
          PCRE2_CALLOUT_BACKTRACK
 
-       This  is  set if there has been a matching backtrack since the previous
-       callout, or since the start of matching if this is  the  first  callout
+       This is set if there has been a matching backtrack since  the  previous
+       callout,  or  since  the start of matching if this is the first callout
        from a pcre2_match() run.
 
-       Both  bits  are  set when a backtrack has caused a "bumpalong" to a new
-       starting position in the subject. Output from pcre2test does not  indi-
-       cate  the  presence  of these bits unless the callout_extra modifier is
+       Both bits are set when a backtrack has caused a "bumpalong"  to  a  new
+       starting  position in the subject. Output from pcre2test does not indi-
+       cate the presence of these bits unless the  callout_extra  modifier  is
        set.
 
        The information in the callout_flags field is provided so that applica-
-       tions  can track and tell their users how matching with backtracking is
-       done. This can be useful when trying to optimize patterns, or  just  to
-       understand  how  PCRE2  works. There is no support in pcre2_dfa_match()
-       because there is no backtracking in DFA matching, and there is no  sup-
+       tions can track and tell their users how matching with backtracking  is
+       done.  This  can be useful when trying to optimize patterns, or just to
+       understand how PCRE2 works. There is no  support  in  pcre2_dfa_match()
+       because  there is no backtracking in DFA matching, and there is no sup-
        port in JIT because JIT is all about maximimizing matching performance.
        In both these cases the callout_flags field is always zero.
 
@@ -4465,17 +4659,16 @@ THE CALLOUT INTERFACE
 RETURN VALUES FROM CALLOUTS
 
        The external callout function returns an integer to PCRE2. If the value
-       is  zero,  matching  proceeds  as  normal. If the value is greater than
-       zero, matching fails at the current point, but  the  testing  of  other
+       is zero, matching proceeds as normal. If  the  value  is  greater  than
+       zero,  matching  fails  at  the current point, but the testing of other
        matching possibilities goes ahead, just as if a lookahead assertion had
        failed. If the value is less than zero, the match is abandoned, and the
        matching function returns the negative value.
 
-       Negative   values   should   normally   be   chosen  from  the  set  of
-       PCRE2_ERROR_xxx values. In  particular,  PCRE2_ERROR_NOMATCH  forces  a
-       standard  "no  match"  failure. The error number PCRE2_ERROR_CALLOUT is
-       reserved for use by callout functions; it will never be used  by  PCRE2
-       itself.
+       Negative values should normally be chosen from  the  set  of  PCRE2_ER-
+       ROR_xxx  values.  In  particular, PCRE2_ERROR_NOMATCH forces a standard
+       "no match" failure. The error number  PCRE2_ERROR_CALLOUT  is  reserved
+       for use by callout functions; it will never be used by PCRE2 itself.
 
 
 CALLOUT ENUMERATION
@@ -4530,8 +4723,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 26 April 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 03 February 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -4545,25 +4738,25 @@ NAME
 DIFFERENCES BETWEEN PCRE2 AND PERL
 
        This document describes the differences in the ways that PCRE2 and Perl
-       handle regular expressions. The differences  described  here  are  with
-       respect  to Perl versions 5.26, but as both Perl and PCRE2 are continu-
-       ally changing, the information may sometimes be out of date.
+       handle regular expressions. The differences described here are with re-
+       spect to Perl versions 5.26, but as both Perl and PCRE2 are continually
+       changing, the information may sometimes be out of date.
 
        1. PCRE2 has only a subset of Perl's Unicode support. Details  of  what
        it does have are given in the pcre2unicode page.
 
        2.  Like  Perl, PCRE2 allows repeat quantifiers on parenthesized asser-
        tions, but they do not mean what you might think. For example, (?!a){3}
-       does  not  assert  that  the next three characters are not "a". It just
-       asserts that the next character is not "a" three times  (in  principle;
+       does not assert that the next three characters are not "a". It just as-
+       serts that the next character is not "a"  three  times  (in  principle;
        PCRE2  optimizes this to run the assertion just once). Perl allows some
        repeat quantifiers on other  assertions,  for  example,  \b*  (but  not
        \b{3}), but these do not seem to have any use.
 
-       3.  Capturing  subpatterns that occur inside negative lookaround asser-
-       tions are counted, but their entries in the offsets vector are set only
-       when  a  negative  assertion  is a condition that has a matching branch
-       (that is, the condition is false).
+       3.  Capture groups that occur inside negative lookaround assertions are
+       counted, but their entries in the offsets vector are set  only  when  a
+       negative  assertion is a condition that has a matching branch (that is,
+       the condition is false).
 
        4. The following Perl escape sequences are not supported: \F,  \l,  \L,
        \u, \U, and \N when followed by a character name. \N on its own, match-
@@ -4571,28 +4764,29 @@ DIFFERENCES BETWEEN PCRE2 AND PERL
        point,  are  supported.  The  escapes that modify the case of following
        letters are implemented by Perl's general string-handling and  are  not
        part of its pattern matching engine. If any of these are encountered by
-       PCRE2, an error is generated by default. However, if the PCRE2_ALT_BSUX
-       option is set, \U and \u are interpreted as ECMAScript interprets them.
+       PCRE2, an error is generated by default.  However,  if  either  of  the
+       PCRE2_ALT_BSUX  or  PCRE2_EXTRA_ALT_BSUX  options is set, \U and \u are
+       interpreted as ECMAScript interprets them.
 
        5. The Perl escape sequences \p, \P, and \X are supported only if PCRE2
        is built with Unicode support (the default). The properties that can be
-       tested  with  \p  and \P are limited to the general category properties
-       such as Lu and Nd, script names such as Greek or Han, and  the  derived
+       tested with \p and \P are limited to the  general  category  properties
+       such  as  Lu and Nd, script names such as Greek or Han, and the derived
        properties Any and L&.  PCRE2 does support the Cs (surrogate) property,
-       which Perl does not; the Perl documentation says  "Because  Perl  hides
+       which  Perl  does  not; the Perl documentation says "Because Perl hides
        the need for the user to understand the internal representation of Uni-
-       code characters, there is no need to implement the somewhat messy  con-
+       code  characters, there is no need to implement the somewhat messy con-
        cept of surrogates."
 
        6. PCRE2 supports the \Q...\E escape for quoting substrings. Characters
        in between are treated as literals. However, this is slightly different
-       from  Perl  in  that  $  and  @ are also handled as literals inside the
+       from Perl in that $ and @ are  also  handled  as  literals  inside  the
        quotes. In Perl, they cause variable interpolation (but of course PCRE2
-       does  not  have  variables).  Also, Perl does "double-quotish backslash
-       interpolation" on any backslashes between \Q and \E which, its documen-
-       tation  says, "may lead to confusing results". PCRE2 treats a backslash
-       between \Q and \E just like any other  character.  Note  the  following
-       examples:
+       does not have variables). Also, Perl does "double-quotish backslash in-
+       terpolation" on any backslashes between \Q and \E which, its documenta-
+       tion says, "may lead to confusing results". PCRE2  treats  a  backslash
+       between \Q and \E just like any other character. Note the following ex-
+       amples:
 
            Pattern            PCRE2 matches     Perl matches
 
@@ -4603,55 +4797,54 @@ DIFFERENCES BETWEEN PCRE2 AND PERL
            \QA\B\E            A\B               A\B
            \Q\\E              \                 \\E
 
-       The  \Q...\E  sequence  is recognized both inside and outside character
+       The \Q...\E sequence is recognized both inside  and  outside  character
        classes.
 
-       7.  Fairly  obviously,  PCRE2  does  not  support  the  (?{code})   and
+       7.   Fairly  obviously,  PCRE2  does  not  support  the  (?{code})  and
        (??{code}) constructions. However, PCRE2 does have a "callout" feature,
        which allows an external function to be called during pattern matching.
        See the pcre2callout documentation for details.
 
-       8.  Subroutine  calls (whether recursive or not) were treated as atomic
-       groups up to PCRE2 release 10.23, but from release 10.30 this  changed,
+       8. Subroutine calls (whether recursive or not) were treated  as  atomic
+       groups  up to PCRE2 release 10.23, but from release 10.30 this changed,
        and backtracking into subroutine calls is now supported, as in Perl.
 
-       9.  If  any  of the backtracking control verbs are used in a subpattern
-       that is called as a subroutine  (whether  or  not  recursively),  their
-       effect  is  confined to that subpattern; it does not extend to the sur-
-       rounding pattern. This is not always the case in Perl.  In  particular,
-       if  (*THEN)  is  present in a group that is called as a subroutine, its
-       action is limited to that group, even if the group does not contain any
-       |  characters.  Note that such subpatterns are processed as anchored at
-       the point where they are tested.
-
-       10. If a pattern contains more than one backtracking control verb,  the
-       first  one  that  is backtracked onto acts. For example, in the pattern
-       A(*COMMIT)B(*PRUNE)C a failure in B triggers (*COMMIT), but  a  failure
+       9. If any of the backtracking control verbs are used in a group that is
+       called  as  a  subroutine (whether or not recursively), their effect is
+       confined to that group; it does not extend to the surrounding  pattern.
+       This  is  not  always  the  case  in Perl. In particular, if (*THEN) is
+       present in a group that is called as a subroutine, its action  is  lim-
+       ited  to  that  group, even if the group does not contain any | charac-
+       ters. Note that such groups are processed  as  anchored  at  the  point
+       where they are tested.
+
+       10.  If a pattern contains more than one backtracking control verb, the
+       first one that is backtracked onto acts. For example,  in  the  pattern
+       A(*COMMIT)B(*PRUNE)C  a  failure in B triggers (*COMMIT), but a failure
        in C triggers (*PRUNE). Perl's behaviour is more complex; in many cases
        it is the same as PCRE2, but there are cases where it differs.
 
-       11. Most backtracking verbs in assertions have  their  normal  actions.
+       11.  Most  backtracking  verbs in assertions have their normal actions.
        They are not confined to the assertion.
 
-       12.  There are some differences that are concerned with the settings of
-       captured strings when part of  a  pattern  is  repeated.  For  example,
-       matching  "aba"  against  the  pattern  /^(a(b)?)+$/  in Perl leaves $2
-       unset, but in PCRE2 it is set to "b".
-
-       13. PCRE2's handling of duplicate subpattern numbers and duplicate sub-
-       pattern names is not as general as Perl's. This is a consequence of the
-       fact the PCRE2 works internally just with numbers,  using  an  external
-       table  to translate between numbers and names. In particular, a pattern
-       such as (?|(?<a>A)|(?<b>B), where the two  capturing  parentheses  have
-       the  same  number  but different names, is not supported, and causes an
-       error at compile time. If it were allowed, it would not be possible  to
-       distinguish  which  parentheses matched, because both names map to cap-
-       turing subpattern number 1. To avoid this confusing situation, an error
-       is given at compile time.
+       12. There are some differences that are concerned with the settings  of
+       captured  strings  when  part  of  a  pattern is repeated. For example,
+       matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves  $2  un-
+       set, but in PCRE2 it is set to "b".
+
+       13.  PCRE2's  handling  of duplicate capture group numbers and names is
+       not as general as Perl's. This is a consequence of the fact  the  PCRE2
+       works  internally  just with numbers, using an external table to trans-
+       late between numbers and  names.  In  particular,  a  pattern  such  as
+       (?|(?<a>A)|(?<b>B),  where  the two capture groups have the same number
+       but different names, is not supported, and causes an error  at  compile
+       time. If it were allowed, it would not be possible to distinguish which
+       group matched, because both names map to capture  group  number  1.  To
+       avoid this confusing situation, an error is given at compile time.
 
        14. Perl used to recognize comments in some places that PCRE2 does not,
-       for example, between the ( and ? at the start of a subpattern.  If  the
-       /x modifier is set, Perl allowed white space between ( and ? though the
+       for example, between the ( and ? at the start of a  group.  If  the  /x
+       modifier  is  set,  Perl allowed white space between ( and ? though the
        latest Perls give an error (for a while it was just deprecated).  There
        may still be some cases where Perl behaves differently.
 
@@ -4667,10 +4860,10 @@ DIFFERENCES BETWEEN PCRE2 AND PERL
        \p{Ll} match all letters, regardless of case, when case independence is
        specified.
 
-       17.  PCRE2  provides  some  extensions  to  the Perl regular expression
-       facilities.  Perl 5.10 includes new features that are  not  in  earlier
-       versions  of  Perl,  some  of which (such as named parentheses) were in
-       PCRE2 for some time before. This list is with respect to Perl 5.26:
+       17.  PCRE2  provides some extensions to the Perl regular expression fa-
+       cilities.  Perl 5.10 includes new features that are not in earlier ver-
+       sions  of Perl, some of which (such as named parentheses) were in PCRE2
+       for some time before. This list is with respect to Perl 5.26:
 
        (a) Although lookbehind assertions in PCRE2  must  match  fixed  length
        strings,  each alternative branch of a lookbehind assertion can match a
@@ -4713,9 +4906,13 @@ DIFFERENCES BETWEEN PCRE2 AND PERL
        at the start of a pattern that  set  overall  options  that  cannot  be
        changed within the pattern.
 
+       (m)  PCRE2  supports non-atomic positive lookaround assertions. This is
+       an extension to the lookaround facilities. The default, Perl-compatible
+       lookarounds are atomic.
+
        18.  The  Perl  /a modifier restricts /d numbers to pure ascii, and the
-       /aa modifier restricts /i  case-insensitive  matching  to  pure  ascii,
-       ignoring  Unicode  rules.  This  separation  cannot be represented with
+       /aa modifier restricts /i case-insensitive matching to pure ascii,  ig-
+       noring  Unicode  rules.  This  separation  cannot  be  represented with
        PCRE2_UCP.
 
        19. Perl has different limits than PCRE2. See the pcre2limit documenta-
@@ -4735,8 +4932,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 28 July 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 13 July 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -4808,8 +5005,8 @@ SIMPLE USE OF JIT
 
        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
+       mented because they may change at any time, in particular, when new op-
+       timizations 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-
@@ -4835,8 +5032,8 @@ SIMPLE USE OF JIT
        the entire compiled pattern is freed by calling pcre2_code_free().
 
        In  some circumstances you may need to call additional functions. These
-       are described in the  section  entitled  "Controlling  the  JIT  stack"
-       below.
+       are described in the section entitled "Controlling the JIT  stack"  be-
+       low.
 
        There are some pcre2_match() options that are not supported by JIT, and
        there are also some pattern items that JIT cannot handle.  Details  are
@@ -4851,39 +5048,65 @@ SIMPLE USE OF JIT
 
        If the JIT compiler finds an unsupported item, no JIT  data  is  gener-
        ated.  You  can find out if JIT matching is available after compiling a
-       pattern by calling  pcre2_pattern_info()  with  the  PCRE2_INFO_JITSIZE
-       option.  A non-zero result means that JIT compilation was successful. A
+       pattern by calling pcre2_pattern_info() with the PCRE2_INFO_JITSIZE op-
+       tion.  A  non-zero  result means that JIT compilation was successful. A
        result of 0 means that JIT support is not available, or the pattern was
        not  processed by pcre2_jit_compile(), or the JIT compiler was not able
        to handle the pattern.
 
 
+MATCHING SUBJECTS CONTAINING INVALID UTF
+
+       When a pattern is compiled with the PCRE2_UTF option,  subject  strings
+       are  normally expected to be a valid sequence of UTF code units. By de-
+       fault, this is checked at the start of matching and an error is  gener-
+       ated  if  invalid UTF is detected. The PCRE2_NO_UTF_CHECK option can be
+       passed to pcre2_match() to skip the check (for improved performance) if
+       you  are  sure  that  a subject string is valid. If this option is used
+       with an invalid string, the result is undefined.
+
+       However, a way of running matches on strings that may  contain  invalid
+       UTF   sequences   is   available.   Calling  pcre2_compile()  with  the
+       PCRE2_MATCH_INVALID_UTF option has two effects:  it  tells  the  inter-
+       preter  in pcre2_match() to support invalid UTF, and, if pcre2_jit_com-
+       pile() is called, the compiled JIT code also supports invalid UTF.  De-
+       tails  of  how this support works, in both the JIT and the interpretive
+       cases, is given in the pcre2unicode documentation.
+
+       There  is  also  an  obsolete  option  for  pcre2_jit_compile()  called
+       PCRE2_JIT_INVALID_UTF, which currently exists only for backward compat-
+       ibility.    It   is   superseded   by   the   pcre2_compile()    option
+       PCRE2_MATCH_INVALID_UTF and should no longer be used. It may be removed
+       in future.
+
+
 UNSUPPORTED OPTIONS AND PATTERN ITEMS
 
        The pcre2_match() options that  are  supported  for  JIT  matching  are
-       PCRE2_NOTBOL,   PCRE2_NOTEOL,  PCRE2_NOTEMPTY,  PCRE2_NOTEMPTY_ATSTART,
-       PCRE2_NO_UTF_CHECK,  PCRE2_PARTIAL_HARD,  and  PCRE2_PARTIAL_SOFT.  The
-       PCRE2_ANCHORED option is not supported at match time.
+       PCRE2_COPY_MATCHED_SUBJECT, PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY,
+       PCRE2_NOTEMPTY_ATSTART,  PCRE2_NO_UTF_CHECK,  PCRE2_PARTIAL_HARD,   and
+       PCRE2_PARTIAL_SOFT.  The  PCRE2_ANCHORED  and PCRE2_ENDANCHORED options
+       are not supported at match time.
 
-       If  the  PCRE2_NO_JIT option is passed to pcre2_match() it disables the
+       If the PCRE2_NO_JIT option is passed to pcre2_match() it  disables  the
        use of JIT, forcing matching by the interpreter code.
 
-       The only unsupported pattern items are \C (match a  single  data  unit)
-       when  running in a UTF mode, and a callout immediately before an asser-
+       The  only  unsupported  pattern items are \C (match a single data unit)
+       when running in a UTF mode, and a callout immediately before an  asser-
        tion condition in a conditional group.
 
 
 RETURN VALUES FROM JIT MATCHING
 
        When a pattern is matched using JIT matching, the return values are the
-       same  as  those  given by the interpretive pcre2_match() code, with the
-       addition of one new error code: PCRE2_ERROR_JIT_STACKLIMIT. This  means
-       that  the memory used for the JIT stack was insufficient. See "Control-
+       same as those given by the interpretive pcre2_match()  code,  with  the
+       addition  of one new error code: PCRE2_ERROR_JIT_STACKLIMIT. This means
+       that the memory used for the JIT stack was insufficient. See  "Control-
        ling the JIT stack" below for a discussion of JIT stack usage.
 
-       The error code PCRE2_ERROR_MATCHLIMIT is returned by the  JIT  code  if
-       searching  a  very large pattern tree goes on for too long, as it is in
-       the same circumstance when JIT is not used, but the details of  exactly
+       The  error  code  PCRE2_ERROR_MATCHLIMIT is returned by the JIT code if
+       searching a very large pattern tree goes on for too long, as it  is  in
+       the  same circumstance when JIT is not used, but the details of exactly
        what is counted are not the same. The PCRE2_ERROR_DEPTHLIMIT error code
        is never returned when JIT matching is used.
 
@@ -4891,25 +5114,25 @@ RETURN VALUES FROM JIT MATCHING
 CONTROLLING THE JIT STACK
 
        When the compiled JIT code runs, it needs a block of memory to use as a
-       stack.   By  default, it uses 32KiB on the machine stack. However, some
-       large  or  complicated  patterns  need  more  than  this.   The   error
-       PCRE2_ERROR_JIT_STACKLIMIT  is  given  when  there is not enough stack.
-       Three functions are provided for managing blocks of memory for  use  as
-       JIT  stacks. There is further discussion about the use of JIT stacks in
-       the section entitled "JIT stack FAQ" below.
-
-       The pcre2_jit_stack_create() function creates a JIT  stack.  Its  argu-
-       ments  are  a starting size, a maximum size, and a general context (for
-       memory allocation functions, or NULL for standard  memory  allocation).
+       stack.  By default, it uses 32KiB on the machine stack.  However,  some
+       large  or complicated patterns need more than this. The error PCRE2_ER-
+       ROR_JIT_STACKLIMIT is given when there is not enough stack. Three func-
+       tions are provided for managing blocks of memory for use as JIT stacks.
+       There is further discussion about the use of JIT stacks in the  section
+       entitled "JIT stack FAQ" below.
+
+       The  pcre2_jit_stack_create()  function  creates a JIT stack. Its argu-
+       ments are a starting size, a maximum size, and a general  context  (for
+       memory  allocation  functions, or NULL for standard memory allocation).
        It returns a pointer to an opaque structure of type pcre2_jit_stack, or
-       NULL if there is an error. The pcre2_jit_stack_free() function is  used
+       NULL  if there is an error. The pcre2_jit_stack_free() function is used
        to free a stack that is no longer needed. If its argument is NULL, this
-       function returns immediately, without doing anything. (For the  techni-
-       cally  minded: the address space is allocated by mmap or VirtualAlloc.)
-       A maximum stack size of 512KiB to 1MiB should be more than  enough  for
+       function  returns immediately, without doing anything. (For the techni-
+       cally minded: the address space is allocated by mmap or  VirtualAlloc.)
+       A  maximum  stack size of 512KiB to 1MiB should be more than enough for
        any pattern.
 
-       The  pcre2_jit_stack_assign()  function  specifies which stack JIT code
+       The pcre2_jit_stack_assign() function specifies which  stack  JIT  code
        should use. Its arguments are as follows:
 
          pcre2_match_context  *mcontext
@@ -4919,7 +5142,7 @@ CONTROLLING THE JIT STACK
        The first argument is a pointer to a match context. When this is subse-
        quently passed to a matching function, its information determines which
        JIT stack is used. If this argument is NULL, the function returns imme-
-       diately,  without  doing anything. There are three cases for the values
+       diately, without doing anything. There are three cases for  the  values
        of the other two options:
 
          (1) If callback is NULL and data is NULL, an internal 32KiB block
@@ -4937,34 +5160,34 @@ CONTROLLING THE JIT STACK
              return value must be a valid JIT stack, the result of calling
              pcre2_jit_stack_create().
 
-       A callback function is obeyed whenever JIT code is about to be run;  it
+       A  callback function is obeyed whenever JIT code is about to be run; it
        is not obeyed when pcre2_match() is called with options that are incom-
-       patible for JIT matching. A callback function can therefore be used  to
-       determine  whether  a  match  operation  was  executed by JIT or by the
-       interpreter.
+       patible  for JIT matching. A callback function can therefore be used to
+       determine whether a match operation was executed by JIT or by  the  in-
+       terpreter.
 
        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
+       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
+       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,
-       as  long  as  they are not used for matching by multiple threads at the
-       same time. For example, you could use the same stack  in  all  compiled
-       patterns,  with  a global mutex in the callback to wait until the stack
+       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, be-
+       cause 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,
+       as long as they are not used for matching by multiple  threads  at  the
+       same  time.  For  example, you could use the same stack in all compiled
+       patterns, with a global mutex in the callback to wait until  the  stack
        is available for use. However, this is an inefficient solution, and not
        recommended.
 
-       This  is a suggestion for how a multithreaded program that needs to set
+       This is a suggestion for how a multithreaded program that needs to  set
        up non-default JIT stacks might operate:
 
          During thread initalization
@@ -4976,7 +5199,7 @@ CONTROLLING THE JIT STACK
          Use a one-line callback function
            return thread_local_var
 
-       All the functions described in this section do nothing if  JIT  is  not
+       All  the  functions  described in this section do nothing if JIT is not
        available.
 
 
@@ -4985,20 +5208,20 @@ JIT STACK FAQ
        (1) Why do we need JIT stacks?
 
        PCRE2 (and JIT) is a recursive, depth-first engine, so it needs a stack
-       where the local data of the current node is pushed before checking  its
+       where  the local data of the current node is pushed before checking its
        child nodes.  Allocating real machine stack on some platforms is diffi-
        cult. For example, the stack chain needs to be updated every time if we
-       extend  the  stack  on  PowerPC.  Although it is possible, its updating
+       extend the stack on PowerPC.  Although it  is  possible,  its  updating
        time overhead decreases performance. So we do the recursion in memory.
 
        (2) Why don't we simply allocate blocks of memory with malloc()?
 
-       Modern operating systems have a  nice  feature:  they  can  reserve  an
-       address space instead of allocating memory. We can safely allocate mem-
-       ory pages inside this address space, so the stack  could  grow  without
-       moving memory data (this is important because of pointers). Thus we can
-       allocate 1MiB address space, and use only a single memory page (usually
-       4KiB)  if that is enough. However, we can still grow up to 1MiB anytime
+       Modern  operating  systems have a nice feature: they can reserve an ad-
+       dress space instead of allocating memory. We can safely allocate memory
+       pages inside this address space, so the stack could grow without moving
+       memory data (this is important because of pointers). Thus we can  allo-
+       cate  1MiB  address  space,  and use only a single memory page (usually
+       4KiB) if that is enough. However, we can still grow up to 1MiB  anytime
        if needed.
 
        (3) Who "owns" a JIT stack?
@@ -5006,8 +5229,8 @@ JIT STACK FAQ
        The owner of the stack is the user program, not the JIT studied pattern
        or anything else. The user program must ensure that if a stack is being
        used by pcre2_match(), (that is, it is assigned to a match context that
-       is  passed  to  the  pattern currently running), that stack must not be
-       used by any other threads (to avoid overwriting the same memory  area).
+       is passed to the pattern currently running), that  stack  must  not  be
+       used  by any other threads (to avoid overwriting the same memory area).
        The best practice for multithreaded programs is to allocate a stack for
        each thread, and return this stack through the JIT callback function.
 
@@ -5015,36 +5238,36 @@ JIT STACK FAQ
 
        You can free a JIT stack at any time, as long as it will not be used by
        pcre2_match() again. When you assign the stack to a match context, only
-       a pointer is set. There is no reference counting or  any  other  magic.
+       a  pointer  is  set. There is no reference counting or any other magic.
        You can free compiled patterns, contexts, and stacks in any order, any-
-       time. Just do not call pcre2_match() with a match context  pointing  to
+       time.  Just  do not call pcre2_match() with a match context pointing to
        an already freed stack, as that will cause SEGFAULT. (Also, do not free
-       a stack currently used by pcre2_match() in  another  thread).  You  can
-       also  replace the stack in a context at any time when it is not in use.
+       a  stack  currently  used  by pcre2_match() in another thread). You can
+       also replace the stack in a context at any time when it is not in  use.
        You should free the previous stack before assigning a replacement.
 
-       (5) Should I allocate/free a  stack  every  time  before/after  calling
+       (5)  Should  I  allocate/free  a  stack every time before/after calling
        pcre2_match()?
 
-       No,  because  this  is  too  costly in terms of resources. However, you
-       could implement some clever idea which release the stack if it  is  not
-       used  in  let's  say  two minutes. The JIT callback can help to achieve
+       No, because this is too costly in  terms  of  resources.  However,  you
+       could  implement  some clever idea which release the stack if it is not
+       used in let's say two minutes. The JIT callback  can  help  to  achieve
        this without keeping a list of patterns.
 
-       (6) OK, the stack is for long term memory allocation. But what  happens
-       if  a  pattern causes stack overflow with a stack of 1MiB? Is that 1MiB
+       (6)  OK, the stack is for long term memory allocation. But what happens
+       if a pattern causes stack overflow with a stack of 1MiB? Is  that  1MiB
        kept until the stack is freed?
 
-       Especially on embedded sytems, it might be a good idea to release  mem-
-       ory  sometimes  without  freeing the stack. There is no API for this at
-       the moment.  Probably a function call which returns with the  currently
-       allocated  memory for any stack and another which allows releasing mem-
+       Especially  on embedded sytems, it might be a good idea to release mem-
+       ory sometimes without freeing the stack. There is no API  for  this  at
+       the  moment.  Probably a function call which returns with the currently
+       allocated memory for any stack and another which allows releasing  mem-
        ory (shrinking the stack) would be a good idea if someone needs this.
 
        (7) This is too much of a headache. Isn't there any better solution for
        JIT stack handling?
 
-       No,  thanks to Windows. If POSIX threads were used everywhere, we could
+       No, thanks to Windows. If POSIX threads were used everywhere, we  could
        throw out this complicated API.
 
 
@@ -5053,18 +5276,18 @@ FREEING JIT SPECULATIVE MEMORY
        void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext);
 
        The JIT executable allocator does not free all memory when it is possi-
-       ble.   It expects new allocations, and keeps some free memory around to
-       improve allocation speed. However, in low memory conditions,  it  might
-       be  better to free all possible memory. You can cause this to happen by
-       calling pcre2_jit_free_unused_memory(). Its argument is a general  con-
+       ble.  It expects new allocations, and keeps some free memory around  to
+       improve  allocation  speed. However, in low memory conditions, it might
+       be better to free all possible memory. You can cause this to happen  by
+       calling  pcre2_jit_free_unused_memory(). Its argument is a general con-
        text, for custom memory management, or NULL for standard memory manage-
        ment.
 
 
 EXAMPLE CODE
 
-       This is a single-threaded example that specifies a  JIT  stack  without
-       using  a  callback.  A real program should include error checking after
+       This  is  a  single-threaded example that specifies a JIT stack without
+       using a callback. A real program should include  error  checking  after
        all the function calls.
 
          int rc;
@@ -5092,29 +5315,31 @@ EXAMPLE CODE
 JIT FAST PATH API
 
        Because the API described above falls back to interpreted matching when
-       JIT  is  not  available, it is convenient for programs that are written
+       JIT is not available, it is convenient for programs  that  are  written
        for  general  use  in  many  environments.  However,  calling  JIT  via
        pcre2_match() does have a performance impact. Programs that are written
-       for use where JIT is known to be available, and  which  need  the  best
-       possible  performance,  can  instead  use a "fast path" API to call JIT
-       matching directly instead of calling pcre2_match() (obviously only  for
+       for  use  where  JIT  is known to be available, and which need the best
+       possible performance, can instead use a "fast path"  API  to  call  JIT
+       matching  directly instead of calling pcre2_match() (obviously only for
        patterns that have been successfully processed by pcre2_jit_compile()).
 
-       The  fast  path  function  is  called  pcre2_jit_match(),  and it takes
-       exactly the same arguments as pcre2_match(). The return values are also
-       the same, plus PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or
-       complete) is requested that was not compiled. Unsupported  option  bits
-       (for  example,  PCRE2_ANCHORED)  are  ignored,  as  is the PCRE2_NO_JIT
-       option.
+       The fast path function is called pcre2_jit_match(), and  it  takes  ex-
+       actly  the same arguments as pcre2_match(). However, the subject string
+       must be specified with a  length;  PCRE2_ZERO_TERMINATED  is  not  sup-
+       ported. Unsupported option bits (for example, PCRE2_ANCHORED, PCRE2_EN-
+       DANCHORED  and  PCRE2_COPY_MATCHED_SUBJECT)  are  ignored,  as  is  the
+       PCRE2_NO_JIT  option.  The  return  values  are  also  the  same as for
+       pcre2_match(), plus PCRE2_ERROR_JIT_BADOPTION if a matching mode  (par-
+       tial or complete) is requested that was not compiled.
 
-       When you call pcre2_match(), as well as testing for invalid options,  a
+       When  you call pcre2_match(), as well as testing for invalid options, a
        number of other sanity checks are performed on the arguments. For exam-
        ple, if the subject pointer is NULL, an immediate error is given. Also,
-       unless  PCRE2_NO_UTF_CHECK  is  set, a UTF subject string is tested for
-       validity. In the interests of speed, these checks do not happen on  the
+       unless PCRE2_NO_UTF_CHECK is set, a UTF subject string  is  tested  for
+       validity.  In the interests of speed, these checks do not happen on the
        JIT fast path, and if invalid data is passed, the result is undefined.
 
-       Bypassing  the  sanity  checks  and the pcre2_match() wrapping can give
+       Bypassing the sanity checks and the  pcre2_match()  wrapping  can  give
        speedups of more than 10%.
 
 
@@ -5132,8 +5357,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 28 June 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 23 May 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -5151,46 +5376,45 @@ SIZE AND OTHER LIMITATIONS
 
        The maximum size of a compiled pattern  is  approximately  64  thousand
        code units for the 8-bit and 16-bit libraries if PCRE2 is compiled with
-       the  default  internal  linkage  size,  which  is  2  bytes  for  these
-       libraries.  If  you  want to process regular expressions that are truly
+       the default internal linkage size, which  is  2  bytes  for  these  li-
+       braries.  If  you  want  to  process regular expressions that are truly
        enormous, you can compile PCRE2 with an internal linkage size of 3 or 4
        (when  building  the  16-bit  library,  3  is rounded up to 4). See the
        README file in the source distribution and the pcre2build documentation
        for  details.  In  these cases the limit is substantially larger.  How-
-       ever, the speed of execution is slower.  In  the  32-bit  library,  the
-       internal linkage size is always 4.
+       ever, the speed of execution is slower. In the 32-bit library, the  in-
+       ternal 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
-       (that is ~(PCRE2_SIZE)0) is reserved as a special indicator  for  zero-
-       terminated strings and unset offsets.
+       the largest number a PCRE2_SIZE variable can hold. PCRE2_SIZE is an un-
+       signed integer type, usually defined as size_t. Its maximum value (that
+       is ~(PCRE2_SIZE)0) is reserved as a special indicator  for  zero-termi-
+       nated strings and unset offsets.
 
        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
-       kinds. This is imposed in order to limit the  amount  of  system  stack
-       used  at compile time. The default limit can be specified when PCRE2 is
-       built; if not, the default is set to 250.  An  application  can  change
-       this limit by calling pcre2_set_parens_nest_limit() to set the limit in
-       a compile context.
+       There  is no limit to the number of parenthesized groups, but there can
+       be no more than 65535 capture groups, and there is a limit to the depth
+       of  nesting  of parenthesized subpatterns of all kinds. This is imposed
+       in order to limit the amount of system stack used at compile time.  The
+       default limit can be specified when PCRE2 is built; if not, the default
+       is set to  250.  An  application  can  change  this  limit  by  calling
+       pcre2_set_parens_nest_limit() to set the limit in a compile context.
 
-       The maximum length of name for a named subpattern is 32 code units, and
-       the maximum number of named subpatterns is 10000.
+       The  maximum length of name for a named capture group is 32 code units,
+       and the maximum number of such groups is 10000.
 
-       The  maximum  length  of  a  name  in  a (*MARK), (*PRUNE), (*SKIP), or
-       (*THEN) verb is 255 code units for the 8-bit  library  and  65535  code
+       The maximum length of a  name  in  a  (*MARK),  (*PRUNE),  (*SKIP),  or
+       (*THEN)  verb  is  255  code units for the 8-bit library and 65535 code
        units for the 16-bit and 32-bit libraries.
 
-       The  maximum  length  of  a string argument to a callout is the largest
+       The maximum length of a string argument to a  callout  is  the  largest
        number a 32-bit unsigned integer can hold.
 
 
@@ -5203,8 +5427,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 30 March 2017
-       Copyright (c) 1997-2017 University of Cambridge.
+       Last updated: 02 February 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -5227,8 +5451,8 @@ PCRE2 MATCHING ALGORITHMS
 
        An alternative algorithm is provided by the pcre2_dfa_match() function;
        it operates in a different way, and is not Perl-compatible. This alter-
-       native  has  advantages  and  disadvantages  compared with the standard
-       algorithm, and these are described below.
+       native  has advantages and disadvantages compared with the standard al-
+       gorithm, and these are described below.
 
        When there is only one possible way in which a given subject string can
        match  a pattern, the two algorithms give the same answer. A difference
@@ -5296,8 +5520,8 @@ THE ALTERNATIVE MATCHING ALGORITHM
        Although the general principle of this matching algorithm  is  that  it
        scans  the subject string only once, without backtracking, there is one
        exception: when a lookaround assertion is encountered,  the  characters
-       following  or  preceding  the  current  point  have to be independently
-       inspected.
+       following  or  preceding the current point have to be independently in-
+       spected.
 
        The scan continues until either the end of the subject is  reached,  or
        there  are  no more unterminated paths. At this point, terminated paths
@@ -5328,12 +5552,12 @@ THE ALTERNATIVE MATCHING ALGORITHM
        SESS option when compiling.
 
        There are a number of features of PCRE2 regular  expressions  that  are
-       not  supported  by the alternative matching algorithm. They are as fol-
-       lows:
+       not  supported  or behave differently in the alternative matching func-
+       tion. Those that are not supported cause an error if encountered.
 
-       1. Because the algorithm finds all  possible  matches,  the  greedy  or
-       ungreedy  nature  of  repetition quantifiers is not relevant (though it
-       may affect auto-possessification, as just described). During  matching,
+       1. Because the algorithm finds all possible matches, the greedy or  un-
+       greedy  nature of repetition quantifiers is not relevant (though it may
+       affect auto-possessification,  as  just  described).  During  matching,
        greedy  and  ungreedy  quantifiers are treated in exactly the same way.
        However, possessive quantifiers can make a difference when what follows
        could  also  match  what  is  quantified, for example in a pattern like
@@ -5354,30 +5578,34 @@ THE ALTERNATIVE MATCHING ALGORITHM
        strings are available.
 
        3. Because no substrings are captured, backreferences within  the  pat-
-       tern are not supported, and cause errors if encountered.
+       tern are not supported.
 
        4.  For  the same reason, conditional expressions that use a backrefer-
        ence as the condition or test for a specific group  recursion  are  not
        supported.
 
-       5.  Because  many  paths  through the tree may be active, the \K escape
-       sequence, which resets the start of the match when encountered (but may
-       be  on  some  paths  and not on others), is not supported. It causes an
-       error if encountered.
+       5. Again for the same reason, script runs are not supported.
+
+       6. Because many paths through the tree may be active, the \K escape se-
+       quence, which resets the start of the match when encountered  (but  may
+       be on some paths and not on others), is not supported.
 
-       6. Callouts are supported, but the value of the  capture_top  field  is
+       7.  Callouts  are  supported, but the value of the capture_top field is
        always 1, and the value of the capture_last field is always 0.
 
-       7.  The  \C  escape  sequence, which (in the standard algorithm) always
-       matches a single code unit, even in a UTF mode,  is  not  supported  in
-       these  modes,  because the alternative algorithm moves through the sub-
-       ject string one character (not code unit) at a  time,  for  all  active
+       8. The \C escape sequence, which (in  the  standard  algorithm)  always
+       matches  a  single  code  unit, even in a UTF mode, is not supported in
+       these modes, because the alternative algorithm moves through  the  sub-
+       ject  string  one  character  (not code unit) at a time, for all active
        paths through the tree.
 
-       8.  Except for (*FAIL), the backtracking control verbs such as (*PRUNE)
-       are not supported. (*FAIL) is supported, and  behaves  like  a  failing
+       9. Except for (*FAIL), the backtracking control verbs such as  (*PRUNE)
+       are  not  supported.  (*FAIL)  is supported, and behaves like a failing
        negative assertion.
 
+       10. The PCRE2_MATCH_INVALID_UTF option for pcre2_compile() is not  sup-
+       ported by pcre2_dfa_match().
+
 
 ADVANTAGES OF THE ALTERNATIVE ALGORITHM
 
@@ -5407,7 +5635,8 @@ DISADVANTAGES OF THE ALTERNATIVE ALGORITHM
        partly  because  it has to search for all possible matches, but is also
        because it is less susceptible to optimization.
 
-       2. Capturing parentheses and backreferences are not supported.
+       2. Capturing parentheses, backreferences,  script  runs,  and  matching
+       within invalid UTF string are not supported.
 
        3. Although atomic groups are supported, their use does not provide the
        performance advantage that it does for the standard algorithm.
@@ -5422,8 +5651,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 29 September 2014
-       Copyright (c) 1997-2014 University of Cambridge.
+       Last updated: 23 May 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -5436,66 +5665,109 @@ NAME
 
 PARTIAL MATCHING IN PCRE2
 
-       In  normal  use  of  PCRE2,  if  the subject string that is passed to a
-       matching function matches as far as it goes, but is too short to  match
-       the  entire pattern, PCRE2_ERROR_NOMATCH is returned. There are circum-
-       stances where it might be helpful to distinguish this case  from  other
-       cases in which there is no match.
-
-       Consider, for example, an application where a human is required to type
-       in data for a field with specific formatting requirements.  An  example
-       might be a date in the form ddmmmyy, defined by this pattern:
-
-         ^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$
-
-       If the application sees the user's keystrokes one by one, and can check
-       that what has been typed so far is potentially valid,  it  is  able  to
-       raise  an  error  as  soon  as  a  mistake  is made, by beeping and not
-       reflecting the character that has been typed, for example. This immedi-
-       ate  feedback is likely to be a better user interface than a check that
-       is delayed until the entire string has been entered.  Partial  matching
-       can  also be useful when the subject string is very long and is not all
-       available at once.
-
-       PCRE2 supports partial matching by means of the PCRE2_PARTIAL_SOFT  and
-       PCRE2_PARTIAL_HARD  options,  which  can be set when calling a matching
-       function.  The difference between the two options is whether or  not  a
-       partial match is preferred to an alternative complete match, though the
-       details differ between the two types  of  matching  function.  If  both
-       options are set, PCRE2_PARTIAL_HARD takes precedence.
-
-       If  you  want to use partial matching with just-in-time optimized code,
-       you must call pcre2_jit_compile() with one or both of these options:
+       In  normal use of PCRE2, if there is a match up to the end of a subject
+       string, but more characters are needed to  match  the  entire  pattern,
+       PCRE2_ERROR_NOMATCH  is  returned,  just  like any other failing match.
+       There are circumstances where it might be helpful to  distinguish  this
+       "partial match" case.
+
+       One  example  is  an application where the subject string is very long,
+       and not all available at once. The requirement here is to be able to do
+       the  matching  segment  by segment, but special action is needed when a
+       matched substring spans the boundary between two segments.
+
+       Another example is checking a user input string as it is typed, to  en-
+       sure  that  it conforms to a required format. Invalid characters can be
+       immediately diagnosed and rejected, giving instant feedback.
+
+       Partial matching is a PCRE2-specific feature; it is  not  Perl-compati-
+       ble.  It  is  requested  by  setting  one  of the PCRE2_PARTIAL_HARD or
+       PCRE2_PARTIAL_SOFT options when calling a matching function.  The  dif-
+       ference  between  the  two options is whether or not a partial match is
+       preferred to an alternative complete match, though the  details  differ
+       between  the  two  types of matching function. If both options are set,
+       PCRE2_PARTIAL_HARD takes precedence.
+
+       If you want to use partial matching with just-in-time  optimized  code,
+       as  well  as  setting a partial match option for the matching function,
+       you must also call pcre2_jit_compile() with one or both  of  these  op-
+       tions:
 
-         PCRE2_JIT_PARTIAL_SOFT
          PCRE2_JIT_PARTIAL_HARD
+         PCRE2_JIT_PARTIAL_SOFT
+
+       PCRE2_JIT_COMPLETE  should also be set if you are going to run non-par-
+       tial matches on the same pattern. Separate code is  compiled  for  each
+       mode.  If  the appropriate JIT mode has not been compiled, interpretive
+       matching code is used.
+
+       Setting a partial matching option disables two of PCRE2's standard  op-
+       timization  hints. PCRE2 remembers the last literal code unit in a pat-
+       tern, and abandons matching immediately if it is  not  present  in  the
+       subject  string.  This optimization cannot be used for a subject string
+       that might match only partially. PCRE2 also remembers a minimum  length
+       of  a matching string, and does not bother to run the matching function
+       on shorter strings. This optimization  is  also  disabled  for  partial
+       matching.
+
+
+REQUIREMENTS FOR A PARTIAL MATCH
+
+       A  possible  partial  match  occurs during matching when the end of the
+       subject string is reached successfully, but either more characters  are
+       needed  to complete the match, or the addition of more characters might
+       change what is matched.
+
+       Example 1: if the pattern is /abc/ and the subject is "ab", more  char-
+       acters  are  definitely  needed  to complete a match. In this case both
+       hard and soft matching options yield a partial match.
+
+       Example 2: if the pattern is /ab+/ and the subject is "ab", a  complete
+       match  can  be  found, but the addition of more characters might change
+       what is matched. In this case, only PCRE2_PARTIAL_HARD returns  a  par-
+       tial match; PCRE2_PARTIAL_SOFT returns the complete match.
+
+       On  reaching the end of the subject, when PCRE2_PARTIAL_HARD is set, if
+       the next pattern item is \z, \Z, \b, \B, or $ there is always a partial
+       match.   Otherwise, for both options, the next pattern item must be one
+       that inspects a character, and at least one of the  following  must  be
+       true:
+
+       (1)  At  least  one  character has already been inspected. An inspected
+       character need not form part of the final  matched  string;  lookbehind
+       assertions  and the \K escape sequence provide ways of inspecting char-
+       acters before the start of a matched string.
 
-       PCRE2_JIT_COMPLETE should also be set if you are going to run  non-par-
-       tial  matches  on the same pattern. If the appropriate JIT mode has not
-       been compiled, interpretive matching code is used.
+       (2) The pattern contains one or more lookbehind assertions. This condi-
+       tion  exists in case there is a lookbehind that inspects characters be-
+       fore the start of the match.
 
-       Setting a partial matching option  disables  two  of  PCRE2's  standard
-       optimizations. PCRE2 remembers the last literal code unit in a pattern,
-       and abandons matching immediately if it is not present in  the  subject
-       string.  This  optimization  cannot  be  used for a subject string that
-       might match only partially. PCRE2 also knows the minimum  length  of  a
-       matching  string,  and  does not bother to run the matching function on
-       shorter strings. This optimization is also disabled for partial  match-
-       ing.
+       (3) There is a special case when the whole pattern can match  an  empty
+       string.   When  the  starting  point  is at the end of the subject, the
+       empty string match is a possibility, and if PCRE2_PARTIAL_SOFT  is  set
+       and  neither  of the above conditions is true, it is returned. However,
+       because adding more characters  might  result  in  a  non-empty  match,
+       PCRE2_PARTIAL_HARD  returns  a  partial match, which in this case means
+       "there is going to be a match at this point, but until some more  char-
+       acters are added, we do not know if it will be an empty string or some-
+       thing longer".
 
 
 PARTIAL MATCHING USING pcre2_match()
 
-       A  partial  match occurs during a call to pcre2_match() when the end of
-       the subject string is reached successfully, but  matching  cannot  con-
-       tinue because more characters are needed. However, at least one charac-
-       ter in the subject must have been inspected. This  character  need  not
-       form part of the final matched string; lookbehind assertions and the \K
-       escape sequence provide ways of inspecting characters before the  start
-       of  a matched string. The requirement for inspecting at least one char-
-       acter exists because an empty string can  always  be  matched;  without
-       such  a  restriction  there would always be a partial match of an empty
-       string at the end of the subject.
+       When  a  partial  matching  option  is  set,  the  result  of   calling
+       pcre2_match() can be one of the following:
+
+       A successful match
+         A complete match has been found, starting and ending within this sub-
+         ject.
+
+       PCRE2_ERROR_NOMATCH
+         No match can start anywhere in this subject.
+
+       PCRE2_ERROR_PARTIAL
+         Adding more characters may result in a complete match that  uses  one
+         or more characters from the end of this subject.
 
        When a partial match is returned, the first two elements in the ovector
        point to the portion of the subject that was matched, but the values in
@@ -5505,29 +5777,12 @@ PARTIAL MATCHING USING pcre2_match()
          /abc\K123/
 
        If it is matched against "456abc123xyz" the result is a complete match,
-       and the ovector defines the matched string as "123", because \K  resets
-       the  "start  of  match" point. However, if a partial match is requested
-       and the subject string is "456abc12", a partial match is found for  the
-       string  "abc12",  because  all these characters are needed for a subse-
+       and  the ovector defines the matched string as "123", because \K resets
+       the "start of match" point. However, if a partial  match  is  requested
+       and  the subject string is "456abc12", a partial match is found for the
+       string "abc12", because all these characters are needed  for  a  subse-
        quent re-match with additional characters.
 
-       What happens when a partial match is identified depends on which of the
-       two partial matching options are set.
-
-   PCRE2_PARTIAL_SOFT WITH pcre2_match()
-
-       If  PCRE2_PARTIAL_SOFT  is  set when pcre2_match() identifies a partial
-       match, the partial match is remembered, but matching continues as  nor-
-       mal,  and  other  alternatives in the pattern are tried. If no complete
-       match  can  be  found,  PCRE2_ERROR_PARTIAL  is  returned  instead   of
-       PCRE2_ERROR_NOMATCH.
-
-       This  option  is "soft" because it prefers a complete match over a par-
-       tial match.  All the various matching items in a pattern behave  as  if
-       the  subject string is potentially complete. For example, \z, \Z, and $
-       match at the end of the subject, as normal, and for \b and \B  the  end
-       of the subject is treated as a non-alphanumeric.
-
        If  there  is more than one partial match, the first one that was found
        provides the data that is returned. Consider this pattern:
 
@@ -5536,23 +5791,31 @@ PARTIAL MATCHING USING pcre2_match()
        If this is matched against the subject string "abc123dog", both  alter-
        natives  fail  to  match,  but the end of the subject is reached during
        matching, so PCRE2_ERROR_PARTIAL is returned. The offsets are set to  3
-       and  9, identifying "123dog" as the first partial match that was found.
-       (In this example, there are two partial matches, because "dog"  on  its
-       own partially matches the second alternative.)
-
-   PCRE2_PARTIAL_HARD WITH pcre2_match()
+       and  9, identifying "123dog" as the first partial match. (In this exam-
+       ple, there are two partial matches, because "dog" on its own  partially
+       matches the second alternative.)
 
-       If  PCRE2_PARTIAL_HARD is set for pcre2_match(), PCRE2_ERROR_PARTIAL is
-       returned as soon as a partial match is  found,  without  continuing  to
-       search  for possible complete matches. This option is "hard" because it
-       prefers an earlier partial match over a later complete match. For  this
-       reason,  the  assumption  is  made that the end of the supplied subject
-       string may not be the true end of the available data, and  so,  if  \z,
-       \Z,  \b, \B, or $ are encountered at the end of the subject, the result
-       is PCRE2_ERROR_PARTIAL, provided that at least  one  character  in  the
-       subject has been inspected.
+   How a partial match is processed by pcre2_match()
 
-   Comparing hard and soft partial matching
+       What happens when a partial match is identified depends on which of the
+       two partial matching options is set.
+
+       If PCRE2_PARTIAL_HARD is set, PCRE2_ERROR_PARTIAL is returned  as  soon
+       as  a partial match is found, without continuing to search for possible
+       complete matches. This option is "hard" because it prefers  an  earlier
+       partial match over a later complete match. For this reason, the assump-
+       tion is made that the end of the supplied subject  string  is  not  the
+       true  end of the available data, which is why \z, \Z, \b, \B, and $ al-
+       ways give a partial match.
+
+       If PCRE2_PARTIAL_SOFT is set, the  partial  match  is  remembered,  but
+       matching continues as normal, and other alternatives in the pattern are
+       tried. If no complete match can be found,  PCRE2_ERROR_PARTIAL  is  re-
+       turned instead of PCRE2_ERROR_NOMATCH. This option is "soft" because it
+       prefers a complete match over a partial match. All the various matching
+       items  in a pattern behave as if the subject string is potentially com-
+       plete; \z, \Z, and $ match at the end of the subject,  as  normal,  and
+       for \b and \B the end of the subject is treated as a non-alphanumeric.
 
        The  difference  between the two partial matching options can be illus-
        trated by a pattern such as:
@@ -5579,89 +5842,150 @@ PARTIAL MATCHING USING pcre2_match()
        The second pattern will never match "dogsbody", because it will  always
        find the shorter match first.
 
+   Example of partial matching using pcre2test
 
-PARTIAL MATCHING USING pcre2_dfa_match()
+       The  pcre2test data modifiers partial_hard (or ph) and partial_soft (or
+       ps) set PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT,  respectively,  when
+       calling  pcre2_match(). Here is a run of pcre2test using a pattern that
+       matches the whole subject in the form of a date:
 
-       The DFA functions move along the subject string character by character,
-       without backtracking, searching for  all  possible  matches  simultane-
-       ously.  If the end of the subject is reached before the end of the pat-
-       tern, there is the possibility of a partial match, again provided  that
-       at least one character has been inspected.
+           re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+         data> 25dec3\=ph
+         Partial match: 23dec3
+         data> 3ju\=ph
+         Partial match: 3ju
+         data> 3juj\=ph
+         No match
 
-       When PCRE2_PARTIAL_SOFT is set, PCRE2_ERROR_PARTIAL is returned only if
-       there have been no complete matches. Otherwise,  the  complete  matches
-       are  returned.   However, if PCRE2_PARTIAL_HARD is set, a partial match
-       takes precedence over any complete matches. The portion of  the  string
-       that was matched when the longest partial match was found is set as the
-       first matching string.
+       This example gives the same results for  both  hard  and  soft  partial
+       matching options. Here is an example where there is a difference:
 
-       Because the DFA functions always search for all possible  matches,  and
-       there  is  no  difference between greedy and ungreedy repetition, their
-       behaviour is different from  the  standard  functions  when  PCRE2_PAR-
-       TIAL_HARD  is  set.  Consider  the  string  "dog"  matched  against the
-       ungreedy pattern shown above:
+           re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+         data> 25jun04\=ps
+          0: 25jun04
+          1: jun
+         data> 25jun04\=ph
+         Partial match: 25jun04
 
-         /dog(sbody)??/
+       With   PCRE2_PARTIAL_SOFT,  the  subject  is  matched  completely.  For
+       PCRE2_PARTIAL_HARD, however, the subject is assumed not to be complete,
+       so there is only a partial match.
 
-       Whereas the standard function stops as soon as it  finds  the  complete
-       match  for  "dog",  the  DFA  function also finds the partial match for
-       "dogsbody", and so returns that when PCRE2_PARTIAL_HARD is set.
 
+MULTI-SEGMENT MATCHING WITH pcre2_match()
 
-PARTIAL MATCHING AND WORD BOUNDARIES
+       PCRE  was  not originally designed with multi-segment matching in mind.
+       However, over time, features (including  partial  matching)  that  make
+       multi-segment matching possible have been added. A very long string can
+       be searched segment by segment  by  calling  pcre2_match()  repeatedly,
+       with the aim of achieving the same results that would happen if the en-
+       tire string was available for searching all  the  time.  Normally,  the
+       strings  that  are  being  sought are much shorter than each individual
+       segment, and are in the middle of very long strings, so the pattern  is
+       normally not anchored.
+
+       Special  logic  must  be implemented to handle a matched substring that
+       spans a segment boundary. PCRE2_PARTIAL_HARD should be used, because it
+       returns  a  partial match at the end of a segment whenever there is the
+       possibility of changing  the  match  by  adding  more  characters.  The
+       PCRE2_NOTBOL option should also be set for all but the first segment.
+
+       When a partial match occurs, the next segment must be added to the cur-
+       rent subject and the match re-run, using the  startoffset  argument  of
+       pcre2_match()  to  begin  at the point where the partial match started.
+       For example:
 
-       If a pattern ends with one of sequences \b or \B, which test  for  word
-       boundaries,  partial matching with PCRE2_PARTIAL_SOFT can give counter-
-       intuitive results. Consider this pattern:
+           re> /\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d/
+         data> ...the date is 23ja\=ph
+         Partial match: 23ja
+         data> ...the date is 23jan19 and on that day...\=offset=15
+          0: 23jan19
+          1: jan
+
+       Note the use of the offset modifier to start the new  match  where  the
+       partial match was found. In this example, the next segment was added to
+       the one in which  the  partial  match  was  found.  This  is  the  most
+       straightforward approach, typically using a memory buffer that is twice
+       the size of each segment. After a partial match, the first half of  the
+       buffer  is discarded, the second half is moved to the start of the buf-
+       fer, and a new segment is added before repeating the match  as  in  the
+       example above. After a no match, the entire buffer can be discarded.
+
+       If there are memory constraints, you may want to discard text that pre-
+       cedes a partial match before adding the  next  segment.  Unfortunately,
+       this  is  not  at  present straightforward. In cases such as the above,
+       where the pattern does not contain any lookbehinds, it is sufficient to
+       retain  only  the  partially matched substring. However, if the pattern
+       contains a lookbehind assertion, characters that precede the  start  of
+       the  partial match may have been inspected during the matching process.
+       When pcre2test displays a partial match, it indicates these  characters
+       with '<' if the allusedtext modifier is set:
 
-         /\bcat\b/
+           re> "(?<=123)abc"
+         data> xx123ab\=ph,allusedtext
+         Partial match: 123ab
+                        <<<
 
-       This matches "cat", provided there is a word boundary at either end. If
-       the subject string is "the cat", the comparison of the final "t" with a
-       following character cannot take place, so a  partial  match  is  found.
-       However,  normal  matching carries on, and \b matches at the end of the
-       subject when the last character is a letter, so  a  complete  match  is
-       found.   The  result,  therefore,  is  not  PCRE2_ERROR_PARTIAL.  Using
-       PCRE2_PARTIAL_HARD in this case does yield PCRE2_ERROR_PARTIAL, because
-       then the partial match takes precedence.
+       However,  the  allusedtext  modifier is not available for JIT matching,
+       because JIT matching does not record  the  first  (or  last)  consulted
+       characters.  For this reason, this information is not available via the
+       API. It is therefore not possible in general to obtain the exact number
+       of characters that must be retained in order to get the right match re-
+       sult. If you cannot retain the  entire  segment,  you  must  find  some
+       heuristic way of choosing.
+
+       If  you know the approximate length of the matching substrings, you can
+       use that to decide how much text to retain. The only lookbehind  infor-
+       mation  that  is  currently  available via the API is the length of the
+       longest individual lookbehind in a pattern, but this can be  misleading
+       if  there  are  nested  lookbehinds.  The  value  returned  by  calling
+       pcre2_pattern_info() with the PCRE2_INFO_MAXLOOKBEHIND  option  is  the
+       maximum number of characters (not code units) that any individual look-
+       behind  moves  back  when  it  is  processed.   A   pattern   such   as
+       "(?<=(?<!b)a)"  has a maximum lookbehind value of one, but inspects two
+       characters before its starting point.
+
+       In a non-UTF or a 32-bit case, moving back is just a  subtraction,  but
+       in  UTF-8  or  UTF-16  you  have  to count characters while moving back
+       through the code units.
 
 
-EXAMPLE OF PARTIAL MATCHING USING PCRE2TEST
+PARTIAL MATCHING USING pcre2_dfa_match()
 
-       If  the  partial_soft  (or  ps) modifier is present on a pcre2test data
-       line, the PCRE2_PARTIAL_SOFT option is used for the match.  Here  is  a
-       run of pcre2test that uses the date example quoted above:
+       The DFA function moves along the subject string character by character,
+       without  backtracking,  searching  for  all possible matches simultane-
+       ously. If the end of the subject is reached before the end of the  pat-
+       tern, there is the possibility of a partial match.
 
-           re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
-         data> 25jun04\=ps
-          0: 25jun04
-          1: jun
-         data> 25dec3\=ps
-         Partial match: 23dec3
-         data> 3ju\=ps
-         Partial match: 3ju
-         data> 3juj\=ps
-         No match
-         data> j\=ps
-         No match
+       When PCRE2_PARTIAL_SOFT is set, PCRE2_ERROR_PARTIAL is returned only if
+       there have been no complete matches. Otherwise,  the  complete  matches
+       are  returned.   If  PCRE2_PARTIAL_HARD  is  set, a partial match takes
+       precedence over any complete matches. The portion of  the  string  that
+       was  matched  when  the  longest  partial match was found is set as the
+       first matching string.
 
-       The  first  data  string  is matched completely, so pcre2test shows the
-       matched substrings. The remaining four strings do not  match  the  com-
-       plete pattern, but the first two are partial matches. Similar output is
-       obtained if DFA matching is used.
+       Because the DFA function always searches for all possible matches,  and
+       there  is no difference between greedy and ungreedy repetition, its be-
+       haviour is different from the pcre2_match(). Consider the string  "dog"
+       matched against this ungreedy pattern:
 
-       If the partial_hard (or ph) modifier is present  on  a  pcre2test  data
-       line, the PCRE2_PARTIAL_HARD option is set for the match.
+         /dog(sbody)??/
+
+       Whereas  the  standard  function stops as soon as it finds the complete
+       match for "dog", the DFA function also  finds  the  partial  match  for
+       "dogsbody", and so returns that when PCRE2_PARTIAL_HARD is set.
 
 
 MULTI-SEGMENT MATCHING WITH pcre2_dfa_match()
 
-       When  a  partial match has been found using a DFA matching function, it
+       When a partial match has been found using the DFA matching function, it
        is possible to continue the match by providing additional subject  data
        and  calling  the function again with the same compiled regular expres-
        sion, this time setting the PCRE2_DFA_RESTART option. You must pass the
        same working space as before, because this is where details of the pre-
-       vious partial match are stored. Here is an example using pcre2test:
+       vious partial match are stored. You can set the  PCRE2_PARTIAL_SOFT  or
+       PCRE2_PARTIAL_HARD  options  with PCRE2_DFA_RESTART to continue partial
+       matching over multiple segments. Here is an example using pcre2test:
 
            re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
          data> 23ja\=dfa,ps
@@ -5674,152 +5998,10 @@ MULTI-SEGMENT MATCHING WITH pcre2_dfa_match()
        (restarted) match.  Notice that when the match is  complete,  only  the
        last  part  is  shown;  PCRE2 does not retain the previously partially-
        matched string. It is up to the calling program to do that if it  needs
-       to.
-
-       That means that, for an unanchored pattern, if a continued match fails,
-       it is not possible to try again at  a  new  starting  point.  All  this
-       facility  is  capable  of  doing  is continuing with the previous match
-       attempt. In the previous example, if the second set of data  is  "ug23"
-       the  result is no match, even though there would be a match for "aug23"
-       if the entire string were given at once. Depending on the  application,
-       this may or may not be what you want.  The only way to allow for start-
-       ing again at the next character is to retain the matched  part  of  the
-       subject and try a new complete match.
-
-       You  can  set the PCRE2_PARTIAL_SOFT or PCRE2_PARTIAL_HARD options with
-       PCRE2_DFA_RESTART to continue partial matching over multiple  segments.
-       This  facility can be used to pass very long subject strings to the DFA
-       matching functions.
-
-
-MULTI-SEGMENT MATCHING WITH pcre2_match()
-
-       Unlike the DFA function, it is not possible  to  restart  the  previous
-       match with a new segment of data when using pcre2_match(). Instead, new
-       data must be added to the previous subject string, and the entire match
-       re-run,  starting from the point where the partial match occurred. Ear-
-       lier data can be discarded.
-
-       It is best to use PCRE2_PARTIAL_HARD in this situation, because it does
-       not  treat the end of a segment as the end of the subject when matching
-       \z, \Z, \b, \B, and $. Consider  an  unanchored  pattern  that  matches
-       dates:
-
-           re> /\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d/
-         data> The date is 23ja\=ph
-         Partial match: 23ja
-
-       At  this stage, an application could discard the text preceding "23ja",
-       add on text from the next  segment,  and  call  the  matching  function
-       again.  Unlike  the  DFA  matching function, the entire matching string
-       must always be available, and the complete matching process occurs  for
-       each call, so more memory and more processing time is needed.
-
-
-ISSUES WITH MULTI-SEGMENT MATCHING
-
-       Certain types of pattern may give problems with multi-segment matching,
-       whichever matching function is used.
-
-       1. If the pattern contains a test for the beginning of a line, you need
-       to  pass  the  PCRE2_NOTBOL option when the subject string for any call
-       does start at the beginning of a line. There  is  also  a  PCRE2_NOTEOL
-       option, but in practice when doing multi-segment matching you should be
-       using PCRE2_PARTIAL_HARD, which includes the effect of PCRE2_NOTEOL.
-
-       2. If a pattern contains a lookbehind assertion, characters  that  pre-
-       cede  the start of the partial match may have been inspected during the
-       matching process.  When using pcre2_match(), sufficient characters must
-       be  retained  for  the  next  match attempt. You can ensure that enough
-       characters are retained by doing the following:
-
-       Before doing any matching, find the length of the longest lookbehind in
-       the     pattern    by    calling    pcre2_pattern_info()    with    the
-       PCRE2_INFO_MAXLOOKBEHIND option. Note that the resulting  count  is  in
-       characters, not code units. After a partial match, moving back from the
-       ovector[0] offset in the subject by the number of characters given  for
-       the  maximum lookbehind gets you to the earliest character that must be
-       retained. In a non-UTF or a 32-bit situation, moving  back  is  just  a
-       subtraction,  but in UTF-8 or UTF-16 you have to count characters while
-       moving back through the code units.
-
-       Characters before the point you have now reached can be discarded,  and
-       after  the  next segment has been added to what is retained, you should
-       run the next match with the startoffset argument set so that the  match
-       begins at the same point as before.
-
-       For  example, if the pattern "(?<=123)abc" is partially matched against
-       the string "xx123ab", the ovector offsets are 5 and 7 ("ab"). The maxi-
-       mum  lookbehind  count  is  3, so all characters before offset 2 can be
-       discarded. The value of startoffset for the next  match  should  be  3.
-       When  pcre2test  displays  a partial match, it indicates the lookbehind
-       characters with '<' characters:
-
-           re> "(?<=123)abc"
-         data> xx123ab\=ph
-         Partial match: 123ab
-                        <<<
-
-       3. Because a partial match must always contain at least one  character,
-       what  might  be  considered a partial match of an empty string actually
-       gives a "no match" result. For example:
-
-           re> /c(?<=abc)x/
-         data> ab\=ps
-         No match
-
-       If the next segment begins "cx", a match should be found, but this will
-       only  happen  if characters from the previous segment are retained. For
-       this reason, a "no match" result  should  be  interpreted  as  "partial
-       match of an empty string" when the pattern contains lookbehinds.
-
-       4.  Matching  a subject string that is split into multiple segments may
-       not always produce exactly the same result as matching over one  single
-       long  string,  especially  when PCRE2_PARTIAL_SOFT is used. The section
-       "Partial Matching and Word Boundaries" above describes  an  issue  that
-       arises  if  the  pattern ends with \b or \B. Another kind of difference
-       may occur when there are multiple matching possibilities, because  (for
-       PCRE2_PARTIAL_SOFT) a partial match result is given only when there are
-       no completed matches. This means that as soon as the shortest match has
-       been  found,  continuation to a new subject segment is no longer possi-
-       ble. Consider this pcre2test example:
-
-           re> /dog(sbody)?/
-         data> dogsb\=ps
-          0: dog
-         data> do\=ps,dfa
-         Partial match: do
-         data> gsb\=ps,dfa,dfa_restart
-          0: g
-         data> dogsbody\=dfa
-          0: dogsbody
-          1: dog
-
-       The first data line passes the string "dogsb" to  a  standard  matching
-       function, setting the PCRE2_PARTIAL_SOFT option. Although the string is
-       a partial match for "dogsbody", the result is not  PCRE2_ERROR_PARTIAL,
-       because  the  shorter string "dog" is a complete match. Similarly, when
-       the subject is presented to a DFA matching function  in  several  parts
-       ("do"  and  "gsb"  being  the first two) the match stops when "dog" has
-       been found, and it is not possible to continue.  On the other hand,  if
-       "dogsbody"  is  presented  as  a single string, a DFA matching function
-       finds both matches.
-
-       Because of these problems, it is best to  use  PCRE2_PARTIAL_HARD  when
-       matching  multi-segment  data.  The  example above then behaves differ-
-       ently:
-
-           re> /dog(sbody)?/
-         data> dogsb\=ph
-         Partial match: dogsb
-         data> do\=ps,dfa
-         Partial match: do
-         data> gsb\=ph,dfa,dfa_restart
-         Partial match: gsb
-
-       5. Patterns that contain alternatives at the top level which do not all
-       start  with  the  same  pattern  item  may  not  work  as expected when
-       PCRE2_DFA_RESTART is used. For example, consider this pattern:
+       to.  This  means  that, for an unanchored pattern, if a continued match
+       fails, it is not possible to try again at a  new  starting  point.  All
+       this facility is capable of doing is continuing with the previous match
+       attempt. For example, consider this pattern:
 
          1234|3789
 
@@ -5828,29 +6010,16 @@ ISSUES WITH MULTI-SEGMENT MATCHING
        the second alternative, because such a match does not start at the same
        point  in  the  subject  string. Attempting to continue with the string
        "7890" does not yield a match  because  only  those  alternatives  that
-       match  at  one  point in the subject are remembered. The problem arises
-       because the start of the second alternative matches  within  the  first
-       alternative.  There  is  no  problem with anchored patterns or patterns
-       such as:
-
-         1234|ABCD
-
-       where no string can be a partial match for both alternatives.  This  is
-       not  a  problem  if  a  standard matching function is used, because the
-       entire match has to be rerun each time:
-
-           re> /1234|3789/
-         data> ABC123\=ph
-         Partial match: 123
-         data> 1237890
-          0: 3789
+       match  at one point in the subject are remembered. Depending on the ap-
+       plication, this may or may not be what you want.
 
-       Of course, instead of using PCRE2_DFA_RESTART, the  same  technique  of
-       re-running  the  entire  match  can  also be used with the DFA matching
-       function. Another possibility is to work with two buffers. If a partial
-       match  at  offset  n in the first buffer is followed by "no match" when
-       PCRE2_DFA_RESTART is used on the second buffer, you can then try a  new
-       match starting at offset n+1 in the first buffer.
+       If you do want to allow for starting again at the next  character,  one
+       way  of  doing it is to retain some or all of the segment and try a new
+       complete match, as described for pcre2_match() above. Another possibil-
+       ity  is to work with two buffers. If a partial match at offset n in the
+       first buffer is followed by "no match" when PCRE2_DFA_RESTART  is  used
+       on  the  second buffer, you can then try a new match starting at offset
+       n+1 in the first buffer.
 
 
 AUTHOR
@@ -5862,8 +6031,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 22 December 2014
-       Copyright (c) 1997-2014 University of Cambridge.
+       Last updated: 04 September 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -5886,114 +6055,115 @@ PCRE2 REGULAR EXPRESSION DETAILS
 
        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.
+       of which have copious examples. Jeffrey Friedl's "Mastering Regular Ex-
+       pressions", 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.
+       This document discusses the regular expression patterns that  are  sup-
+       ported  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 advantages and disadvantages
+       of the alternative function, and how it differs from the  normal  func-
+       tion, 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
+       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
+       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 to-
+       gether 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.
+       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  one or both of the PCRE2_UTF or PCRE2_MATCH_INVALID_UTF
+       options, or the pattern must start with the  special  sequence  (*UTF),
+       which  is  equivalent  to setting the relevant PCRE2_UTF. 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.
 
        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.
+       restrict  them  to  non-UTF  data  for   security   reasons.   If   the
+       PCRE2_NEVER_UTF  option is passed to pcre2_compile(), (*UTF) is not al-
+       lowed, and its appearance in a pattern causes an error.
 
    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-
+       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.
 
        Some applications that allow their users to supply patterns may wish to
-       restrict them for security reasons. If the  PCRE2_NEVER_UCP  option  is
+       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.
 
    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
+       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.
+       tern. These options lock out the matching of empty strings, either  en-
+       tirely, or only at the start of the subject.
 
    Disabling auto-possessification
 
-       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
+       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.
 
    Disabling start-up optimizations
 
-       If a pattern starts with (*NO_START_OPT), it has  the  same  effect  as
+       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,
+       mizations  for  quickly  reaching "no match" results. For more details,
        see the pcre2api documentation.
 
    Disabling automatic anchoring
 
-       If  a  pattern starts with (*NO_DOTSTAR_ANCHOR), it has the same effect
-       as setting the PCRE2_NO_DOTSTAR_ANCHOR option. This disables  optimiza-
+       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
+       (match  any  number of arbitrary characters). For more details, see the
        pcre2api documentation.
 
    Disabling JIT compilation
 
-       If  a  pattern  that starts with (*NO_JIT) is successfully compiled, an
-       attempt by the application to apply the  JIT  optimization  by  calling
+       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.
 
    Setting match resource limits
 
        The pcre2_match() function contains a counter that is incremented every
        time it goes round its main loop. The caller of pcre2_match() can set a
-       limit  on  this counter, which therefore limits the amount of computing
+       limit on this counter, which therefore limits the amount  of  computing
        resource used for a match. The maximum depth of nested backtracking can
-       also  be  limited;  this indirectly restricts the amount of heap memory
-       that is used, but there is also an explicit memory limit  that  can  be
+       also be limited; this indirectly restricts the amount  of  heap  memory
+       that  is  used,  but there is also an explicit memory limit that can be
        set.
 
-       These  facilities  are  provided to catch runaway matches that are pro-
-       voked by patterns with huge matching trees (a typical example is a pat-
-       tern  with  nested unlimited repeats applied to a long string that does
-       not match). 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
+       These facilities are provided to catch runaway matches  that  are  pro-
+       voked  by patterns with huge matching trees. A common example is a pat-
+       tern with nested unlimited repeats applied to a long string  that  does
+       not  match. 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
 
          (*LIMIT_HEAP=d)
@@ -6001,35 +6171,35 @@ SPECIAL START-OF-PATTERN ITEMS
          (*LIMIT_DEPTH=d)
 
        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. The heap limit is specified in kibibytes (units of 1024
+       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. The heap limit is specified in kibibytes (units of  1024
        bytes).
 
-       Prior to release 10.30, LIMIT_DEPTH was  called  LIMIT_RECURSION.  This
+       Prior  to  release  10.30, LIMIT_DEPTH was called LIMIT_RECURSION. This
        name is still recognized for backwards compatibility.
 
        The heap limit applies only when the pcre2_match() or pcre2_dfa_match()
        interpreters are used for matching. It does not apply to JIT. The match
-       limit  is used (but in a different way) when JIT is being used, or when
+       limit is used (but in a different way) when JIT is being used, or  when
        pcre2_dfa_match() is called, to limit computing resource usage by those
-       matching  functions.  The depth limit is ignored by JIT but is relevant
-       for DFA matching, which uses function recursion for  recursions  within
-       the  pattern  and  for lookaround assertions and atomic groups. In this
+       matching functions. The depth limit is ignored by JIT but  is  relevant
+       for  DFA  matching, which uses function recursion for recursions within
+       the pattern and for lookaround assertions and atomic  groups.  In  this
        case, the depth limit controls the depth of such recursion.
 
    Newline conventions
 
-       PCRE2 supports six different conventions for indicating line breaks  in
-       strings:  a  single  CR (carriage return) character, a single LF (line-
+       PCRE2  supports six 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,  any  Unicode  newline  sequence,  or the NUL character (binary
-       zero). The pcre2api page has further  discussion  about  newlines,  and
+       ceding, any Unicode newline sequence,  or  the  NUL  character  (binary
+       zero).  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-
+       It is also possible to specify a newline convention by starting a  pat-
        tern string with one of the following sequences:
 
          (*CR)        carriage return
@@ -6040,8 +6210,8 @@ SPECIAL START-OF-PATTERN ITEMS
          (*NUL)       the NUL character (binary zero)
 
        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
+       tion. For example, on a Unix system where LF is the default newline se-
+       quence, the pattern
 
          (*CR)a.b
 
@@ -6049,39 +6219,39 @@ SPECIAL START-OF-PATTERN ITEMS
        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-
+       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  when  not
-       followed  by  an opening brace. 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
+       acter  when  PCRE2_DOTALL  is not set, and the behaviour of \N when not
+       followed by an opening brace. However, it does not affect what  the  \R
+       escape  sequence  matches.  By default, this is any Unicode newline se-
+       quence, for Perl compatibility. However, this can be changed;  see  the
        next section and the description of \R in the section entitled "Newline
-       sequences"  below. A change of \R setting can be combined with a change
+       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-
+       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 instead of ASCII or Unicode (typically a mainframe sys-
-       tem). In the sections below, character code values are  ASCII  or  Uni-
+       PCRE2  can be compiled to run in an environment that uses EBCDIC as its
+       character code instead of 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
+       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
@@ -6090,10 +6260,11 @@ CHARACTERS AND METACHARACTERS
        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.
+       The power of regular expressions comes from the ability to include wild
+       cards, character classes, 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
@@ -6106,14 +6277,11 @@ CHARACTERS AND METACHARACTERS
          .      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
+         (      start group or control verb
+         )      end group or control verb
          *      0 or more quantifier
-         +      1 or more quantifier
-                also "possessive quantifier"
+         +      1 or more quantifier; also "possessive quantifier"
+         ?      0 or 1 quantifier; also quantifier minimizer
          {      start min/max quantifier
 
        Part  of  a  pattern  that is in square brackets is called a "character
@@ -6122,8 +6290,7 @@ CHARACTERS AND METACHARACTERS
          \      general escape character
          ^      negate the class, but only if the first character
          -      indicates character range
-         [      POSIX character class (only if followed by POSIX
-                  syntax)
+         [      POSIX character class (if followed by POSIX syntax)
          ]      terminates the character class
 
        The following sections describe the use of each of the metacharacters.
@@ -6132,7 +6299,7 @@ CHARACTERS AND 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
+       a  character that is not a digit 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.
 
@@ -6143,7 +6310,7 @@ BACKSLASH
        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
+       In a UTF mode, only ASCII digits and letters have any  special  meaning
        after  a  backslash.  All  other characters (in particular, those whose
        code points are greater than 127) are treated as literals.
 
@@ -6153,14 +6320,14 @@ BACKSLASH
        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. Also, Perl does "double-quotish backslash interpolation"  on  any
-       backslashes  between \Q and \E which, its documentation says, "may lead
-       to confusing results". PCRE2 treats a backslash between \Q and \E  just
-       like any other character. Note the following examples:
+       If you want to treat all characters in a sequence as literals, you  can
+       do so by putting them between \Q and \E. This is different from Perl in
+       that $ and @ are handled as literals in  \Q...\E  sequences  in  PCRE2,
+       whereas  in Perl, $ and @ cause variable interpolation. Also, Perl does
+       "double-quotish backslash interpolation" on any backslashes between  \Q
+       and  \E which, its documentation says, "may lead to confusing results".
+       PCRE2 treats a backslash between \Q and \E just like any other  charac-
+       ter. Note the following examples:
 
          Pattern            PCRE2 matches   Perl matches
 
@@ -6185,15 +6352,16 @@ BACKSLASH
        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:
+       following  escape  sequences  instead of the binary character it repre-
+       sents. In an ASCII or Unicode environment, these escapes  are  as  fol-
+       lows:
 
          \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)
+         \r          carriage return (hex 0D) (but see below)
          \t          tab (hex 09)
          \0dd        character with octal code 0dd
          \ddd        character with octal code ddd, or backreference
@@ -6201,55 +6369,84 @@ BACKSLASH
          \xhh        character with hex code hh
          \x{hhh..}   character with hex code hhh..
          \N{U+hhh..} character with Unicode hex code point hhh..
-         \uhhhh      character with hex code hhhh (when PCRE2_ALT_BSUX is set)
 
-       The \N{U+hhh..} escape sequence is recognized only when  the  PCRE2_UTF
-       option is set, that is, when PCRE2 is operating in a Unicode mode. Perl
-       also uses \N{name} to specify characters by Unicode  name;  PCRE2  does
-       not  support  this.   Note  that  when \N is not followed by an opening
-       brace (curly bracket) it has an entirely  different  meaning,  matching
-       any character that is not a newline.
+       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.
 
-       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
+       Characters whose code points are less than 256 can be defined by either
+       of the two syntaxes for \x or by an octal sequence. There is no differ-
+       ence in the way they are handled. For example, \xdc is exactly the same
+       as \x{dc} or \334.  However, using the braced versions does  make  such
+       sequences easier to read.
+
+       Support  is  available  for some ECMAScript (aka JavaScript) escape se-
+       quences via two compile-time options. If PCRE2_ALT_BSUX is set, the se-
+       quence  \x  followed  by { is not recognized. Only if \x is followed by
+       two hexadecimal digits is it recognized as a character  escape.  Other-
+       wise  it  is interpreted as a literal "x" character. In this mode, sup-
+       port for code points greater than 256 is provided by \u, which must  be
+       followed  by  four hexadecimal digits; otherwise it is interpreted as a
+       literal "u" character.
+
+       PCRE2_EXTRA_ALT_BSUX has the same effect as PCRE2_ALT_BSUX and, in  ad-
+       dition, \u{hhh..} is recognized as the character specified by hexadeci-
+       mal code point.  There may be any number of  hexadecimal  digits.  This
+       syntax is from ECMAScript 6.
+
+       The  \N{U+hhh..} escape sequence is recognized only when PCRE2 is oper-
+       ating in UTF mode. Perl also uses \N{name}  to  specify  characters  by
+       Unicode  name;  PCRE2  does  not support this. Note that when \N is not
+       followed by an opening brace (curly bracket) it has an entirely differ-
+       ent meaning, matching any character that is not a newline.
+
+       There  are some legacy applications where the escape sequence \r is ex-
+       pected to match a newline. If the  PCRE2_EXTRA_ESCAPED_CR_IS_LF  option
+       is  set,  \r  in  a  pattern is converted to \n so that it matches a LF
+       (linefeed) instead of a CR (carriage return) character.
+
+       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
+       (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.
 
-       When PCRE2 is compiled in EBCDIC mode, \N{U+hhh..}  is  not  supported.
+       When  PCRE2  is  compiled in EBCDIC mode, \N{U+hhh..} is not supported.
        \a, \e, \f, \n, \r, and \t generate the appropriate EBCDIC code values.
        The \c escape is processed as specified for Perl in the perlebcdic doc-
-       ument.  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  \c@ encodes character code 0; after \c the
-       letters (in either case) encode characters 1-26 (hex 01 to hex 1A);  [,
-       \,  ],  ^,  and  _  encode characters 27-31 (hex 1B to hex 1F), and \c?
-       becomes either 255 (hex FF) or 95 (hex 5F).
-
-       Thus, apart from \c?, 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, \cG always generates code  value  7,
+       ument. 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 \c@ encodes character code  0;  after  \c  the
+       letters  (in either case) encode characters 1-26 (hex 01 to hex 1A); [,
+       \, ], ^, and _ encode characters 27-31 (hex 1B to hex 1F), and \c?  be-
+       comes either 255 (hex FF) or 95 (hex 5F).
+
+       Thus,  apart  from  \c?, 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, \cG always generates code value 7,
        which is BEL in ASCII but DEL in EBCDIC.
 
-       The  sequence  \c? 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
+       The sequence \c? 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 \c? 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
+       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 se-
+       quence \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
+       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 backreferences to be unambiguously specified.
 
        For greater clarity and unambiguity, it is best to avoid following \ by
@@ -6262,21 +6459,21 @@ BACKSLASH
 
        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
-       backreference.  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-
+       digit 8 or 9, or if there are  at  least  that  many  previous  capture
+       groups  in the expression, the entire sequence is taken as a backrefer-
+       ence. A description of how this works is  given  later,  following  the
+       discussion  of parenthesized groups.  Otherwise, up to three octal dig-
+       its 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
+       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
+                   previous capture groups
          \7     is always a backreference
          \11    might be a backreference, or another way of
                    writing a tab
@@ -6288,31 +6485,13 @@ BACKSLASH
                    the value 255 (decimal)
          \81    is always a backreference
 
-       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
+       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, support for
-       code points greater than 256 is provided by \u, which must be  followed
-       by  four hexadecimal digits; otherwise it matches a literal "u" charac-
-       ter.
-
-       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
+       Characters that are specified using octal or  hexadecimal  numbers  are
        limited to certain values, as follows:
 
          8-bit non-UTF mode    no greater than 0xff
@@ -6321,43 +6500,44 @@ BACKSLASH
          All UTF modes         no greater than 0x10ffff and a valid code point
 
        Invalid Unicode code points are all those in the range 0xd800 to 0xdfff
-       (the  so-called  "surrogate"  code  points). The check for these can be
-       disabled by  the  caller  of  pcre2_compile()  by  setting  the  option
-       PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES.  However, this is possible only in
-       UTF-8 and UTF-32 modes, because these values are not  representable  in
+       (the so-called "surrogate" code points). The check  for  these  can  be
+       disabled  by  the  caller  of  pcre2_compile()  by  setting  the option
+       PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES. However, this is possible only  in
+       UTF-8  and  UTF-32 modes, because these values are not representable in
        UTF-16.
 
    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
+       inside  and  outside character classes. In addition, inside a character
        class, \b is interpreted as the backspace character (hex 08).
 
        When not followed by an opening brace, \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.
+       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 \F, \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 above.
+       In  Perl,  the  sequences  \F, \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 in patterns.
+       However, if either of the PCRE2_ALT_BSUX  or  PCRE2_EXTRA_ALT_BSUX  op-
+       tions  is set, \U matches a "U" character, and \u can be used to define
+       a character by code point, as described above.
 
    Absolute and relative backreferences
 
-       The sequence \g followed by a signed  or  unsigned  number,  optionally
-       enclosed  in  braces, is an absolute or relative backreference. A named
+       The sequence \g followed by a signed or unsigned number, optionally en-
+       closed  in  braces,  is  an absolute or relative backreference. A named
        backreference can be coded as \g{name}.  Backreferences  are  discussed
-       later, following the discussion of parenthesized subpatterns.
+       later, following the discussion of parenthesized groups.
 
    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".
+       an  alternative syntax for referencing a capture group as a subroutine.
        Details are discussed later.   Note  that  \g{...}  (Perl  syntax)  and
        \g<...> (Oniguruma syntax) are not synonymous. The former is a backref-
        erence; the latter is a subroutine call.
@@ -6394,8 +6574,8 @@ BACKSLASH
        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.
+       (13), and space (32), which are defined as white space in the  "C"  lo-
+       cale.  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.
 
@@ -6473,8 +6653,8 @@ BACKSLASH
 
          (?>\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
+       This is an example of an "atomic group", details of which are given be-
+       low.  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
@@ -6501,36 +6681,38 @@ BACKSLASH
        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:
+       used. They can be combined with a change of newline convention; for ex-
+       ample, 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.
+       Inside a character class, \R is treated as an unrecognized  escape  se-
+       quence, 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 code points are less than 256,  but
-       they do work in this mode.  In 32-bit non-UTF mode, code points greater
-       than 0x10ffff (the Unicode limit) may be  encountered.  These  are  all
-       treated  as being in the Common script and with an unassigned type. The
-       extra escape sequences are:
+       are available. They can be used in any mode, though in 8-bit and 16-bit
+       non-UTF modes these sequences are of course limited to testing  charac-
+       ters  whose code points are less than U+0100 and U+10000, respectively.
+       In 32-bit non-UTF mode, code points greater than 0x10ffff (the  Unicode
+       limit)  may  be  encountered. These are all treated as being in the Un-
+       known script and with an unassigned type. 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.
+       The property names represented by xx above are case-sensitive. There is
+       support for Unicode script names, Unicode general category  properties,
+       "Any",  which  matches any character (including newline), and some spe-
+       cial PCRE2 properties (described in  the  next  section).   Other  Perl
+       properties such as "InMusicalSymbols" 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.
@@ -6539,42 +6721,45 @@ BACKSLASH
          \p{Greek}
          \P{Han}
 
-       Those  that are not part of an identified script are lumped together as
-       "Common". The current list of scripts is:
+       Unassigned characters (and in non-UTF 32-bit mode, characters with code
+       points greater than 0x10FFFF) are assigned the "Unknown" script. Others
+       that  are not part of an identified script are lumped together as "Com-
+       mon". The current list of scripts is:
 
        Adlam, Ahom, Anatolian_Hieroglyphs, Arabic,  Armenian,  Avestan,  Bali-
        nese,  Bamum,  Bassa_Vah,  Batak, Bengali, Bhaiksuki, Bopomofo, Brahmi,
        Braille, Buginese, Buhid, Canadian_Aboriginal, Carian,  Caucasian_Alba-
        nian,  Chakma,  Cham,  Cherokee,  Common,  Coptic,  Cuneiform, Cypriot,
        Cyrillic, Deseret, Devanagari, Dogra,  Duployan,  Egyptian_Hieroglyphs,
-       Elbasan,   Ethiopic,  Georgian,  Glagolitic,  Gothic,  Grantha,  Greek,
-       Gujarati,  Gunjala_Gondi,  Gurmukhi,  Han,   Hangul,   Hanifi_Rohingya,
-       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,  Makasar, Malayalam, Mandaic, Manichaean, Marchen, Masaram_Gondi,
-       Medefaidrin,     Meetei_Mayek,     Mende_Kikakui,     Meroitic_Cursive,
-       Meroitic_Hieroglyphs,  Miao,  Modi,  Mongolian,  Mro, Multani, Myanmar,
-       Nabataean, New_Tai_Lue, Newa, Nko, Nushu, Ogham, Ol_Chiki,  Old_Hungar-
-       ian,  Old_Italic,  Old_North_Arabian, Old_Permic, Old_Persian, Old_Sog-
-       dian,   Old_South_Arabian,   Old_Turkic,   Oriya,    Osage,    Osmanya,
-       Pahawh_Hmong,    Palmyrene,    Pau_Cin_Hau,    Phags_Pa,    Phoenician,
+       Elbasan,  Elymaic,  Ethiopic,  Georgian,  Glagolitic,  Gothic, Grantha,
+       Greek, Gujarati, Gunjala_Gondi, Gurmukhi, Han, Hangul, Hanifi_Rohingya,
+       Hanunoo,  Hatran,  Hebrew,  Hiragana,  Imperial_Aramaic, Inherited, In-
+       scriptional_Pahlavi, Inscriptional_Parthian, Javanese, Kaithi, Kannada,
+       Katakana,  Kayah_Li,  Kharoshthi, Khmer, Khojki, Khudawadi, Lao, Latin,
+       Lepcha, Limbu, Linear_A,  Linear_B,  Lisu,  Lycian,  Lydian,  Mahajani,
+       Makasar,  Malayalam, Mandaic, Manichaean, Marchen, Masaram_Gondi, Mede-
+       faidrin, Meetei_Mayek, Mende_Kikakui, Meroitic_Cursive, Meroitic_Hiero-
+       glyphs, Miao, Modi, Mongolian, Mro, Multani, Myanmar, Nabataean, Nandi-
+       nagari, New_Tai_Lue, Newa, Nko,  Nushu,  Nyakeng_Puachue_Hmong,  Ogham,
+       Ol_Chiki,  Old_Hungarian,  Old_Italic,  Old_North_Arabian,  Old_Permic,
+       Old_Persian, Old_Sogdian, Old_South_Arabian, Old_Turkic, Oriya,  Osage,
+       Osmanya,  Pahawh_Hmong,  Palmyrene,  Pau_Cin_Hau, Phags_Pa, Phoenician,
        Psalter_Pahlavi, Rejang, Runic, Samaritan,  Saurashtra,  Sharada,  Sha-
        vian,  Siddham,  SignWriting,  Sinhala, Sogdian, Sora_Sompeng, Soyombo,
        Sundanese, Syloti_Nagri, Syriac, Tagalog, Tagbanwa,  Tai_Le,  Tai_Tham,
        Tai_Viet,  Takri,  Tamil,  Tangut, Telugu, Thaana, Thai, Tibetan, Tifi-
-       nagh, Tirhuta, Ugaritic, Vai, Warang_Citi, Yi, Zanabazar_Square.
+       nagh, Tirhuta, Ugaritic, Unknown, Vai, Wancho,  Warang_Citi,  Yi,  Zan-
+       abazar_Square.
 
        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
+       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
+       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}
@@ -6626,86 +6811,88 @@ BACKSLASH
          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
+       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 Cs (Surrogate) property  applies  only  to  characters  whose  code
+       points  are in the range U+D800 to U+DFFF. These characters are no dif-
+       ferent to any other character when PCRE2 is not in UTF mode (using  the
+       16-bit  or  32-bit  library).   However,  they are not valid in Unicode
+       strings and so cannot be tested by PCRE2 in UTF mode, unless UTF valid-
+       ity   checking   has   been   turned   off   (see   the  discussion  of
+       PCRE2_NO_UTF_CHECK in the pcre2api page).
 
-       The  long  synonyms  for  property  names  that  Perl supports (such as
-       \p{Letter}) are not supported by PCRE2, nor is it permitted  to  prefix
+       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
+       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-
+       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
+       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
+       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
+       (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.  The rules are defined in Unicode Standard Annex 29, "Unicode
-       Text Segmentation". Unicode 11.0.0 abandoned the use of  some  previous
-       properties  that had been used for emojis.  Instead it introduced vari-
-       ous emoji-specific properties. PCRE2  uses  only  the  Extended  Picto-
+       clusters. The rules are defined in Unicode Standard Annex 29,  "Unicode
+       Text  Segmentation".  Unicode 11.0.0 abandoned the use of some previous
+       properties that had been used for emojis.  Instead it introduced  vari-
+       ous  emoji-specific  properties.  PCRE2  uses  only the Extended Picto-
        graphic property.
 
-       \X  always  matches  at least one character. Then it decides whether to
+       \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-
+       2. Do not end between CR and LF; otherwise end after any control  char-
        acter.
 
-       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
+       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  or  the
-       "zero-width  joiner"  character.  Characters  with  the "mark" property
-       always have the "extend" grapheme breaking property.
+       4.  Do  not  end  before  extending  characters or spacing marks or the
+       "zero-width joiner" character. Characters with the "mark" property  al-
+       ways have the "extend" grapheme breaking property.
 
        5. Do not end after prepend characters.
 
        6. Do not break within emoji modifier sequences or emoji zwj sequences.
        That is, do not break between characters with the Extended_Pictographic
-       property.  Extend and ZWJ characters are allowed  between  the  charac-
+       property.   Extend  and  ZWJ characters are allowed between the charac-
        ters.
 
-       7.  Do  not  break  within  emoji flag sequences. That is, do not break
-       between regional indicator (RI) characters if there are an  odd  number
-       of RI characters before the break point.
+       7. Do not break within emoji flag sequences. That is, do not break  be-
+       tween  regional indicator (RI) characters if there are an odd number of
+       RI characters before the break point.
 
        8. 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.
+       As well as the standard Unicode properties described above, PCRE2  sup-
+       ports four more that make it possible to convert traditional escape se-
+       quences 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
@@ -6713,70 +6900,70 @@ BACKSLASH
          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
+       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 ex-
+       clude 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.
+       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
 
-       In normal use, the escape sequence \K  causes  any  previously  matched
-       characters  not  to  be  included in the final matched sequence that is
-       returned. For example, the pattern:
+       In  normal  use,  the  escape sequence \K causes any previously matched
+       characters not to be included in the final matched sequence that is re-
+       turned. For example, the pattern:
 
          foo\Kbar
 
-       matches "foobar", but reports that it has matched "bar".  \K  does  not
+       matches  "foobar",  but  reports that it has matched "bar". \K does not
        interact with anchoring in any way. The pattern:
 
          ^foo\Kbar
 
-       matches  only  when  the  subject  begins with "foobar" (in single line
-       mode), though it again reports the matched string as "bar".  This  fea-
-       ture  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  exam-
+       matches only when the subject begins  with  "foobar"  (in  single  line
+       mode),  though  it again reports the matched string as "bar". This fea-
+       ture 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 exam-
        ple, 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. Using \K in a lookbehind asser-
-       tion at the start of a pattern can also lead to odd effects. For  exam-
-       ple, consider this pattern:
+       Perl documents that the use of \K within assertions is  "not  well  de-
+       fined".  In  PCRE2, \K is acted upon when it occurs inside positive as-
+       sertions, but is ignored in negative assertions. Note that when a  pat-
+       tern  such  as (?=ab\K) matches, the reported start of the match can be
+       greater than the end of the match. Using \K in a  lookbehind  assertion
+       at  the  start  of a pattern can also lead to odd effects. For example,
+       consider this pattern:
 
          (?<=\Kfoo)bar
 
-       If  the  subject  is  "foobar", a call to pcre2_match() with a starting
-       offset of 3 succeeds and reports the matching string as "foobar",  that
-       is,  the  start  of  the reported match is earlier than where the match
+       If the subject is "foobar", a call to  pcre2_match()  with  a  starting
+       offset  of 3 succeeds and reports the matching string as "foobar", that
+       is, the start of the reported match is earlier  than  where  the  match
        started.
 
    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:
+       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 groups 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
@@ -6786,19 +6973,20 @@ BACKSLASH
          \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
+       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.
+       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.  When
+       PCRE2  is  built with Unicode support, the meanings of \w and \W can be
+       changed by setting the PCRE2_UCP option. When this is done, it also af-
+       fects  \b and \B. Neither PCRE2 nor Perl has a separate "start of word"
+       or "end of word" metasequence. 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
@@ -6846,8 +7034,8 @@ CIRCUMFLEX AND DOLLAR
        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).
+       character  class, circumflex has an entirely different meaning (see be-
+       low).
 
        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
@@ -6858,11 +7046,11 @@ CIRCUMFLEX AND DOLLAR
        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
+       matching  point is at the end of the subject string, or immediately be-
+       fore a newline at the end of the string (by default), unless  PCRE2_NO-
+       TEOL  is  set.  Note, however, that it does not actually match the new-
+       line. Dollar need not be the last character of the pattern if a  number
+       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.
 
@@ -6945,11 +7133,11 @@ MATCHING A SINGLE CODE UNIT
 
        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).
+       string may start with a malformed UTF character. This has undefined re-
+       sults, because PCRE2 assumes that it is matching character by character
+       in a valid UTF string (by default it checks the subject string's valid-
+       ity  at  the  start  of  processing  unless  the  PCRE2_NO_UTF_CHECK or
+       PCRE2_MATCH_INVALID_UTF 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
@@ -6962,8 +7150,8 @@ MATCHING A SINGLE CODE UNIT
        these UTF modes.  The former gives a match-time error; the latter fails
        to optimize and so the match is always run using the interpreter.
 
-       In  the  32-bit  library,  however,  \C  is  always supported (when not
-       explicitly locked out) because it always matches a  single  code  unit,
+       In  the  32-bit  library, however, \C is always supported (when not ex-
+       plicitly locked out) because it always  matches  a  single  code  unit,
        whether or not UTF-32 is specified.
 
        In general, the \C escape sequence is best avoided. However, one way of
@@ -6978,11 +7166,11 @@ MATCHING A SINGLE CODE UNIT
              (?=[\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.
+       parentheses numbers in each alternative (see "Duplicate Group  Numbers"
+       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,  respec-
+       tively.  The  character's individual bytes are then captured by the ap-
+       propriate number of \C groups.
 
 
 SQUARE BRACKETS AND CHARACTER CLASSES
@@ -7019,93 +7207,92 @@ SQUARE BRACKETS AND CHARACTER CLASSES
        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
+       special way when matching character classes, whatever  line-ending  se-
+       quence  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 generic character type 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 hexadecimal 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, \R, and \X are not
-       special inside a character class. Like any  other  unrecognized  escape
-       sequences,  they  cause an error. The same is true for \N when not fol-
-       lowed by an opening brace.
+       matches any hexadecimal digit. In UTF modes, the PCRE2_UCP  option  af-
+       fects 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, \R, and \X are not special in-
+       side a character class. Like any other unrecognized  escape  sequences,
+       they  cause  an  error. The same is true for \N when not followed by an
+       opening brace.
 
        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.
+       ters  in  a  character class. For example, [d-m] matches any letter be-
+       tween 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 character, or z.
 
        Perl treats a hyphen as a literal if it appears before or after a POSIX
        class (see below) or before or after a character type escape such as as
-       \d  or  \H.   However,  unless  the hyphen is the last character in the
-       class, Perl outputs a warning in its warning  mode,  as  this  is  most
-       likely  a user error. As PCRE2 has no facility for warning, an error is
+       \d or \H.  However, unless the hyphen is  the  last  character  in  the
+       class,  Perl  outputs  a  warning  in its warning mode, as this is most
+       likely a user error. As PCRE2 has no facility for warning, an error  is
        given in these cases.
 
        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
+       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.
 
        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. In any  UTF  mode,  the  so-called
-       "surrogate"  characters (those whose code points lie between 0xd800 and
-       0xdfff inclusive) may not  be  specified  explicitly  by  default  (the
-       PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES  option  disables this check). How-
+       acters,  inclusive. They can also be used for code points specified nu-
+       merically, for example [\000-\037]. Ranges can include  any  characters
+       that  are  valid  for  the current mode. In any UTF mode, the so-called
+       "surrogate" characters (those whose code points lie between 0xd800  and
+       0xdfff  inclusive)  may  not  be  specified  explicitly by default (the
+       PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES option disables this  check).  How-
        ever, ranges such as [\x{d7ff}-\x{e000}], which include the surrogates,
        are always permitted.
 
-       There  is  a  special  case in EBCDIC environments for ranges whose end
+       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,
+       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,
+       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
+       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.
 
-       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
+       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.
+       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-al-
+       phanumeric 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
+       enclosed by [: and :] within the enclosing square brackets. PCRE2  also
        supports this notation. For example,
 
          [01[:alpha:]%]
@@ -7128,13 +7315,13 @@ POSIX CHARACTER CLASSES
          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
+       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
+       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:]]
@@ -7145,11 +7332,11 @@ POSIX CHARACTER CLASSES
 
        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:
+       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  se-
+       quences, as follows:
 
          [:alnum:]  becomes  \p{Xan}
          [:alpha:]  becomes  \p{L}
@@ -7161,10 +7348,10 @@ POSIX CHARACTER CLASSES
          [:upper:]  becomes  \p{Lu}
          [:word:]   becomes  \p{Xwd}
 
-       Negated versions, such as [:^alpha:] use \P instead of \p. Three  other
+       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
+       [: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:
 
@@ -7173,60 +7360,60 @@ POSIX CHARACTER CLASSES
                    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
+       [: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
+                 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
+       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"
+       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
+       [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.
+       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 as-
+       sertions that are used above in order to give exactly the POSIX  behav-
+       iour.
 
 
 VERTICAL BAR
 
-       Vertical bar characters are used to separate alternative patterns.  For
+       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
+       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.
+       to  right, and the first one that succeeds is used. If the alternatives
+       are within a group (defined below), "succeeds" means matching the  rest
+       of the main pattern as well as the alternative in the group.
 
 
 INTERNAL OPTION SETTING
 
-       The settings  of  the  PCRE2_CASELESS,  PCRE2_MULTILINE,  PCRE2_DOTALL,
-       PCRE2_EXTENDED,  PCRE2_EXTENDED_MORE, and PCRE2_NO_AUTO_CAPTURE options
-       can be changed from  within  the  pattern  by  a  sequence  of  letters
-       enclosed  between "(?"  and ")". These options are Perl-compatible, and
-       are described in detail in the pcre2api documentation. The option  let-
+       The  settings  of  the  PCRE2_CASELESS,  PCRE2_MULTILINE, PCRE2_DOTALL,
+       PCRE2_EXTENDED, PCRE2_EXTENDED_MORE, and PCRE2_NO_AUTO_CAPTURE  options
+       can  be  changed  from  within the pattern by a sequence of letters en-
+       closed between "(?"  and ")". These options  are  Perl-compatible,  and
+       are  described in detail in the pcre2api documentation. The option let-
        ters are:
 
          i  for PCRE2_CASELESS
@@ -7237,72 +7424,73 @@ INTERNAL OPTION SETTING
          xx for PCRE2_EXTENDED_MORE
 
        For example, (?im) sets caseless, multiline matching. It is also possi-
-       ble to unset these options by preceding the  relevant  letters  with  a
-       hyphen, for example (?-im). The two "extended" options are not indepen-
+       ble to unset these options by preceding the relevant letters with a hy-
+       phen, for example (?-im). The two "extended" options are  not  indepen-
        dent; unsetting either one cancels the effects of both of them.
 
-       A  combined  setting  and  unsetting  such  as  (?im-sx),  which   sets
-       PCRE2_CASELESS  and  PCRE2_MULTILINE  while  unsetting PCRE2_DOTALL and
-       PCRE2_EXTENDED, is also permitted. Only one hyphen may  appear  in  the
-       options  string.  If a letter appears both before and after the hyphen,
-       the option is unset. An empty options setting "(?)" is  allowed.  Need-
+       A   combined  setting  and  unsetting  such  as  (?im-sx),  which  sets
+       PCRE2_CASELESS and PCRE2_MULTILINE  while  unsetting  PCRE2_DOTALL  and
+       PCRE2_EXTENDED,  is  also  permitted. Only one hyphen may appear in the
+       options string. If a letter appears both before and after  the  hyphen,
+       the  option  is unset. An empty options setting "(?)" is allowed. Need-
        less to say, it has no effect.
 
-       If  the  first character following (? is a circumflex, it causes all of
-       the above options to be unset. Thus, (?^) is equivalent  to  (?-imnsx).
-       Letters  may  follow  the  circumflex  to  cause some options to be re-
-       instated, but a hyphen may not appear.
+       If the first character following (? is a circumflex, it causes  all  of
+       the  above  options to be unset. Thus, (?^) is equivalent to (?-imnsx).
+       Letters may follow the circumflex to cause some options  to  be  re-in-
+       stated, but a hyphen may not appear.
 
-       The PCRE2-specific options PCRE2_DUPNAMES  and  PCRE2_UNGREEDY  can  be
-       changed  in  the  same  way as the Perl-compatible options by using the
+       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. However, these are not unset by (?^).
 
-       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. An option change  within  a  subpattern  (see
-       below  for  a description of subpatterns) affects only that part of the
-       subpattern that follows it, so
+       When  one of these option changes occurs at top level (that is, not in-
+       side group parentheses), the change applies to  the  remainder  of  the
+       pattern  that follows. An option change within a group (see below for a
+       description of groups) affects only that part of the group that follows
+       it, so
 
          (a(?i)b)c
 
-       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-
+       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,
+       native do carry on into subsequent branches within the same group.  For
+       example,
 
          (a(?i)b|c)
 
-       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
+       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.
 
-       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
+       As a convenient shorthand, if any option settings are required  at  the
+       start  of a non-capturing group (see the next section), the option let-
+       ters may appear between the "?" and the ":". Thus the two patterns
 
          (?i:saturday|sunday)
          (?:(?i)saturday|sunday)
 
        match exactly the same set of strings.
 
-       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.
+       Note: There are other PCRE2-specific options,  applying  to  the  whole
+       pattern,  which  can be set by the application when the compiling func-
+       tion is called. In addition, the pattern can  contain  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, respec-
+       tively. 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.
 
 
-SUBPATTERNS
+GROUPS
 
-       Subpatterns are delimited by parentheses (round brackets), which can be
-       nested.  Turning part of a pattern into a subpattern does two things:
+       Groups are delimited by parentheses  (round  brackets),  which  can  be
+       nested.  Turning part of a pattern into a group does two things:
 
        1. It localizes a set of alternatives. For example, the pattern
 
@@ -7311,55 +7499,53 @@ SUBPATTERNS
        matches  "cataract",  "caterpillar", or "cat". Without the parentheses,
        it would match "cataract", "erpillar" or an empty string.
 
-       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.)
+       2. It creates a "capture group". This means that, when the  whole  pat-
+       tern  matches, the portion of the subject string that matched the group
+       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
+       obtain  numbers for capture groups. For example, if the string "the red
+       king" is matched against the pattern
 
          the ((red|white) (king|queen))
 
        the captured substrings are "red king", "red", and "king", and are num-
        bered 1, 2, and 3, respectively.
 
-       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  fact  that  plain  parentheses  fulfil two functions is not always
+       helpful.  There are often times when grouping is required without  cap-
+       turing.  If an opening parenthesis is followed by a question mark and a
+       colon, the group does not do any capturing, and  is  not  counted  when
+       computing  the number of any subsequent capture groups. 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.
+       1 and 2. The maximum number of capture groups 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
+       start of a non-capturing group, 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".
+       the  group is reached, an option setting in one branch does affect sub-
+       sequent branches, so the above patterns match "SUNDAY" as well as "Sat-
+       urday".
 
 
-DUPLICATE SUBPATTERN NUMBERS
+DUPLICATE GROUP 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:
+       Perl 5.10 introduced a feature whereby each alternative in a group uses
+       the same numbers for its capturing parentheses.  Such  a  group  starts
+       with  (?|  and  is  itself a non-capturing group. For example, consider
+       this pattern:
 
          (?|(Sat)ur|(Sun))day
 
@@ -7370,7 +7556,7 @@ DUPLICATE SUBPATTERN NUMBERS
        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-
+       whole group 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.
 
@@ -7378,90 +7564,94 @@ DUPLICATE SUBPATTERN NUMBERS
          / ( a )  (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x
          # 1            2         2  3        2     3     4
 
-       A  backreference  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":
+       A  backreference  to a capture group uses the most recent value that is
+       set for the group. 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":
+       In contrast, a subroutine call to a capture group 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.
+       If a condition test for a group's having matched refers to a non-unique
+       number, the test is true if any group with that number has matched.
 
        An alternative approach to using this "branch reset" feature is to  use
-       duplicate named subpatterns, as described in the next section.
+       duplicate named groups, as described in the next section.
 
 
-NAMED SUBPATTERNS
+NAMED CAPTURE GROUPS
 
-       Identifying  capturing  parentheses  by number is simple, but it can be
-       very hard to keep track of the numbers in  complicated  patterns.  Fur-
-       thermore, if an expression is modified, the numbers may change. To help
-       with this difficulty, PCRE2 supports the naming  of  capturing  subpat-
-       terns.  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.
+       Identifying capture groups by number is simple, but it can be very hard
+       to keep track of the numbers in complicated patterns.  Furthermore,  if
+       an  expression  is  modified, the numbers may change. To help with this
+       difficulty, PCRE2 supports the naming of capture groups.  This  feature
+       was  not  added to Perl until release 5.10. Python had the feature ear-
+       lier, and PCRE1 introduced it at release 4.0, using the Python  syntax.
+       PCRE2 supports both the Perl and the Python syntax.
 
-       In  PCRE2,  a  capturing  subpattern can be named in one of three ways:
+       In  PCRE2,  a  capture  group  can  be  named  in  one  of  three ways:
        (?<name>...) or (?'name'...) as in Perl, or (?P<name>...) as in Python.
-       Names  consist of up to 32 alphanumeric characters and underscores, but
-       must start with a non-digit. References to capturing  parentheses  from
-       other parts of the pattern, such as backreferences, recursion, and con-
-       ditions, can all be made by name as well as by number.
-
-       Named capturing parentheses are allocated numbers  as  well  as  names,
-       exactly  as if the names were not present. In both PCRE2 and Perl, cap-
-       turing subpatterns are primarily identified by numbers; any  names  are
-       just  aliases  for these numbers. The PCRE2 API provides function calls
-       for extracting the complete name-to-number  translation  table  from  a
-       compiled  pattern, as well as convenience functions for extracting cap-
-       tured substrings by name.
-
-       Warning: When  more  than  one  subpattern  has  the  same  number,  as
-       described  in the previous section, a name given to one of them applies
-       to all of them.  Perl allows identically numbered subpatterns  to  have
-       different  names.  Consider this pattern, where there are two capturing
-       subpatterns, both numbered 1:
+       Names  may be up to 32 code units long. When PCRE2_UTF is not set, they
+       may contain only ASCII alphanumeric  characters  and  underscores,  but
+       must start with a non-digit. When PCRE2_UTF is set, the syntax of group
+       names is extended to allow any Unicode letter or Unicode decimal digit.
+       In other words, group names must match one of these patterns:
+
+         ^[_A-Za-z][_A-Za-z0-9]*\z   when PCRE2_UTF is not set
+         ^[_\p{L}][_\p{L}\p{Nd}]*\z  when PCRE2_UTF is set
+
+       References  to  capture groups from other parts of the pattern, such as
+       backreferences, recursion, and conditions, can all be made by  name  as
+       well as by number.
+
+       Named capture groups are allocated numbers as well as names, exactly as
+       if the names were not present. In both PCRE2 and Perl,  capture  groups
+       are  primarily  identified  by  numbers; any names are just aliases for
+       these numbers. The PCRE2 API provides function calls for extracting the
+       complete  name-to-number  translation table from a compiled pattern, as
+       well as convenience functions for  extracting  captured  substrings  by
+       name.
+
+       Warning:  When  more than one capture group has the same number, as de-
+       scribed in the previous section, a name given to one of them applies to
+       all  of them. Perl allows identically numbered groups to have different
+       names.  Consider this pattern, where there are two capture groups, both
+       numbered 1:
 
          (?|(?<AA>aa)|(?<BB>bb))
 
-       Perl allows this, with both names AA and BB  as  aliases  of  group  1.
+       Perl  allows  this,  with  both  names AA and BB as aliases of group 1.
        Thus, after a successful match, both names yield the same value (either
        "aa" or "bb").
 
-       In an attempt to reduce confusion, PCRE2 does not allow the same  group
+       In  an attempt to reduce confusion, PCRE2 does not allow the same group
        number to be associated with more than one name. The example above pro-
-       vokes a compile-time error. However, there is still  scope  for  confu-
+       vokes  a  compile-time  error. However, there is still scope for confu-
        sion. Consider this pattern:
 
          (?|(?<AA>aa)|(bb))
 
-       Although  the  second  subpattern number 1 is not explicitly named, the
-       name AA is still an alias for subpattern 1. Whether the pattern matches
-       "aa"  or  "bb",  a  reference  by  name  to group AA yields the matched
-       string.
+       Although the second group number 1 is not explicitly named, the name AA
+       is  still an alias for any group 1. Whether the pattern matches "aa" or
+       "bb", a reference by name to group AA yields the matched string.
 
        By default, a name must be unique within a pattern, except that  dupli-
-       cate  names  are  permitted  for  subpatterns with the same number, for
-       example:
+       cate names are permitted for groups with the same number, for example:
 
          (?|(?<AA>aa)|(?<AA>bb))
 
        The duplicate name constraint can be disabled by setting the PCRE2_DUP-
        NAMES option at compile time, or by the use of (?J) within the pattern.
-       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
+       Duplicate  names  can be useful for patterns where only one instance of
+       the named capture group 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)?|
@@ -7470,33 +7660,32 @@ NAMED SUBPATTERNS
          (?<DN>Thu)(?:rsday)?|
          (?<DN>Sat)(?:urday)?
 
-       There are five capturing substrings, but only one is ever set  after  a
-       match.   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. (An alternative way of  solving  this
-       problem is to use a "branch reset" subpattern, as described in the pre-
-       vious section.)
+       There  are five capture groups, but only one is ever set after a match.
+       The convenience functions for extracting the data by name  returns  the
+       substring  for  the first (and in this example, the only) group of that
+       name that matched. This saves searching to find which numbered group it
+       was.  (An  alternative  way of solving this problem is to use a "branch
+       reset" group, as described in the previous section.)
 
-       If you make a backreference to a non-unique named subpattern from else-
-       where  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":
+       If you make a backreference to a non-unique named group from  elsewhere
+       in  the pattern, the groups 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 pattern 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 this is the one with the lowest number.
+       If you make a subroutine call to a non-unique named group, the one that
+       corresponds to the first occurrence of the name is used. In the absence
+       of duplicate numbers 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
+       conditions below), either to check whether a capture group has matched,
+       or to check for recursion, all groups 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  de-
+       tails  of  the  interfaces  for  handling named capture groups, see the
        pcre2api documentation.
 
 
@@ -7508,18 +7697,18 @@ REPETITION
          a literal data character
          the dot metacharacter
          the \C escape sequence
-         the \X escape sequence
          the \R escape sequence
+         the \X escape sequence
          an escape such as \d or \pL that matches a single character
          a character class
          a backreference
-         a parenthesized subpattern (including most assertions)
-         a subroutine call to a subpattern (recursive or otherwise)
+         a parenthesized group (including most assertions)
+         a subroutine call (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:
+       and the first must be less than or equal to the second. For example,
 
          z{2,4}
 
@@ -7549,37 +7738,40 @@ REPETITION
 
        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.
+       ful for capture groups that are referenced as  subroutines  from  else-
+       where  in the pattern (but see also the section entitled "Defining cap-
+       ture groups for use by reference only" below). Except for parenthesized
+       groups,  items that have a {0} quantifier are omitted from the compiled
+       pattern.
 
-       For  convenience, the three most common quantifiers have single-charac-
+       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:
+       It  is  possible  to construct infinite loops by following a group that
+       can match no characters with a quantifier that has no upper limit,  for
+       example:
 
          (a?)*
 
-       Earlier versions of Perl and PCRE1 used to give  an  error  at  compile
+       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.
-
-       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
+       be useful, such patterns are now accepted, but whenever an iteration of
+       such a group matches no characters, matching moves on to the next  item
+       in  the  pattern  instead  of repeatedly matching an empty string. This
+       does not prevent backtracking into any of the iterations  if  a  subse-
+       quent item fails to match.
+
+       By  default,  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  ap-
+       pear between /* and */ and within the comment, individual * and / char-
+       acters may appear. An attempt to match C comments by applying the  pat-
+       tern
 
          /\*.*\*/
 
@@ -7587,19 +7779,17 @@ REPETITION
 
          /* 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
+       fails,  because it matches the entire string owing to the greediness of
+       the .*  item. However, 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 pattern
 
          /\*.*?\*/
 
-       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
+       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
@@ -7608,56 +7798,56 @@ REPETITION
        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
+       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
+       When a parenthesized group is quantified with a  minimum  repeat  count
+       that  is  greater  than 1 or with a limited maximum, more memory is re-
+       quired for the compiled pattern, in proportion to the size of the mini-
+       mum 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 af-
+       ter 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-
+       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
-       backreference elsewhere in the pattern, a match at the start  may  fail
+       However,  there  are  some cases where the optimization cannot be used.
+       When .*  is inside capturing parentheses that  are  the  subject  of  a
+       backreference  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-
+       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
+       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
+       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
+       When  a  capture group is repeated, the value captured is the substring
+       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
+       is  "tweedledee". However, if there are nested capture groups, the cor-
+       responding captured values may have been set  in  previous  iterations.
+       For example, after
 
          (a|(b))+
 
@@ -7666,54 +7856,58 @@ REPETITION
 
 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
+       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
+       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
+       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 group 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
+       Perl  5.28  introduced an experimental alphabetic form starting with (*
+       which may be easier to remember:
+
+         (*atomic:\d+)foo
+
+       This kind of parenthesized group "locks up" the  part of the pattern it
+       contains 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.
+       An alternative description is that a group 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  are  not capture groups. Simple cases such as the above
+       example can be thought of as a maximizing repeat that must swallow  ev-
+       erything  it  can.   So, while both \d+ and \d+? are prepared to adjust
+       the number of digits they match in order to make the rest of  the  pat-
+       tern 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
+       Atomic  groups in general can of course contain arbitrarily complicated
+       expressions, and can be nested. However, when the contents of an atomic
+       group  is  just a single repeated item, as in the example above, a sim-
+       pler notation, called a "possessive quantifier" can be used. This  con-
+       sists  of  an additional + character following a quantifier. Using this
+       notation, the previous example can be rewritten as
 
          \d++foo
 
@@ -7722,47 +7916,47 @@ ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS
 
          (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
+       Possessive  quantifiers are always greedy; the setting of the PCRE2_UN-
+       GREEDY option is ignored. They are a convenient notation for  the  sim-
+       pler  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
+       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.
+       built  Sun's Java package, and PCRE1 copied it from there. It 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
+       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
+       When a pattern contains an unlimited repeat inside a group that can it-
+       self  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  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:
+       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 ex-
+       ample 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 character  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+>)*[!?]
 
@@ -7772,26 +7966,25 @@ ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS
 BACKREFERENCES
 
        Outside a character class, a backslash followed by a digit greater than
-       0  (and possibly further digits) is a backreference 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 backreference, 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.
+       0 (and possibly further digits) is a backreference to a  capture  group
+       earlier (that is, to its left) in the pattern, provided there have been
+       that many previous capture groups.
+
+       However, if the decimal number following the backslash is less than  8,
+       it  is  always  taken  as  a backreference, and causes an error only if
+       there are not that many capture groups in the entire pattern. In  other
+       words, the group that is referenced need not be to the left of the ref-
+       erence for numbers less than 8. A "forward backreference" of this  type
+       can make sense when a repetition is involved and the group to the right
+       has participated in an earlier iteration.
 
        It is not possible to have a numerical  "forward  backreference"  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 backreference to any
-       subpattern is possible using named parentheses (see below).
+       group  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. Other forms  of  back-
+       referencing  do  not suffer from this restriction. In particular, there
+       is no problem when named capture groups are used (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
@@ -7809,21 +8002,21 @@ BACKREFERENCES
 
          (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.
+       The sequence \g{-1} is a reference to the most recently started capture
+       group before \g, that is, is it equivalent to \2 in this example. Simi-
+       larly, \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  them-
+       selves.
 
-       The  sequence  \g{+1}  is a reference to the next capturing subpattern.
-       This kind of forward reference can be useful it patterns  that  repeat.
-       Perl does not support the use of + in this way.
+       The sequence \g{+1} is a reference to the next capture group. This kind
+       of forward reference can be useful in patterns that repeat.  Perl  does
+       not support the use of + in this way.
 
-       A backreference matches whatever actually matched the capturing subpat-
-       tern 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
+       A  backreference  matches  whatever  actually most recently matched the
+       capture group in the current subject string, rather  than  anything  at
+       all that matches the group (see "Groups as subroutines" below for a way
+       of doing that). So the pattern
 
          (sens|respons)e and \1ibility
 
@@ -7835,26 +8028,26 @@ BACKREFERENCES
          ((?i)rah)\s+\1
 
        matches  "rah  rah"  and  "RAH RAH", but not "RAH rah", even though the
-       original capturing subpattern is matched caselessly.
+       original capture group is matched caselessly.
 
        There are several different ways of  writing  backreferences  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  backreference 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:
+       capture  groups.  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  backreference 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
+       A  capture  group  that is referenced by name may appear in the pattern
        before or after the reference.
 
-       There may be more than one backreference 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
+       There may be more than one backreference to the same group. If a  group
+       has  not actually been used in a particular match, backreferences to it
+       always fail by default. For example, the pattern
 
          (a|(bc))\2
 
@@ -7862,62 +8055,72 @@ BACKREFERENCES
        the PCRE2_MATCH_UNSET_BACKREF option is set at compile time, a backref-
        erence 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 backrefer-
-       ence number.  If the pattern continues with  a  digit  character,  some
-       delimiter   must  be  used  to  terminate  the  backreference.  If  the
-       PCRE2_EXTENDED or PCRE2_EXTENDED_MORE option is set, this can be  white
-       space.  Otherwise,  the  \g{ syntax or an empty comment (see "Comments"
-       below) can be used.
+       Because there may be many capture groups in a pattern, all digits  fol-
+       lowing  a backslash are taken as part of a potential backreference num-
+       ber. If the pattern continues with a digit  character,  some  delimiter
+       must  be  used to terminate the backreference. If the PCRE2_EXTENDED or
+       PCRE2_EXTENDED_MORE option is set, this can be white space.  Otherwise,
+       the \g{} syntax or an empty comment (see "Comments" below) can be used.
 
    Recursive backreferences
 
-       A backreference 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  backreference  that occurs inside the group to which it refers fails
+       when the group is first used, so, for  example,  (a\1)  never  matches.
+       However,  such references can be useful inside repeated groups. For ex-
+       ample, the pattern
 
          (a|b\1)+
 
        matches any number of "a"s and also "aba", "ababbaa" etc. At each iter-
-       ation of the subpattern, the backreference 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  backreference. This can be done using alternation, as in the exam-
+       ation of the group, the backreference matches the character string cor-
+       responding 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 backreference. This can be done using alternation, as in the  exam-
        ple above, or by a quantifier with a minimum of zero.
 
-       Backreferences 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
+       Backreferences  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
+       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
+       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, and in each  case  an  assertion
-       may  be  positive  (must  succeed for matching to continue) or negative
-       (must not succeed for matching to continue). An assertion subpattern is
-       matched in the normal way, except that, when matching continues after a
-       successful assertion, the matching position in the subject string is as
-       it was before the assertion was processed.
-
-       Assertion  subpatterns  are  not capturing subpatterns. If an assertion
-       contains capturing subpatterns within it, these  are  counted  for  the
-       purposes  of  numbering the capturing subpatterns in the whole pattern.
-       Within each branch of an assertion, locally captured substrings may  be
-       referenced in the usual way.  For example, a sequence such as (.)\g{-1}
-       can be used to check that two adjacent characters are the same.
+       More  complicated  assertions  are coded as parenthesized groups. There
+       are two kinds: those that look ahead of the  current  position  in  the
+       subject  string, and those that look behind it, and in each case an as-
+       sertion may be positive (must match for the assertion to  be  true)  or
+       negative  (must  not  match for the assertion to be true). An assertion
+       group is matched in the normal way, and if it is true, matching contin-
+       ues  after it, but with the matching position in the subject string re-
+       set to what it was before the assertion was processed.
+
+       The Perl-compatible lookaround assertions are atomic. If  an  assertion
+       is  true, but there is a subsequent matching failure, there is no back-
+       tracking into the assertion. However, there are some cases  where  non-
+       atomic  assertions can be useful. PCRE2 has some support for these, de-
+       scribed in the section entitled "Non-atomic assertions" below, but they
+       are not Perl-compatible.
+
+       A  lookaround  assertion  may  appear as the condition in a conditional
+       group (see below). In this case, the result of matching  the  assertion
+       determines which branch of the condition is followed.
+
+       Assertion  groups are not capture groups. If an assertion contains cap-
+       ture groups within it, these are counted for the purposes of  numbering
+       the  capture  groups in the whole pattern. Within each branch of an as-
+       sertion, locally captured substrings may be  referenced  in  the  usual
+       way.  For  example,  a  sequence such as (.)\g{-1} can be used to check
+       that two adjacent characters are the same.
 
        When a branch within an assertion fails to match, any  substrings  that
        were  captured  are  discarded (as happens with any pattern branch that
-       fails to match). A  negative  assertion  succeeds  only  when  all  its
+       fails to match). A  negative  assertion  is  true  only  when  all  its
        branches fail to match; this means that no captured substrings are ever
        retained after a successful negative assertion. When an assertion  con-
        tains a matching branch, what happens depends on the type of assertion.
@@ -7925,33 +8128,49 @@ ASSERTIONS
        For  a  positive  assertion, internally captured substrings in the suc-
        cessful branch are retained, and matching continues with the next  pat-
        tern  item  after  the  assertion. For a negative assertion, a matching
-       branch means that the assertion has failed. If the assertion  is  being
-       used  as  a condition in a conditional subpattern (see below), captured
+       branch means that the assertion is not true. If such  an  assertion  is
+       being  used as a condition in a conditional group (see below), captured
        substrings are retained,  because  matching  continues  with  the  "no"
        branch of the condition. For other failing negative assertions, control
        passes to the previous backtracking point, thus discarding any captured
        strings within the assertion.
 
-       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:
+       For  compatibility  with  Perl,  most assertion groups may be repeated;
+       though it makes no sense to assert the same thing  several  times,  the
+       side effect of capturing may occasionally be useful. However, an asser-
+       tion that forms the condition for a conditional group may not be  quan-
+       tified. In practice, for other assertions, 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.
+       (1)  If  the  quantifier  is  {0}, the assertion is never obeyed during
+       matching.  However, it may contain internal  capture  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
+       (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
+       (3) If the minimum repetition is greater than zero, the  quantifier  is
+       ignored.   The  assertion  is  obeyed just once when encountered during
        matching.
 
+   Alphabetic assertion names
+
+       Traditionally, symbolic sequences such as (?= and (?<= have  been  used
+       to  specify lookaround assertions. Perl 5.28 introduced some experimen-
+       tal alphabetic alternatives which might be easier to remember. They all
+       start  with  (* instead of (? and must be written using lower case let-
+       ters. PCRE2 supports the following synonyms:
+
+         (*positive_lookahead:  or (*pla: is the same as (?=
+         (*negative_lookahead:  or (*nla: is the same as (?!
+         (*positive_lookbehind: or (*plb: is the same as (?<=
+         (*negative_lookbehind: or (*nlb: is the same as (?<!
+
+       For example, (*pla:foo) is the same assertion as (?=foo). In  the  fol-
+       lowing  sections, the various assertions are described using the origi-
+       nal symbolic forms.
+
    Lookahead assertions
 
        Lookahead assertions start with (?= for positive assertions and (?! for
@@ -7959,38 +8178,38 @@ ASSERTIONS
 
          \w+(?=;)
 
-       matches a word followed by a semicolon, but does not include the  semi-
+       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
+       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
+       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
+       most  convenient  way to do it is with (?!) because an empty string al-
+       ways 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 (?<!
+       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
+       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
+       eral top-level alternatives, they do not all  have  to  have  the  same
        fixed length. Thus
 
          (?<=bullock|donkey)
@@ -7999,74 +8218,74 @@ ASSERTIONS
 
          (?<!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.
+       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
+       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
+       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
+       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  UTF-8  and  UTF-16 modes, PCRE2 does not allow the \C escape (which
-       matches a single code unit even in a UTF mode) to appear in  lookbehind
-       assertions,  because  it makes it impossible to calculate the length of
-       the lookbehind. The \X and \R escapes, which can match  different  num-
+       In UTF-8 and UTF-16 modes, PCRE2 does not allow the  \C  escape  (which
+       matches  a single code unit even in a UTF mode) to appear in lookbehind
+       assertions, because it makes it impossible to calculate the  length  of
+       the  lookbehind.  The \X and \R escapes, which can match different num-
        bers of code units, are never permitted in lookbehinds.
 
-       "Subroutine"  calls  (see below) such as (?2) or (?&X) are permitted in
-       lookbehinds, as long as the subpattern matches a  fixed-length  string.
-       However,  recursion,  that is, a "subroutine" call into a group that is
-       already active, is not supported.
+       "Subroutine" calls (see below) such as (?2) or (?&X) are  permitted  in
+       lookbehinds, as long as the called capture group matches a fixed-length
+       string. However, recursion, that is, a "subroutine" call into  a  group
+       that is already active, is not supported.
 
        Perl does not support backreferences in lookbehinds. PCRE2 does support
-       them,    but    only    if    certain    conditions    are   met.   The
-       PCRE2_MATCH_UNSET_BACKREF option must not be set, there must be no  use
-       of (?| in the pattern (it creates duplicate subpattern numbers), and if
-       the backreference is by name, the name must be unique. Of  course,  the
-       referenced  subpattern  must  itself  be of fixed length. The following
-       pattern matches words containing at least two characters that begin and
-       end with the same character:
+       them, but only if  certain  conditions  are  met.  The  PCRE2_MATCH_UN-
+       SET_BACKREF  option must not be set, there must be no use of (?| in the
+       pattern (it creates duplicate group numbers), and if the  backreference
+       is  by  name,  the name must be unique. Of course, the referenced group
+       must itself match a  fixed  length  substring.  The  following  pattern
+       matches  words  containing  at  least two characters that begin and end
+       with the same character:
 
           \b(\w)\w++(?<=\1)
 
-       Possessive  quantifiers  can  be  used  in  conjunction with lookbehind
-       assertions to specify efficient matching of fixed-length strings at the
+       Possessive quantifiers can be used in conjunction with  lookbehind  as-
+       sertions  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
+       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
+       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,
+       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
+       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
@@ -8075,18 +8294,18 @@ ASSERTIONS
 
          (?<=\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
+       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-
+       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,
+       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".
 
@@ -8094,22 +8313,131 @@ ASSERTIONS
 
          (?<=(?<!foo)bar)baz
 
-       matches  an occurrence of "baz" that is preceded by "bar" which in turn
+       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
+       is  another pattern that matches "foo" preceded by three digits and any
        three characters that are not "999".
 
 
-CONDITIONAL SUBPATTERNS
+NON-ATOMIC ASSERTIONS
+
+       The traditional Perl-compatible lookaround assertions are atomic.  That
+       is,  if  an assertion is true, but there is a subsequent matching fail-
+       ure, there is no backtracking into the assertion.  However,  there  are
+       some  cases  where  non-atomic positive assertions can be useful. PCRE2
+       provides these using the following syntax:
+
+         (*non_atomic_positive_lookahead:  or (*napla:
+         (*non_atomic_positive_lookbehind: or (*naplb:
+
+       Consider the problem of finding the right-most word in  a  string  that
+       also  appears  earlier  in the string, that is, it must appear at least
+       twice in total.  This pattern returns the required result  as  captured
+       substring 1:
+
+         ^(?x)(*napla: .* \b(\w++)) (?> .*? \b\1\b ){2}
+
+       For  a subject such as "word1 word2 word3 word2 word3 word4" the result
+       is "word3". How does it work? At the start, ^(?x) anchors  the  pattern
+       and sets the "x" option, which causes white space (introduced for read-
+       ability) to be ignored. Inside the assertion, the greedy  .*  at  first
+       consumes the entire string, but then has to backtrack until the rest of
+       the assertion can match a word, which is captured by group 1. In  other
+       words,  when  the  assertion first succeeds, it captures the right-most
+       word in the string.
+
+       The current matching point is then reset to the start of  the  subject,
+       and  the  rest  of  the pattern match checks for two occurrences of the
+       captured word, using an ungreedy .*? to scan from  the  left.  If  this
+       succeeds,  we are done, but if the last word in the string does not oc-
+       cur twice, this part of the pattern  fails.  If  a  traditional  atomic
+       lookhead (?= or (*pla: had been used, the assertion could not be re-en-
+       tered, and the whole match would fail. The pattern would  succeed  only
+       if the very last word in the subject was found twice.
+
+       Using  a  non-atomic  lookahead, however, means that when the last word
+       does not occur twice in the string, the  lookahead  can  backtrack  and
+       find  the second-last word, and so on, until either the match succeeds,
+       or all words have been tested.
+
+       Two conditions must be met for a non-atomic assertion to be useful: the
+       contents  of one or more capturing groups must change after a backtrack
+       into the assertion, and there must be  a  backreference  to  a  changed
+       group  later  in  the pattern. If this is not the case, the rest of the
+       pattern match fails exactly as before because nothing has  changed,  so
+       using a non-atomic assertion just wastes resources.
+
+       Non-atomic  assertions  are  not  supported by the alternative matching
+       function pcre2_dfa_match(). They are also not supported by JIT (but may
+       be  in future). Note that assertions that appear as conditions for con-
+       ditional groups (see below) must be atomic.
+
+
+SCRIPT RUNS
+
+       In concept, a script run is a sequence of characters that are all  from
+       the  same  Unicode script such as Latin or Greek. However, because some
+       scripts are commonly used together, and because  some  diacritical  and
+       other  marks  are  used  with  multiple scripts, it is not that simple.
+       There is a full description of the rules that PCRE2 uses in the section
+       entitled "Script Runs" in the pcre2unicode documentation.
+
+       If  part  of a pattern is enclosed between (*script_run: or (*sr: and a
+       closing parenthesis, it fails if the sequence  of  characters  that  it
+       matches  are not a script run. After a failure, normal backtracking oc-
+       curs. Script runs can be used to detect spoofing attacks using  charac-
+       ters  that  look  the  same, but are from different scripts. The string
+       "paypal.com" is an infamous example, where the letters could be a  mix-
+       ture of Latin and Cyrillic. This pattern ensures that the matched char-
+       acters in a sequence of non-spaces that follow white space are a script
+       run:
+
+         \s+(*sr:\S+)
+
+       To  be  sure  that  they are all from the Latin script (for example), a
+       lookahead can be used:
+
+         \s+(?=\p{Latin})(*sr:\S+)
+
+       This works as long as the first character is expected to be a character
+       in  that  script,  and  not (for example) punctuation, which is allowed
+       with any script. If this is not the case, a more creative lookahead  is
+       needed.  For  example, if digits, underscore, and dots are permitted at
+       the start:
+
+         \s+(?=[0-9_.]*\p{Latin})(*sr:\S+)
+
+
+       In many cases, backtracking into a script run pattern fragment  is  not
+       desirable.  The  script run can employ an atomic group to prevent this.
+       Because this is a common requirement, a shorthand notation is  provided
+       by (*atomic_script_run: or (*asr:
+
+         (*asr:...) is the same as (*sr:(?>...))
 
-       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:
+       Note that the atomic group is inside the script run. Putting it outside
+       would not prevent backtracking into the script run pattern.
+
+       Support for script runs is not available if PCRE2 is  compiled  without
+       Unicode support. A compile-time error is given if any of the above con-
+       structs is encountered. Script runs are not supported by the  alternate
+       matching  function,  pcre2_dfa_match() because they use the same mecha-
+       nism as capturing parentheses.
+
+       Warning: The (*ACCEPT) control verb (see  below)  should  not  be  used
+       within a script run group, because it causes an immediate exit from the
+       group, bypassing the script run checking.
+
+
+CONDITIONAL GROUPS
+
+       It is possible to cause the matching process to obey a pattern fragment
+       conditionally or to choose between two alternative fragments, depending
+       on the result of an assertion, or whether a specific capture group  has
+       already been matched. The two possible forms of conditional group are:
 
          (?(condition)yes-pattern)
          (?(condition)yes-pattern|no-pattern)
@@ -8117,33 +8445,33 @@ CONDITIONAL SUBPATTERNS
        If  the  condition is satisfied, the yes-pattern is used; otherwise the
        no-pattern (if present) is used. An absent no-pattern is equivalent  to
        an  empty string (it always matches). If there are more than two alter-
-       natives 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:
+       natives in the group, a compile-time error occurs. Each of the two  al-
+       ternatives may itself contain nested groups of any form, including con-
+       ditional groups; the restriction to two alternatives  applies  only  at
+       the  level of the condition itself. 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-
+       There are five kinds of condition: references to capture groups, refer-
        ences  to  recursion,  two pseudo-conditions called DEFINE and VERSION,
        and assertions.
 
-   Checking for a used subpattern by number
+   Checking for a used capture group 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.)
+       the  condition is true if a capture group of that number has previously
+       matched. If there is more than one capture group with the  same  number
+       (see  the earlier section about duplicate group numbers), the condition
+       is true if any of them have matched. An alternative notation is to pre-
+       cede the digits with a plus or minus sign. In this case, the group num-
+       ber is relative rather than absolute. The most recently opened  capture
+       group  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 capture group can be referenced as (?(+1), and so on.
+       (The value zero in any of these forms is not used; it provokes  a  com-
+       pile-time error.)
 
        Consider  the  following  pattern, which contains non-significant white
        space to make it more readable (assume the PCRE2_EXTENDED  option)  and
@@ -8154,13 +8482,13 @@ CONDITIONAL SUBPATTERNS
        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.
+       third part is a conditional group that tests whether or not  the  first
+       capture  group  matched. If it 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. Otherwise, since no-
+       pattern is not present, the conditional group 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:
@@ -8170,70 +8498,68 @@ CONDITIONAL SUBPATTERNS
        This  makes  the  fragment independent of the parentheses in the larger
        pattern.
 
-   Checking for a used subpattern by name
+   Checking for a used capture group by name
 
        Perl uses the syntax (?(<name>)...) or (?('name')...)  to  test  for  a
-       used  subpattern  by  name.  For compatibility with earlier versions of
+       used  capture group by name. For compatibility with earlier versions of
        PCRE1, which had this facility before Perl, the syntax (?(name)...)  is
-       also  recognized.  Note,  however, that undelimited names consisting of
+       also  recognized.   Note, however, that undelimited names consisting of
        the letter R followed by digits are ambiguous (see the  following  sec-
-       tion).
-
-       Rewriting the above example to use a named subpattern gives this:
+       tion). Rewriting the above example to use a named group 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.
+       is applied to all groups of the same name, and is true if  any  one  of
+       them has matched.
 
    Checking for pattern recursion
 
        "Recursion"  in  this sense refers to any subroutine-like call from one
        part of the pattern to another, whether or not it  is  actually  recur-
-       sive.  See  the sections entitled "Recursive patterns" and "Subpatterns
-       as subroutines" below for details of recursion and subpattern calls.
-
-       If a condition is the string (R), and there is no subpattern  with  the
-       name  R,  the condition is true if matching is currently in a recursion
-       or subroutine call to the whole pattern or any  subpattern.  If  digits
-       follow  the  letter  R,  and there is no subpattern with that name, the
-       condition is true if the most recent call is into a subpattern with the
+       sive.  See  the  sections  entitled "Recursive patterns" and "Groups as
+       subroutines" below for details of recursion and subroutine calls.
+
+       If a condition is the string (R), and there is no  capture  group  with
+       the  name R, the condition is true if matching is currently in a recur-
+       sion or subroutine call to the whole pattern or any capture  group.  If
+       digits  follow  the letter R, and there is no group with that name, the
+       condition is true if the most recent call is  into  a  group  with  the
        given  number,  which must exist somewhere in the overall pattern. This
        is a contrived example that is equivalent to a+b:
 
          ((?(R1)a+|(?1)b))
 
-       However, in both cases, if there is a subpattern with a matching  name,
-       the  condition  tests  for  its  being set, as described in the section
-       above, instead of testing for recursion. For example, creating a  group
-       with  the  name  R1  by  adding (?<R1>) to the above pattern completely
-       changes its meaning.
+       However, in both cases, if there is a capture  group  with  a  matching
+       name,  the  condition tests for its being set, as described in the sec-
+       tion above, instead of testing for recursion. For example,  creating  a
+       group  with  the  name  R1  by adding (?<R1>) to the above pattern com-
+       pletely changes its meaning.
 
        If a name preceded by ampersand follows the letter R, for example:
 
          (?(R&name)...)
 
-       the condition is true if the most recent recursion is into a subpattern
-       of that name (which must exist within the pattern).
+       the condition is true if the most recent recursion is into a  group  of
+       that name (which must exist within the pattern).
 
        This condition does not check the entire recursion stack. It tests only
        the current level. 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.
+       duplicate,  the  test is applied to all groups 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.
 
-   Defining subpatterns for use by reference only
+   Defining capture groups for use by reference only
 
        If the condition is the string (DEFINE), the condition is always false,
        even  if there is a group with the name DEFINE. In this case, there may
-       be only one alternative in the subpattern. It is always skipped if con-
-       trol  reaches  this point in the pattern; the idea of DEFINE is that it
-       can be used to define subroutines that can  be  referenced  from  else-
-       where. (The use of subroutines is described below.) For example, a pat-
-       tern to match an IPv4 address such as "192.168.23.245" could be written
-       like this (ignore white space and line breaks):
+       be only one alternative in the rest of the conditional group. It is al-
+       ways  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
@@ -8264,71 +8590,74 @@ CONDITIONAL SUBPATTERNS
 
    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:
+       If  the  condition  is  not  in  any of the above formats, it must be a
+       parenthesized assertion. This may be a positive or  negative  lookahead
+       or  lookbehind  assertion. However, it must be a traditional atomic as-
+       sertion, not one of the PCRE2-specific non-atomic assertions.
+
+       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
+       The  condition  is  a  positive lookahead assertion that matches an op-
+       tional 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 let-
+       ter 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.
 
-       When an assertion that is a condition contains  capturing  subpatterns,
-       any  capturing that occurs in a matching branch is retained afterwards,
-       for both positive and negative assertions, because matching always con-
-       tinues after the assertion, whether it succeeds or fails. (Compare non-
-       conditional assertions, when captures are retained  only  for  positive
-       assertions that succeed.)
+       When an assertion that is a condition contains capture groups, any cap-
+       turing that occurs in a matching branch  is  retained  afterwards,  for
+       both  positive and negative assertions, because matching always contin-
+       ues after the assertion, whether it succeeds or  fails.  (Compare  non-
+       conditional  assertions, for which captures are retained only for posi-
+       tive assertions that succeed.)
 
 
 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  or  PCRE2_EXTENDED_MORE  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
+       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 group 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 or PCRE2_EXTENDED_MORE 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 characters are interpreted as newlines is controlled
-       by  an option passed to the compiling function or by a special sequence
+       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 "New-
        line conventions" above. Note that the end of this type of comment is a
-       literal newline sequence in the pattern; escape sequences  that  happen
+       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  sin-
+       when  PCRE2_EXTENDED is set, and the default newline convention (a sin-
        gle 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
+       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
+       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
+       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:
 
@@ -8337,65 +8666,64 @@ RECURSIVE PATTERNS
        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.
+       Obviously, PCRE2 cannot support the interpolation  of  Perl  code.  In-
+       stead,  it supports special syntax for recursion of the entire pattern,
+       and also for individual capture group recursion. After its introduction
+       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.
+       A special item that consists of (? followed by a  number  greater  than
+       zero  and  a  closing parenthesis is a recursive subroutine call of the
+       capture group of the given number, provided that it occurs inside  that
+       group.  (If  not,  it  is a non-recursive subroutine call, which is de-
+       scribed in the next section.) The special item (?R) or (?0) is a recur-
+       sive call of the entire regular expression.
 
-       This PCRE2 pattern solves the nested parentheses  problem  (assume  the
+       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-
+       First it matches an opening parenthesis. Then it matches any number  of
+       substrings  which can either be a sequence of non-parentheses, or a re-
+       cursive match of the pattern itself (that is, a correctly parenthesized
+       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
+       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
+       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
+       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
+       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
+       Be aware however, that if duplicate capture group numbers are  in  use,
+       relative  references  refer  to the earliest group 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.
+       The first two capture 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,  rela-
+       tive 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.
+       It  is  also possible to refer to subsequent capture groups, 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 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-
@@ -8403,8 +8731,8 @@ RECURSIVE PATTERNS
 
          (?<pn> \( ( [^()]++ | (?&pn) )* \) )
 
-       If  there  is more than one subpattern with the same name, the earliest
-       one is used.
+       If there is more than one group 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
@@ -8426,10 +8754,10 @@ RECURSIVE PATTERNS
          (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.
+       which is the last value taken on at the top level. If a  capture  group
+       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.
 
        Do  not  confuse  the (?R) item with the condition (R), which tests for
        recursion.  Consider this pattern, which matches text in  angle  brack-
@@ -8439,16 +8767,16 @@ RECURSIVE PATTERNS
 
          < (?: (?(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.
+       In  this  pattern,  (?(R) is the start of a conditional group, 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
 
        Some former differences between PCRE2 and Perl no longer exist.
 
        Before  release 10.30, recursion processing in PCRE2 differed from Perl
-       in that a recursive subpattern call was always  treated  as  an  atomic
+       in that a recursive subroutine call was always  treated  as  an  atomic
        group.  That is, once it had matched some of the subject string, it was
        never re-entered, even if it contained untried alternatives  and  there
        was  a  subsequent matching failure. (Historical note: PCRE implemented
@@ -8460,54 +8788,53 @@ RECURSIVE PATTERNS
        now  compatible  with the way Perl works. If you want a subroutine call
        to be atomic, you must explicitly enclose it in an atomic group.
 
-       Supporting backtracking into recursions  simplifies  certain  types  of
-       recursive  pattern.  For  example,  this  pattern  matches  palindromic
-       strings:
+       Supporting backtracking into recursions simplifies certain types of re-
+       cursive pattern. For example, this pattern matches palindromic strings:
 
          ^((.)(?1)\2|.?)$
 
-       The second branch in the group matches a single  central  character  in
-       the  palindrome  when there are an odd number of characters, or nothing
-       when there are an even number of characters, but in order  to  work  it
-       has  to  be  able  to  try the second case when the rest of the pattern
+       The  second  branch  in the group matches a single central character in
+       the palindrome when there are an odd number of characters,  or  nothing
+       when  there  are  an even number of characters, but in order to work it
+       has to be able to try the second case when  the  rest  of  the  pattern
        match fails. If you want to match typical palindromic phrases, the pat-
-       tern  has  to  ignore  all  non-word characters, which can be done like
+       tern has to ignore all non-word characters,  which  can  be  done  like
        this:
 
          ^\W*+((.)\W*+(?1)\W*+\2|\W*+.?)\W*+$
 
-       If run with the PCRE2_CASELESS option,  this  pattern  matches  phrases
-       such  as "A man, a plan, a canal: Panama!". Note the use of the posses-
-       sive quantifier *+ to avoid backtracking  into  sequences  of  non-word
+       If  run  with  the  PCRE2_CASELESS option, this pattern matches phrases
+       such as "A man, a plan, a canal: Panama!". Note the use of the  posses-
+       sive  quantifier  *+  to  avoid backtracking 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
+       more)  to  match typical phrases, and Perl takes so long that you think
        it has gone into a loop.
 
-       Another  way  in which PCRE2 and Perl used to differ in their recursion
-       processing is in the handling of captured  values.  Formerly  in  Perl,
-       when  a  subpattern  was called recursively or as a subpattern (see the
-       next section), it had no access to any values that were  captured  out-
-       side  the  recursion,  whereas in PCRE2 these values can be referenced.
-       Consider this pattern:
+       Another way in which PCRE2 and Perl used to differ in  their  recursion
+       processing  is  in  the  handling of captured values. Formerly in Perl,
+       when a group was called recursively or as a subroutine  (see  the  next
+       section), it had no access to any values that were captured outside the
+       recursion, whereas in PCRE2 these values can  be  referenced.  Consider
+       this pattern:
 
          ^(.)(\1|a(?2))
 
-       This pattern matches "bab". The first capturing parentheses match  "b",
+       This  pattern matches "bab". The first capturing parentheses match "b",
        then in the second group, when the backreference \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. This match used
+       \1 does now match "b" and so the whole match succeeds. This match  used
        to fail in Perl, but in later versions (I tried 5.024) it now works.
 
 
-SUBPATTERNS AS SUBROUTINES
+GROUPS 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 a
-       bit like a subroutine in a programming language. More accurately, PCRE2
-       treats  the referenced subpattern as an independent subpattern which it
-       tries to match at the current matching position. The called  subpattern
-       may  be defined before or after the reference. A numbered reference can
-       be absolute or relative, as in these examples:
+       If  the syntax for a recursive group call (either by number or by name)
+       is used outside the parentheses to which it refers, it operates  a  bit
+       like  a  subroutine  in  a programming language. More accurately, PCRE2
+       treats the referenced group as an independent subpattern which it tries
+       to  match at the current matching position. The called group may be de-
+       fined before or after the reference. A numbered reference can be  abso-
+       lute or relative, as in these examples:
 
          (...(absolute)...)...(?2)...
          (...(relative)...)...(?-1)...
@@ -8517,106 +8844,106 @@ SUBPATTERNS AS SUBROUTINES
 
          (sens|respons)e and \1ibility
 
-       matches "sense and sensibility" and "response and responsibility",  but
+       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
+       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.
 
-       Like  recursions,  subroutine  calls  used to be treated as atomic, but
-       this changed at PCRE2 release 10.30, so  backtracking  into  subroutine
-       calls  can  now  occur. However, any capturing parentheses that are set
+       Like recursions, subroutine calls used to be  treated  as  atomic,  but
+       this  changed  at  PCRE2 release 10.30, so backtracking into subroutine
+       calls can now occur. However, 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:
+       Processing  options such as case-independence are fixed when a group 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.
+       It  matches  "abcabc". It does not match "abcABC" because the change of
+       processing option does not affect the called group.
 
-       The  behaviour of backtracking control verbs in subpatterns when called
-       as subroutines is described in the section entitled "Backtracking verbs
-       in subroutines" below.
+       The behaviour of backtracking control verbs in groups  when  called  as
+       subroutines is described in the section entitled "Backtracking verbs in
+       subroutines" below.
 
 
 ONIGURUMA SUBROUTINE SYNTAX
 
-       For  compatibility with Oniguruma, the non-Perl syntax \g followed by a
+       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:
+       an alternative syntax for calling a group as a subroutine, possibly re-
+       cursively.  Here  are  two  of the examples used above, rewritten 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
+       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 backreference; the latter is a subroutine
+       Note  that \g{...} (Perl syntax) and \g<...> (Oniguruma syntax) are not
+       synonymous. The former is a backreference; 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.
+       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
+       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
+       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
+       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
+       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,
+       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-
+       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
+       just  before the condition. An explicit callout may also be set at this
        position, as in this example:
 
          (?(?C9)(?=a)abc|def)
@@ -8626,25 +8953,26 @@ CALLOUTS
 
    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
+       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
+       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
+       The  doubling  is  removed  before  the string is passed to the callout
        function.
 
 
 BACKTRACKING CONTROL
 
-       There  are  a  number  of  special "Backtracking Control Verbs" (to use
-       Perl's terminology) that modify the behaviour  of  backtracking  during
-       matching.  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.
+       There are a number of special  "Backtracking  Control  Verbs"  (to  use
+       Perl's  terminology)  that  modify the behaviour of backtracking during
+       matching. They are generally of the form (*VERB) or (*VERB:NAME).  Some
+       verbs take either form, and may behave differently depending on whether
+       or not a name argument is present. The names are  not  required  to  be
+       unique within the pattern.
 
        By  default,  for  compatibility  with  Perl, a name is any sequence of
        characters that does not include a closing parenthesis. The name is not
@@ -8670,7 +8998,7 @@ BACKTRACKING CONTROL
        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.
+       tern. Except for (*ACCEPT), they may not be quantified.
 
        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-
@@ -8680,8 +9008,8 @@ BACKTRACKING CONTROL
        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.
+       capture  groups  called  as subroutines (whether or not recursively) is
+       documented below.
 
    Optimizations that affect backtracking verbs
 
@@ -8706,8 +9034,8 @@ BACKTRACKING CONTROL
           (*ACCEPT) or (*ACCEPT:NAME)
 
        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
+       of  the  pattern.  However,  when  it is inside a capture group that is
+       called as a subroutine, only that group 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.
@@ -8720,6 +9048,22 @@ BACKTRACKING CONTROL
        This matches "AB", "AAD", or "ACD"; when it matches "AB", "B"  is  cap-
        tured by the outer parentheses.
 
+       (*ACCEPT)  is  the only backtracking verb that is allowed to be quanti-
+       fied because an ungreedy quantification with a  minimum  of  zero  acts
+       only when a backtrack happens. Consider, for example,
+
+         (A(*ACCEPT)??B)C
+
+       where  A,  B, and C may be complex expressions. After matching "A", the
+       matcher processes "BC"; if that fails, causing a  backtrack,  (*ACCEPT)
+       is  triggered  and the match succeeds. In both cases, all but C is cap-
+       tured. Whereas (*COMMIT) (see below) means "fail on backtrack",  a  re-
+       peated (*ACCEPT) of this type means "succeed on backtrack".
+
+       Warning:  (*ACCEPT)  should  not be used within a script run group, be-
+       cause it causes an immediate exit from the group, bypassing the  script
+       run checking.
+
          (*FAIL) or (*FAIL:NAME)
 
        This  verb causes a matching failure, forcing backtracking to occur. It
@@ -8734,35 +9078,33 @@ BACKTRACKING CONTROL
        A match with the string "aaaa" always fails, but the callout  is  taken
        before each backtrack happens (in this example, 10 times).
 
-       (*ACCEPT:NAME)   and   (*FAIL:NAME)   behave   exactly   the   same  as
-       (*MARK:NAME)(*ACCEPT) and (*MARK:NAME)(*FAIL), respectively.
+       (*ACCEPT:NAME)  and  (*FAIL:NAME)  behave the same as (*MARK:NAME)(*AC-
+       CEPT) and (*MARK:NAME)(*FAIL), respectively,  that  is,  a  (*MARK)  is
+       recorded just before the verb acts.
 
    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).
+       There  is  one  verb whose main purpose is to track how a match was ar-
+       rived at, though it also has a secondary use in  conjunction  with  ad-
+       vancing 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.
+       A  name is always required with this verb. For all the other backtrack-
+       ing control verbs, a NAME argument is optional.
 
-       When a match succeeds, the name of the last-encountered (*MARK:NAME) on
+       When a match succeeds, the name of the last-encountered  mark  name  on
        the matching path is passed back to the caller as described in the sec-
        tion entitled "Other information about the match" in the pcre2api docu-
-       mentation.  This  applies  to all instances of (*MARK), including those
-       inside assertions and atomic groups. (There are  differences  in  those
-       cases  when  (*MARK)  is  used in conjunction with (*SKIP) as described
-       below.)
+       mentation.  This  applies  to all instances of (*MARK) and other verbs,
+       including those inside assertions and atomic groups. However, there are
+       differences  in  those  cases  when (*MARK) is used in conjunction with
+       (*SKIP) as described below.
 
-       As well as (*MARK), the (*COMMIT), (*PRUNE) and (*THEN) verbs may  have
-       associated  NAME  arguments.  Whichever is last on the matching path is
-       passed back. See below for more details of these other verbs.
-
-       Here is an example of  pcre2test  output,  where  the  "mark"  modifier
-       requests the retrieval and outputting of (*MARK) data:
+       The mark name that was last encountered on the matching path is  passed
+       back.  A verb without a NAME argument is ignored for this purpose. 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
@@ -8808,7 +9150,7 @@ BACKTRACKING CONTROL
        that is true, its effect is confined to that group,  because  once  the
        group  has been matched, there is never any backtracking into it. Back-
        tracking from beyond an assertion or an atomic group ignores the entire
-       group, and seeks a preceeding backtracking point.
+       group, and seeks a preceding backtracking point.
 
        These  verbs  differ  in exactly what kind of failure occurs when back-
        tracking reaches them. The behaviour described below  is  what  happens
@@ -8833,16 +9175,16 @@ BACKTRACKING CONTROL
        The  behaviour  of (*COMMIT:NAME) is not the same as (*MARK:NAME)(*COM-
        MIT). It is like (*MARK:NAME) in that the name is remembered for  pass-
        ing  back  to the caller. However, (*SKIP:NAME) searches only for names
-       set with  (*MARK),  ignoring  those  set  by  (*COMMIT),  (*PRUNE)  and
-       (*THEN).
+       that are set with (*MARK), ignoring those set by any of the other back-
+       tracking verbs.
 
        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
+       Note that (*COMMIT) at the start of a pattern is not the same as an an-
+       chor,  unless  PCRE2's  start-of-match optimizations are turned off, as
        shown in this output from pcre2test:
 
            re> /(*COMMIT)abc/
@@ -8878,7 +9220,7 @@ BACKTRACKING CONTROL
        The behaviour of (*PRUNE:NAME) is 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 (*COMMIT), (*PRUNE) or (*THEN).
+       (*MARK), ignoring those set by other backtracking verbs.
 
          (*SKIP)
 
@@ -8895,21 +9237,26 @@ BACKTRACKING CONTROL
        (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
+       suppress backtracking during the first match attempt,  the  second  at-
+       tempt  would  start  at  the second character instead of skipping on to
        "c".
 
+       If (*SKIP) is used to specify a new starting position that is the  same
+       as  the  starting  position of the current match, or (by being inside a
+       lookbehind) earlier, the position specified by (*SKIP) is ignored,  and
+       instead the normal "bumpalong" occurs.
+
          (*SKIP:NAME)
 
-       When (*SKIP) has an associated name, its behaviour  is  modified.  When
-       such  a  (*SKIP) 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 corre-
-       sponds to that (*MARK) instead of to where (*SKIP) was encountered.  If
+       When  (*SKIP)  has  an associated name, its behaviour is modified. When
+       such a (*SKIP) 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  corre-
+       sponds  to that (*MARK) instead of to where (*SKIP) was encountered. If
        no (*MARK) with a matching name is found, the (*SKIP) is ignored.
 
-       The  search  for a (*MARK) name uses the normal backtracking mechanism,
-       which means that it does not  see  (*MARK)  settings  that  are  inside
+       The search for a (*MARK) name uses the normal  backtracking  mechanism,
+       which  means  that  it  does  not  see (*MARK) settings that are inside
        atomic groups or assertions, because they are never re-entered by back-
        tracking. Compare the following pcre2test examples:
 
@@ -8923,19 +9270,18 @@ BACKTRACKING CONTROL
           0: b
           1: b
 
-       In the first example, the (*MARK) setting is in an atomic group, so  it
+       In  the first example, the (*MARK) setting is in an atomic group, so it
        is not seen when (*SKIP:X) triggers, causing the (*SKIP) to be ignored.
-       This allows the second branch of the pattern to be tried at  the  first
-       character  position.  In the second example, the (*MARK) setting is not
-       in an atomic group. This allows (*SKIP:X) to find the (*MARK)  when  it
+       This  allows  the second branch of the pattern to be tried at the first
+       character position.  In the second example, the (*MARK) setting is  not
+       in  an  atomic group. This allows (*SKIP:X) to find the (*MARK) when it
        backtracks, and this causes a new matching attempt to start at the sec-
-       ond character. This time, the (*MARK) is never seen  because  "a"  does
+       ond  character.  This  time, the (*MARK) is never seen because "a" does
        not match "b", so the matcher immediately jumps to the second branch of
        the pattern.
 
-       Note that (*SKIP:NAME) searches only for names set by (*MARK:NAME).  It
-       ignores   names  that  are  set  by  (*COMMIT:NAME),  (*PRUNE:NAME)  or
-       (*THEN:NAME).
+       Note  that (*SKIP:NAME) searches only for names set by (*MARK:NAME). It
+       ignores names that are set by other backtracking verbs.
 
          (*THEN) or (*THEN:NAME)
 
@@ -8951,50 +9297,50 @@ BACKTRACKING CONTROL
        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).
+       track to whatever came before the entire group. If (*THEN) is  not  in-
+       side an alternation, it acts like (*PRUNE).
 
        The  behaviour  of (*THEN:NAME) is 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 (*COMMIT), (*PRUNE) and (*THEN).
+       (*MARK), ignoring those set by other backtracking verbs.
 
-       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
+       A group that does not contain a | character is just a part of  the  en-
+       closing  alternative;  it is not a nested alternation with only one al-
+       ternative. The effect of (*THEN) extends beyond such a group to the en-
+       closing  alternative.  Consider this pattern, where A, B, etc. are com-
+       plex 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:
+       However,  if  the  group 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.
+       The effect of (*THEN) is now confined to the inner group. After a fail-
+       ure  in  C,  matching moves to (*FAIL), which causes the whole group to
+       fail because there are no more  alternatives  to  try.  In  this  case,
+       matching does 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:
+       Note  that a conditional group is not considered as having two alterna-
+       tives, because only one is ever used. In other words, the  |  character
+       in  a  conditional group 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.)
+       If the subject is "ba", this pattern does not match. Because .*? is un-
+       greedy,  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 group 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
@@ -9041,24 +9387,32 @@ BACKTRACKING CONTROL
        (*FAIL)  in any assertion has its normal effect: it forces an immediate
        backtrack. The behaviour of the other  backtracking  verbs  depends  on
        whether  or  not the assertion is standalone or acting as the condition
-       in a conditional subpattern.
+       in a conditional group.
 
        (*ACCEPT) in a standalone positive assertion causes  the  assertion  to
-       succeed  without any further processing; captured strings and a (*MARK)
-       name (if  set)  are  retained.  In  a  standalone  negative  assertion,
-       (*ACCEPT)  causes the assertion to fail without any further processing;
-       captured substrings and any (*MARK) name are discarded.
+       succeed  without  any  further  processing; captured strings and a mark
+       name (if set) are retained. In a standalone negative  assertion,  (*AC-
+       CEPT) causes the assertion to fail without any further processing; cap-
+       tured substrings and any mark name are discarded.
 
        If the assertion is a condition, (*ACCEPT) causes the condition  to  be
        true  for  a  positive assertion and false for a negative one; captured
        substrings are retained in both cases.
 
        The remaining verbs act only when a later failure causes a backtrack to
-       reach  them. This means that their effect is confined to the assertion,
-       because lookaround assertions are atomic. A backtrack that occurs after
-       an assertion is complete does not jump back into the assertion. Note in
-       particular that a (*MARK) name that is  set  in  an  assertion  is  not
-       "seen" by an instance of (*SKIP:NAME) latter in the pattern.
+       reach  them. This means that, for the Perl-compatible assertions, their
+       effect is confined to the assertion, because Perl lookaround assertions
+       are atomic. A backtrack that occurs after such an assertion is complete
+       does not jump back into  the  assertion.  Note  in  particular  that  a
+       (*MARK)  name  that is set in an assertion is not "seen" by an instance
+       of (*SKIP:NAME) later in the pattern.
+
+       PCRE2 now supports non-atomic positive assertions, as described in  the
+       section  entitled  "Non-atomic assertions" above. These assertions must
+       be standalone (not used as conditions). They are  not  Perl-compatible.
+       For  these assertions, a later backtrack does jump back into the asser-
+       tion, and therefore verbs such as (*COMMIT) can be triggered  by  back-
+       tracks from later in the pattern.
 
        The  effect of (*THEN) is not allowed to escape beyond an assertion. If
        there are no more branches to try, (*THEN) causes a positive  assertion
@@ -9074,26 +9428,24 @@ BACKTRACKING CONTROL
 
    Backtracking verbs in subroutines
 
-       These  behaviours  occur whether or not the subpattern is called recur-
-       sively.
+       These behaviours occur whether or not the group is called recursively.
 
-       (*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. Perl documents  this  behaviour.  Perl's
-       treatment of the other verbs in subroutines is different in some cases.
+       (*ACCEPT) in a group called as a subroutine causes the subroutine match
+       to succeed without any further processing. Matching then continues  af-
+       ter  the  subroutine call. Perl documents this behaviour. Perl's treat-
+       ment of the other verbs in subroutines is different in some cases.
 
-       (*FAIL)  in  a subpattern called as a subroutine has its normal effect:
-       it forces an immediate backtrack.
+       (*FAIL) in a group called as a subroutine has  its  normal  effect:  it
+       forces an immediate backtrack.
 
-       (*COMMIT), (*SKIP), and (*PRUNE) cause the  subroutine  match  to  fail
-       when triggered by being backtracked to in a subpattern called as a sub-
-       routine. There is then a backtrack at the outer level.
+       (*COMMIT),  (*SKIP),  and  (*PRUNE)  cause the subroutine match to fail
+       when triggered by being backtracked to in a group called as  a  subrou-
+       tine. There is then a backtrack at the outer level.
 
        (*THEN), when triggered, skips to the next alternative in the innermost
-       enclosing group within the subpattern that has alternatives (its normal
-       behaviour). However, if there is no such group  within  the  subroutine
-       subpattern,  the subroutine match fails and there is a backtrack at the
-       outer level.
+       enclosing group that has alternatives (its normal behaviour).  However,
+       if there is no such group within the subroutine's group, the subroutine
+       match fails and there is a backtrack at the outer level.
 
 
 SEE ALSO
@@ -9111,8 +9463,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 04 September 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 29 July 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -9136,9 +9488,9 @@ COMPILED PATTERN MEMORY USAGE
        code, so that most simple patterns do not use much memory  for  storing
        the compiled version. 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 lim-
-       ited maximum, the whole subpattern is repeated in  the  compiled  code.
-       For example, the pattern
+       group  has  a quantifier with a minimum greater than 1 and/or a limited
+       maximum, the whole group is repeated in the compiled code. For example,
+       the pattern
 
          (abc|def){2,4}
 
@@ -9195,9 +9547,9 @@ STACK AND HEAP USAGE AT RUN TIME
        also reduce the memory requirements.
 
        In contrast to  pcre2_match(),  pcre2_dfa_match()  does  use  recursive
-       function  calls,  but  only  for  processing  atomic groups, lookaround
-       assertions, and recursion within the pattern. The original  version  of
-       the code used to allocate quite large internal workspace vectors on the
+       function  calls,  but only for processing atomic groups, lookaround as-
+       sertions, and recursion within the pattern. The original version of the
+       code  used  to  allocate  quite large internal workspace vectors on the
        stack, which caused some problems for  some  patterns  in  environments
        with  small  stacks.  From release 10.32 the code for pcre2_dfa_match()
        has been re-factored to use heap memory  when  necessary  for  internal
@@ -9217,8 +9569,8 @@ PROCESSING TIME
        (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.
+       expressions for efficient performance. This document contains a few ob-
+       servations 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
@@ -9239,11 +9591,11 @@ PROCESSING TIME
        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).
+       tion can be disabled by the PCRE2_NO_DOTSTAR_ANCHOR option, and is  au-
+       tomatically 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
+       If  PCRE2_DOTALL  is  not set, PCRE2 cannot make this optimization, be-
+       cause 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
@@ -9257,8 +9609,8 @@ PROCESSING TIME
 
        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-
+       PCRE2_DOTALL, or starting the pattern with ^.* or ^.*? to indicate  ex-
+       plicit  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
@@ -9272,8 +9624,8 @@ PROCESSING TIME
        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.
+       in  principle to try every possible variation, and this can take an ex-
+       tremely long time, even for relatively short strings.
 
        An optimization catches some of the more simple cases such as
 
@@ -9327,8 +9679,8 @@ PROCESSING TIME
        matching,  and  on  the amount of heap memory that is used. 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() or pcre2_dfa_match() is  called.  For  details  of  these
-       interfaces,  see  the pcre2build documentation and the section entitled
+       pcre2_match() or pcre2_dfa_match() is called. For details of these  in-
+       terfaces,  see  the  pcre2build  documentation and the section entitled
        "The match context" in the pcre2api documentation.
 
        The pcre2test test program has a modifier called  "find_limits"  which,
@@ -9346,8 +9698,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 25 April 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 03 February 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -9362,33 +9714,56 @@ SYNOPSIS
 
        #include <pcre2posix.h>
 
-       int regcomp(regex_t *preg, const char *pattern,
+       int pcre2_regcomp(regex_t *preg, const char *pattern,
             int cflags);
 
-       int regexec(const regex_t *preg, const char *string,
+       int pcre2_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,
+       size_t pcre2_regerror(int errcode, const regex_t *preg,
             char *errbuf, size_t errbuf_size);
 
-       void regfree(regex_t *preg);
+       void pcre2_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 are no POSIX-style wrappers 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.
+       expression 8-bit library. There are no POSIX-style wrappers for PCRE2's
+       16-bit  and  32-bit libraries. See the pcre2api documentation for a de-
+       scription of PCRE2's native API, which contains much  additional  func-
+       tionality.
+
+       The functions described here are wrapper functions that ultimately call
+       the PCRE2 native API. Their prototypes are defined in the  pcre2posix.h
+       header  file, and they all have unique names starting with pcre2_. How-
+       ever, the pcre2posix.h header also contains macro definitions that con-
+       vert  the standard POSIX names such regcomp() into pcre2_regcomp() etc.
+       This means that a program can use the usual POSIX names without running
+       the  risk of accidentally linking with POSIX functions from a different
+       library.
+
+       On Unix-like systems the PCRE2 POSIX library is called  libpcre2-posix,
+       so  can  be accessed by adding -lpcre2-posix to the command for linking
+       an application. Because the POSIX functions call the native ones, it is
+       also necessary to add -lpcre2-8.
+
+       Although  they are not defined as protypes in pcre2posix.h, the library
+       does contain functions with the POSIX names regcomp() etc. These simply
+       pass  their  arguments to the PCRE2 functions. These functions are pro-
+       vided for backwards compatibility with earlier versions  of  PCRE2,  so
+       that existing programs do not have to be recompiled.
+
+       Calling  the  header  file  pcre2posix.h avoids any conflict with other
+       POSIX libraries. It can, of course, be renamed or aliased  as  regex.h,
+       which  is  the  "correct"  name,  if there is no clash. It provides two
+       structure types, regex_t for compiled internal  forms,  and  regmatch_t
+       for returning captured substrings. It also defines some constants whose
+       names start with "REG_"; these are used for setting options and identi-
+       fying error codes.
+
+
+USING THE POSIX FUNCTIONS
 
        Those  POSIX  option bits that can reasonably be mapped to PCRE2 native
        options have been implemented. In addition, the option REG_EXTENDED  is
@@ -9410,23 +9785,19 @@ DESCRIPTION
        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.
+       The  descriptions  below use the actual names of the functions, but, as
+       described above, the standard POSIX names (without the  pcre2_  prefix)
+       may also be used.
 
 
 COMPILING A PATTERN
 
-       The  function regcomp() is called to compile a pattern into an internal
-       form. By default, the pattern is a C string terminated by a binary zero
-       (but  see  REG_PEND below). The preg argument is a pointer to a regex_t
-       structure that is used as a base for storing information about the com-
-       piled  regular  expression. (It is also used for input when REG_PEND is
-       set.)
+       The function pcre2_regcomp() is called to compile a pattern into an in-
+       ternal form. By default, the pattern is a C string terminated by a  bi-
+       nary zero (but see REG_PEND below). 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.  (It  is  also  used for input when
+       REG_PEND is set.)
 
        The argument cflags is either zero, or contains one or more of the bits
        defined by the following macros:
@@ -9460,21 +9831,23 @@ COMPILING A PATTERN
 
          REG_NOSUB
 
-       When a pattern that is compiled with this flag is passed  to  regexec()
-       for  matching, the nmatch and pmatch arguments are ignored, and no cap-
-       tured strings are returned. Versions of the PCRE library prior to 10.22
-       used  to  set  the  PCRE2_NO_AUTO_CAPTURE  compile  option, but this no
-       longer happens because it disables the use of backreferences.
+       When  a  pattern  that  is  compiled  with  this  flag  is  passed   to
+       pcre2_regexec()  for  matching, the nmatch and pmatch arguments are ig-
+       nored, and no captured strings are returned. Versions of the  PCRE  li-
+       brary  prior to 10.22 used to set the PCRE2_NO_AUTO_CAPTURE compile op-
+       tion, but this no longer happens because it disables the use  of  back-
+       references.
 
          REG_PEND
 
-       If this option is set, the reg_endp field in the preg structure  (which
+       If  this option is set, the reg_endp field in the preg structure (which
        has the type const char *) must be set to point to the character beyond
-       the end of the pattern before calling regcomp(). The pattern itself may
-       now contain binary zeros, which are treated as data characters. Without
-       REG_PEND, a binary zero terminates the pattern and the re_endp field is
-       ignored.  This  is  a GNU extension to the POSIX standard and should be
-       used with caution in software intended to be portable to other systems.
+       the  end of the pattern before calling pcre2_regcomp(). The pattern it-
+       self may now contain binary zeros, which are treated  as  data  charac-
+       ters.  Without  REG_PEND,  a binary zero terminates the pattern and the
+       re_endp field is ignored. This is a GNU extension to the POSIX standard
+       and  should be used with caution in software intended to be portable to
+       other systems.
 
          REG_UCP
 
@@ -9497,30 +9870,31 @@ COMPILING A PATTERN
        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
+       function.   This means the the regex is compiled with PCRE2 default se-
+       mantics. 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 other member of the
-       structure (as well as re_endp) is public: re_nsub contains  the  number
-       of capturing subpatterns in the regular expression. Various error codes
-       are defined in the header file.
+       The yield of pcre2_regcomp() is zero on success,  and  non-zero  other-
+       wise.  The preg structure is filled in on success, and one other member
+       of the structure (as well as re_endp) is public: re_nsub  contains  the
+       number  of capturing subpatterns in the regular expression. Various er-
+       ror 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.
+       NOTE: If the yield of pcre2_regcomp() is non-zero, you must not attempt
+       to use the contents of the preg structure. If, for example, you pass it
+       to pcre2_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
+       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
+       lists the different possibilities for matching  newline  characters  in
        Perl and PCRE2:
 
                                  Default   Change with
@@ -9541,25 +9915,25 @@ MATCHING NEWLINE CHARACTERS
          $ 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
+       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.
+       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 ac-
+       tion.  When  using  the  POSIX  API,  passing  REG_NEWLINE  to  PCRE2's
+       pcre2_regcomp()  function  causes  PCRE2_MULTILINE  to  be  passed   to
+       pcre2_compile(), and REG_DOTALL passes PCRE2_DOTALL. There is no way to
+       pass PCRE2_DOLLAR_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
+       The function pcre2_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
@@ -9569,9 +9943,9 @@ MATCHING A PATTERN
 
          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-
+       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
@@ -9581,32 +9955,33 @@ MATCHING A PATTERN
 
          REG_STARTEND
 
-       When  this  option  is  set,  the  subject  string  starts  at string +
-       pmatch[0].rm_so and ends at  string  +  pmatch[0].rm_eo,  which  should
-       point  to  the  first  character beyond the string. There may be binary
-       zeros within the subject string, and indeed, using REG_STARTEND is  the
+       When this option  is  set,  the  subject  string  starts  at  string  +
+       pmatch[0].rm_so  and  ends  at  string  + pmatch[0].rm_eo, which should
+       point to the first character beyond the string. There may be binary ze-
+       ros  within  the  subject string, and indeed, using REG_STARTEND is the
        only way to pass a subject string that contains a binary zero.
 
-       Whatever  the  value  of  pmatch[0].rm_so,  the  offsets of the matched
-       string and any captured substrings are  still  given  relative  to  the
-       start  of  string  itself. (Before PCRE2 release 10.30 these were given
-       relative to string +  pmatch[0].rm_so,  but  this  differs  from  other
-       implementations.)
-
-       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  and
-       length  of  the string, not how it is matched. Setting REG_STARTEND and
-       passing pmatch as NULL are mutually exclusive; the error REG_INVARG  is
+       Whatever the value of  pmatch[0].rm_so,  the  offsets  of  the  matched
+       string  and  any  captured  substrings  are still given relative to the
+       start of string itself. (Before PCRE2 release 10.30  these  were  given
+       relative  to  string + pmatch[0].rm_so, but this differs from other im-
+       plementations.)
+
+       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 and
+       length 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 (except possibly as input for REG_STARTEND).
+       If the pattern was compiled with the REG_NOSUB flag, no data about  any
+       matched  strings  is  returned.  The  nmatch  and  pmatch  arguments of
+       pcre2_regexec() are ignored (except possibly  as  input  for  REG_STAR-
+       TEND).
 
-       The  value  of  nmatch  may  be  zero, and the value pmatch may be NULL
-       (unless REG_STARTEND is set); in both these cases  no  data  about  any
+       The  value of nmatch may be zero, and the value pmatch may be NULL (un-
+       less REG_STARTEND is set); in  both  these  cases  no  data  about  any
        matched strings is returned.
 
        Otherwise,  the  portion  of  the string that was matched, and also any
@@ -9619,29 +9994,29 @@ MATCHING A PATTERN
        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.
+       A  successful  match  yields a zero return; various error codes are de-
+       fined in the header file, of which REG_NOMATCH is the "expected"  fail-
+       ure 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.
+       The  pcre2_regerror()  function  maps  a non-zero errorcode from either
+       pcre2_regcomp() or pcre2_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  buf-
+       fer  is too short, only the first errbuf_size - 1 characters of the er-
+       ror 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.
+       ciated  with the preg structure. The function pcre2_regfree() frees all
+       such memory, after which preg may no longer be used as a  compiled  ex-
+       pression.
 
 
 AUTHOR
@@ -9653,8 +10028,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 15 June 2017
-       Copyright (c) 1997-2017 University of Cambridge.
+       Last updated: 30 January 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
@@ -9701,8 +10076,8 @@ PCRE2 SAMPLE PROGRAM
 
        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:
+       installed  in /usr/local, you can compile the demonstration program us-
+       ing a command like this:
 
          cc -o pcre2demo -I/usr/local/include pcre2demo.c \
             -L/usr/local/lib -lpcre2-8
@@ -9714,8 +10089,8 @@ PCRE2 SAMPLE PROGRAM
          ./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 all three PCRE2 libraries (8-bit, 16-bit, and 32-bit,
+       pcre2test, which supports many more facilities for testing regular  ex-
+       pressions  using  all three PCRE2 libraries (8-bit, 16-bit, and 32-bit,
        though not all three need be installed). The pcre2demo program is  pro-
        vided as a relatively simple coding example.
 
@@ -9851,26 +10226,26 @@ SAVING COMPILED PATTERNS
          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
+       the 256 possible byte values. On systems that make  a  distinction  be-
+       tween  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(). If this function is  called  with  a  NULL  argument,  it
-       returns immediately without doing anything.
+       alize_free(). If this function is called with a NULL argument,  it  re-
+       turns immediately without doing anything.
 
 
 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:
+       In  order to re-use a set of saved patterns you must first make the se-
+       rialized byte stream available in main memory (for example, by  reading
+       from a file). The management of this memory block is up to the applica-
+       tion. 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);
@@ -9878,8 +10253,8 @@ RE-USING PRECOMPILED PATTERNS
        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
+       and its length, and the third argument points to a byte stream. The fi-
+       nal 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.
@@ -9891,9 +10266,9 @@ RE-USING PRECOMPILED PATTERNS
            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:
+       stream, it is filled with those that fit, and  the  remainder  are  ig-
+       nored.  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
@@ -9907,9 +10282,9 @@ RE-USING PRECOMPILED PATTERNS
 
        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
+       potential  race  issue if you are using multiple patterns that were de-
+       coded from a single byte stream in a multithreaded application. A  sin-
+       gle  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()
@@ -9959,7 +10334,8 @@ QUOTING
 
 ESCAPED CHARACTERS
 
-       This table applies to ASCII and Unicode environments.
+       This  table  applies to ASCII and Unicode environments. An unrecognized
+       escape sequence causes an error.
 
          \a         alarm, that is, the BEL character (hex 07)
          \cx        "control-x", where x is any ASCII printing character
@@ -9971,26 +10347,32 @@ ESCAPED CHARACTERS
          \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)
          \N{U+hh..} character with Unicode code point hh.. (Unicode mode only)
-         \uhhhh     character with hex code hhhh (if PCRE2_ALT_BSUX is set)
          \xhh       character with hex code hh
          \x{hh..}   character with hex code hh..
 
+       If PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set ("ALT_BSUX mode"), the
+       following are also recognized:
+
+         \U         the character "U"
+         \uhhhh     character with hex code hhhh
+         \u{hh..}   character with hex code hh.. but only for EXTRA_ALT_BSUX
+
+       When  \x  is not followed by {, from zero to two hexadecimal digits are
+       read, but in ALT_BSUX mode \x must be followed by two hexadecimal  dig-
+       its  to  be  recognized as a hexadecimal escape; otherwise it matches a
+       literal "x".  Likewise, if \u (in ALT_BSUX mode)  is  not  followed  by
+       four  hexadecimal  digits or (in EXTRA_ALT_BSUX mode) a sequence of hex
+       digits in curly brackets, it matches a literal "u".
+
        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.
+       lowed  by  a non-zero digit is complicated; for details see the section
+       "Non-printing characters" in the pcre2pattern documentation, where  de-
+       tails  of  escape  processing  in  EBCDIC  environments are also given.
        \N{U+hh..} is synonymous with \x{hh..} in PCRE2 but is not supported in
-       EBCDIC environments. Note that \N not  followed  by  an  opening  curly
+       EBCDIC  environments.  Note  that  \N  not followed by an opening curly
        bracket has a different meaning (see below).
 
-       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
 
@@ -10013,14 +10395,14 @@ CHARACTER TYPES
          \W         a "non-word" character
          \X         a Unicode extended grapheme cluster
 
-       \C  is dangerous because it may leave the current matching point in the
+       \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
+       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
+       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
+       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.
@@ -10089,29 +10471,30 @@ PCRE2 SPECIAL CATEGORY PROPERTIES FOR \p and \P
 
 SCRIPT NAMES FOR \p AND \P
 
-       Adlam, Ahom, Anatolian_Hieroglyphs, Arabic,  Armenian,  Avestan,  Bali-
-       nese,  Bamum,  Bassa_Vah,  Batak, Bengali, Bhaiksuki, Bopomofo, Brahmi,
-       Braille, Buginese, Buhid, Canadian_Aboriginal, Carian,  Caucasian_Alba-
-       nian,  Chakma,  Cham,  Cherokee,  Common,  Coptic,  Cuneiform, Cypriot,
-       Cyrillic, Deseret, Devanagari, Dogra,  Duployan,  Egyptian_Hieroglyphs,
-       Elbasan,   Ethiopic,  Georgian,  Glagolitic,  Gothic,  Grantha,  Greek,
-       Gujarati,  Gunjala_Gondi,  Gurmukhi,  Han,   Hangul,   Hanifi_Rohingya,
-       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,  Makasar, Malayalam, Mandaic, Manichaean, Marchen, Masaram_Gondi,
-       Medefaidrin,     Meetei_Mayek,     Mende_Kikakui,     Meroitic_Cursive,
-       Meroitic_Hieroglyphs,  Miao,  Modi,  Mongolian,  Mro, Multani, Myanmar,
-       Nabataean, New_Tai_Lue, Newa, Nko, Nushu, Ogham, Ol_Chiki,  Old_Hungar-
-       ian,  Old_Italic,  Old_North_Arabian, Old_Permic, Old_Persian, Old_Sog-
-       dian,   Old_South_Arabian,   Old_Turkic,   Oriya,    Osage,    Osmanya,
-       Pahawh_Hmong,    Palmyrene,    Pau_Cin_Hau,    Phags_Pa,    Phoenician,
-       Psalter_Pahlavi, Rejang, Runic, Samaritan,  Saurashtra,  Sharada,  Sha-
-       vian,  Siddham,  SignWriting,  Sinhala, Sogdian, Sora_Sompeng, Soyombo,
-       Sundanese, Syloti_Nagri, Syriac, Tagalog, Tagbanwa,  Tai_Le,  Tai_Tham,
-       Tai_Viet,  Takri,  Tamil,  Tangut, Telugu, Thaana, Thai, Tibetan, Tifi-
-       nagh, Tirhuta, Ugaritic, Vai, Warang_Citi, Yi, Zanabazar_Square.
+       Adlam,  Ahom,  Anatolian_Hieroglyphs,  Arabic, Armenian, Avestan, Bali-
+       nese, Bamum, Bassa_Vah, Batak, Bengali,  Bhaiksuki,  Bopomofo,  Brahmi,
+       Braille,  Buginese, Buhid, Canadian_Aboriginal, Carian, Caucasian_Alba-
+       nian, Chakma,  Cham,  Cherokee,  Common,  Coptic,  Cuneiform,  Cypriot,
+       Cyrillic,  Deseret,  Devanagari, Dogra, Duployan, Egyptian_Hieroglyphs,
+       Elbasan, Elymaic,  Ethiopic,  Georgian,  Glagolitic,  Gothic,  Grantha,
+       Greek, Gujarati, Gunjala_Gondi, Gurmukhi, Han, Hangul, Hanifi_Rohingya,
+       Hanunoo, Hatran, Hebrew,  Hiragana,  Imperial_Aramaic,  Inherited,  In-
+       scriptional_Pahlavi, Inscriptional_Parthian, Javanese, Kaithi, Kannada,
+       Katakana, Kayah_Li, Kharoshthi, Khmer, Khojki, Khudawadi,  Lao,  Latin,
+       Lepcha,  Limbu,  Linear_A,  Linear_B,  Lisu,  Lycian, Lydian, Mahajani,
+       Makasar, Malayalam, Mandaic, Manichaean, Marchen, Masaram_Gondi,  Mede-
+       faidrin, Meetei_Mayek, Mende_Kikakui, Meroitic_Cursive, Meroitic_Hiero-
+       glyphs, Miao, Modi, Mongolian, Mro, Multani, Myanmar, Nabataean, Nandi-
+       nagari,  New_Tai_Lue,  Newa,  Nko, Nushu, Nyakeng_Puachue_Hmong, Ogham,
+       Ol_Chiki,  Old_Hungarian,  Old_Italic,  Old_North_Arabian,  Old_Permic,
+       Old_Persian,  Old_Sogdian, Old_South_Arabian, Old_Turkic, Oriya, Osage,
+       Osmanya, Pahawh_Hmong, Palmyrene,  Pau_Cin_Hau,  Phags_Pa,  Phoenician,
+       Psalter_Pahlavi,  Rejang,  Runic,  Samaritan, Saurashtra, Sharada, Sha-
+       vian, Siddham, SignWriting, Sinhala,  Sogdian,  Sora_Sompeng,  Soyombo,
+       Sundanese,  Syloti_Nagri,  Syriac, Tagalog, Tagbanwa, Tai_Le, Tai_Tham,
+       Tai_Viet, Takri, Tamil, Tangut, Telugu, Thaana,  Thai,  Tibetan,  Tifi-
+       nagh,   Tirhuta,   Ugaritic,   Vai,   Wancho,   Warang_Citi,  Yi,  Zan-
+       abazar_Square.
 
 
 CHARACTER CLASSES
@@ -10193,18 +10576,23 @@ ALTERNATION
 
 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
+         (...)           capture group
+         (?<name>...)    named capture group (Perl)
+         (?'name'...)    named capture group (Perl)
+         (?P<name>...)   named capture group (Python)
+         (?:...)         non-capture group
+         (?|...)         non-capture group; reset group numbers for
+                          capture groups in each alternative
+
+       In non-UTF modes, names may contain underscores and ASCII  letters  and
+       digits;  in  UTF  modes, any Unicode letters and Unicode decimal digits
+       are permitted. In both cases, a name must not start with a digit.
 
 
 ATOMIC GROUPS
 
-         (?>...)         atomic, non-capturing group
+         (?>...)         atomic non-capture group
+         (*atomic:...)   atomic non-capture group
 
 
 COMMENT
@@ -10231,11 +10619,11 @@ OPTION SETTING
        a mixture of setting and unsetting such as (?i-x) is allowed, but there
        may be only one hyphen. Setting (but no unsetting) is allowed after (?^
        for example (?^in). An option setting may appear at the start of a non-
-       capturing group, for example (?i:...).
+       capture group, for example (?i:...).
 
-       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. For the first three, d is a decimal number.
+       The following are recognized only at the very start of a pattern or af-
+       ter one of the newline or \R options with similar syntax. More than one
+       of them may appear. For the first three, d is a decimal number.
 
          (*LIMIT_DEPTH=d) set the backtracking limit to d
          (*LIMIT_HEAP=d)  set the heap size limit to d * 1024 bytes
@@ -10259,8 +10647,8 @@ OPTION SETTING
 
 NEWLINE CONVENTION
 
-       These are recognized only at the very start of  the  pattern  or  after
-       option settings with a similar syntax.
+       These are recognized only at the very start of the pattern or after op-
+       tion settings with a similar syntax.
 
          (*CR)           carriage return only
          (*LF)           linefeed only
@@ -10272,8 +10660,8 @@ NEWLINE CONVENTION
 
 WHAT \R MATCHES
 
-       These  are  recognized  only  at the very start of the pattern or after
-       option setting with a similar syntax.
+       These are recognized only at the very start of the pattern or after op-
+       tion setting with a similar syntax.
 
          (*BSR_ANYCRLF)  CR, LF, or CRLF
          (*BSR_UNICODE)  any Unicode newline sequence
@@ -10281,12 +10669,43 @@ WHAT \R MATCHES
 
 LOOKAHEAD AND LOOKBEHIND ASSERTIONS
 
-         (?=...)         positive look ahead
-         (?!...)         negative look ahead
-         (?<=...)        positive look behind
-         (?<!...)        negative look behind
+         (?=...)                     )
+         (*pla:...)                  ) positive lookahead
+         (*positive_lookahead:...)   )
+
+         (?!...)                     )
+         (*nla:...)                  ) negative lookahead
+         (*negative_lookahead:...)   )
 
-       Each top-level branch of a look behind must be of a fixed length.
+         (?<=...)                    )
+         (*plb:...)                  ) positive lookbehind
+         (*positive_lookbehind:...)  )
+
+         (?<!...)                    )
+         (*nlb:...)                  ) negative lookbehind
+         (*negative_lookbehind:...)  )
+
+       Each top-level branch of a lookbehind must be of a fixed length.
+
+
+NON-ATOMIC LOOKAROUND ASSERTIONS
+
+       These assertions are specific to PCRE2 and are not Perl-compatible.
+
+         (*napla:...)
+         (*non_atomic_positive_lookahead:...)
+
+         (*naplb:...)
+         (*non_atomic_positive_lookbehind:...)
+
+
+SCRIPT RUNS
+
+         (*script_run:...)           ) script run, can be backtracked into
+         (*sr:...)                   )
+
+         (*atomic_script_run:...)    ) atomic script run
+         (*asr:...)                  )
 
 
 BACKREFERENCES
@@ -10308,19 +10727,19 @@ BACKREFERENCES
 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)
+         (?n)            call subroutine by absolute number
+         (?+n)           call subroutine by relative number
+         (?-n)           call subroutine by relative number
+         (?&name)        call subroutine by name (Perl)
+         (?P>name)       call subroutine by name (Python)
+         \g<name>        call subroutine by name (Oniguruma)
+         \g'name'        call subroutine by name (Oniguruma)
+         \g<n>           call subroutine by absolute number (Oniguruma)
+         \g'n'           call subroutine by absolute number (Oniguruma)
+         \g<+n>          call subroutine by relative number (PCRE2 extension)
+         \g'+n'          call subroutine by relative number (PCRE2 extension)
+         \g<-n>          call subroutine by relative number (PCRE2 extension)
+         \g'-n'          call subroutine by relative number (PCRE2 extension)
 
 
 CONDITIONAL PATTERNS
@@ -10337,7 +10756,7 @@ CONDITIONAL PATTERNS
          (?(R)               overall recursion condition
          (?(Rn)              specific numbered group recursion condition
          (?(R&name)          specific named group recursion condition
-         (?(DEFINE)          define subpattern for reference
+         (?(DEFINE)          define groups for reference
          (?(VERSION[>]=n.m)  test PCRE2 version
          (?(assert)          assertion condition
 
@@ -10401,8 +10820,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 02 September 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 29 July 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
 
 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.  There  are
-       also  some  other  changes  to the way characters are handled, as docu-
-       mented below.
+       PCRE2 is normally built with Unicode support, though if you do not need
+       it, you can build it  without,  in  which  case  the  library  will  be
+       smaller. With Unicode support, PCRE2 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), but this is not the default.
+       Unless specifically requested, PCRE2 treats each code unit in a  string
+       as one character.
+
+       There  are two ways of telling PCRE2 to switch to UTF mode, where char-
+       acters may consist of more than one code unit and the range  of  values
+       is constrained. The program can call pcre2_compile() with the PCRE2_UTF
+       option, or the pattern may start with the  sequence  (*UTF).   However,
+       the  latter  facility  can be locked out by the PCRE2_NEVER_UTF option.
+       That is, the programmer can prevent the supplier of  the  pattern  from
+       switching to UTF mode.
 
-       If you do not need Unicode support you can build PCRE2 without  it,  in
-       which case the library will be smaller.
+       Note   that  the  PCRE2_MATCH_INVALID_UTF  option  (see  below)  forces
+       PCRE2_UTF to be set.
+
+       In UTF mode, both the pattern and any subject strings that are  matched
+       against  it are treated as UTF strings instead of strings of individual
+       one-code-unit characters. There are also some other changes to the  way
+       characters are handled, as documented below.
 
 
 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. PCRE2 does not support this.
+       \P{..}, and \X can be used. This is not dependent on the PCRE2_UTF set-
+       ting.   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 letter. Its Perl
+       synonym,  \p{Letter},  is  not  supported.   Furthermore, in Perl, many
+       properties may optionally be prefixed by "Is", for  compatibility  with
+       Perl 5.6. PCRE2 does not support this.
 
 
 WIDE CHARACTERS AND UTF MODES
 
        Code points 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
+       Larger  values have to use braced sequences. Unbraced octal code points
        up to \777 are also recognized; larger ones can be coded using \o{...}.
 
-       The  escape sequence \N{U+<hex digits>} is recognized as another way of
-       specifying a Unicode character by code point in a UTF mode. It  is  not
-       allowed in non-UTF modes.
+       The escape sequence \N{U+<hex digits>} is recognized as another way  of
+       specifying  a  Unicode character by code point in a UTF mode. It is not
+       allowed in non-UTF mode.
 
-       In  UTF modes, repeat quantifiers apply to complete UTF characters, not
+       In UTF mode, 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.
+       In UTF mode, the dot metacharacter matches one UTF character instead of
+       a single code unit.
+
+       In UTF mode, capture group names are not restricted to ASCII,  and  may
+       contain any Unicode letters and decimal digits, as well as underscore.
 
-       The escape sequence \C can be used to match a single code unit in a UTF
+       The  escape  sequence \C can be used to match a single code unit in 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).
+       documentation). For this reason, there is a build-time option that dis-
+       ables  support  for  \C completely. There is also a less draconian com-
+       pile-time option for locking out the use of \C when a pattern  is  com-
+       piled.
 
-       The use of \C is not supported by  the  alternative  matching  function
+       The  use  of  \C  is not supported by the alternative matching function
        pcre2_dfa_match() when in UTF-8 or UTF-16 mode, that is, when a charac-
-       ter may consist of more than one code unit. The  use  of  \C  in  these
-       modes  provokes a match-time error. Also, the JIT optimization does not
+       ter  may  consist  of  more  than one code unit. The use of \C in these
+       modes provokes a match-time error. Also, the JIT optimization does  not
        support \C in these modes. If JIT optimization is requested for a UTF-8
-       or  UTF-16  pattern  that contains \C, it will not succeed, and so when
-       pcre2_match() is called, the matching will be carried out by the normal
-       interpretive function.
+       or UTF-16 pattern that contains \C, it will not succeed,  and  so  when
+       pcre2_match() is called, the matching will be carried out by the inter-
+       pretive 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
+       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 re-
+       mains 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}.  Alterna-
+       tively, if you set the PCRE2_UCP option, the way that the character es-
+       capes 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.
+       However,  the  special horizontal and vertical white space matching es-
+       capes (\h, \H, \v, and \V) do match all the appropriate Unicode charac-
+       ters, whether or not PCRE2_UCP is set.
 
 
-CASE-EQUIVALENCE IN UTF MODES
+CASE-EQUIVALENCE IN UTF MODE
 
-       Case-insensitive matching in a UTF mode makes use of Unicode properties
+       Case-insensitive  matching  in UTF mode makes use of Unicode properties
        except for characters whose code points are less than 128 and that have
        at most two case-equivalent values. For these, a direct table lookup is
-       used  for speed. A few Unicode characters such as Greek sigma have more
-       than two code points that are case-equivalent, and these are treated as
-       such.
+       used for speed. A few Unicode characters such as Greek sigma have  more
+       than  two  code  points that are case-equivalent, and these are treated
+       specially.
+
+
+SCRIPT RUNS
+
+       The pattern constructs (*script_run:...) and  (*atomic_script_run:...),
+       with  synonyms (*sr:...) and (*asr:...), verify that the string matched
+       within the parentheses is a script run. In concept, a script run  is  a
+       sequence  of characters that are all from the same Unicode script. How-
+       ever, because some scripts are commonly used together, and because some
+       diacritical  and  other marks are used with multiple scripts, it is not
+       that simple.
+
+       Every Unicode character has a Script property, mostly with a value cor-
+       responding  to the name of a script, such as Latin, Greek, or Cyrillic.
+       There are also three special values:
+
+       "Unknown" is used for code points that have not been assigned, and also
+       for  the surrogate code points. In the PCRE2 32-bit library, characters
+       whose code points are greater  than  the  Unicode  maximum  (U+10FFFF),
+       which  are  accessible  only  in non-UTF mode, are assigned the Unknown
+       script.
+
+       "Common" is used for characters that are used with many scripts.  These
+       include  punctuation,  emoji,  mathematical, musical, and currency sym-
+       bols, and the ASCII digits 0 to 9.
+
+       "Inherited" is used for characters such as diacritical marks that  mod-
+       ify a previous character. These are considered to take on the script of
+       the character that they modify.
+
+       Some Inherited characters are used with many scripts, but many of  them
+       are  only  normally  used  with a small number of scripts. For example,
+       U+102E0 (Coptic Epact thousands mark) is used only with Arabic and Cop-
+       tic.  In  order  to  make it possible to check this, a Unicode property
+       called Script Extension exists. Its value is a list of scripts that ap-
+       ply to the character. For the majority of characters, the list contains
+       just one script, the same one as  the  Script  property.  However,  for
+       characters  such  as  U+102E0 more than one Script is listed. There are
+       also some Common characters that have a single,  non-Common  script  in
+       their Script Extension list.
+
+       The next section describes the basic rules for deciding whether a given
+       string of characters is a script run. Note,  however,  that  there  are
+       some  special cases involving the Chinese Han script, and an additional
+       constraint for decimal digits. These are  covered  in  subsequent  sec-
+       tions.
+
+   Basic script run rules
+
+       A string that is less than two characters long is a script run. This is
+       the only case in which an Unknown character can be  part  of  a  script
+       run.  Longer strings are checked using only the Script Extensions prop-
+       erty, not the basic Script property.
+
+       If a character's Script Extension property is the single value  "Inher-
+       ited", it is always accepted as part of a script run. This is also true
+       for the property "Common", subject to the checking  of  decimal  digits
+       described below. All the remaining characters in a script run must have
+       at least one script in common in their Script Extension lists. In  set-
+       theoretic terminology, the intersection of all the sets of scripts must
+       not be empty.
+
+       A simple example is an Internet name such as "google.com". The  letters
+       are all in the Latin script, and the dot is Common, so this string is a
+       script run.  However, the Cyrillic letter "o" looks exactly the same as
+       the  Latin "o"; a string that looks the same, but with Cyrillic "o"s is
+       not a script run.
+
+       More interesting examples involve characters with more than one  script
+       in their Script Extension. Consider the following characters:
+
+         U+060C  Arabic comma
+         U+06D4  Arabic full stop
+
+       The  first  has the Script Extension list Arabic, Hanifi Rohingya, Syr-
+       iac, and Thaana; the second has just Arabic and Hanifi  Rohingya.  Both
+       of  them  could  appear  in  script runs of either Arabic or Hanifi Ro-
+       hingya. The first could also appear in Syriac or  Thaana  script  runs,
+       but the second could not.
+
+   The Chinese Han script
+
+       The  Chinese  Han  script  is  commonly  used in conjunction with other
+       scripts for writing certain languages. Japanese uses the  Hiragana  and
+       Katakana  scripts  together  with Han; Korean uses Hangul and Han; Tai-
+       wanese Mandarin uses Bopomofo and Han.  These  three  combinations  are
+       treated  as special cases when checking script runs and are, in effect,
+       "virtual scripts". Thus, a script run may contain a  mixture  of  Hira-
+       gana,  Katakana,  and Han, or a mixture of Hangul and Han, or a mixture
+       of Bopomofo and Han, but not, for example,  a  mixture  of  Hangul  and
+       Bopomofo  and  Han. PCRE2 (like Perl) follows Unicode's Technical Stan-
+       dard  39   ("Unicode   Security   Mechanisms",   http://unicode.org/re-
+       ports/tr39/) in allowing such mixtures.
+
+   Decimal digits
+
+       Unicode  contains  many sets of 10 decimal digits in different scripts,
+       and some scripts (including the Common script) contain  more  than  one
+       set.  Some  of these decimal digits them are visually indistinguishable
+       from the common ASCII digits. In addition to the  script  checking  de-
+       scribed  above,  if a script run contains any decimal digits, they must
+       all come from the same set of 10 adjacent characters.
 
 
 VALIDITY OF UTF STRINGS
 
-       When  the  PCRE2_UTF  option is set, the strings passed as patterns and
+       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(),
+       functions. If an invalid UTF string is passed, a negative error code is
+       returned.  The  code  unit offset to the offending character can be ex-
+       tracted 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
@@ -10554,21 +11061,55 @@ VALIDITY OF UTF STRINGS
        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 or
+       give incorrect results. There is, however, one mode  of  matching  that
+       can  handle  invalid  UTF  subject  strings. This is enabled by passing
+       PCRE2_MATCH_INVALID_UTF to pcre2_compile() and is  discussed  below  in
+       the  next  section.  The  rest  of  this  section  covers the case when
+       PCRE2_MATCH_INVALID_UTF is not set.
 
-       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.
+       Passing PCRE2_NO_UTF_CHECK to pcre2_compile()  just  disables  the  UTF
+       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
+       same option to pcre2_match() or pcre2_dfa_match().
 
-       Note that setting PCRE2_NO_UTF_CHECK at compile time does  not  disable
-       the  error  that  is given if an escape sequence for an invalid Unicode
-       code point is encountered in the pattern. If you want to  allow  escape
-       sequences  such  as  \x{d800}  (a surrogate code point) you can set the
-       PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES extra option. However, this is pos-
-       sible only in UTF-8 and UTF-32 modes, because these values are not rep-
-       resentable in UTF-16.
+       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.
+
+       Unless  PCRE2_NO_UTF_CHECK  is  set, 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 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.
+
+       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 un-
+       fortunately messes up UTF-8 and UTF-32.)
+
+       Setting PCRE2_NO_UTF_CHECK at compile time does not disable  the  error
+       that  is  given if an escape sequence for an invalid Unicode code point
+       is encountered in the pattern. If you want to  allow  escape  sequences
+       such  as  \x{d800}  (a  surrogate code point) you can set the PCRE2_EX-
+       TRA_ALLOW_SURROGATE_ESCAPES extra option.  However,  this  is  possible
+       only  in  UTF-8  and  UTF-32 modes, because these values are not repre-
+       sentable in UTF-16.
 
    Errors in UTF-8 strings
 
@@ -10604,7 +11145,7 @@ VALIDITY OF UTF STRINGS
 
          PCRE2_ERROR_UTF8_ERR13
 
-       A  4-byte character has a value greater than 0x10fff; these code points
+       A 4-byte character has a value greater than 0x10ffff; these code points
        are excluded by RFC 3629.
 
          PCRE2_ERROR_UTF8_ERR14
@@ -10655,6 +11196,54 @@ VALIDITY OF UTF STRINGS
          PCRE2_ERROR_UTF32_ERR2  Code point is greater than 0x10ffff
 
 
+MATCHING IN INVALID UTF STRINGS
+
+       You can run pattern matches on subject strings that may contain invalid
+       UTF sequences if you  call  pcre2_compile()  with  the  PCRE2_MATCH_IN-
+       VALID_UTF  option.  This  is  supported by pcre2_match(), including JIT
+       matching, but not by pcre2_dfa_match(). When PCRE2_MATCH_INVALID_UTF is
+       set,  it  forces  PCRE2_UTF  to be set as well. Note, however, that the
+       pattern itself must be a valid UTF string.
+
+       Setting PCRE2_MATCH_INVALID_UTF does not  affect  what  pcre2_compile()
+       generates,  but  if pcre2_jit_compile() is subsequently called, it does
+       generate different code. If JIT is not used, the option affects the be-
+       haviour of the interpretive code in pcre2_match(). When PCRE2_MATCH_IN-
+       VALID_UTF is set at compile  time,  PCRE2_NO_UTF_CHECK  is  ignored  at
+       match time.
+
+       In  this  mode,  an  invalid  code  unit  sequence in the subject never
+       matches any pattern item. It does not match  dot,  it  does  not  match
+       \p{Any},  it does not even match negative items such as [^X]. A lookbe-
+       hind assertion fails if it encounters an invalid sequence while  moving
+       the  current  point backwards. In other words, an invalid UTF code unit
+       sequence acts as a barrier which no match can cross.
+
+       You can also think of this as the subject being split up into fragments
+       of  valid UTF, delimited internally by invalid code unit sequences. The
+       pattern is matched fragment by fragment. The  result  of  a  successful
+       match,  however,  is  given  as code unit offsets in the entire subject
+       string in the usual way. There are a few points to consider:
+
+       The internal boundaries are not interpreted as the beginnings  or  ends
+       of  lines  and  so  do not match circumflex or dollar characters in the
+       pattern.
+
+       If pcre2_match() is called with an offset that  points  to  an  invalid
+       UTF-sequence,  that  sequence  is  skipped, and the match starts at the
+       next valid UTF character, or the end of the subject.
+
+       At internal fragment boundaries, \b and \B behave in the same way as at
+       the  beginning  and end of the subject. For example, a sequence such as
+       \bWORD\b would match an instance of WORD that is surrounded by  invalid
+       UTF code units.
+
+       Using  PCRE2_MATCH_INVALID_UTF, an application can run matches on arbi-
+       trary data, knowing that any matched  strings  that  are  returned  are
+       valid UTF. This can be useful when searching for UTF text in executable
+       or other binary files.
+
+
 AUTHOR
 
        Philip Hazel
@@ -10664,8 +11253,8 @@ AUTHOR
 
 REVISION
 
-       Last updated: 02 September 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 24 May 2019
+       Copyright (c) 1997-2019 University of Cambridge.
 ------------------------------------------------------------------------------
 
 
index a5e8269d6fea5f736a844789628b826b1e18e6ed..58a60c1dccd6224977c15a66b19f1a028b848866 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_COMPILE 3 "16 June 2017" "PCRE2 10.30"
+.TH PCRE2_COMPILE 3 "23 May 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -53,6 +53,7 @@ The option bits are:
   PCRE2_EXTENDED           Ignore white space and # comments
   PCRE2_FIRSTLINE          Force matching to be before newline
   PCRE2_LITERAL            Pattern characters are all literal
+  PCRE2_MATCH_INVALID_UTF  Enable support for matching invalid UTF
   PCRE2_MATCH_UNSET_BACKREF  Match unset backreferences
   PCRE2_MULTILINE          ^ and $ match newlines within data
   PCRE2_NEVER_BACKSLASH_C  Lock out the use of \eC in patterns
@@ -73,7 +74,13 @@ The option bits are:
 PCRE2 must be built with Unicode support (the default) in order to use
 PCRE2_UTF, PCRE2_UCP and related options.
 .P
-The yield of the function is a pointer to a private data structure that
+Additional options may be set in the compile context via the
+.\" HREF
+\fBpcre2_set_compile_extra_options\fP
+.\"
+function.
+.P
+The yield of this function is a pointer to a private data structure that
 contains the compiled pattern, or NULL if an error was detected.
 .P
 There is a complete description of the PCRE2 native API, with more detail on
index dfc3ae6e5cb8e4d81311272f136cf03cb343154f..6413cb60222339326d81789946a6c5faf08fe3a4 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_DFA_MATCH 3 "26 April 2018" "PCRE2 10.32"
+.TH PCRE2_DFA_MATCH 3 "16 October 2018" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -39,6 +39,8 @@ depth limits. The \fIlength\fP and \fIstartoffset\fP values are code units, not
 characters. The options are:
 .sp
   PCRE2_ANCHORED          Match only at the first position
+  PCRE2_COPY_MATCHED_SUBJECT
+                          On success, make a private subject copy
   PCRE2_ENDANCHORED       Pattern can match only at end of subject
   PCRE2_NOTBOL            Subject is not the beginning of a line
   PCRE2_NOTEOL            Subject is not the end of a line
diff --git a/doc/pcre2_get_match_data_size.3 b/doc/pcre2_get_match_data_size.3
new file mode 100644 (file)
index 0000000..cf5fa5e
--- /dev/null
@@ -0,0 +1,27 @@
+.TH PCRE2_GET_MATCH_DATA_SIZE 3 "16 July 2019" "PCRE2 10.34"
+.SH NAME
+PCRE2 - Perl-compatible regular expressions (revised API)
+.SH SYNOPSIS
+.rs
+.sp
+.B #include <pcre2.h>
+.PP
+.nf
+.B PCRE2_SIZE pcre2_get_match_data_size(pcre2_match_data *\fImatch_data\fP);
+.fi
+.
+.SH DESCRIPTION
+.rs
+.sp
+This function returns the size, in bytes, of the match data block that is its
+argument.
+.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 a11d949d9229061f1b6de9604ea5ea484955128b..6cc17880f10de3e56b755f2d8ecffe531b332228 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_JIT_COMPILE 3 "21 October 2014" "PCRE2 10.00"
+.TH PCRE2_JIT_COMPILE 3 "29 July 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -30,9 +30,15 @@ bits:
   PCRE2_JIT_PARTIAL_SOFT  compile code for soft partial matching
   PCRE2_JIT_PARTIAL_HARD  compile code for hard partial matching
 .sp
+There is also an obsolete option called PCRE2_JIT_INVALID_UTF, which has been
+superseded by the \fBpcre2_compile()\fP option PCRE2_MATCH_INVALID_UTF. The old
+option is deprecated and may be removed in the future.
+.P
 The yield of the function is 0 for success, or a negative error code otherwise.
 In particular, PCRE2_ERROR_JIT_BADOPTION is returned if JIT is not supported or
-if an unknown bit is set in \fIoptions\fP.
+if an unknown bit is set in \fIoptions\fP. The function can also return
+PCRE2_ERROR_NOMEMORY if JIT is unable to allocate executable memory for the
+compiler, even if it was because of a system security restriction.
 .P
 There is a complete description of the PCRE2 native API in the
 .\" HREF
index 740954b9be8d15ad2909a92b35c9b52625ea3f9a..7dc8438bc3cb0748c542f0c54c6202ff410caafc 100644 (file)
@@ -7,7 +7,7 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .B #include <pcre2.h>
 .PP
 .SM
-.B const unsigned char *pcre2_maketables(pcre2_general_context *\fIgcontext\fP);
+.B const uint8_t *pcre2_maketables(pcre2_general_context *\fIgcontext\fP);
 .
 .SH DESCRIPTION
 .rs
diff --git a/doc/pcre2_maketables_free.3 b/doc/pcre2_maketables_free.3
new file mode 100644 (file)
index 0000000..07986b9
--- /dev/null
@@ -0,0 +1,31 @@
+.TH PCRE2_MAKETABLES_FREE 3 "02 September 2019" "PCRE2 10.34"
+.SH NAME
+PCRE2 - Perl-compatible regular expressions (revised API)
+.SH SYNOPSIS
+.rs
+.sp
+.B #include <pcre2.h>
+.PP
+.nf
+.B void pcre2_maketables_free(pcre2_general_context *\fIgcontext\fP,
+.B "  const uint8_t *\fItables\fP);"
+.fi
+.
+.SH DESCRIPTION
+.rs
+.sp
+This function discards a set of character tables that were created by a call
+to
+.\" HREF
+\fBpcre2_maketables()\fP.
+.\"
+.P
+The \fIgcontext\fP parameter should match what was used in that call to
+account for any custom allocators that might be in use; if it is NULL
+the system \fBfree()\fP is used.
+.P
+There is a complete description of the PCRE2 native API in the
+.\" HREF
+\fBpcre2api\fP
+.\"
+page.
index 9d15ec9c324c7c403af38abfdcb97939fe080073..2be2dd0a3b4bc866f87bfc5efd5fe78fdfb110e0 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_MATCH 3 "14 November 2017" "PCRE2 10.31"
+.TH PCRE2_MATCH 3 "16 October 2018" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -43,11 +43,13 @@ A match context is needed only if you want to:
   Change the backtracking depth limit
   Set custom memory management specifically for the match
 .sp
-The \fIlength\fP and \fIstartoffset\fP values are code
-units, not characters. The length may be given as PCRE2_ZERO_TERMINATE for a
-subject that is terminated by a binary zero code unit. The options are:
+The \fIlength\fP and \fIstartoffset\fP values are code units, not characters.
+The length may be given as PCRE2_ZERO_TERMINATED for a subject that is
+terminated by a binary zero code unit. The options are:
 .sp
   PCRE2_ANCHORED          Match only at the first position
+  PCRE2_COPY_MATCHED_SUBJECT
+                          On success, make a private subject copy
   PCRE2_ENDANCHORED       Pattern can match only at end of subject
   PCRE2_NOTBOL            Subject string is not the beginning of a line
   PCRE2_NOTEOL            Subject string is not the end of a line
index 56ed08bbf69857cab380dde9ccb9e3c45cfb530a..cebdef900aac6a70523045bb81ab42fae23da66c 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_MATCH_DATA_FREE 3 "28 June 2018" "PCRE2 10.32"
+.TH PCRE2_MATCH_DATA_FREE 3 "16 October 2018" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -18,6 +18,10 @@ If \fImatch_data\fP is NULL, this function does nothing. Otherwise,
 using the memory freeing function from the general context or compiled pattern
 with which it was created, or \fBfree()\fP if that was not set.
 .P
+If the PCRE2_COPY_MATCHED_SUBJECT was used for a successful match using this
+match data block, the copy of the subject that was remembered with the block is
+also freed.
+.P
 There is a complete description of the PCRE2 native API in the
 .\" HREF
 \fBpcre2api\fP
index 01b74a2a26896ac94b60601099f49642d642ef3f..edd8989d9e185495e53e6771ad7414d60512e76f 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_PATTERN_INFO 3 "16 December 2017" "PCRE2 10.31"
+.TH PCRE2_PATTERN_INFO 3 "14 February 2019" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -7,7 +7,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .B #include <pcre2.h>
 .PP
 .nf
-.B int pcre2_pattern_info(const pcre2 *\fIcode\fP, uint32_t \fIwhat\fP, void *\fIwhere\fP);
+.B int pcre2_pattern_info(const pcre2_code *\fIcode\fP, uint32_t \fIwhat\fP,
+.B "   void *\fIwhere\fP);"
 .fi
 .
 .SH DESCRIPTION
index 1ede4f91b4ffb40c83efa910d968e4b71fe965e2..1b740a17fc99a0d15b8a89c964c6dc0d7b7776c1 100644 (file)
@@ -8,7 +8,7 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .PP
 .nf
 .B int pcre2_set_character_tables(pcre2_compile_context *\fIccontext\fP,
-.B "  const unsigned char *\fItables\fP);"
+.B "  const uint8_t *\fItables\fP);"
 .fi
 .
 .SH DESCRIPTION
index 79f71cec4ba85650706eb5d567125d7117c0cdd8..764a75e878179cffb649e3efb207efad3d8b3c73 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_SET_COMPILE_EXTRA_OPTIONS 3 "16 June 2017" "PCRE2 10.30"
+.TH PCRE2_SET_COMPILE_EXTRA_OPTIONS 3 "11 February 2019" "PCRE2 10.33"
 .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 int pcre2_set_compile_extra_options(pcre2_compile_context *\fIccontext\fP,
-.B "  PCRE2_SIZE \fIextra_options\fP);"
+.B "  uint32_t \fIextra_options\fP);"
 .fi
 .
 .SH DESCRIPTION
@@ -21,9 +21,13 @@ options are:
 .\" JOIN
   PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES  Allow \ex{df800} to \ex{dfff}
                                          in UTF-8 and UTF-32 modes
+.\" JOIN
+  PCRE2_EXTRA_ALT_BSUX                 Extended alternate \eu, \eU, and \ex
+                                         handling
 .\" JOIN
   PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL    Treat all invalid escapes as
                                          a literal following character
+  PCRE2_EXTRA_ESCAPED_CR_IS_LF         Interpret \er as \en
   PCRE2_EXTRA_MATCH_LINE               Pattern matches whole lines
   PCRE2_EXTRA_MATCH_WORD               Pattern matches "words"
 .sp
diff --git a/doc/pcre2_set_substitute_callout.3 b/doc/pcre2_set_substitute_callout.3
new file mode 100644 (file)
index 0000000..cdd7ac6
--- /dev/null
@@ -0,0 +1,31 @@
+.TH PCRE2_SET_SUBSTITUTE_CALLOUT 3 "12 November 2018" "PCRE2 10.33"
+.SH NAME
+PCRE2 - Perl-compatible regular expressions (revised API)
+.SH SYNOPSIS
+.rs
+.sp
+.B #include <pcre2.h>
+.PP
+.nf
+.B int pcre2_set_substitute_callout(pcre2_match_context *\fImcontext\fP,
+.B "  int (*\fIcallout_function\fP)(pcre2_substitute_callout_block *),"
+.B "  void *\fIcallout_data\fP);"
+.fi
+.
+.SH DESCRIPTION
+.rs
+.sp
+This function sets the substitute callout fields in a match context (the first
+argument). The second argument specifies a callout function, and the third
+argument is an opaque data item that is passed to it. The result of this
+function 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 4342f9887c9f6480eb0beccc769b7bf2bed7c2d1..9ab58cdcc6ddbf83292788336c29e027232ea34a 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2_SUBSTRING_NAMETABLE_SCAN 3 "21 October 2014" "PCRE2 10.00"
+.TH PCRE2_SUBSTRING_NAMETABLE_SCAN 3 "03 February 2019" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -15,8 +15,8 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .rs
 .sp
 This convenience function finds, for a compiled pattern, the first and last
-entries for a given name in the table that translates capturing parenthesis
-names into numbers.
+entries for a given name in the table that translates capture group names into
+numbers.
 .sp
   \fIcode\fP    Compiled regular expression
   \fIname\fP    Name whose entries required
index ba90c86d0540a153f6f2df05759f66d7cdaaf181..27e3ef4fa137de2c7b99a3f9ee66928c41b944d7 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2API 3 "07 September 2018" "PCRE2 10.32"
+.TH PCRE2API 3 "02 September 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .sp
@@ -88,7 +88,7 @@ document for an overview of all the PCRE2 documentation.
 .B "  uint32_t \fIvalue\fP);"
 .sp
 .B int pcre2_set_character_tables(pcre2_compile_context *\fIccontext\fP,
-.B "  const unsigned char *\fItables\fP);"
+.B "  const uint8_t *\fItables\fP);"
 .sp
 .B int pcre2_set_compile_extra_options(pcre2_compile_context *\fIccontext\fP,
 .B "  uint32_t \fIextra_options\fP);"
@@ -123,6 +123,10 @@ document for an overview of all the PCRE2 documentation.
 .B "  int (*\fIcallout_function\fP)(pcre2_callout_block *, void *),"
 .B "  void *\fIcallout_data\fP);"
 .sp
+.B int pcre2_set_substitute_callout(pcre2_match_context *\fImcontext\fP,
+.B "  int (*\fIcallout_function\fP)(pcre2_substitute_callout_block *, void *),"
+.B "  void *\fIcallout_data\fP);"
+.sp
 .B int pcre2_set_offset_limit(pcre2_match_context *\fImcontext\fP,
 .B "  PCRE2_SIZE \fIvalue\fP);"
 .sp
@@ -241,9 +245,13 @@ document for an overview of all the PCRE2 documentation.
 .B int pcre2_get_error_message(int \fIerrorcode\fP, PCRE2_UCHAR *\fIbuffer\fP,
 .B "  PCRE2_SIZE \fIbufflen\fP);"
 .sp
-.B const unsigned char *pcre2_maketables(pcre2_general_context *\fIgcontext\fP);
+.B const uint8_t *pcre2_maketables(pcre2_general_context *\fIgcontext\fP);
 .sp
-.B int pcre2_pattern_info(const pcre2 *\fIcode\fP, uint32_t \fIwhat\fP, void *\fIwhere\fP);
+.B void pcre2_maketables_free(pcre2_general_context *\fIgcontext\fP,
+.B "  const uint8_t *\fItables\fP);"
+.sp
+.B int pcre2_pattern_info(const pcre2_code *\fIcode\fP, uint32_t \fIwhat\fP,
+.B "  void *\fIwhere\fP);"
 .sp
 .B int pcre2_callout_enumerate(const pcre2_code *\fIcode\fP,
 .B "  int (*\fIcallback\fP)(pcre2_callout_enumerate_block *, void *),"
@@ -720,10 +728,10 @@ interpreted matching functions, \fIpcre2_match()\fP and
 .sp
 .nf
 .B int pcre2_set_character_tables(pcre2_compile_context *\fIccontext\fP,
-.B "  const unsigned char *\fItables\fP);"
+.B "  const uint8_t *\fItables\fP);"
 .fi
 .sp
-The value must be the result of a call to \fIpcre2_maketables()\fP, whose only
+The value must be the result of a call to \fBpcre2_maketables()\fP, whose only
 argument is a general context. This function builds a set of character tables
 in the current locale.
 .sp
@@ -785,7 +793,7 @@ functions, \fIpcre2_match()\fP and \fIpcre2_dfa_match()\fP.
 .B "  uint32_t \fIvalue\fP);"
 .fi
 .sp
-This parameter ajusts the limit, set when PCRE2 is built (default 250), on the
+This parameter adjusts the limit, set when PCRE2 is built (default 250), on the
 depth of parenthesis nesting in a pattern. This limit stops rogue patterns
 using up too much system stack when being compiled. The limit applies to
 parentheses of all kinds, not just capturing parentheses.
@@ -847,7 +855,7 @@ PCRE2_ERROR_BADDATA if invalid data is detected.
 .B "  void *\fIcallout_data\fP);"
 .fi
 .sp
-This sets up a "callout" function for PCRE2 to call at specified points
+This sets up a callout function for PCRE2 to call at specified points
 during a matching operation. Details are given in the
 .\" HREF
 \fBpcre2callout\fP
@@ -855,6 +863,20 @@ during a matching operation. Details are given in the
 documentation.
 .sp
 .nf
+.B int pcre2_set_substitute_callout(pcre2_match_context *\fImcontext\fP,
+.B "  int (*\fIcallout_function\fP)(pcre2_substitute_callout_block *, void *),"
+.B "  void *\fIcallout_data\fP);"
+.fi
+.sp
+This sets up a callout function for PCRE2 to call after each substitution
+made by \fBpcre2_substitute()\fP. Details are given in the section entitled
+"Creating a new string with substitutions"
+.\" HTML <a href="#substitutions">
+.\" </a>
+below.
+.\"
+.sp
+.nf
 .B int pcre2_set_offset_limit(pcre2_match_context *\fImcontext\fP,
 .B "  PCRE2_SIZE \fIvalue\fP);"
 .fi
@@ -867,7 +889,7 @@ offset is not found. The \fBpcre2_substitute()\fP function makes no more
 substitutions.
 .P
 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
+limit less than 3, the result is PCRE2_ERROR_NOMATCH. A match can never be
 found if the \fIstartoffset\fP argument of \fBpcre2_match()\fP,
 \fBpcre2_dfa_match()\fP, or \fBpcre2_substitute()\fP is greater than the offset
 limit set in the match context.
@@ -1213,22 +1235,28 @@ are needed. The \fBpcre2_code_copy_with_tables()\fP provides this facility.
 Copies of both the code and the tables are made, with the new code pointing to
 the new tables. The memory for the new tables is automatically freed when
 \fBpcre2_code_free()\fP is called for the new copy of the compiled code. If
-\fBpcre2_code_copy_withy_tables()\fP is called with a NULL argument, it returns
+\fBpcre2_code_copy_with_tables()\fP is called with a NULL argument, it returns
 NULL.
 .P
 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 substring extraction functions. After running a match, you
-must not free a compiled pattern (or a subject string) until after all
-operations on the
+be referenced by the substring extraction functions after a successful match.
+After running a match, you must not free a compiled pattern or a subject string
+until after all operations on the
 .\" HTML <a href="#matchdatablock">
 .\" </a>
 match data block
 .\"
-have taken place.
+have taken place, unless, in the case of the subject string, you have used the
+PCRE2_COPY_MATCHED_SUBJECT option, which is described in the section entitled
+"Option bits for \fBpcre2_match()\fP"
+.\" HTML <a href="#matchoptions>">
+.\" </a>
+below.
+.\"
 .P
 The \fIoptions\fP argument for \fBpcre2_compile()\fP contains various bit
-settings that affect the compilation. It should be zero if no options are
+settings that affect the compilation. It should be zero if none of them 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
@@ -1243,8 +1271,9 @@ contents of the \fIoptions\fP argument specifies their settings at the start of
 compilation. The PCRE2_ANCHORED, PCRE2_ENDANCHORED, and PCRE2_NO_UTF_CHECK
 options can be set at the time of matching as well as at compile time.
 .P
-Other, less frequently required compile-time parameters (for example, the
-newline setting) can be provided in a compile context (as described
+Some additional options and less frequently required compile-time parameters
+(for example, the newline setting) can be provided in a compile context (as
+described
 .\" HTML <a href="#compilecontext">
 .\" </a>
 above).
@@ -1259,13 +1288,14 @@ and \fBpcre2_compile()\fP returns a non-NULL value.
 .P
 There are nearly 100 positive error codes that \fBpcre2_compile()\fP 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
-\fBpcre2_match()\fP and \fBpcre2_dfa_match()\fP, and are described in the
+that are used for invalid UTF strings when validity checking is in force. These
+are the same as given by \fBpcre2_match()\fP and \fBpcre2_dfa_match()\fP, and
+are described in the
 .\" HREF
 \fBpcre2unicode\fP
 .\"
-page. There is no separate documentation for the positive error codes, because
-the textual error messages that are obtained by calling the
+documentation. There is no separate documentation for the positive error codes,
+because the textual error messages that are obtained by calling the
 \fBpcre2_get_error_message()\fP function (see "Obtaining a textual error
 message"
 .\" HTML <a href="#geterrormessage">
@@ -1301,6 +1331,11 @@ This code fragment shows a typical straightforward call to
     &erroffset,             /* for error offset */
     NULL);                  /* no compile context */
 .sp
+.
+.
+.SS "Main compile options"
+.rs
+.sp
 The following names for option bits are defined in the \fBpcre2.h\fP header
 file:
 .sp
@@ -1337,6 +1372,16 @@ 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
 \ex, but it may have zero, one, or two digits (so, for example, \exz matches a
 binary zero character followed by z).
+.P
+ECMAscript 6 added additional functionality to \eu. This can be accessed using
+the PCRE2_EXTRA_ALT_BSUX extra option (see "Extra compile options"
+.\" HTML <a href="#extracompileoptions">
+.\" </a>
+below).
+.\"
+Note that this alternative escape handling applies only to patterns. Neither of
+these options affects the processing of replacement strings passed to
+\fBpcre2_substitute()\fP.
 .sp
   PCRE2_ALT_CIRCUMFLEX
 .sp
@@ -1405,10 +1450,10 @@ independent of the setting of PCRE2_DOTALL.
 .sp
   PCRE2_DUPNAMES
 .sp
-If this bit is set, names used to identify capturing subpatterns need not be
-unique. This can be helpful for certain types of pattern when it is known that
-only one instance of the named subpattern can ever be matched. There are more
-details of named subpatterns below; see also the
+If this bit is set, names used to identify capture groups need not be unique.
+This can be helpful for certain types of pattern when it is known that only one
+instance of the named group can ever be matched. There are more details of
+named capture groups below; see also the
 .\" HREF
 \fBpcre2pattern\fP
 .\"
@@ -1442,11 +1487,11 @@ the end of the subject.
 If this bit is set, most white space characters in the pattern are totally
 ignored except when escaped or inside a character class. However, white space
 is not allowed within sequences such as (?> that introduce various
-parenthesized subpatterns, nor within numerical quantifiers such as {1,3}.
-Ignorable white space is permitted between an item and a following quantifier
-and between a quantifier and a following + that indicates possessiveness.
-PCRE2_EXTENDED is equivalent to Perl's /x option, and it can be changed within
-a pattern by a (?x) option setting.
+parenthesized groups, nor within numerical quantifiers such as {1,3}. Ignorable
+white space is permitted between an item and a following quantifier and between
+a quantifier and a following + that indicates possessiveness. PCRE2_EXTENDED is
+equivalent to Perl's /x option, and it can be changed within a pattern by a
+(?x) option setting.
 .P
 When PCRE2 is compiled without Unicode support, PCRE2_EXTENDED recognizes as
 white space only those characters with code points less than 256 that are
@@ -1516,14 +1561,24 @@ expression engine is not the most efficient way of doing it. If you are doing a
 lot of literal matching and are worried about efficiency, you should consider
 using other approaches. The only other main options that are allowed with
 PCRE2_LITERAL are: PCRE2_ANCHORED, PCRE2_ENDANCHORED, PCRE2_AUTO_CALLOUT,
-PCRE2_CASELESS, PCRE2_FIRSTLINE, PCRE2_NO_START_OPTIMIZE, PCRE2_NO_UTF_CHECK,
-PCRE2_UTF, and PCRE2_USE_OFFSET_LIMIT. The extra options PCRE2_EXTRA_MATCH_LINE
-and PCRE2_EXTRA_MATCH_WORD are also supported. Any other options cause an
-error.
+PCRE2_CASELESS, PCRE2_FIRSTLINE, PCRE2_MATCH_INVALID_UTF,
+PCRE2_NO_START_OPTIMIZE, PCRE2_NO_UTF_CHECK, PCRE2_UTF, and
+PCRE2_USE_OFFSET_LIMIT. The extra options PCRE2_EXTRA_MATCH_LINE and
+PCRE2_EXTRA_MATCH_WORD are also supported. Any other options cause an error.
+.sp
+  PCRE2_MATCH_INVALID_UTF
+.sp
+This option forces PCRE2_UTF (see below) and also enables support for matching
+by \fBpcre2_match()\fP in subject strings that contain invalid UTF sequences.
+This facility is not supported for DFA matching. For details, see the
+.\" HREF
+\fBpcre2unicode\fP
+.\"
+documentation.
 .sp
   PCRE2_MATCH_UNSET_BACKREF
 .sp
-If this option is set, a backreference to an unset subpattern group matches an
+If this option is set, a backreference to an unset capture group matches an
 empty string (by default this causes the current matching alternative to fail).
 A pattern such as (\e1)(a) succeeds when this option is set (assuming it can
 find an "a" in the subject), whereas it fails by default, for Perl
@@ -1584,7 +1639,7 @@ If this option is set, it disables the use of numbered capturing parentheses in
 the pattern. Any opening parenthesis that is not followed by ? behaves as if it
 were followed by ?: but named parentheses can still be used for capturing (and
 they acquire numbers in the usual way). This is the same as Perl's /n option.
-Note that, when this option is set, references to capturing groups
+Note that, when this option is set, references to capture groups
 (backreferences or recursion/subroutine calls) may only refer to named groups,
 though the reference can be by name or by number.
 .sp
@@ -1603,7 +1658,7 @@ purposes.
 If this option is set, it disables an optimization that is applied when .* is
 the first significant item in a top-level branch of a pattern, and all the
 other branches also start with .* or with \eA or \eG or ^. The optimization is
-automatically disabled for .* if it is inside an atomic group or a capturing
+automatically disabled for .* if it is inside an atomic group or a capture
 group that is the subject of a backreference, or if the pattern contains
 (*PRUNE) or (*SKIP). When the optimization is not disabled, such a pattern is
 automatically anchored if PCRE2_DOTALL is set for all the .* items and
@@ -1649,17 +1704,22 @@ subject string does not happen. The first match attempt is run starting from
 "D" and when this fails, (*COMMIT) prevents any further matches being tried, so
 the overall result is "no match".
 .P
-There are also other start-up optimizations. For example, a minimum length for
-the subject may be recorded. Consider the pattern
+As another start-up optimization makes use of a minimum length for a matching
+subject, which is recorded when possible. Consider the pattern
 .sp
-  (*MARK:A)(X|Y)
+  (*MARK:1)B(*MARK:2)(X|Y)
 .sp
-The minimum length for a match is one character. If the subject is "ABC", there
-will be attempts to match "ABC", "BC", and "C". An attempt to match an empty
-string at the end of the subject does not take place, because PCRE2 knows that
-the subject is now too short, and so the (*MARK) is never encountered. In this
-case, the optimization does not affect the overall match result, which is still
-"no match", but it does affect the auxiliary information that is returned.
+The minimum length for a match is two characters. If the subject is "XXBB", the
+"starting character" optimization skips "XX", then tries to match "BB", which
+is long enough. In the process, (*MARK:2) is encountered and remembered. When
+the match attempt fails, the next "B" is found, but there is only one character
+left, so there are no more attempts, and "no match" is returned with the "last
+mark seen" set to "2". If NO_START_OPTIMIZE is set, however, matches are tried
+at every possible starting position, including at the end of the subject, where
+(*MARK:1) is encountered, but there is no "B", so the "last mark seen" that is
+returned is "1". In this case, the optimizations do not affect the overall
+match result, which is still "no match", but they do affect the auxiliary
+information that is returned.
 .sp
   PCRE2_NO_UTF_CHECK
 .sp
@@ -1764,9 +1824,8 @@ characters with code points greater than 127.
 .SS "Extra compile options"
 .rs
 .sp
-Unlike the main compile-time options, the extra options are not saved with the
-compiled pattern. The option bits that can be set in a compile context by
-calling the \fBpcre2_set_compile_extra_options()\fP function are as follows:
+The option bits that can be set in a compile context by calling the
+\fBpcre2_set_compile_extra_options()\fP function are as follows:
 .sp
   PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES
 .sp
@@ -1789,6 +1848,14 @@ If the extra option PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is set, surrogate code
 point values in UTF-8 and UTF-32 patterns no longer provoke errors and are
 incorporated in the compiled pattern. However, they can only match subject
 characters if the matching function is called with PCRE2_NO_UTF_CHECK set.
+.sp
+  PCRE2_EXTRA_ALT_BSUX
+.sp
+The original option PCRE2_ALT_BSUX causes PCRE2 to process \eU, \eu, and \ex in
+the way that ECMAscript (aka JavaScript) does. Additional functionality was
+defined by ECMAscript 6; setting PCRE2_EXTRA_ALT_BSUX has the effect of
+PCRE2_ALT_BSUX, but in addition it recognizes \eu{hhh..} as a hexadecimal
+character code, where hhh.. is any number of hexadecimal digits.
 .sp
   PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL
 .sp
@@ -1801,11 +1868,22 @@ Perl's warning switch is enabled. However, a malformed octal number after \eo{
 always causes an error in Perl.
 .P
 If the PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL extra option is passed to
-\fBpcre2_compile()\fP, all unrecognized or erroneous escape sequences are
+\fBpcre2_compile()\fP, all unrecognized or malformed escape sequences are
 treated as single-character escapes. For example, \ej is a literal "j" and
 \ex{2z} is treated as the literal string "x{2z}". Setting this option means
-that typos in patterns may go undetected and have unexpected results. This is a
-dangerous option. Use with care.
+that typos in patterns may go undetected and have unexpected results. Also note
+that a sequence such as [\eN{] is interpreted as a malformed attempt at
+[\eN{...}] and so is treated as [N{] whereas [\eN] gives an error because an
+unqualified \eN is a valid escape sequence but is not supported in a character
+class. To reiterate: this is a dangerous option. Use with great care.
+.sp
+  PCRE2_EXTRA_ESCAPED_CR_IS_LF
+.sp
+There are some legacy applications where the escape sequence \er in a pattern
+is expected to match a newline. If this option is set, \er in a pattern is
+converted to \en so that it matches a LF (linefeed) instead of a CR (carriage
+return) character. The option does not affect a literal CR in the pattern, nor
+does it affect CR specified as an explicit code point such as \ex{0D}.
 .sp
   PCRE2_EXTRA_MATCH_LINE
 .sp
@@ -1868,35 +1946,45 @@ Most (but not all) patterns can be optimized by the JIT compiler.
 .SH "LOCALE SUPPORT"
 .rs
 .sp
+.nf
+.B const uint8_t *pcre2_maketables(pcre2_general_context *\fIgcontext\fP);
+.sp
+.B void pcre2_maketables_free(pcre2_general_context *\fIgcontext\fP,
+.B "  const uint8_t *\fItables\fP);"
+.fi
+.P
 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 \ew or \ed.
-However, if PCRE2 is built with Unicode support, all characters can be tested
-with \ep and \eP, or, alternatively, the PCRE2_UCP option can be set when a
-pattern is compiled; this causes \ew and friends to use Unicode property
+point. However, this applies only to characters whose code points are less than
+256. By default, higher-valued code points never match escapes such as \ew or
+\ed. When PCRE2 is built with Unicode support (the default), all characters can
+be tested with \ep and \eP, or, alternatively, the PCRE2_UCP option can be set
+when a pattern is compiled; this causes \ew and friends to use Unicode property
 support instead of the built-in tables.
 .P
 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.
 .P
-PCRE2 contains an internal set of character tables that are used by default.
+PCRE2 contains a built-in 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 different.
 .P
-The internal tables can be overridden by tables supplied by the application
+The built-in tables can be overridden by tables supplied by the application
 that calls PCRE2. These may be created in a different locale from the default.
 As more and more applications change to using Unicode, the need for this locale
 support is expected to die away.
 .P
 External tables are built by calling the \fBpcre2_maketables()\fP function, in
-the relevant locale. The result can be passed to \fBpcre2_compile()\fP as often
-as necessary, by creating a compile context and calling
-\fBpcre2_set_character_tables()\fP to set the tables pointer therein. For
-example, to build and use tables that are appropriate for the French locale
+the relevant locale. The only argument to this function is a general context,
+which can be used to pass a custom memory allocator. If the argument is NULL,
+the system \fBmalloc()\fP is used. The result can be passed to
+\fBpcre2_compile()\fP as often as necessary, by creating a compile context and
+calling \fBpcre2_set_character_tables()\fP to set the tables pointer therein.
+.P
+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:
 .sp
@@ -1907,15 +1995,19 @@ letters), the following code could be used:
   re = pcre2_compile(..., ccontext);
 .sp
 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.
+are using Windows, the name for the French locale is "french".
 .P
 The pointer that is passed (via the compile context) to \fBpcre2_compile()\fP
 is saved with the compiled pattern, and the same tables are used by
 \fBpcre2_match()\fP and \fBpcre_dfa_match()\fP. Thus, for any single pattern,
 compilation and matching both happen in the same locale, but different patterns
 can be processed in different locales.
+.P
+It is the caller's responsibility to ensure that the memory containing the
+tables remains available while they are still in use. When they are no longer
+needed, you can discard them using \fBpcre2_maketables_free()\fP, which should
+pass as its first parameter the same global context that was used to create the
+tables.
 .
 .
 .\" HTML <a name="infoaboutpattern"></a>
@@ -1945,7 +2037,7 @@ the following negative numbers:
   PCRE2_ERROR_BADOPTION      the value of \fIwhat\fP was invalid
   PCRE2_ERROR_UNSET          the requested field is not set
 .sp
-The "magic number" is placed at the start of each compiled pattern as an simple
+The "magic number" is placed at the start of each compiled pattern as a simple
 check against passing an arbitrary memory pointer. Here is a typical call of
 \fBpcre2_pattern_info()\fP, to obtain the length of the compiled pattern:
 .sp
@@ -1990,7 +2082,7 @@ following are true:
 .sp
   .* is not in an atomic group
 .\" JOIN
-  .* is not in a capturing group that is the subject
+  .* is not in a capture group that is the subject
        of a backreference
   PCRE2_DOTALL is in force for .*
   Neither (*PRUNE) nor (*SKIP) appears in the pattern
@@ -2002,12 +2094,12 @@ options returned for PCRE2_INFO_ALLOPTIONS.
   PCRE2_INFO_BACKREFMAX
 .sp
 Return the number of the highest backreference in the pattern. The third
-argument should point to an \fBuint32_t\fP variable. Named subpatterns acquire
-numbers as well as names, and these count towards the highest backreference.
-Backreferences such as \e4 or \eg{12} match the captured 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 backreference. Zero is
-returned if there are no backreferences.
+argument should point to a \fBuint32_t\fP variable. Named capture groups
+acquire numbers as well as names, and these count towards the highest
+backreference. Backreferences such as \e4 or \eg{12} match the captured
+characters of the given group, but in addition, the check that a capture
+group is set in a conditional group such as (?(3)a|b) is also a backreference.
+Zero is returned if there are no backreferences.
 .sp
   PCRE2_INFO_BSR
 .sp
@@ -2018,9 +2110,9 @@ that \eR matches only CR, LF, or CRLF.
 .sp
   PCRE2_INFO_CAPTURECOUNT
 .sp
-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.
+Return the highest capture group number in the pattern. In patterns where (?|
+is not used, this is also the total number of capture groups. The third
+argument should point to a \fBuint32_t\fP variable.
 .sp
   PCRE2_INFO_DEPTHLIMIT
 .sp
@@ -2045,7 +2137,7 @@ returned. Otherwise NULL is returned. The third argument should point to a
   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
+non-anchored pattern. The third argument should point to a \fBuint32_t\fP
 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 value can be retrieved
 using PCRE2_INFO_FIRSTCODEUNIT. If there is no fixed first value, but it is
@@ -2057,7 +2149,7 @@ is returned.
 .sp
 Return the value of the first code unit of any matched string for a pattern
 where PCRE2_INFO_FIRSTCODETYPE returns 1; otherwise return 0. The third
-argument should point to an \fBuint32_t\fP variable. In the 8-bit library, the
+argument should point to a \fBuint32_t\fP 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.
@@ -2068,17 +2160,17 @@ Return the size (in bytes) of the data frames that are used to remember
 backtracking positions when the pattern is processed by \fBpcre2_match()\fP
 without the use of JIT. The third argument should point to a \fBsize_t\fP
 variable. The frame size depends on the number of capturing parentheses in the
-pattern. Each additional capturing group adds two PCRE2_SIZE variables.
+pattern. Each additional capture group adds two PCRE2_SIZE variables.
 .sp
   PCRE2_INFO_HASBACKSLASHC
 .sp
 Return 1 if the pattern contains any instances of \eC, otherwise 0. The third
-argument should point to an \fBuint32_t\fP variable.
+argument should point to a \fBuint32_t\fP variable.
 .sp
   PCRE2_INFO_HASCRORLF
 .sp
 Return 1 if the pattern contains any explicit matches for CR or LF characters,
-otherwise 0. The third argument should point to an \fBuint32_t\fP variable. An
+otherwise 0. The third argument should point to a \fBuint32_t\fP variable. An
 explicit match is either a literal CR or LF character, or \er or \en or one of
 the equivalent hexadecimal or octal escape sequences.
 .sp
@@ -2094,7 +2186,7 @@ defaulted by the caller of the match function.
   PCRE2_INFO_JCHANGED
 .sp
 Return 1 if the (?J) or (?-J) option setting is used in the pattern, otherwise
-0. The third argument should point to an \fBuint32_t\fP variable. (?J) and
+0. The third argument should point to a \fBuint32_t\fP variable. (?J) and
 (?-J) set and unset the local PCRE2_DUPNAMES option, respectively.
 .sp
   PCRE2_INFO_JITSIZE
@@ -2106,7 +2198,7 @@ return zero. The third argument should point to a \fBsize_t\fP variable.
   PCRE2_INFO_LASTCODETYPE
 .sp
 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
+matched string, other than at its start. The third argument should  point to a
 \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. For anchored patterns, a last literal value is
@@ -2119,12 +2211,12 @@ PCRE2_INFO_LASTCODEUNIT), but for /^a\edz\ed/ the returned value is 0.
 Return the value of the rightmost literal code unit that must exist in any
 matched string, other than at its start, for a pattern where
 PCRE2_INFO_LASTCODETYPE returns 1. Otherwise, return 0. The third argument
-should point to an \fBuint32_t\fP variable.
+should point to a \fBuint32_t\fP variable.
 .sp
   PCRE2_INFO_MATCHEMPTY
 .sp
 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
+argument should point to a \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.
@@ -2140,26 +2232,35 @@ defaulted by the caller of the match function.
 .sp
   PCRE2_INFO_MAXLOOKBEHIND
 .sp
-Return the number of characters (not code units) in the longest lookbehind
-assertion in the pattern. The third argument should point to a uint32_t
-integer. This information is useful when doing multi-segment matching using the
-partial matching facilities. Note that the simple assertions \eb and \eB
-require a one-character lookbehind. \eA 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 processed. Otherwise, if there are no lookbehinds in the
-pattern, \eA might match incorrectly at the start of a second or subsequent
-segment.
+A lookbehind assertion moves back a certain number of characters (not code
+units) when it starts to process each of its branches. This request returns the
+largest of these backward moves. The third argument should point to a uint32_t
+integer. The simple assertions \eb and \eB require a one-character lookbehind
+and cause PCRE2_INFO_MAXLOOKBEHIND to return 1 in the absence of anything
+longer. \eA also registers a one-character lookbehind, though it does not
+actually inspect the previous character.
+.P
+Note that this information is useful for multi-segment matching only
+if the pattern contains no nested lookbehinds. For example, the pattern
+(?<=a(?<=ba)c) returns a maximum lookbehind of 2, but when it is processed, the
+first lookbehind moves back by two characters, matches one character, then the
+nested lookbehind also moves back by two characters. This puts the matching
+point three characters earlier than it was at the start.
+PCRE2_INFO_MAXLOOKBEHIND is really only useful as a debugging tool. See the
+.\" HREF
+\fBpcre2partial\fP
+.\"
+documentation for a discussion of multi-segment matching.
 .sp
   PCRE2_INFO_MINLENGTH
 .sp
 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 number of code units.
-The third argument should point to an \fBuint32_t\fP 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.
+returned. Otherwise the returned value is 0. This value is not computed when
+PCRE2_NO_START_OPTIMIZE is set. The value is a number of characters, which in
+UTF mode may be different from the number of code units. The third argument
+should point to a \fBuint32_t\fP 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.
 .sp
   PCRE2_INFO_NAMECOUNT
   PCRE2_INFO_NAMEENTRYSIZE
@@ -2189,11 +2290,11 @@ 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.
 .P
-The names are in alphabetical order. If (?| is used to create multiple groups
-with the same number, as described in the
-.\" HTML <a href="pcre2pattern.html#dupsubpatternnumber">
+The names are in alphabetical order. If (?| is used to create multiple capture
+groups with the same number, as described in the
+.\" HTML <a href="pcre2pattern.html#dupgroupnumber">
 .\" </a>
-section on duplicate subpattern numbers
+section on duplicate group numbers
 .\"
 in the
 .\" HREF
@@ -2202,11 +2303,11 @@ in the
 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.
 .P
-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
+Duplicate names for capture groups 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.
+later capture groups may have lower numbers.
 .P
 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
@@ -2216,16 +2317,16 @@ space - including newlines - is ignored):
   (?<date> (?<year>(\ed\ed)?\ed\ed) -
   (?<month>\ed\ed) - (?<day>\ed\ed) )
 .sp
-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 ??:
+There are four named capture groups, 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 ??:
 .sp
   00 01 d  a  t  e  00 ??
   00 05 d  a  y  00 ?? ??
   00 04 m  o  n  t  h  00
   00 02 y  e  a  r  00 ??
 .sp
-When writing code to extract data from named subpatterns using the
+When writing code to extract data from named capture groups using the
 name-to-number map, remember that the length of the entries is likely to be
 different for each compiled pattern.
 .sp
@@ -2362,9 +2463,16 @@ on the error, and is detailed below.
 .P
 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.
+referenced by the extraction functions after a successful match. 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,
+unless, in the case of the subject string, you have used the
+PCRE2_COPY_MATCHED_SUBJECT option, which is described in the section entitled
+"Option bits for \fBpcre2_match()\fP"
+.\" HTML <a href="#matchoptions>">
+.\" </a>
+below.
+.\"
 .P
 When a match data block itself is no longer needed, it should be freed by
 calling \fBpcre2_match_data_free()\fP. If this function is called with a NULL
@@ -2481,10 +2589,10 @@ the use of .* with PCRE2_DOTALL, not by starting the pattern with ^ or \eA.
 .rs
 .sp
 The unused bits of the \fIoptions\fP argument for \fBpcre2_match()\fP must be
-zero. The only bits that may be set are PCRE2_ANCHORED, PCRE2_ENDANCHORED,
-PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART,
-PCRE2_NO_JIT, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT.
-Their action is described below.
+zero. The only bits that may be set are PCRE2_ANCHORED,
+PCRE2_COPY_MATCHED_SUBJECT, PCRE2_ENDANCHORED, PCRE2_NOTBOL, PCRE2_NOTEOL,
+PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_JIT, PCRE2_NO_UTF_CHECK,
+PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT. Their action is described below.
 .P
 Setting PCRE2_ANCHORED or PCRE2_ENDANCHORED at match time is not supported by
 the just-in-time (JIT) compiler. If it is set, JIT matching is disabled and the
@@ -2498,6 +2606,22 @@ 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.
+.sp
+  PCRE2_COPY_MATCHED_SUBJECT
+.sp
+By default, a pointer to the subject is remembered in the match data block so
+that, after a successful match, it can be referenced by the substring
+extraction functions. This means that the subject's memory must not be freed
+until all such operations are complete. For some applications where the
+lifetime of the subject string is not guaranteed, it may be necessary to make a
+copy of the subject string, but it is wasteful to do this unless the match is
+successful. After a successful match, if PCRE2_COPY_MATCHED_SUBJECT is set, the
+subject is copied and the new pointer is remembered in the match data block
+instead of the original subject pointer. The memory allocator that was used for
+the match block itself is used. The copy is automatically freed when
+\fBpcre2_match_data_free()\fP is called to free the match data block. It is also
+automatically freed if the match data block is re-used for another match
+operation.
 .sp
   PCRE2_ENDANCHORED
 .sp
@@ -2553,15 +2677,23 @@ of JIT; it forces matching to be done by the interpreter.
   PCRE2_NO_UTF_CHECK
 .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.
-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.
+string is checked unless PCRE2_NO_UTF_CHECK is passed to \fBpcre2_match()\fP or
+PCRE2_MATCH_INVALID_UTF was passed to \fBpcre2_compile()\fP. The latter special
+case is discussed in detail in the
+.\" HREF
+\fBpcre2unicode\fP
+.\"
+documentation.
+.P
+In the default case, 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
@@ -2584,29 +2716,34 @@ in the
 .\" HREF
 \fBpcre2unicode\fP
 .\"
-page.
+documentation.
 .P
-If you know that your subject is valid, and you want to skip these checks for
+If you know that your subject is valid, and you want to skip this check for
 performance reasons, you can set the PCRE2_NO_UTF_CHECK option when calling
 \fBpcre2_match()\fP. You might want to do this for the second and subsequent
-calls to \fBpcre2_match()\fP if you are making repeated calls to find other
+calls to \fBpcre2_match()\fP if you are making repeated calls to find multiple
 matches in the same subject string.
 .P
-\fBWarning:\fP When PCRE2_NO_UTF_CHECK is set, the effect of passing an invalid
+\fBWarning:\fP Unless PCRE2_MATCH_INVALID_UTF was set at compile time, when
+PCRE2_NO_UTF_CHECK is set at match time the effect of passing an invalid
 string as a subject, or an invalid value of \fIstartoffset\fP, is undefined.
-Your program may crash or loop indefinitely.
+Your program may crash or loop indefinitely or give wrong results.
 .sp
   PCRE2_PARTIAL_HARD
   PCRE2_PARTIAL_SOFT
 .sp
 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 complete match can be found.
+subject characters to complete the match. In addition, either at least one
+character must have been inspected or the pattern must contain a lookbehind, or
+the pattern must be one that could match an empty string.
+.P
+If this situation arises 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 complete match can
+be found.
 .P
 If PCRE2_PARTIAL_HARD is set, it overrides PCRE2_PARTIAL_SOFT. In this case, if
 a partial match is found, \fBpcre2_match()\fP immediately returns
@@ -2682,12 +2819,12 @@ valid newline sequence and explicit \er or \en escapes appear in the pattern.
 In general, a pattern matches a certain portion of the subject, and in
 addition, further substrings from the subject may be picked out by
 parenthesized parts of the pattern. Following the usage in Jeffrey Friedl's
-book, this is called "capturing" in what follows, and the phrase "capturing
-subpattern" or "capturing group" is used for a fragment of a pattern that picks
-out a substring. PCRE2 supports several other kinds of parenthesized subpattern
-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.
+book, this is called "capturing" in what follows, and the phrase "capture
+group" (Perl terminology) is used for a fragment of a pattern that picks out a
+substring. PCRE2 supports several other kinds of parenthesized group that do
+not cause substrings to be captured. The \fBpcre2_pattern_info()\fP function
+can be used to find out how many capture groups there are in a compiled
+pattern.
 .P
 You can use auxiliary functions for accessing captured substrings
 .\" HTML <a href="#extractbynumber">
@@ -2740,30 +2877,28 @@ reported start of a successful match can be greater than the end of the match.
 For example, if the pattern (?=ab\eK) is matched against "ab", the start and
 end offset values for the match are 2 and 0.
 .P
-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 a capture group is matched repeatedly within a single match operation, it is
+the last portion of the subject that it matched that is returned.
 .P
 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, \fBpcre2_match()\fP may be called with a match
 data block whose ovector is of minimum length (that is, one pair).
 .P
-It is possible for capturing subpattern number \fIn+1\fP to match some part of
-the subject when subpattern \fIn\fP has not been used at all. For example, 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 corresponding to unused subpatterns
-are set to PCRE2_UNSET.
-.P
-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 highest used capturing
-subpattern number is 1. The offsets for for the second and third capturing
-subpatterns (assuming the vector is large enough, of course) are set to
+It is possible for capture group number \fIn+1\fP to match some part of the
+subject when group \fIn\fP has not been used at all. For example, if the string
+"abc" is matched against the pattern (a|(z))(bc) the return from the function
+is 4, and groups 1 and 3 are matched, but 2 is not. When this happens, both
+values in the offset pairs corresponding to unused groups are set to
 PCRE2_UNSET.
 .P
+Offset values that correspond to unused groups 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)?)? groups 2 and 3 are not matched. The return from the
+function is 2, because the highest used capture group number is 1. The offsets
+for for the second and third capture groupss (assuming the vector is large
+enough, of course) are set to PCRE2_UNSET.
+.P
 Elements in the ovector that do not correspond to capturing parentheses in the
 pattern are never changed. That is, if a pattern contains \fIn\fP capturing
 parentheses, no more than \fIovector[0]\fP to \fIovector[2n+1]\fP are set by
@@ -2787,21 +2922,22 @@ appropriate circumstances. If they are called at other times, the result is
 undefined.
 .P
 After a successful match, a partial match (PCRE2_ERROR_PARTIAL), or a failure
-to match (PCRE2_ERROR_NOMATCH), a (*MARK), (*PRUNE), or (*THEN) name may be
-available. The function \fBpcre2_get_mark()\fP can be called to access this
-name. The same function applies to all three verbs. It returns a pointer to the
-zero-terminated name, which is within the compiled pattern. If no name is
+to match (PCRE2_ERROR_NOMATCH), a mark name may be available. The function
+\fBpcre2_get_mark()\fP can be called to access this name, which can be
+specified in the pattern by any of the backtracking control verbs, not just
+(*MARK). The same function applies to all the verbs. It returns a pointer to
+the zero-terminated name, which is within the compiled pattern. If no name is
 available, NULL is returned. The length of the name (excluding the terminating
 zero) is stored in the code unit that precedes the name. You should use this
 length instead of relying on the terminating zero if the name might contain a
 binary zero.
 .P
-After a successful match, the name that is returned is the last (*MARK),
-(*PRUNE), or (*THEN) name encountered on the matching path through the pattern.
-Instances of (*PRUNE) and (*THEN) without names are ignored. Thus, for example,
-if the matching path contains (*MARK:A)(*PRUNE), the name "A" is returned.
-After a "no match" or a partial match, the last encountered name is returned.
-For example, consider this pattern:
+After a successful match, the name that is returned is the last mark name
+encountered on the matching path through the pattern. Instances of backtracking
+verbs without names do not count. Thus, for example, if the matching path
+contains (*MARK:A)(*PRUNE), the name "A" is returned. After a "no match" or a
+partial match, the last encountered name is returned. For example, consider
+this pattern:
 .sp
   ^(*MARK:A)((*MARK:B)a|b)c
 .sp
@@ -2815,7 +2951,7 @@ is removed from the pattern above, there is an initial check for the presence
 of "c" in the subject before running the matching engine. This check fails for
 "bx", causing a match failure without seeing any marks. You can disable the
 start-of-match optimizations by setting the PCRE2_NO_START_OPTIMIZE option for
-\fBpcre2_compile()\fP or starting the pattern with (*NO_START_OPT).
+\fBpcre2_compile()\fP or by starting the pattern with (*NO_START_OPT).
 .P
 After a successful match, a partial match, or one of the invalid UTF errors
 (for example, PCRE2_ERROR_UTF8_ERR5), \fBpcre2_get_startchar()\fP can be
@@ -2935,7 +3071,8 @@ The backtracking match limit was reached.
 If a pattern contains many nested backtracking points, heap memory is used to
 remember them. This error is given when the memory allocation function (default
 or custom) fails. Note that a different error, PCRE2_ERROR_HEAPLIMIT, is given
-if the amount of memory needed exceeds the heap limit.
+if the amount of memory needed exceeds the heap limit. PCRE2_ERROR_NOMEMORY is
+also returned if PCRE2_COPY_MATCHED_SUBJECT is set and memory allocation fails.
 .sp
   PCRE2_ERROR_NULL
 .sp
@@ -2946,11 +3083,11 @@ as NULL.
 .sp
 This error is returned when \fBpcre2_match()\fP detects a recursion loop within
 the pattern. Specifically, it means that either the whole pattern or a
-subpattern has been called recursively for the second time at the same position
-in the subject string. Some simple patterns that might do this are detected and
-faulted at compile time, but more complicated cases, in particular mutual
-recursions between two different subpatterns, cannot be detected until matching
-is attempted.
+capture group has been called recursively for the second time at the same
+position in the subject string. Some simple patterns that might do this are
+detected and faulted at compile time, but more complicated cases, in particular
+mutual recursions between two different groups, cannot be detected until
+matching is attempted.
 .
 .
 .\" HTML <a name="geterrormessage"></a>
@@ -3030,7 +3167,7 @@ The \fBpcre2_substring_copy_bynumber()\fP function copies a captured substring
 into a supplied buffer, whereas \fBpcre2_substring_get_bynumber()\fP copies it
 into new memory, obtained using the same memory allocation function that was
 used for the match data block. The first two arguments of these functions are a
-pointer to the match data block and a capturing group number.
+pointer to the match data block and a capture group number.
 .P
 The final arguments of \fBpcre2_substring_copy_bynumber()\fP are a pointer to
 the buffer and a pointer to a variable that contains its length in code units.
@@ -3102,9 +3239,9 @@ could not be obtained. When the list is no longer needed, it should be freed by
 calling \fBpcre2_substring_list_free()\fP.
 .P
 If this function encounters a substring that is unset, which can happen when
-capturing subpattern number \fIn+1\fP matches some part of the subject, but
-subpattern \fIn\fP has not been used at all, it returns an empty string. This
-can be distinguished from a genuine zero-length substring by inspecting the
+capture group number \fIn+1\fP matches some part of the subject, but group
+\fIn\fP has not been used at all, it returns an empty string. This can be
+distinguished from a genuine zero-length substring by inspecting the
 appropriate offset in the ovector, which contain PCRE2_UNSET for unset
 substrings, or by calling \fBpcre2_substring_length_bynumber()\fP.
 .
@@ -3134,20 +3271,20 @@ For example, for this pattern:
 .sp
   (a+)b(?<xxx>\ed+)...
 .sp
-the number of the subpattern called "xxx" is 2. If the name is known to be
+the number of the capture group called "xxx" is 2. If the name is known to be
 unique (PCRE2_DUPNAMES was not set), you can find the number from the name by
 calling \fBpcre2_substring_number_from_name()\fP. The first argument is the
 compiled pattern, and the second is the name. The yield of the function is the
-subpattern number, PCRE2_ERROR_NOSUBSTRING if there is no subpattern of that
-name, or PCRE2_ERROR_NOUNIQUESUBSTRING if there is more than one subpattern of
-that name. Given the number, you can extract the substring directly from the
-ovector, or use one of the "bynumber" functions described above.
+group number, PCRE2_ERROR_NOSUBSTRING if there is no group with that name, or
+PCRE2_ERROR_NOUNIQUESUBSTRING if there is more than one group with that name.
+Given the number, you can extract the substring directly from the ovector, or
+use one of the "bynumber" functions described above.
 .P
 For convenience, there are also "byname" functions that correspond to the
 "bynumber" functions, the only difference being that the second argument is a
 name instead of a number. If PCRE2_DUPNAMES is set and there are duplicate
 names, these functions scan all the groups with the given name, and return the
-first named string that is set.
+captured substring from the first named group that is set.
 .P
 If there are no groups with the given name, PCRE2_ERROR_NOSUBSTRING is
 returned. If all groups with the name have numbers that are greater than the
@@ -3156,21 +3293,22 @@ is at least one group with a slot in the ovector, but no group is found to be
 set, PCRE2_ERROR_UNSET is returned.
 .P
 \fBWarning:\fP If the pattern uses the (?| feature to set up multiple
-subpatterns with the same number, as described in the
-.\" HTML <a href="pcre2pattern.html#dupsubpatternnumber">
+capture groups with the same number, as described in the
+.\" HTML <a href="pcre2pattern.html#dupgroupnumber">
 .\" </a>
-section on duplicate subpattern numbers
+section on duplicate group numbers
 .\"
 in the
 .\" HREF
 \fBpcre2pattern\fP
 .\"
-page, you cannot use names to distinguish the different subpatterns, because
+page, you cannot use names to distinguish the different capture groups, because
 names are not included in the compiled code. The matching process uses only
-numbers. For this reason, the use of different names for subpatterns of the
+numbers. For this reason, the use of different names for groups with the
 same number causes an error at compile time.
 .
 .
+.\" HTML <a name="substitutions"></a>
 .SH "CREATING A NEW STRING WITH SUBSTITUTIONS"
 .rs
 .sp
@@ -3179,19 +3317,22 @@ same number causes an error at compile time.
 .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 \fIreplacement\fP,"
-.B "  PCRE2_SIZE \fIrlength\fP, PCRE2_UCHAR *\fIoutputbuffer\zfP,"
+.B "  PCRE2_SIZE \fIrlength\fP, PCRE2_UCHAR *\fIoutputbuffer\fP,"
 .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. 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. For global
-replacements, matches in which \eK in a lookbehind causes the match to start
-earlier than the point that was reached in the previous iteration are also not
-supported.
+string in \fIoutputbuffer\fP, replacing one or more parts that were 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.
+The default is to perform just one replacement, but there is an option that
+requests multiple replacements (see PCRE2_SUBSTITUTE_GLOBAL below for details).
+.P
+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. For
+global replacements, matches in which \eK in a lookbehind causes the match to
+start earlier than the point that was reached in the previous iteration are
+also not supported.
 .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
@@ -3201,9 +3342,9 @@ functions from the match context, if provided, or else those that were used to
 allocate memory for the compiled code.
 .P
 If an external \fImatch_data\fP block is provided, its contents afterwards
-are those set by the final call to \fBpcre2_match()\fP, which will have
-ended in a matching error. The contents of the ovector within the match data
-block may or may not have been changed.
+are those set by the final call to \fBpcre2_match()\fP. For global changes,
+this will have ended in a matching error. The contents of the ovector within
+the match data block may or may not have been changed.
 .P
 The \fIoutlengthptr\fP argument must point to a variable that contains the
 length, in code units, of the output buffer. If the function is successful, the
@@ -3224,12 +3365,12 @@ 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 specify the insertion of
-characters from capturing groups or (*MARK), (*PRUNE), or (*THEN) items in the
-pattern. The following forms are always recognized:
+characters from capture groups or names from (*MARK) or other control verbs
+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 a (*MARK), (*PRUNE), or (*THEN) name
+  $*MARK or ${*MARK}  insert a control verb name
 .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
@@ -3237,11 +3378,11 @@ 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
-$*MARK inserts the name from the last encountered (*MARK), (*PRUNE), or (*THEN)
-on the matching path that has a name. (*MARK) must always include a name, but
-(*PRUNE) and (*THEN) need not. For example, in the case of (*MARK:A)(*PRUNE)
-the name inserted is "A", but for (*MARK:A)(*PRUNE:B) the relevant name is "B".
-This facility can be used to perform simple simultaneous substitutions, as this
+$*MARK inserts the name from the last encountered backtracking control verb on
+the matching path that has a name. (*MARK) must always include a name, but the
+other verbs need not. For example, in the case of (*MARK:A)(*PRUNE) the name
+inserted is "A", but for (*MARK:A)(*PRUNE:B) the relevant name is "B". This
+facility can be used to perform simple simultaneous substitutions, as this
 \fBpcre2test\fP example shows:
 .sp
   /(*MARK:pear)apple|(*MARK:orange)lemon/g,replace=${*MARK}
@@ -3287,12 +3428,12 @@ 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
+PCRE2_SUBSTITUTE_UNKNOWN_UNSET causes references to capture 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
+PCRE2_SUBSTITUTE_UNSET_EMPTY causes unset capture 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
@@ -3317,14 +3458,16 @@ 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.
+capture 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.
+effect. Note also that the PCRE2_ALT_BSUX and PCRE2_EXTRA_ALT_BSUX options do
+not apply to replacement strings.
 .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:
+flexibility to capture group substitution. The syntax is similar to that used
+by Bash:
 .sp
   ${<n>:-<string>}
   ${<n>:+<string1>:<string2>}
@@ -3351,9 +3494,9 @@ 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
-unless PCRE2_SUBSTITUTE_GLOBAL is set.
+If successful, \fBpcre2_substitute()\fP returns the number of successful
+matches. 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
@@ -3388,7 +3531,65 @@ above).
 .\"
 .
 .
-.SH "DUPLICATE SUBPATTERN NAMES"
+.SS "Substitution callouts"
+.rs
+.sp
+.nf
+.B int pcre2_set_substitute_callout(pcre2_match_context *\fImcontext\fP,
+.B "  int (*\fIcallout_function\fP)(pcre2_substitute_callout_block *, void *),"
+.B "  void *\fIcallout_data\fP);"
+.fi
+.sp
+The \fBpcre2_set_substitution_callout()\fP function can be used to specify a
+callout function for \fBpcre2_substitute()\fP. This information is passed in
+a match context. The callout function is called after each substitution has
+been processed, but it can cause the replacement not to happen. The callout
+function is not called for simulated substitutions that happen as a result of
+the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option.
+.P
+The first argument of the callout function is a pointer to a substitute callout
+block structure, which contains the following fields, not necessarily in this
+order:
+.sp
+  uint32_t    \fIversion\fP;
+  uint32_t    \fIsubscount\fP;
+  PCRE2_SPTR  \fIinput\fP;
+  PCRE2_SPTR  \fIoutput\fP;
+  PCRE2_SIZE \fI*ovector\fP;
+  uint32_t    \fIoveccount\fP;
+  PCRE2_SIZE  \fIoutput_offsets[2]\fP;
+.sp
+The \fIversion\fP field contains the version number of the block format. The
+current version is 0. The version number will increase in future if more fields
+are added, but the intention is never to remove any of the existing fields.
+.P
+The \fIsubscount\fP field is the number of the current match. It is 1 for the
+first callout, 2 for the second, and so on. The \fIinput\fP and \fIoutput\fP
+pointers are copies of the values passed to \fBpcre2_substitute()\fP.
+.P
+The \fIovector\fP field points to the ovector, which contains the result of the
+most recent match. The \fIoveccount\fP field contains the number of pairs that
+are set in the ovector, and is always greater than zero.
+.P
+The \fIoutput_offsets\fP vector contains the offsets of the replacement in the
+output string. This has already been processed for dollar and (if requested)
+backslash substitutions as described above.
+.P
+The second argument of the callout function is the value passed as
+\fIcallout_data\fP when the function was registered. The value returned by the
+callout function is interpreted as follows:
+.P
+If the value is zero, the replacement is accepted, and, if
+PCRE2_SUBSTITUTE_GLOBAL is set, processing continues with a search for the next
+match. If the value is not zero, the current replacement is not accepted. If
+the value is greater than zero, processing continues when
+PCRE2_SUBSTITUTE_GLOBAL is set. Otherwise (the value is less than zero or
+PCRE2_SUBSTITUTE_GLOBAL is not set), the the rest of the input is copied to the
+output and the call to \fBpcre2_substitute()\fP exits, returning the number of
+matches so far.
+.
+.
+.SH "DUPLICATE CAPTURE GROUP NAMES"
 .rs
 .sp
 .nf
@@ -3396,13 +3597,14 @@ above).
 .B "  PCRE2_SPTR \fIname\fP, PCRE2_SPTR *\fIfirst\fP, PCRE2_SPTR *\fIlast\fP);"
 .fi
 .P
-When a pattern is compiled with the PCRE2_DUPNAMES option, names for
-subpatterns are not required to be unique. Duplicate names are always allowed
-for subpatterns with the same number, created by using the (?| feature. Indeed,
-if such subpatterns are named, they are required to use the same names.
+When a pattern is compiled with the PCRE2_DUPNAMES option, names for capture
+groups are not required to be unique. Duplicate names are always allowed for
+groups with the same number, created by using the (?| feature. Indeed, if such
+groups are named, they are required to use the same names.
 .P
-Normally, patterns with duplicate names are such that in any one match, only
-one of the named subpatterns participates. An example is shown in the
+Normally, patterns that use duplicate names are such that in any one match,
+only one of each set of identically-named groups participates. An example is
+shown in the
 .\" HREF
 \fBpcre2pattern\fP
 .\"
@@ -3512,11 +3714,12 @@ Here is an example of a simple call to \fBpcre2_dfa_match()\fP:
 .rs
 .sp
 The unused bits of the \fIoptions\fP argument for \fBpcre2_dfa_match()\fP must
-be zero. The only bits that may be set are PCRE2_ANCHORED, PCRE2_ENDANCHORED,
-PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART,
-PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, PCRE2_PARTIAL_SOFT, PCRE2_DFA_SHORTEST,
-and PCRE2_DFA_RESTART. All but the last four of these are exactly the same as
-for \fBpcre2_match()\fP, so their description is not repeated here.
+be zero. The only bits that may be set are PCRE2_ANCHORED,
+PCRE2_COPY_MATCHED_SUBJECT, PCRE2_ENDANCHORED, PCRE2_NOTBOL, PCRE2_NOTEOL,
+PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD,
+PCRE2_PARTIAL_SOFT, PCRE2_DFA_SHORTEST, and PCRE2_DFA_RESTART. All but the last
+four of these are exactly the same as for \fBpcre2_match()\fP, so their
+description is not repeated here.
 .sp
   PCRE2_PARTIAL_HARD
   PCRE2_PARTIAL_SOFT
@@ -3582,9 +3785,8 @@ the three matched strings are
 On success, the yield of the function is a number greater than zero, which is
 the number of matched substrings. The offsets of the substrings are returned in
 the ovector, and can be extracted by number in the same way as for
-\fBpcre2_match()\fP, but the numbers bear no relation to any capturing groups
-that may exist in the pattern, because DFA matching does not support group
-capture.
+\fBpcre2_match()\fP, but the numbers bear no relation to any capture groups
+that may exist in the pattern, because DFA matching does not support capturing.
 .P
 Calls to the convenience functions that extract substrings by name
 return the error PCRE2_ERROR_DFA_UFUNC (unsupported function) if used after a
@@ -3626,7 +3828,13 @@ a backreference.
 .sp
 This return is given if \fBpcre2_dfa_match()\fP encounters a condition item
 that uses a backreference for the condition, or a test for recursion in a
-specific group. These are not supported.
+specific capture group. These are not supported.
+.sp
+  PCRE2_ERROR_DFA_UINVALID_UTF
+.sp
+This return is given if \fBpcre2_dfa_match()\fP is called for a pattern that
+was compiled with PCRE2_MATCH_INVALID_UTF. This is not supported for DFA
+matching.
 .sp
   PCRE2_ERROR_DFA_WSSIZE
 .sp
@@ -3635,9 +3843,9 @@ This return is given if \fBpcre2_dfa_match()\fP runs out of space in the
 .sp
   PCRE2_ERROR_DFA_RECURSE
 .sp
-When a recursive subpattern is processed, the matching function calls itself
-recursively, using private memory for the ovector and \fIworkspace\fP. This
-error is given if the internal ovector is not large enough. This should be
+When a recursion or subroutine call is processed, the matching function calls
+itself recursively, using private memory for the ovector and \fIworkspace\fP.
+This error is given if the internal ovector is not large enough. This should be
 extremely rare, as a vector of size 1000 is used.
 .sp
   PCRE2_ERROR_DFA_BADRESTART
@@ -3670,6 +3878,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 07 September 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 02 September 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 540df789ec89bc3a303095f8d433b094164fa732..f1d28f8be2bf111e863ecbc7b0125e2c6734a61d 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2BUILD 3 "26 April 2018" "PCRE2 10.32"
+.TH PCRE2BUILD 3 "03 March 2019" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .
@@ -373,14 +373,17 @@ environment.
 .SH "PCRE2GREP SUPPORT FOR EXTERNAL SCRIPTS"
 .rs
 .sp
-By default, on non-Windows systems, \fBpcre2grep\fP supports the use of
-callouts with string arguments within the patterns it is matching, in order to
-run external scripts. For details, see the
+By default \fBpcre2grep\fP supports the use of callouts with string arguments
+within the patterns it is matching. There are two kinds: one that generates
+output using local code, and another that calls an external program or script.
+If --disable-pcre2grep-callout-fork is added to the \fBconfigure\fP command,
+only the first kind of callout is supported; if --disable-pcre2grep-callout is
+used, all callouts are completely ignored. For more details of \fBpcre2grep\fP
+callouts, see the
 .\" HREF
 \fBpcre2grep\fP
 .\"
-documentation. This support can be disabled by adding
---disable-pcre2grep-callout to the \fBconfigure\fP command.
+documentation.
 .
 .
 .SH "PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT"
@@ -533,6 +536,22 @@ information about code coverage, see the \fBgcov\fP and \fBlcov\fP
 documentation.
 .
 .
+.SH "DISABLING THE Z AND T FORMATTING MODIFIERS"
+.rs
+.sp
+The C99 standard defines formatting modifiers z and t for size_t and
+ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in
+environments other than Microsoft Visual Studio when __STDC_VERSION__ is
+defined and has a value greater than or equal to 199901L (indicating C99).
+However, there is at least one environment that claims to be C99 but does not
+support these modifiers. If
+.sp
+  --disable-percent-zt
+.sp
+is specified, no use is made of the z or t modifiers. Instead or %td or %zu,
+%lu is used, with a cast for size_t values.
+.
+.
 .SH "SUPPORT FOR FUZZERS"
 .rs
 .sp
@@ -591,6 +610,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 26 April 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 03 March 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index c815c7229af8db2849e01c865d12f80f458c65d7..adb411b5b171a53acfb06c936a79ce4bef9282b0 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2CALLOUT 3 "26 April 2018" "PCRE2 10.32"
+.TH PCRE2CALLOUT 3 "03 February 2019" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH SYNOPSIS
@@ -27,6 +27,15 @@ a match context (see \fBpcre2_set_callout()\fP in the
 .\"
 documentation).
 .P
+When using the \fBpcre2_substitute()\fP function, an additional callout feature
+is available. This does a callout after each change to the subject string and
+is described in the
+.\" HREF
+\fBpcre2api\fP
+.\"
+documentation; the rest of this document is concerned with callouts during
+pattern matching.
+.P
 Within a regular expression, (?C<arg>) indicates a point at which the external
 function is to be called. Different callout points can be identified by putting
 a number less than 256 after the letter C. The default value is zero.
@@ -128,7 +137,7 @@ start only after an internal newline or at the beginning of the subject, and
 branch, automatic anchoring occurs if all branches are anchorable.
 .P
 This optimization is disabled, however, if .* is in an atomic group or if there
-is a backreference to the capturing group in which it appears. It is also
+is a backreference to the capture group in which it appears. It is also
 disabled if the pattern contains (*PRUNE) or (*SKIP). However, the presence of
 callouts does not affect it.
 .P
@@ -322,8 +331,8 @@ callout before an assertion such as (?=ab) the length is 3. For an an
 alternation bar or a closing parenthesis, the length is one, unless a closing
 parenthesis is followed by a quantifier, in which case its length is included.
 (This changed in release 10.23. In earlier releases, before an opening
-parenthesis the length was that of the entire subpattern, and before an
-alternation bar or a closing parenthesis the length was zero.)
+parenthesis the length was that of the entire group, and before an alternation
+bar or a closing parenthesis the length was zero.)
 .P
 The \fIpattern_position\fP and \fInext_item_length\fP fields are intended to
 help in distinguishing between different automatic callouts, which all have the
@@ -443,6 +452,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 26 April 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 03 February 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 6e448f6c495a464a37e9c03f10e1145eef3432f6..b4209dbde4c6831fb01d3f3ebe301c831f9e2965 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2COMPAT 3 "28 July 2018" "PCRE2 10.32"
+.TH PCRE2COMPAT 3 "13 July 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "DIFFERENCES BETWEEN PCRE2 AND PERL"
@@ -23,10 +23,9 @@ character is not "a" three times (in principle; PCRE2 optimizes this to run the
 assertion just once). Perl allows some repeat quantifiers on other assertions,
 for example, \eb* (but not \eb{3}), but these do not seem to have any use.
 .P
-3. Capturing subpatterns that occur inside negative lookaround assertions are
-counted, but their entries in the offsets vector are set only when a negative
-assertion is a condition that has a matching branch (that is, the condition is
-false).
+3. Capture groups that occur inside negative lookaround assertions are counted,
+but their entries in the offsets vector are set only when a negative assertion
+is a condition that has a matching branch (that is, the condition is false).
 .P
 4. The following Perl escape sequences are not supported: \eF, \el, \eL, \eu,
 \eU, and \eN when followed by a character name. \eN on its own, matching a
@@ -34,8 +33,9 @@ non-newline character, and \eN{U+dd..}, matching a Unicode code point, are
 supported. The escapes that modify the case of following letters are
 implemented by Perl's general string-handling and are not part of its pattern
 matching engine. If any of these are encountered by PCRE2, an error is
-generated by default. However, if the PCRE2_ALT_BSUX option is set, \eU and \eu
-are interpreted as ECMAScript interprets them.
+generated by default. However, if either of the PCRE2_ALT_BSUX or
+PCRE2_EXTRA_ALT_BSUX options is set, \eU and \eu are interpreted as ECMAScript
+interprets them.
 .P
 5. The Perl escape sequences \ep, \eP, and \eX are supported only if PCRE2 is
 built with Unicode support (the default). The properties that can be tested
@@ -79,13 +79,13 @@ documentation for details.
 to PCRE2 release 10.23, but from release 10.30 this changed, and backtracking
 into subroutine calls is now supported, as in Perl.
 .P
-9. If any of the backtracking control verbs are used in a subpattern that is
-called as a subroutine (whether or not recursively), their effect is confined
-to that subpattern; it does not extend to the surrounding pattern. This is not
-always the case in Perl. In particular, if (*THEN) is present in a group that
-is called as a subroutine, its action is limited to that group, even if the
-group does not contain any | characters. Note that such subpatterns are
-processed as anchored at the point where they are tested.
+9. If any of the backtracking control verbs are used in a group that is called
+as a subroutine (whether or not recursively), their effect is confined to that
+group; it does not extend to the surrounding pattern. This is not always the
+case in Perl. In particular, if (*THEN) is present in a group that is called as
+a subroutine, its action is limited to that group, even if the group does not
+contain any | characters. Note that such groups are processed as anchored
+at the point where they are tested.
 .P
 10. If a pattern contains more than one backtracking control verb, the first
 one that is backtracked onto acts. For example, in the pattern
@@ -101,21 +101,20 @@ strings when part of a pattern is repeated. For example, matching "aba" against
 the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE2 it is set to
 "b".
 .P
-13. PCRE2's handling of duplicate subpattern numbers and duplicate subpattern
-names is not as general as Perl's. This is a consequence of the fact the PCRE2
-works internally just with numbers, using an external table to translate
-between numbers and names. In particular, a pattern such as (?|(?<a>A)|(?<b>B),
-where the two capturing parentheses have the same number but different names,
-is not supported, and causes an error at compile time. If it were allowed, it
-would not be possible to distinguish which parentheses matched, because both
-names map to capturing subpattern number 1. To avoid this confusing situation,
-an error is given at compile time.
+13. PCRE2's handling of duplicate capture group numbers and names is not as
+general as Perl's. This is a consequence of the fact the PCRE2 works internally
+just with numbers, using an external table to translate between numbers and
+names. In particular, a pattern such as (?|(?<a>A)|(?<b>B), where the two
+capture groups have the same number but different names, is not supported, and
+causes an error at compile time. If it were allowed, it would not be possible
+to distinguish which group matched, because both names map to capture group
+number 1. To avoid this confusing situation, an error is given at compile time.
 .P
 14. Perl used to recognize comments in some places that PCRE2 does not, for
-example, between the ( and ? at the start of a subpattern. If the /x modifier
-is set, Perl allowed white space between ( and ? though the latest Perls give
-an error (for a while it was just deprecated). There may still be some cases
-where Perl behaves differently.
+example, between the ( and ? at the start of a group. If the /x modifier is
+set, Perl allowed white space between ( and ? though the latest Perls give an
+error (for a while it was just deprecated). There may still be some cases where
+Perl behaves differently.
 .P
 15. Perl, when in warning mode, gives warnings for character classes such as
 [A-\ed] or [a-[:digit:]]. It then treats the hyphens as literals. PCRE2 has no
@@ -171,6 +170,10 @@ different way and is not Perl-compatible.
 (l) PCRE2 recognizes some special sequences such as (*CR) or (*NO_JIT) at
 the start of a pattern that set overall options that cannot be changed within
 the pattern.
+.sp
+(m) PCRE2 supports non-atomic positive lookaround assertions. This is an
+extension to the lookaround facilities. The default, Perl-compatible
+lookarounds are atomic.
 .P
 18. The Perl /a modifier restricts /d numbers to pure ascii, and the /aa
 modifier restricts /i case-insensitive matching to pure ascii, ignoring Unicode
@@ -200,6 +203,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 28 July 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 13 July 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index a9e58e2684365842ed27a0a50afd31ee13916024..0d3014596e0d45c61d40c5e77f0d6d899795a081 100644 (file)
@@ -104,12 +104,11 @@ uint32_t newline;
 
 PCRE2_SIZE erroroffset;
 PCRE2_SIZE *ovector;
+PCRE2_SIZE subject_length;
 
-size_t subject_length;
 pcre2_match_data *match_data;
 
 
-
 /**************************************************************************
 * First, sort out the command line. There is only one possible option at  *
 * the moment, "-g" to request repeated matching to find all occurrences,  *
@@ -138,12 +137,14 @@ if (argc - i != 2)
   return 1;
   }
 
-/* As pattern and subject are char arguments, they can be straightforwardly
-cast to PCRE2_SPTR as we are working in 8-bit code units. */
+/* Pattern and subject are char arguments, so they can be straightforwardly
+cast to PCRE2_SPTR because we are working in 8-bit code units. The subject
+length is cast to PCRE2_SIZE for completeness, though PCRE2_SIZE is in fact
+defined to be size_t. */
 
 pattern = (PCRE2_SPTR)argv[i];
 subject = (PCRE2_SPTR)argv[i+1];
-subject_length = strlen((char *)subject);
+subject_length = (PCRE2_SIZE)strlen((char *)subject);
 
 
 /*************************************************************************
@@ -172,17 +173,22 @@ if (re == NULL)
 
 
 /*************************************************************************
-* If the compilation succeeded, we call PCRE again, in order to do a     *
+* If the compilation succeeded, we call PCRE2 again, in order to do a    *
 * pattern match against the subject string. This does just ONE match. If *
 * further matching is needed, it will be done below. Before running the  *
-* match we must set up a match_data block for holding the result.        *
+* match we must set up a match_data block for holding the result. Using  *
+* pcre2_match_data_create_from_pattern() ensures that the block is       *
+* exactly the right size for the number of capturing parentheses in the  *
+* pattern. If you need to know the actual size of a match_data block as  *
+* a number of bytes, you can find it like this:                          *
+*                                                                        *
+* PCRE2_SIZE match_data_size = pcre2_get_match_data_size(match_data);    *
 *************************************************************************/
 
-/* Using this function ensures that the block is exactly the right size for
-the number of capturing parentheses in the pattern. */
-
 match_data = pcre2_match_data_create_from_pattern(re, NULL);
 
+/* Now run the match. */
+
 rc = pcre2_match(
   re,                   /* the compiled pattern */
   subject,              /* the subject string */
@@ -205,7 +211,7 @@ if (rc < 0)
     default: printf("Matching error %d\en", rc); break;
     }
   pcre2_match_data_free(match_data);   /* Release memory used for the match */
-  pcre2_code_free(re);                 /* data and the compiled pattern. */
+  pcre2_code_free(re);                 /*   data and the compiled pattern. */
   return 1;
   }
 
@@ -249,7 +255,7 @@ application you might want to do things other than print them. */
 for (i = 0; i < rc; i++)
   {
   PCRE2_SPTR substring_start = subject + ovector[2*i];
-  size_t substring_length = ovector[2*i+1] - ovector[2*i];
+  PCRE2_SIZE substring_length = ovector[2*i+1] - ovector[2*i];
   printf("%2d: %.*s\en", i, (int)substring_length, (char *)substring_start);
   }
 
index ce112af7cc40596a480a8369359ba65787966e3a..22992b14ad1fe739ec8c3283929b75c61e491438 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2GREP 1 "24 February 2018" "PCRE2 10.32"
+.TH PCRE2GREP 1 "15 June 2019" "PCRE2 10.34"
 .SH NAME
 pcre2grep - a grep with Perl-compatible regular expressions.
 .SH SYNOPSIS
@@ -596,19 +596,29 @@ otherwise empty line. This option is mutually exclusive with \fB--output\fP,
 .TP
 \fB-o\fP\fInumber\fP, \fB--only-matching\fP=\fInumber\fP
 Show only the part of the line that matched the capturing parentheses of the
-given number. Up to 32 capturing parentheses are supported, and -o0 is
-equivalent to \fB-o\fP without a number. Because these options can be given
-without an argument (see above), if an argument is present, it must be given in
-the same shell item, for example, -o3 or --only-matching=2. The comments given
-for the non-argument case above also apply to this option. If the specified
-capturing parentheses do not exist in the pattern, or were not set in the
-match, nothing is output unless the file name or line number are being output.
+given number. Up to 50 capturing parentheses are supported by default. This
+limit can be changed via the \fB--om-capture\fP option. A pattern may contain
+any number of capturing parentheses, but only those whose number is within the
+limit can be accessed by \fB-o\fP. An error occurs if the number specified by
+\fB-o\fP is greater than the limit.
+.sp
+-o0 is the same as \fB-o\fP without a number. Because these options can be
+given without an argument (see above), if an argument is present, it must be
+given in the same shell item, for example, -o3 or --only-matching=2. The
+comments given for the non-argument case above also apply to this option. If
+the specified capturing parentheses do not exist in the pattern, or were not
+set in the match, nothing is output unless the file name or line number are
+being output.
 .sp
 If this option is given multiple times, multiple substrings are output for each
 match, in the order the options are given, and all on one line. For example,
 -o3 -o1 -o3 causes the substrings matched by capturing parentheses 3 and 1 and
 then 3 again to be output. By default, there is no separator (but see the next
-option).
+but one option).
+.TP
+\fB--om-capture\fP=\fInumber\fP
+Set the number of capturing parentheses that can be accessed by \fB-o\fP. The
+default is 50.
 .TP
 \fB--om-separator\fP=\fItext\fP
 Specify a separating string for multiple occurrences of \fB-o\fP. The default
@@ -644,12 +654,22 @@ is listed. If file names are being output, the grand total is preceded by
 ignored when used with \fB-L\fP (list files without matches), because the grand
 total would always be zero.
 .TP
-\fB-u\fP, \fB--utf-8\fP
+\fB-u\fP, \fB--utf\fP
 Operate in UTF-8 mode. This option is available only if PCRE2 has been compiled
 with UTF-8 support. All patterns (including those for any \fB--exclude\fP and
 \fB--include\fP options) and all subject lines that are scanned must be valid
 strings of UTF-8 characters.
 .TP
+\fB-U\fP, \fB--utf-allow-invalid\fP
+As \fB--utf\fP, but in addition subject lines may contain invalid UTF-8 code
+unit sequences. These can never form part of any pattern match. This facility
+allows valid UTF-8 strings to be sought in executable or other binary files.
+For more details about matching in non-valid UTF-8 strings, see the
+.\" HREF
+\fBpcre2unicode\fP(3)
+.\"
+documentation.
+.TP
 \fB-V\fP, \fB--version\fP
 Write the version numbers of \fBpcre2grep\fP and the PCRE2 library to the
 standard output and then exit. Anything else on the command line is
@@ -711,9 +731,9 @@ as in the GNU \fBgrep\fP program. Any long option of the form
 \fB--file-offsets\fP, \fB--heap-limit\fP, \fB--include-dir\fP,
 \fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP, \fB-M\fP,
 \fB--multiline\fP, \fB-N\fP, \fB--newline\fP, \fB--om-separator\fP,
-\fB--output\fP, \fB-u\fP, and \fB--utf-8\fP options are specific to
-\fBpcre2grep\fP, as is the use of the \fB--only-matching\fP option with a
-capturing parentheses number.
+\fB--output\fP, \fB-u\fP, \fB--utf\fP, \fB-U\fP, and \fB--utf-allow-invalid\fP
+options are specific to \fBpcre2grep\fP, as is the use of the
+\fB--only-matching\fP option with a capturing parentheses number.
 .P
 Although most of the common options work the same way, a few are different in
 \fBpcre2grep\fP. For example, the \fB--include\fP option's argument is a glob
@@ -759,10 +779,12 @@ character. Otherwise \fBpcre2grep\fP will assume that it has no data.
 .sp
 \fBpcre2grep\fP has, by default, support for calling external programs or
 scripts or echoing specific strings during matching by making use of PCRE2's
-callout facility. However, this support can be disabled when \fBpcre2grep\fP is
-built. You can find out whether your binary has support for callouts by running
-it with the \fB--help\fP option. If the support is not enabled, all callouts in
-patterns are ignored by \fBpcre2grep\fP.
+callout facility. However, this support can be completely or partially disabled
+when \fBpcre2grep\fP is built. You can find out whether your binary has support
+for callouts by running it with the \fB--help\fP option. If callout support is
+completely disabled, all callouts in patterns are ignored by \fBpcre2grep\fP.
+If the facility is partially disabled, calling external programs is not
+supported, and callouts that request it are ignored.
 .P
 A callout in a PCRE2 pattern is of the form (?C<arg>) where the argument is
 either a number or a quoted string (see the
@@ -776,6 +798,11 @@ only callouts with string arguments are useful.
 .SS "Calling external programs or scripts"
 .rs
 .sp
+This facility can be independently disabled when \fBpcre2grep\fP is built. It
+is supported for Windows, where a call to \fB_spawnvp()\fP is used, for VMS,
+where \fBlib$spawn()\fP is used, and for any other Unix-like environment where
+\fBfork()\fP and \fBexecv()\fP are available.
+.P
 If the callout string does not start with a pipe (vertical bar) character, it
 is parsed into a list of substrings separated by pipe characters. The first
 substring must be an executable name, with the following substrings specifying
@@ -803,7 +830,7 @@ a single dollar and $| is replaced by a pipe character. Here is an example:
     Arg1: [1] [234] [4] Arg2: |1| ()
     12345
 .sp
-The parameters for the \fBexecv()\fP system call that is used to run the
+The parameters for the system call that is used to run the
 program or script are zero-terminated strings. This means that binary zero
 characters in the callout argument will cause premature termination of their
 substrings, and therefore should not be present. Any syntax errors in the
@@ -816,14 +843,15 @@ matcher backtracks in the normal way.
 .SS "Echoing a specific string"
 .rs
 .sp
-If the callout string starts with a pipe (vertical bar) character, the rest of
-the string is written to the output, having been passed through the same escape
-processing as text from the --output option. This provides a simple echoing
-facility that avoids calling an external program or script. No terminator is
-added to the string, so if you want a newline, you must include it explicitly.
-Matching continues normally after the string is output. If you want to see only
-the callout output but not any output from an actual match, you should end the
-relevant pattern with (*FAIL).
+This facility is always available, provided that callouts were not completely
+disabled when \fBpcre2grep\fP was built. If the callout string starts with a
+pipe (vertical bar) character, the rest of the string is written to the output,
+having been passed through the same escape processing as text from the --output
+option. This provides a simple echoing facility that avoids calling an external
+program or script. No terminator is added to the string, so if you want a
+newline, you must include it explicitly. Matching continues normally after the
+string is output. If you want to see only the callout output but not any output
+from an actual match, you should end the relevant pattern with (*FAIL).
 .
 .
 .SH "MATCHING ERRORS"
@@ -876,6 +904,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 24 February 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 15 June 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 000239cd922d255252772a9d04c09b26b62d9f9f..b11092a228d8b416bebae101b90170fd33174e8f 100644 (file)
@@ -12,11 +12,11 @@ SYNOPSIS
 DESCRIPTION
 
        pcre2grep  searches  files  for  character patterns, in the same way as
-       other grep commands do,  but  it  uses  the  PCRE2  regular  expression
-       library  to  support  patterns  that  are  compatible  with the regular
-       expressions of Perl 5. See pcre2syntax(3) for a quick-reference summary
-       of  pattern  syntax,  or  pcre2pattern(3) for a full description of the
-       syntax and semantics of the regular expressions that PCRE2 supports.
+       other grep commands do, but it uses the PCRE2  regular  expression  li-
+       brary  to support patterns that are compatible with the regular expres-
+       sions of Perl 5. See pcre2syntax(3) for a  quick-reference  summary  of
+       pattern syntax, or pcre2pattern(3) for a full description of the syntax
+       and semantics of the regular expressions that PCRE2 supports.
 
        Patterns, whether supplied on the command line or in a  separate  file,
        are given without delimiters. For example:
@@ -26,8 +26,8 @@ DESCRIPTION
        If you attempt to use delimiters (for example, by surrounding a pattern
        with slashes, as is common in Perl scripts), they  are  interpreted  as
        part  of  the pattern. Quotes can of course be used to delimit patterns
-       on the command line because they are  interpreted  by  the  shell,  and
-       indeed  quotes  are required if a pattern contains white space or shell
+       on the command line because they are interpreted by the shell, and  in-
+       deed  quotes  are  required  if a pattern contains white space or shell
        metacharacters.
 
        The first argument that follows any option settings is treated  as  the
@@ -54,8 +54,8 @@ DESCRIPTION
        controlled  by  parameters  that  can  be  set by the --buffer-size and
        --max-buffer-size options. The first of these sets the size  of  buffer
        that  is obtained at the start of processing. If an input file contains
-       very long lines, a larger buffer may be  needed;  this  is  handled  by
-       automatically extending the buffer, up to the limit specified by --max-
+       very long lines, a larger buffer may be needed; this is handled by  au-
+       tomatically  extending  the buffer, up to the limit specified by --max-
        buffer-size. The default values for these parameters can  be  set  when
        pcre2grep  is  built;  if nothing is specified, the defaults are set to
        20KiB and 1MiB respectively. An error occurs if a line is too long  and
@@ -75,12 +75,12 @@ DESCRIPTION
        By default, as soon as one pattern matches a line, no further  patterns
        are considered. However, if --colour (or --color) is used to colour the
        matching substrings, or if --only-matching, --file-offsets, or  --line-
-       offsets  is  used  to  output  only  the  part of the line that matched
-       (either shown literally, or as an offset), scanning resumes immediately
+       offsets  is  used to output only the part of the line that matched (ei-
+       ther shown literally, or as an offset),  scanning  resumes  immediately
        following  the  match,  so that further matches on the same line can be
-       found. If there are multiple  patterns,  they  are  all  tried  on  the
-       remainder  of  the  line, but patterns that follow the one that matched
-       are not tried on the earlier part of the line.
+       found. If there are multiple patterns, they are all tried  on  the  re-
+       mainder  of the line, but patterns that follow the one that matched are
+       not tried on the earlier part of the line.
 
        This behaviour means that the order  in  which  multiple  patterns  are
        specified  can affect the output when one of the above options is used.
@@ -89,11 +89,11 @@ DESCRIPTION
        overlap).
 
        Patterns that can match an empty string are accepted, but empty  string
-       matches   are   never   recognized.   An   example   is   the   pattern
-       "(super)?(man)?", in which all components are  optional.  This  pattern
-       finds  all  occurrences  of  both "super" and "man"; the output differs
-       from matching with "super|man" when only the  matching  substrings  are
-       being shown.
+       matches   are  never  recognized.  An  example  is  the  pattern  "(su-
+       per)?(man)?", in which all components are optional. This pattern  finds
+       all  occurrences  of  both  "super"  and "man"; the output differs from
+       matching with "super|man" when only the matching substrings  are  being
+       shown.
 
        If  the  LC_ALL or LC_CTYPE environment variable is set, pcre2grep uses
        the value to set a locale when calling the PCRE2 library.  The --locale
@@ -116,153 +116,152 @@ BINARY FILES
        By  default,  a  file that contains a binary zero byte within the first
        1024 bytes is identified as a binary file, and is processed  specially.
        (GNU grep identifies binary files in this manner.) However, if the new-
-       line type is specified as "nul", that is,  the  line  terminator  is  a
-       binary  zero,  the  test  for  a  binary  file  is not applied. See the
-       --binary-files option for a means of changing the way binary files  are
-       handled.
+       line type is specified as "nul", that is, the line terminator is a  bi-
+       nary zero, the test for a binary file is not applied. See the --binary-
+       files option for a means of changing the way binary files are handled.
 
 
 BINARY ZEROS IN PATTERNS
 
-       Patterns  passed  from the command line are strings that are terminated
-       by a binary zero, so cannot contain internal zeros.  However,  patterns
+       Patterns passed from the command line are strings that  are  terminated
+       by  a  binary zero, so cannot contain internal zeros. However, patterns
        that are read from a file via the -f option may contain binary zeros.
 
 
 OPTIONS
 
-       The  order  in  which some of the options appear can affect the output.
-       For example, both the -H and -l options affect  the  printing  of  file
-       names.  Whichever  comes later in the command line will be the one that
-       takes effect. Similarly, except where noted  below,  if  an  option  is
-       given  twice,  the  later setting is used. Numerical values for options
-       may be followed by K  or  M,  to  signify  multiplication  by  1024  or
+       The order in which some of the options appear can  affect  the  output.
+       For  example,  both  the  -H and -l options affect the printing of file
+       names. Whichever comes later in the command line will be the  one  that
+       takes  effect.  Similarly,  except  where  noted below, if an option is
+       given twice, the later setting is used. Numerical  values  for  options
+       may  be  followed  by  K  or  M,  to  signify multiplication by 1024 or
        1024*1024 respectively.
 
        --        This terminates the list of options. It is useful if the next
-                 item on the command line starts with a hyphen but is  not  an
-                 option.  This  allows for the processing of patterns and file
+                 item  on  the command line starts with a hyphen but is not an
+                 option. This allows for the processing of patterns  and  file
                  names that start with hyphens.
 
        -A number, --after-context=number
-                 Output up to number lines  of  context  after  each  matching
-                 line.  Fewer lines are output if the next match or the end of
-                 the file is reached, or if the  processing  buffer  size  has
-                 been  set  too  small.  If file names and/or line numbers are
-                 being output, a hyphen separator is used instead of  a  colon
-                 for  the  context  lines.  A  line  containing "--" is output
-                 between each group of lines, unless they are in fact contigu-
-                 ous  in the input file. The value of number is expected to be
-                 relatively small. When -c is used, -A is ignored.
+                 Output  up  to  number  lines  of context after each matching
+                 line. Fewer lines are output if the next match or the end  of
+                 the  file  is  reached,  or if the processing buffer size has
+                 been set too small. If file names and/or line numbers are be-
+                 ing output, a hyphen separator is used instead of a colon for
+                 the context lines. A line containing "--" is  output  between
+                 each  group  of  lines, unless they are in fact contiguous in
+                 the input file. The value of number is expected to  be  rela-
+                 tively small. When -c is used, -A is ignored.
 
        -a, --text
-                 Treat binary files as text. This is equivalent  to  --binary-
+                 Treat  binary  files as text. This is equivalent to --binary-
                  files=text.
 
        -B number, --before-context=number
-                 Output  up  to  number  lines of context before each matching
-                 line. Fewer lines are output if the  previous  match  or  the
-                 start  of the file is within number lines, or if the process-
-                 ing buffer size has been set too small. If file names  and/or
-                 line  numbers  are  being  output, a hyphen separator is used
-                 instead of a colon for the context lines. A  line  containing
-                 "--"  is  output between each group of lines, unless they are
-                 in fact contiguous in the input file. The value of number  is
-                 expected  to  be  relatively  small.  When  -c is used, -B is
-                 ignored.
+                 Output up to number lines of  context  before  each  matching
+                 line.  Fewer  lines  are  output if the previous match or the
+                 start of the file is within number lines, or if the  process-
+                 ing  buffer size has been set too small. If file names and/or
+                 line numbers are being output, a hyphen separator is used in-
+                 stead  of  a  colon  for the context lines. A line containing
+                 "--" is output between each group of lines, unless  they  are
+                 in  fact contiguous in the input file. The value of number is
+                 expected to be relatively small. When -c is used, -B  is  ig-
+                 nored.
 
        --binary-files=word
-                 Specify how binary files are to be processed. If the word  is
-                 "binary"  (the  default),  pattern  matching  is performed on
-                 binary files, but the only  output  is  "Binary  file  <name>
-                 matches"  when a match succeeds. If the word is "text", which
-                 is equivalent to the -a or --text option,  binary  files  are
-                 processed  in  the  same way as any other file. In this case,
-                 when a match succeeds, the  output  may  be  binary  garbage,
-                 which  can  have  nasty effects if sent to a terminal. If the
-                 word is  "without-match",  which  is  equivalent  to  the  -I
-                 option,  binary  files  are  not  processed  at all; they are
-                 assumed not to be of interest and are skipped without causing
-                 any output or affecting the return code.
+                 Specify  how binary files are to be processed. If the word is
+                 "binary" (the default), pattern matching is performed on  bi-
+                 nary  files,  but  the  only  output  is  "Binary file <name>
+                 matches" when a match succeeds. If the word is "text",  which
+                 is  equivalent  to  the -a or --text option, binary files are
+                 processed in the same way as any other file.  In  this  case,
+                 when  a  match  succeeds,  the  output may be binary garbage,
+                 which can have nasty effects if sent to a  terminal.  If  the
+                 word  is  "without-match",  which is equivalent to the -I op-
+                 tion, binary files are not processed at all; they are assumed
+                 not  to  be  of  interest and are skipped without causing any
+                 output or affecting the return code.
 
        --buffer-size=number
-                 Set  the  parameter that controls how much memory is obtained
+                 Set the parameter that controls how much memory  is  obtained
                  at the start of processing for buffering files that are being
                  scanned. See also --max-buffer-size below.
 
        -C number, --context=number
-                 Output  number  lines  of  context both before and after each
-                 matching line.  This is equivalent to setting both -A and  -B
+                 Output number lines of context both  before  and  after  each
+                 matching  line.  This is equivalent to setting both -A and -B
                  to the same value.
 
        -c, --count
-                 Do  not  output  lines from the files that are being scanned;
-                 instead output the number  of  lines  that  would  have  been
+                 Do not output lines from the files that  are  being  scanned;
+                 instead  output  the  number  of  lines  that would have been
                  shown, either because they matched, or, if -v is set, because
-                 they failed to match. By default, this count is  exactly  the
-                 same  as the number of lines that would have been output, but
-                 if the -M (multiline) option is used (without -v), there  may
-                 be  more suppressed lines than the count (that is, the number
+                 they  failed  to match. By default, this count is exactly the
+                 same as the number of lines that would have been output,  but
+                 if  the -M (multiline) option is used (without -v), there may
+                 be more suppressed lines than the count (that is, the  number
                  of matches).
 
-                 If no lines are selected, the number zero is output. If  sev-
-                 eral  files are are being scanned, a count is output for each
-                 of them and the -t option can be used to cause a total to  be
-                 output  at  the  end.  However,  if  the --files-with-matches
-                 option is also  used,  only  those  files  whose  counts  are
-                 greater  than  zero  are listed. When -c is used, the -A, -B,
-                 and -C options are ignored.
+                 If  no lines are selected, the number zero is output. If sev-
+                 eral files are are being scanned, a count is output for  each
+                 of  them and the -t option can be used to cause a total to be
+                 output at the end. However, if the  --files-with-matches  op-
+                 tion  is also used, only those files whose counts are greater
+                 than zero are listed. When -c is used, the -A, -B, and -C op-
+                 tions are ignored.
 
        --colour, --color
                  If this option is given without any data, it is equivalent to
-                 "--colour=auto".   If  data  is required, it must be given in
+                 "--colour=auto".  If data is required, it must  be  given  in
                  the same shell item, separated by an equals sign.
 
        --colour=value, --color=value
                  This option specifies under what circumstances the parts of a
                  line that matched a pattern should be coloured in the output.
-                 By default, the output is not coloured. The value  (which  is
-                 optional,  see above) may be "never", "always", or "auto". In
-                 the latter case, colouring happens only if the standard  out-
-                 put  is connected to a terminal. More resources are used when
+                 By  default,  the output is not coloured. The value (which is
+                 optional, see above) may be "never", "always", or "auto".  In
+                 the  latter case, colouring happens only if the standard out-
+                 put is connected to a terminal. More resources are used  when
                  colouring is enabled, because pcre2grep has to search for all
-                 possible  matches in a line, not just one, in order to colour
+                 possible matches in a line, not just one, in order to  colour
                  them all.
 
-                 The colour that is used can be specified by  setting  one  of
-                 the  environment variables PCRE2GREP_COLOUR, PCRE2GREP_COLOR,
+                 The  colour  that  is used can be specified by setting one of
+                 the environment variables PCRE2GREP_COLOUR,  PCRE2GREP_COLOR,
                  PCREGREP_COLOUR, or PCREGREP_COLOR, which are checked in that
                  order.  If  none  of  these  are  set,  pcre2grep  looks  for
-                 GREP_COLORS or GREP_COLOR (in that order). The value  of  the
-                 variable  should  be  a string of two numbers, separated by a
-                 semicolon, except in the  case  of  GREP_COLORS,  which  must
+                 GREP_COLORS  or  GREP_COLOR (in that order). The value of the
+                 variable should be a string of two numbers,  separated  by  a
+                 semicolon,  except  in  the  case  of GREP_COLORS, which must
                  start with "ms=" or "mt=" followed by two semicolon-separated
-                 colours, terminated by the end of the string or by  a  colon.
-                 If  GREP_COLORS  does  not  start  with  "ms=" or "mt=" it is
-                 ignored, and GREP_COLOR is checked.
+                 colours,  terminated  by the end of the string or by a colon.
+                 If GREP_COLORS does not start with "ms=" or "mt=" it  is  ig-
+                 nored, and GREP_COLOR is checked.
 
-                 If the string obtained from one of the above  variables  con-
+                 If  the  string obtained from one of the above variables con-
                  tains any characters other than semicolon or digits, the set-
                  ting is ignored and the default colour is used. The string is
                  copied directly into the control string for setting colour on
-                 a terminal, so it is your responsibility to ensure  that  the
-                 values  make  sense.  If  no relevant environment variable is
+                 a  terminal,  so it is your responsibility to ensure that the
+                 values make sense. If no  relevant  environment  variable  is
                  set, the default is "1;31", which gives red.
 
        -D action, --devices=action
-                 If an input path is  not  a  regular  file  or  a  directory,
-                 "action"  specifies  how  it is to be processed. Valid values
-                 are "read" (the default) or "skip" (silently skip the path).
+                 If  an  input path is not a regular file or a directory, "ac-
+                 tion" specifies how it is to be processed. Valid  values  are
+                 "read" (the default) or "skip" (silently skip the path).
 
        -d action, --directories=action
                  If an input path is a directory, "action" specifies how it is
-                 to  be  processed.   Valid  values are "read" (the default in
-                 non-Windows environments, for compatibility with  GNU  grep),
-                 "recurse"  (equivalent to the -r option), or "skip" (silently
-                 skip the path, the default in Windows environments).  In  the
-                 "read"  case,  directories  are read as if they were ordinary
-                 files. In some operating systems  the  effect  of  reading  a
-                 directory like this is an immediate end-of-file; in others it
+                 to be processed.  Valid values are  "read"  (the  default  in
+                 non-Windows  environments,  for compatibility with GNU grep),
+                 "recurse" (equivalent to the -r option), or "skip"  (silently
+                 skip  the  path, the default in Windows environments). In the
+                 "read" case, directories are read as if  they  were  ordinary
+                 files.  In some operating systems the effect of reading a di-
+                 rectory like this is an immediate end-of-file; in  others  it
                  may provoke an error.
 
        --depth-limit=number
@@ -271,198 +270,198 @@ OPTIONS
        -e pattern, --regex=pattern, --regexp=pattern
                  Specify a pattern to be matched. This option can be used mul-
                  tiple times in order to specify several patterns. It can also
-                 be used as a way of specifying a single pattern  that  starts
-                 with  a hyphen. When -e is used, no argument pattern is taken
-                 from the command line; all  arguments  are  treated  as  file
-                 names.  There is no limit to the number of patterns. They are
-                 applied to each line in the order in which they  are  defined
+                 be  used  as a way of specifying a single pattern that starts
+                 with a hyphen. When -e is used, no argument pattern is  taken
+                 from  the  command  line;  all  arguments are treated as file
+                 names. There is no limit to the number of patterns. They  are
+                 applied  to  each line in the order in which they are defined
                  until one matches.
 
-                 If  -f is used with -e, the command line patterns are matched
+                 If -f is used with -e, the command line patterns are  matched
                  first, followed by the patterns from the file(s), independent
-                 of  the order in which these options are specified. Note that
-                 multiple use of -e is not the same as a single  pattern  with
+                 of the order in which these options are specified. Note  that
+                 multiple  use  of -e is not the same as a single pattern with
                  alternatives. For example, X|Y finds the first character in a
-                 line that is X or Y, whereas if the two  patterns  are  given
+                 line  that  is  X or Y, whereas if the two patterns are given
                  separately, with X first, pcre2grep finds X if it is present,
                  even if it follows Y in the line. It finds Y only if there is
-                 no  X  in  the line. This matters only if you are using -o or
+                 no X in the line. This matters only if you are  using  -o  or
                  --colo(u)r to show the part(s) of the line that matched.
 
        --exclude=pattern
                  Files (but not directories) whose names match the pattern are
-                 skipped  without  being processed. This applies to all files,
-                 whether listed on the command  line,  obtained  from  --file-
+                 skipped without being processed. This applies to  all  files,
+                 whether  listed  on  the  command line, obtained from --file-
                  list, or by scanning a directory. The pattern is a PCRE2 reg-
-                 ular expression, and is matched against the  final  component
-                 of  the  file  name,  not the entire path. The -F, -w, and -x
-                 options do not apply to this pattern. The option may be given
+                 ular  expression,  and is matched against the final component
+                 of the file name, not the entire path. The -F, -w, and -x op-
+                 tions  do  not apply to this pattern. The option may be given
                  any number of times in order to specify multiple patterns. If
-                 a file name matches both an --include and an  --exclude  pat-
+                 a  file  name matches both an --include and an --exclude pat-
                  tern, it is excluded. There is no short form for this option.
 
        --exclude-from=filename
-                 Treat  each  non-empty  line  of  the file as the data for an
+                 Treat each non-empty line of the file  as  the  data  for  an
                  --exclude option. What constitutes a newline when reading the
-                 file  is the operating system's default. The --newline option
-                 has no effect on this option. This option may be  given  more
+                 file is the operating system's default. The --newline  option
+                 has  no  effect on this option. This option may be given more
                  than once in order to specify a number of files to read.
 
        --exclude-dir=pattern
                  Directories whose names match the pattern are skipped without
-                 being processed, whatever  the  setting  of  the  --recursive
-                 option.  This  applies  to all directories, whether listed on
-                 the command line, obtained from --file-list, or by scanning a
-                 parent  directory. The pattern is a PCRE2 regular expression,
-                 and is matched against the final component of  the  directory
-                 name,  not the entire path. The -F, -w, and -x options do not
-                 apply to this pattern. The option may be given any number  of
-                 times  in order to specify more than one pattern. If a direc-
-                 tory matches both  --include-dir  and  --exclude-dir,  it  is
-                 excluded. There is no short form for this option.
+                 being  processed, whatever the setting of the --recursive op-
+                 tion. This applies to all directories, whether listed on  the
+                 command  line,  obtained  from  --file-list, or by scanning a
+                 parent directory. The pattern is a PCRE2 regular  expression,
+                 and  is  matched against the final component of the directory
+                 name, not the entire path. The -F, -w, and -x options do  not
+                 apply  to this pattern. The option may be given any number of
+                 times in order to specify more than one pattern. If a  direc-
+                 tory  matches both --include-dir and --exclude-dir, it is ex-
+                 cluded. There is no short form for this option.
 
        -F, --fixed-strings
-                 Interpret  each  data-matching  pattern  as  a  list of fixed
-                 strings, separated by  newlines,  instead  of  as  a  regular
-                 expression.  What  constitutes  a newline for this purpose is
-                 controlled by the --newline option. The -w (match as a  word)
-                 and  -x (match whole line) options can be used with -F.  They
-                 apply to each of the fixed strings. A line is selected if any
+                 Interpret each data-matching  pattern  as  a  list  of  fixed
+                 strings,  separated  by newlines, instead of as a regular ex-
+                 pression. What constitutes a newline for this purpose is con-
+                 trolled by the --newline option. The -w (match as a word) and
+                 -x (match whole line) options can be used with -F.  They  ap-
+                 ply  to  each of the fixed strings. A line is selected if any
                  of the fixed strings are found in it (subject to -w or -x, if
-                 present). This option applies only to the patterns  that  are
-                 matched  against  the contents of files; it does not apply to
-                 patterns specified by  any  of  the  --include  or  --exclude
-                 options.
+                 present).  This  option applies only to the patterns that are
+                 matched against the contents of files; it does not  apply  to
+                 patterns  specified  by any of the --include or --exclude op-
+                 tions.
 
        -f filename, --file=filename
-                 Read  patterns  from  the  file, one per line, and match them
-                 against each line of input. As is the case with  patterns  on
-                 the  command line, no delimiters should be used. What consti-
-                 tutes a newline when reading the file is the  operating  sys-
-                 tem's  default interpretation of \n. The --newline option has
-                 no effect on this option. Trailing  white  space  is  removed
-                 from  each  line,  and blank lines are ignored. An empty file
-                 contains no patterns and therefore matches nothing.  Patterns
-                 read  from a file in this way may contain binary zeros, which
-                 are treated as ordinary data characters. See  also  the  com-
-                 ments  about  multiple  patterns versus a single pattern with
+                 Read patterns from the file, one per  line,  and  match  them
+                 against  each  line of input. As is the case with patterns on
+                 the command line, no delimiters should be used. What  consti-
+                 tutes  a  newline when reading the file is the operating sys-
+                 tem's default interpretation of \n. The --newline option  has
+                 no  effect  on  this  option. Trailing white space is removed
+                 from each line, and blank lines are ignored.  An  empty  file
+                 contains  no patterns and therefore matches nothing. Patterns
+                 read from a file in this way may contain binary zeros,  which
+                 are  treated  as  ordinary data characters. See also the com-
+                 ments about multiple patterns versus a  single  pattern  with
                  alternatives in the description of -e above.
 
-                 If this option is given more than  once,  all  the  specified
-                 files  are read. A data line is output if any of the patterns
-                 match it. A file name can be given as "-"  to  refer  to  the
-                 standard  input.  When  -f is used, patterns specified on the
-                 command line using -e may also be present;  they  are  tested
-                 before  the  file's  patterns.  However,  no other pattern is
+                 If  this  option  is  given more than once, all the specified
+                 files are read. A data line is output if any of the  patterns
+                 match  it.  A  file  name can be given as "-" to refer to the
+                 standard input. When -f is used, patterns  specified  on  the
+                 command  line  using  -e may also be present; they are tested
+                 before the file's patterns.  However,  no  other  pattern  is
                  taken from the command line; all arguments are treated as the
                  names of paths to be searched.
 
        --file-list=filename
-                 Read  a  list  of  files  and/or  directories  that are to be
+                 Read a list of  files  and/or  directories  that  are  to  be
                  scanned from the given file, one per line. What constitutes a
-                 newline  when  reading  the  file  is  the operating system's
-                 default. Trailing white space is removed from each line,  and
+                 newline when reading the file is the operating  system's  de-
+                 fault.  Trailing  white  space is removed from each line, and
                  blank lines are ignored. These paths are processed before any
-                 that are listed on the command line. The  file  name  can  be
-                 given  as  "-"  to refer to the standard input. If --file and
-                 --file-list are both specified  as  "-",  patterns  are  read
-                 first.  This is useful only when the standard input is a ter-
-                 minal, from which further lines (the list of  files)  can  be
+                 that  are  listed  on  the command line. The file name can be
+                 given as "-" to refer to the standard input.  If  --file  and
+                 --file-list  are  both  specified  as  "-", patterns are read
+                 first. This is useful only when the standard input is a  ter-
+                 minal,  from  which  further lines (the list of files) can be
                  read after an end-of-file indication. If this option is given
                  more than once, all the specified files are read.
 
        --file-offsets
-                 Instead of showing lines or parts of lines that  match,  show
-                 each  match  as  an  offset  from the start of the file and a
-                 length, separated by a comma. In this  mode,  no  context  is
-                 shown.  That  is,  the -A, -B, and -C options are ignored. If
+                 Instead  of  showing lines or parts of lines that match, show
+                 each match as an offset from the start  of  the  file  and  a
+                 length,  separated  by  a  comma. In this mode, no context is
+                 shown. That is, the -A, -B, and -C options  are  ignored.  If
                  there is more than one match in a line, each of them is shown
-                 separately.  This option is mutually exclusive with --output,
+                 separately. This option is mutually exclusive with  --output,
                  --line-offsets, and --only-matching.
 
        -H, --with-filename
-                 Force the inclusion of the file name at the start  of  output
+                 Force  the  inclusion of the file name at the start of output
                  lines when searching a single file. By default, the file name
                  is not shown in this case.  For matching lines, the file name
                  is followed by a colon; for context lines, a hyphen separator
-                 is used. If a line number is also being  output,  it  follows
-                 the  file  name. When the -M option causes a pattern to match
-                 more than one line, only the first is preceded  by  the  file
-                 name.  This  option  overrides  any  previous  -h,  -l, or -L
-                 options.
+                 is  used.  If  a line number is also being output, it follows
+                 the file name. When the -M option causes a pattern  to  match
+                 more  than  one  line, only the first is preceded by the file
+                 name. This option overrides any previous -h, -l,  or  -L  op-
+                 tions.
 
        -h, --no-filename
                  Suppress the output file names when searching multiple files.
-                 By  default,  file  names  are  shown when multiple files are
-                 searched. For matching lines, the file name is followed by  a
-                 colon;  for  context lines, a hyphen separator is used.  If a
-                 line number is also being output, it follows the  file  name.
+                 By default, file names are  shown  when  multiple  files  are
+                 searched.  For matching lines, the file name is followed by a
+                 colon; for context lines, a hyphen separator is used.   If  a
+                 line  number  is also being output, it follows the file name.
                  This option overrides any previous -H, -L, or -l options.
 
        --heap-limit=number
                  See --match-limit below.
 
-       --help    Output  a  help  message, giving brief details of the command
-                 options and file type support, and then exit.  Anything  else
+       --help    Output a help message, giving brief details  of  the  command
+                 options  and  file type support, and then exit. Anything else
                  on the command line is ignored.
 
-       -I        Ignore   binary   files.  This  is  equivalent  to  --binary-
+       -I        Ignore  binary  files.  This  is  equivalent   to   --binary-
                  files=without-match.
 
        -i, --ignore-case
                  Ignore upper/lower case distinctions during comparisons.
 
        --include=pattern
-                 If any --include patterns are specified, the only files  that
-                 are  processed  are those that match one of the patterns (and
-                 do not match an --exclude  pattern).  This  option  does  not
-                 affect  directories,  but  it  applies  to all files, whether
-                 listed on the command line, obtained from --file-list, or  by
-                 scanning  a directory. The pattern is a PCRE2 regular expres-
-                 sion, and is matched against the final component of the  file
-                 name,  not the entire path. The -F, -w, and -x options do not
-                 apply to this pattern. The option may be given any number  of
-                 times.  If  a  file  name  matches  both  an --include and an
-                 --exclude pattern, it is excluded.  There is  no  short  form
-                 for this option.
+                 If  any --include patterns are specified, the only files that
+                 are processed are those that match one of the  patterns  (and
+                 do  not match an --exclude pattern). This option does not af-
+                 fect directories, but it applies to all files, whether listed
+                 on  the  command line, obtained from --file-list, or by scan-
+                 ning a directory. The pattern is a PCRE2 regular  expression,
+                 and  is matched against the final component of the file name,
+                 not the entire path. The -F, -w, and -x options do not  apply
+                 to this pattern. The option may be given any number of times.
+                 If a file name matches both an  --include  and  an  --exclude
+                 pattern, it is excluded.  There is no short form for this op-
+                 tion.
 
        --include-from=filename
-                 Treat  each  non-empty  line  of  the file as the data for an
+                 Treat each non-empty line of the file  as  the  data  for  an
                  --include option. What constitutes a newline for this purpose
-                 is  the  operating system's default. The --newline option has
+                 is the operating system's default. The --newline  option  has
                  no effect on this option. This option may be given any number
                  of times; all the files are read.
 
        --include-dir=pattern
-                 If  any --include-dir patterns are specified, the only direc-
-                 tories that are processed are those that  match  one  of  the
-                 patterns  (and  do  not match an --exclude-dir pattern). This
-                 applies to all directories, whether  listed  on  the  command
-                 line,  obtained  from  --file-list,  or  by scanning a parent
-                 directory. The pattern is a PCRE2 regular expression, and  is
-                 matched  against  the  final component of the directory name,
-                 not the entire path. The -F, -w, and -x options do not  apply
+                 If any --include-dir patterns are specified, the only  direc-
+                 tories  that  are  processed  are those that match one of the
+                 patterns (and do not match an  --exclude-dir  pattern).  This
+                 applies  to  all  directories,  whether listed on the command
+                 line, obtained from --file-list, or by scanning a parent  di-
+                 rectory.  The  pattern  is a PCRE2 regular expression, and is
+                 matched against the final component of  the  directory  name,
+                 not  the entire path. The -F, -w, and -x options do not apply
                  to this pattern. The option may be given any number of times.
-                 If a directory matches both --include-dir and  --exclude-dir,
+                 If  a directory matches both --include-dir and --exclude-dir,
                  it is excluded. There is no short form for this option.
 
        -L, --files-without-match
-                 Instead  of  outputting lines from the files, just output the
-                 names of the files that do not contain any lines  that  would
-                 have  been  output. Each file name is output once, on a sepa-
-                 rate line. This option overrides any previous -H, -h,  or  -l
+                 Instead of outputting lines from the files, just  output  the
+                 names  of  the files that do not contain any lines that would
+                 have been output. Each file name is output once, on  a  sepa-
+                 rate  line.  This option overrides any previous -H, -h, or -l
                  options.
 
        -l, --files-with-matches
-                 Instead  of  outputting lines from the files, just output the
+                 Instead of outputting lines from the files, just  output  the
                  names of the files containing lines that would have been out-
-                 put.  Each  file  name  is  output  once, on a separate line.
-                 Searching normally stops as soon as a matching line is  found
-                 in  a  file.  However, if the -c (count) option is also used,
-                 matching continues in order to obtain the correct count,  and
-                 those  files  that  have  at least one match are listed along
+                 put. Each file name is  output  once,  on  a  separate  line.
+                 Searching  normally stops as soon as a matching line is found
+                 in a file. However, if the -c (count) option  is  also  used,
+                 matching  continues in order to obtain the correct count, and
+                 those files that have at least one  match  are  listed  along
                  with their counts. Using this option with -c is a way of sup-
-                 pressing  the  listing  of files with no matches. This opeion
+                 pressing the listing of files with no  matches.  This  opeion
                  overrides any previous -H, -h, or -L options.
 
        --label=name
@@ -471,261 +470,277 @@ OPTIONS
                  input)" is used. There is no short form for this option.
 
        --line-buffered
-                 When this option is given, non-compressed input is  read  and
-                 processed  line by line, and the output is flushed after each
-                 write. By default, input is  read  in  large  chunks,  unless
-                 pcre2grep  can  determine  that it is reading from a terminal
-                 (which is currently possible only in  Unix-like  environments
-                 or  Windows).  Output  to  terminal is normally automatically
-                 flushed by the operating system. This option  can  be  useful
+                 When  this  option is given, non-compressed input is read and
+                 processed line by line, and the output is flushed after  each
+                 write.  By  default,  input  is  read in large chunks, unless
+                 pcre2grep can determine that it is reading  from  a  terminal
+                 (which  is  currently possible only in Unix-like environments
+                 or Windows). Output to  terminal  is  normally  automatically
+                 flushed  by  the  operating system. This option can be useful
                  when the input or output is attached to a pipe and you do not
-                 want pcre2grep to buffer up large amounts of data.   However,
-                 its  use  will  affect  performance,  and  the -M (multiline)
-                 option ceases to work. When input is from a compressed .gz or
+                 want  pcre2grep to buffer up large amounts of data.  However,
+                 its use will affect performance, and the -M  (multiline)  op-
+                 tion  ceases  to work. When input is from a compressed .gz or
                  .bz2 file, --line-buffered is ignored.
 
        --line-offsets
-                 Instead  of  showing lines or parts of lines that match, show
+                 Instead of showing lines or parts of lines that  match,  show
                  each match as a line number, the offset from the start of the
-                 line,  and a length. The line number is terminated by a colon
-                 (as usual; see the -n option), and the offset and length  are
-                 separated  by  a  comma.  In  this mode, no context is shown.
-                 That is, the -A, -B, and -C options are ignored. If there  is
-                 more  than  one  match in a line, each of them is shown sepa-
-                 rately. This option  is  mutually  exclusive  with  --output,
+                 line, and a length. The line number is terminated by a  colon
+                 (as  usual; see the -n option), and the offset and length are
+                 separated by a comma. In this  mode,  no  context  is  shown.
+                 That  is, the -A, -B, and -C options are ignored. If there is
+                 more than one match in a line, each of them  is  shown  sepa-
+                 rately.  This  option  is  mutually  exclusive with --output,
                  --file-offsets, and --only-matching.
 
        --locale=locale-name
-                 This  option specifies a locale to be used for pattern match-
-                 ing. It overrides the value in the LC_ALL or  LC_CTYPE  envi-
-                 ronment  variables.  If  no  locale  is  specified, the PCRE2
-                 library's default (usually the "C" locale) is used. There  is
-                 no short form for this option.
+                 This option specifies a locale to be used for pattern  match-
+                 ing.  It  overrides the value in the LC_ALL or LC_CTYPE envi-
+                 ronment variables. If no locale is specified, the  PCRE2  li-
+                 brary's default (usually the "C" locale) is used. There is no
+                 short form for this option.
 
        --match-limit=number
-                 Processing  some  regular expression patterns may take a very
+                 Processing some regular expression patterns may take  a  very
                  long time to search for all possible matching strings. Others
-                 may  require  a  very large amount of memory. There are three
+                 may require a very large amount of memory.  There  are  three
                  options that set resource limits for matching.
 
                  The --match-limit option provides a means of limiting comput-
-                 ing  resource  usage  when  processing  patterns that are not
-                 going to match, but which have a very large number of  possi-
-                 bilities in their search trees. The classic example is a pat-
-                 tern that uses nested unlimited  repeats.  Internally,  PCRE2
-                 has  a  counter that is incremented each time around its main
-                 processing  loop.  If  the  value  set  by  --match-limit  is
-                 reached, an error occurs.
-
-                 The  --heap-limit  option specifies, as a number of kibibytes
-                 (units of 1024 bytes), the amount of heap memory that may  be
+                 ing resource usage when processing patterns that are not  go-
+                 ing to match, but which have a very large number of possibil-
+                 ities in their search trees. The classic example is a pattern
+                 that  uses  nested unlimited repeats. Internally, PCRE2 has a
+                 counter that is incremented each time around  its  main  pro-
+                 cessing  loop.  If the value set by --match-limit is reached,
+                 an error occurs.
+
+                 The --heap-limit option specifies, as a number  of  kibibytes
+                 (units  of 1024 bytes), the amount of heap memory that may be
                  used for matching. Heap memory is needed only if matching the
-                 pattern requires a significant number of nested  backtracking
+                 pattern  requires a significant number of nested backtracking
                  points to be remembered. This parameter can be set to zero to
                  forbid the use of heap memory altogether.
 
-                 The --depth-limit option limits the  depth  of  nested  back-
+                 The  --depth-limit  option  limits  the depth of nested back-
                  tracking points, which indirectly limits the amount of memory
                  that is used. The amount of memory needed for each backtrack-
-                 ing  point  depends on the number of capturing parentheses in
+                 ing point depends on the number of capturing  parentheses  in
                  the pattern, so the amount of memory that is used before this
-                 limit  acts  varies from pattern to pattern. This limit is of
+                 limit acts varies from pattern to pattern. This limit  is  of
                  use only if it is set smaller than --match-limit.
 
-                 There are no short forms for these options. The default  lim-
-                 its  can  be  set when the PCRE2 library is compiled; if they
-                 are not specified, the defaults are very large and so  effec-
+                 There  are no short forms for these options. The default lim-
+                 its can be set when the PCRE2 library is  compiled;  if  they
+                 are  not specified, the defaults are very large and so effec-
                  tively unlimited.
 
        --max-buffer-size=number
-                 This  limits  the  expansion  of the processing buffer, whose
-                 initial size can be set by --buffer-size. The maximum  buffer
-                 size  is  silently  forced to be no smaller than the starting
+                 This limits the expansion of  the  processing  buffer,  whose
+                 initial  size can be set by --buffer-size. The maximum buffer
+                 size is silently forced to be no smaller  than  the  starting
                  buffer size.
 
        -M, --multiline
-                 Allow patterns to match more than one line. When this  option
+                 Allow  patterns to match more than one line. When this option
                  is set, the PCRE2 library is called in "multiline" mode. This
-                 allows a matched string to extend past the end of a line  and
-                 continue  on one or more subsequent lines. Patterns used with
+                 allows  a matched string to extend past the end of a line and
+                 continue on one or more subsequent lines. Patterns used  with
                  -M may usefully contain literal newline characters and inter-
-                 nal  occurrences of ^ and $ characters. The output for a suc-
-                 cessful match may consist of more than one  line.  The  first
-                 line  is  the  line  in which the match started, and the last
-                 line is the line in which the match  ended.  If  the  matched
-                 string  ends  with a newline sequence, the output ends at the
-                 end of that line.  If -v is set,  none  of  the  lines  in  a
-                 multi-line  match  are output. Once a match has been handled,
-                 scanning restarts at the beginning of the line after the  one
+                 nal occurrences of ^ and $ characters. The output for a  suc-
+                 cessful  match  may  consist of more than one line. The first
+                 line is the line in which the match  started,  and  the  last
+                 line  is  the  line  in which the match ended. If the matched
+                 string ends with a newline sequence, the output ends  at  the
+                 end  of  that  line.   If  -v  is set, none of the lines in a
+                 multi-line match are output. Once a match has  been  handled,
+                 scanning  restarts at the beginning of the line after the one
                  in which the match ended.
 
-                 The  newline  sequence  that separates multiple lines must be
-                 matched as part of the pattern.  For  example,  to  find  the
-                 phrase  "regular  expression" in a file where "regular" might
-                 be at the end of a line and "expression" at the start of  the
+                 The newline sequence that separates multiple  lines  must  be
+                 matched  as  part  of  the  pattern. For example, to find the
+                 phrase "regular expression" in a file where  "regular"  might
+                 be  at the end of a line and "expression" at the start of the
                  next line, you could use this command:
 
                    pcre2grep -M 'regular\s+expression' <file>
 
-                 The  \s  escape  sequence  matches any white space character,
-                 including newlines, and is followed  by  +  so  as  to  match
-                 trailing  white  space  on the first line as well as possibly
-                 handling a two-character newline sequence.
+                 The \s escape sequence matches any white space character, in-
+                 cluding  newlines, and is followed by + so as to match trail-
+                 ing white space on the first line as well  as  possibly  han-
+                 dling a two-character newline sequence.
 
-                 There is a limit to the number of lines that can be  matched,
-                 imposed  by  the way that pcre2grep buffers the input file as
-                 it scans it. With a  sufficiently  large  processing  buffer,
+                 There  is a limit to the number of lines that can be matched,
+                 imposed by the way that pcre2grep buffers the input  file  as
+                 it  scans  it.  With  a sufficiently large processing buffer,
                  this should not be a problem, but the -M option does not work
                  when input is read line by line (see --line-buffered.)
 
        -N newline-type, --newline=newline-type
-                 The PCRE2 library supports  five  different  conventions  for
-                 indicating  the  ends of lines. They are the single-character
-                 sequences CR (carriage return) and LF  (linefeed),  the  two-
-                 character  sequence CRLF, an "anycrlf" convention, which rec-
-                 ognizes any of the preceding three types, and an  "any"  con-
-                 vention, in which any Unicode line ending sequence is assumed
-                 to end a line. The Unicode sequences are the three just  men-
-                 tioned,  plus  VT  (vertical  tab,  U+000B),  FF  (form feed,
-                 U+000C),  NEL  (next  line,  U+0085),  LS  (line   separator,
+                 The PCRE2 library supports five different conventions for in-
+                 dicating the ends of lines. They are the single-character se-
+                 quences CR (carriage return) and LF (linefeed), the two-char-
+                 acter sequence CRLF, an "anycrlf"  convention,  which  recog-
+                 nizes  any of the preceding three types, and an "any" conven-
+                 tion, in which any Unicode line ending sequence is assumed to
+                 end  a  line.  The  Unicode sequences are the three just men-
+                 tioned, plus  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+2029).
 
-                 When  the  PCRE2  library  is  built,  a  default line-ending
-                 sequence  is  specified.   This  is  normally  the   standard
-                 sequence for the operating system. Unless otherwise specified
-                 by this option, pcre2grep uses the  library's  default.   The
-                 possible values for this option are CR, LF, CRLF, ANYCRLF, or
-                 ANY. This makes it possible to use pcre2grep  to  scan  files
-                 that have come from other environments without having to mod-
-                 ify their line endings. If the data  that  is  being  scanned
-                 does  not  agree  with  the  convention  set  by this option,
-                 pcre2grep may behave in strange ways. Note that  this  option
-                 does  not apply to files specified by the -f, --exclude-from,
-                 or --include-from options, which  are  expected  to  use  the
-                 operating system's standard newline sequence.
+                 When the PCRE2 library is built, a  default  line-ending  se-
+                 quence  is specified.  This is normally the standard sequence
+                 for the operating system. Unless otherwise specified by  this
+                 option,  pcre2grep  uses the library's default.  The possible
+                 values for this option are CR, LF,  CRLF,  ANYCRLF,  or  ANY.
+                 This  makes  it  possible to use pcre2grep to scan files that
+                 have come from other environments without  having  to  modify
+                 their  line  endings.  If the data that is being scanned does
+                 not agree with the convention set by this  option,  pcre2grep
+                 may  behave  in  strange ways. Note that this option does not
+                 apply to files specified by the -f, --exclude-from, or  --in-
+                 clude-from  options,  which are expected to use the operating
+                 system's standard newline sequence.
 
        -n, --line-number
                  Precede each output line by its line number in the file, fol-
-                 lowed by a colon for matching lines or a hyphen  for  context
+                 lowed  by  a colon for matching lines or a hyphen for context
                  lines. If the file name is also being output, it precedes the
-                 line number. When the -M option causes  a  pattern  to  match
-                 more  than  one  line, only the first is preceded by its line
+                 line  number.  When  the  -M option causes a pattern to match
+                 more than one line, only the first is preceded  by  its  line
                  number. This option is forced if --line-offsets is used.
 
-       --no-jit  If the PCRE2 library is built with support  for  just-in-time
+       --no-jit  If  the  PCRE2 library is built with support for just-in-time
                  compiling (which speeds up matching), pcre2grep automatically
                  makes use of this, unless it was explicitly disabled at build
-                 time.  This  option  can be used to disable the use of JIT at
-                 run time. It is provided for testing and working round  prob-
+                 time. This option can be used to disable the use  of  JIT  at
+                 run  time. It is provided for testing and working round prob-
                  lems.  It should never be needed in normal use.
 
        -O text, --output=text
-                 When  there  is a match, instead of outputting the whole line
-                 that matched, output just the  given  text.  This  option  is
-                 mutually  exclusive with --only-matching, --file-offsets, and
+                 When there is a match, instead of outputting the  whole  line
+                 that  matched, output just the given text. This option is mu-
+                 tually exclusive with  --only-matching,  --file-offsets,  and
                  --line-offsets. Escape sequences starting with a dollar char-
-                 acter  may be used to insert the contents of the matched part
+                 acter may be used to insert the contents of the matched  part
                  of the line and/or captured substrings into the text.
 
-                 $<digits> or ${<digits>} is replaced  by  the  captured  sub-
-                 string  of  the  given  decimal  number; zero substitutes the
+                 $<digits>  or  ${<digits>}  is  replaced by the captured sub-
+                 string of the given  decimal  number;  zero  substitutes  the
                  whole match. If the number is greater than the number of cap-
-                 turing  substrings,  or if the capture is unset, the replace-
+                 turing substrings, or if the capture is unset,  the  replace-
                  ment is empty.
 
-                 $a is replaced by bell; $b by backspace; $e by escape; $f  by
-                 form  feed;  $n by newline; $r by carriage return; $t by tab;
+                 $a  is replaced by bell; $b by backspace; $e by escape; $f by
+                 form feed; $n by newline; $r by carriage return; $t  by  tab;
                  $v by vertical tab.
 
-                 $o<digits> is replaced by the character  represented  by  the
+                 $o<digits>  is  replaced  by the character represented by the
                  given octal number; up to three digits are processed.
 
-                 $x<digits>  is  replaced  by the character represented by the
+                 $x<digits> is replaced by the character  represented  by  the
                  given hexadecimal number; up to two digits are processed.
 
-                 Any other character is substituted by itself. In  particular,
+                 Any  other character is substituted by itself. In particular,
                  $$ is replaced by a single dollar.
 
        -o, --only-matching
                  Show only the part of the line that matched a pattern instead
-                 of the whole line. In this mode, no context  is  shown.  That
-                 is,  the -A, -B, and -C options are ignored. If there is more
-                 than one match in a line, each of them is  shown  separately,
-                 on  a  separate  line  of  output.  If -o is combined with -v
-                 (invert the sense of the match to find  non-matching  lines),
-                 no  output is generated, but the return code is set appropri-
-                 ately. If the matched portion of the line is  empty,  nothing
-                 is  output  unless  the  file  name  or line number are being
-                 printed, in which case they are shown on an  otherwise  empty
+                 of  the  whole  line. In this mode, no context is shown. That
+                 is, the -A, -B, and -C options are ignored. If there is  more
+                 than  one  match in a line, each of them is shown separately,
+                 on a separate line of output. If -o is combined with -v  (in-
+                 vert  the  sense of the match to find non-matching lines), no
+                 output is generated, but the return  code  is  set  appropri-
+                 ately.  If  the matched portion of the line is empty, nothing
+                 is output unless the file  name  or  line  number  are  being
+                 printed,  in  which case they are shown on an otherwise empty
                  line.  This  option  is  mutually  exclusive  with  --output,
                  --file-offsets and --line-offsets.
 
        -onumber, --only-matching=number
-                 Show only the part of the line  that  matched  the  capturing
-                 parentheses of the given number. Up to 32 capturing parenthe-
-                 ses are supported, and -o0 is equivalent to -o without a num-
-                 ber.  Because  these options can be given without an argument
-                 (see above), if an argument is present, it must be  given  in
-                 the  same  shell item, for example, -o3 or --only-matching=2.
-                 The comments given for the non-argument case above also apply
-                 to this option. If the specified capturing parentheses do not
-                 exist in the pattern, or were not set in the  match,  nothing
-                 is  output unless the file name or line number are being out-
-                 put.
+                 Show  only  the  part  of the line that matched the capturing
+                 parentheses of the given number. Up to 50 capturing parenthe-
+                 ses  are  supported by default. This limit can be changed via
+                 the --om-capture option. A pattern may contain any number  of
+                 capturing  parentheses, but only those whose number is within
+                 the limit can be accessed by -o. An error occurs if the  num-
+                 ber specified by -o is greater than the limit.
+
+                 -o0 is the same as -o without a number. Because these options
+                 can be given without an argument (see above), if an  argument
+                 is  present, it must be given in the same shell item, for ex-
+                 ample, -o3 or --only-matching=2. The comments given  for  the
+                 non-argument  case  above  also  apply to this option. If the
+                 specified capturing parentheses do not exist in the  pattern,
+                 or  were  not  set in the match, nothing is output unless the
+                 file name or line number are being output.
 
                  If this option is given multiple times,  multiple  substrings
                  are  output  for  each  match,  in  the order the options are
                  given, and all on one line. For example, -o3 -o1  -o3  causes
                  the  substrings  matched by capturing parentheses 3 and 1 and
                  then 3 again to be output. By default, there is no  separator
-                 (but see the next option).
+                 (but see the next but one option).
+
+       --om-capture=number
+                 Set  the number of capturing parentheses that can be accessed
+                 by -o. The default is 50.
 
        --om-separator=text
-                 Specify  a  separating string for multiple occurrences of -o.
-                 The default is an empty string. Separating strings are  never
+                 Specify a separating string for multiple occurrences  of  -o.
+                 The  default is an empty string. Separating strings are never
                  coloured.
 
        -q, --quiet
                  Work quietly, that is, display nothing except error messages.
-                 The exit status indicates whether or  not  any  matches  were
+                 The  exit  status  indicates  whether or not any matches were
                  found.
 
        -r, --recursive
-                 If  any given path is a directory, recursively scan the files
-                 it contains, taking note of any --include and --exclude  set-
-                 tings.  By  default, a directory is read as a normal file; in
-                 some operating systems this gives an  immediate  end-of-file.
-                 This  option  is  a  shorthand  for  setting the -d option to
-                 "recurse".
+                 If any given path is a directory, recursively scan the  files
+                 it  contains, taking note of any --include and --exclude set-
+                 tings. By default, a directory is read as a normal  file;  in
+                 some  operating  systems this gives an immediate end-of-file.
+                 This option is a shorthand for setting the -d option to  "re-
+                 curse".
 
        --recursion-limit=number
                  See --match-limit above.
 
        -s, --no-messages
-                 Suppress error  messages  about  non-existent  or  unreadable
-                 files.  Such  files  are quietly skipped. However, the return
+                 Suppress  error  messages  about  non-existent  or unreadable
+                 files. Such files are quietly skipped.  However,  the  return
                  code is still 2, even if matches were found in other files.
 
        -t, --total-count
-                 This option is useful when scanning more than  one  file.  If
-                 used  on its own, -t suppresses all output except for a grand
-                 total number of matching lines (or non-matching lines  if  -v
-                 is  used)  in  all  the files. If -t is used with -c, a grand
-                 total is output except when the previous output is  just  one
-                 line.  In  other words, it is not output when just one file's
-                 count is listed. If file names are being  output,  the  grand
-                 total  is preceded by "TOTAL:". Otherwise, it appears as just
-                 another number. The -t option is ignored when  used  with  -L
-                 (list  files  without matches), because the grand total would
+                 This  option  is  useful when scanning more than one file. If
+                 used on its own, -t suppresses all output except for a  grand
+                 total  number  of matching lines (or non-matching lines if -v
+                 is used) in all the files. If -t is used with -c, a grand to-
+                 tal  is  output  except  when the previous output is just one
+                 line. In other words, it is not output when just  one  file's
+                 count  is  listed.  If file names are being output, the grand
+                 total is preceded by "TOTAL:". Otherwise, it appears as  just
+                 another  number.  The  -t option is ignored when used with -L
+                 (list files without matches), because the grand  total  would
                  always be zero.
 
-       -u, --utf-8
-                 Operate in UTF-8 mode. This option is available only if PCRE2
+       -u, --utf Operate in UTF-8 mode. This option is available only if PCRE2
                  has been compiled with UTF-8 support. All patterns (including
-                 those for any --exclude and --include options) and  all  sub-
-                 ject  lines  that  are scanned must be valid strings of UTF-8
+                 those  for  any --exclude and --include options) and all sub-
+                 ject lines that are scanned must be valid  strings  of  UTF-8
                  characters.
 
+       -U, --utf-allow-invalid
+                 As  --utf,  but in addition subject lines may contain invalid
+                 UTF-8 code unit sequences. These can never form part  of  any
+                 pattern match. This facility allows valid UTF-8 strings to be
+                 sought in executable or other binary files.  For more details
+                 about  matching in non-valid UTF-8 strings, see the pcre2uni-
+                 code(3) documentation.
+
        -V, --version
                  Write the version numbers of pcre2grep and the PCRE2  library
                  to  the  standard  output and then exit. Anything else on the
@@ -757,10 +772,10 @@ OPTIONS
 
 ENVIRONMENT VARIABLES
 
-       The environment variables LC_ALL and LC_CTYPE  are  examined,  in  that
-       order,  for  a  locale.  The first one that is set is used. This can be
-       overridden by the --locale option. If  no  locale  is  set,  the  PCRE2
-       library's default (usually the "C" locale) is used.
+       The environment variables LC_ALL and LC_CTYPE are examined, in that or-
+       der, for a locale. The first one that is set is used. This can be over-
+       ridden by the --locale option. If no locale is set, the PCRE2 library's
+       default (usually the "C" locale) is used.
 
 
 NEWLINES
@@ -785,9 +800,9 @@ OPTIONS COMPATIBILITY
        terminology) is also available as --xxx-regex (PCRE2 terminology). How-
        ever, the  --depth-limit,  --file-list,  --file-offsets,  --heap-limit,
        --include-dir,  --line-offsets,  --locale,  --match-limit, -M, --multi-
-       line, -N, --newline, --om-separator, --output, -u, and --utf-8  options
-       are  specific to pcre2grep, as is the use of the --only-matching option
-       with a capturing parentheses number.
+       line, -N, --newline,  --om-separator,  --output,  -u,  --utf,  -U,  and
+       --utf-allow-invalid options are specific to pcre2grep, as is the use of
+       the --only-matching option with a capturing parentheses number.
 
        Although most of the common options work the same way, a few  are  dif-
        ferent  in pcre2grep. For example, the --include option's argument is a
@@ -818,13 +833,13 @@ OPTIONS WITH DATA
          --file /some/file
 
        Note,  however, that if you want to supply a file name beginning with ~
-       as data in a shell command, and have the  shell  expand  ~  to  a  home
-       directory, you must separate the file name from the option, because the
+       as data in a shell command, and have the shell expand ~ to a  home  di-
+       rectory,  you  must separate the file name from the option, because the
        shell does not treat ~ specially unless it is at the start of an item.
 
        The exceptions to the above are the --colour (or --color)  and  --only-
-       matching  options,  for  which  the  data  is optional. If one of these
-       options does have data, it must be given in the first  form,  using  an
+       matching  options,  for which the data is optional. If one of these op-
+       tions does have data, it must be given in  the  first  form,  using  an
        equals character. Otherwise pcre2grep will assume that it has no data.
 
 
@@ -832,18 +847,26 @@ USING PCRE2'S CALLOUT FACILITY
 
        pcre2grep  has,  by  default,  support for calling external programs or
        scripts or echoing specific strings during matching by  making  use  of
-       PCRE2's  callout  facility.  However, this support can be disabled when
-       pcre2grep is built. You can find out whether your  binary  has  support
-       for  callouts  by  running it with the --help option. If the support is
-       not enabled, all callouts in patterns are ignored by pcre2grep.
-
-       A callout in a PCRE2 pattern is of the form (?C<arg>) where  the  argu-
-       ment  is either a number or a quoted string (see the pcre2callout docu-
-       mentation for details). Numbered callouts  are  ignored  by  pcre2grep;
+       PCRE2's  callout  facility.  However, this support can be completely or
+       partially disabled when pcre2grep is built. You can  find  out  whether
+       your  binary has support for callouts by running it with the --help op-
+       tion. If callout support is completely disabled, all callouts  in  pat-
+       terns are ignored by pcre2grep.  If the facility is partially disabled,
+       calling external programs is not supported, and callouts  that  request
+       it are ignored.
+
+       A  callout  in a PCRE2 pattern is of the form (?C<arg>) where the argu-
+       ment is either a number or a quoted string (see the pcre2callout  docu-
+       mentation  for  details).  Numbered  callouts are ignored by pcre2grep;
        only callouts with string arguments are useful.
 
    Calling external programs or scripts
 
+       This facility can be independently disabled when pcre2grep is built. It
+       is  supported for Windows, where a call to _spawnvp() is used, for VMS,
+       where lib$spawn() is used, and  for  any  other  Unix-like  environment
+       where fork() and execv() are available.
+
        If the callout string does not start with a pipe (vertical bar) charac-
        ter, it is parsed into a list of substrings separated by  pipe  charac-
        ters.  The first substring must be an executable name, with the follow-
@@ -851,16 +874,16 @@ USING PCRE2'S CALLOUT FACILITY
 
          executable_name|arg1|arg2|...
 
-       Any substring  (including  the  executable  name)  may  contain  escape
-       sequences  started  by  a dollar character: $<digits> or ${<digits>} is
-       replaced by the captured substring of the given decimal  number,  which
+       Any substring (including the executable name) may  contain  escape  se-
+       quences  started by a dollar character: $<digits> or ${<digits>} is re-
+       placed by the captured substring of the  given  decimal  number,  which
        must  be greater than zero. If the number is greater than the number of
        capturing substrings, or if the capture is unset,  the  replacement  is
        empty.
 
-       Any  other  character  is  substituted  by itself. In particular, $$ is
-       replaced by a single dollar and $| is replaced  by  a  pipe  character.
-       Here is an example:
+       Any  other character is substituted by itself. In particular, $$ is re-
+       placed by a single dollar and $| is replaced by a pipe character.  Here
+       is an example:
 
          echo -e "abcde\n12345" | pcre2grep \
            '(?x)(.)(..(.))
@@ -873,27 +896,27 @@ USING PCRE2'S CALLOUT FACILITY
            Arg1: [1] [234] [4] Arg2: |1| ()
            12345
 
-       The parameters for the execv() system call that is used to run the pro-
-       gram or script are zero-terminated strings. This means that binary zero
-       characters  in the callout argument will cause premature termination of
-       their substrings, and therefore  should  not  be  present.  Any  syntax
-       errors  in  the  string  (for example, a dollar not followed by another
-       character) cause the callout to be  ignored.  If  running  the  program
-       fails for any reason (including the non-existence of the executable), a
-       local matching failure occurs and the matcher backtracks in the  normal
-       way.
+       The  parameters  for the system call that is used to run the program or
+       script are zero-terminated strings. This means that binary zero charac-
+       ters  in the callout argument will cause premature termination of their
+       substrings, and therefore should not be present. Any syntax  errors  in
+       the  string  (for  example, a dollar not followed by another character)
+       cause the callout to be ignored. If running the program fails  for  any
+       reason  (including the non-existence of the executable), a local match-
+       ing failure occurs and the matcher backtracks in the normal way.
 
    Echoing a specific string
 
-       If  the callout string starts with a pipe (vertical bar) character, the
-       rest of the string is written to the output, having been passed through
-       the  same escape processing as text from the --output option. This pro-
-       vides a simple echoing facility that avoids calling an external program
-       or  script. No terminator is added to the string, so if you want a new-
-       line, you must include  it  explicitly.   Matching  continues  normally
-       after  the string is output. If you want to see only the callout output
-       but not any output from an actual match, you should  end  the  relevant
-       pattern with (*FAIL).
+       This facility is always available, provided that callouts were not com-
+       pletely disabled when pcre2grep was built. If the callout string starts
+       with a pipe (vertical bar) character, the rest of the string is written
+       to the output, having been passed through the same escape processing as
+       text from the --output option. This provides a simple echoing  facility
+       that  avoids  calling  an  external program or script. No terminator is
+       added to the string, so if you want a newline, you must include it  ex-
+       plicitly.  Matching  continues  normally after the string is output. If
+       you want to see only the callout output but not any output from an  ac-
+       tual match, you should end the relevant pattern with (*FAIL).
 
 
 MATCHING ERRORS
@@ -901,8 +924,8 @@ MATCHING ERRORS
        It  is  possible  to supply a regular expression that takes a very long
        time to fail to match certain lines.  Such  patterns  normally  involve
        nested  indefinite repeats, for example: (a+)*\d when matched against a
-       line of a's with no final digit. The  PCRE2  matching  function  has  a
-       resource  limit that causes it to abort in these circumstances. If this
+       line of a's with no final digit. The PCRE2 matching function has a  re-
+       source  limit  that  causes it to abort in these circumstances. If this
        happens, pcre2grep outputs an error message and the  line  that  caused
        the  problem  to  the  standard error stream. If there are more than 20
        such errors, pcre2grep gives up.
@@ -940,5 +963,5 @@ AUTHOR
 
 REVISION
 
-       Last updated: 24 February 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 15 June 2019
+       Copyright (c) 1997-2019 University of Cambridge.
index c3b916b95b67a639a0d78db563662dcb023586e3..f4be3fb9e379f3aa38e5e27842ec4dbc9e49e37f 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2JIT 3 "28 June 2018" "PCRE2 10.32"
+.TH PCRE2JIT 3 "23 May 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 JUST-IN-TIME COMPILER SUPPORT"
@@ -120,13 +120,42 @@ support is not available, or the pattern was not processed by
 pattern.
 .
 .
+.SH "MATCHING SUBJECTS CONTAINING INVALID UTF"
+.rs
+.sp
+When a pattern is compiled with the PCRE2_UTF option, subject strings are
+normally expected to be a valid sequence of UTF code units. By default, this is
+checked at the start of matching and an error is generated if invalid UTF is
+detected. The PCRE2_NO_UTF_CHECK option can be passed to \fBpcre2_match()\fP to
+skip the check (for improved performance) if you are sure that a subject string
+is valid. If this option is used with an invalid string, the result is
+undefined.
+.P
+However, a way of running matches on strings that may contain invalid UTF
+sequences is available. Calling \fBpcre2_compile()\fP with the
+PCRE2_MATCH_INVALID_UTF option has two effects: it tells the interpreter in
+\fBpcre2_match()\fP to support invalid UTF, and, if \fBpcre2_jit_compile()\fP
+is called, the compiled JIT code also supports invalid UTF. Details of how this
+support works, in both the JIT and the interpretive cases, is given in the
+.\" HREF
+\fBpcre2unicode\fP
+.\"
+documentation.
+.P
+There is also an obsolete option for \fBpcre2_jit_compile()\fP called
+PCRE2_JIT_INVALID_UTF, which currently exists only for backward compatibility.
+It is superseded by the \fBpcre2_compile()\fP option PCRE2_MATCH_INVALID_UTF
+and should no longer be used. It may be removed in future.
+.
+.
 .SH "UNSUPPORTED OPTIONS AND PATTERN ITEMS"
 .rs
 .sp
 The \fBpcre2_match()\fP options that are supported for JIT matching are
-PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART,
-PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT. The
-PCRE2_ANCHORED option is not supported at match time.
+PCRE2_COPY_MATCHED_SUBJECT, PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY,
+PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and
+PCRE2_PARTIAL_SOFT. The PCRE2_ANCHORED and PCRE2_ENDANCHORED options are not
+supported at match time.
 .P
 If the PCRE2_NO_JIT option is passed to \fBpcre2_match()\fP it disables the
 use of JIT, forcing matching by the interpreter code.
@@ -376,10 +405,13 @@ available, and which need the best possible performance, can instead use a
 processed by \fBpcre2_jit_compile()\fP).
 .P
 The fast path function is called \fBpcre2_jit_match()\fP, and it takes exactly
-the same arguments as \fBpcre2_match()\fP. The return values are also the same,
-plus PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is
-requested that was not compiled. Unsupported option bits (for example,
-PCRE2_ANCHORED) are ignored, as is the PCRE2_NO_JIT option.
+the same arguments as \fBpcre2_match()\fP. However, the subject string must be
+specified with a length; PCRE2_ZERO_TERMINATED is not supported. Unsupported
+option bits (for example, PCRE2_ANCHORED, PCRE2_ENDANCHORED and
+PCRE2_COPY_MATCHED_SUBJECT) are ignored, as is the PCRE2_NO_JIT option. The
+return values are also the same as for \fBpcre2_match()\fP, plus
+PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is requested
+that was not compiled.
 .P
 When you call \fBpcre2_match()\fP, as well as testing for invalid options, a
 number of other sanity checks are performed on the arguments. For example, if
@@ -412,6 +444,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 28 June 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 23 May 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 803e97b01c7becc3ed71bf70e4ad8df68a8f2ee6..9bf3626db7f36b566267b0463ccd00fa3c805a16 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2LIMITS 3 "30 March 2017" "PCRE2 10.30"
+.TH PCRE2LIMITS 3 "03 February 2019" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "SIZE AND OTHER LIMITATIONS"
@@ -34,16 +34,16 @@ 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
-order to limit the amount of system stack used at compile time. The default
-limit can be specified when PCRE2 is built; if not, the default is set to 250.
-An application can change this limit by calling pcre2_set_parens_nest_limit()
-to set the limit in a compile context.
+There is no limit to the number of parenthesized groups, but there can be no
+more than 65535 capture groups, and there is a limit to the depth of nesting of
+parenthesized subpatterns of all kinds. This is imposed in order to limit the
+amount of system stack used at compile time. The default limit can be specified
+when PCRE2 is built; if not, the default is set to 250. An application can
+change this limit by calling pcre2_set_parens_nest_limit() to set the limit in
+a compile context.
 .P
-The maximum length of name for a named subpattern is 32 code units, and the
-maximum number of named subpatterns is 10000.
+The maximum length of name for a named capture group is 32 code units, and the
+maximum number of such groups is 10000.
 .P
 The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or (*THEN) verb
 is 255 code units for the 8-bit library and 65535 code units for the 16-bit and
@@ -67,6 +67,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 30 March 2017
-Copyright (c) 1997-2017 University of Cambridge.
+Last updated: 02 February 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 81ce96839cd6639ccb29dddbfa036767333eecb0..7f9bbac72c6fc18936eb2162c141847989c3c30d 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2MATCHING 3 "29 September 2014" "PCRE2 10.00"
+.TH PCRE2MATCHING 3 "23 May 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 MATCHING ALGORITHMS"
@@ -113,7 +113,8 @@ do want multiple matches in such cases, either use an ungreedy repeat
 ("a\ed+?") or set the PCRE2_NO_AUTO_POSSESS option when compiling.
 .P
 There are a number of features of PCRE2 regular expressions that are not
-supported by the alternative matching algorithm. They are as follows:
+supported or behave differently in the alternative matching function. Those
+that are not supported cause an error if encountered.
 .P
 1. Because the algorithm finds all possible matches, the greedy or ungreedy
 nature of repetition quantifiers is not relevant (though it may affect
@@ -135,25 +136,30 @@ possibilities, and PCRE2's implementation of this algorithm does not attempt to
 do this. This means that no captured substrings are available.
 .P
 3. Because no substrings are captured, backreferences within the pattern are
-not supported, and cause errors if encountered.
+not supported.
 .P
 4. For the same reason, conditional expressions that use a backreference as the
 condition or test for a specific group recursion are not supported.
 .P
-5. Because many paths through the tree may be active, the \eK escape sequence,
+5. Again for the same reason, script runs are not supported.
+.P
+6. Because many paths through the tree may be active, the \eK escape sequence,
 which resets the start of the match when encountered (but may be on some paths
-and not on others), is not supported. It causes an error if encountered.
+and not on others), is not supported.
 .P
-6. Callouts are supported, but the value of the \fIcapture_top\fP field is
+7. Callouts are supported, but the value of the \fIcapture_top\fP field is
 always 1, and the value of the \fIcapture_last\fP field is always 0.
 .P
-7. The \eC escape sequence, which (in the standard algorithm) always matches a
+8. The \eC escape sequence, which (in the standard algorithm) always matches a
 single code unit, even in a UTF mode, is not supported in these modes, because
 the alternative algorithm moves through the subject string one character (not
 code unit) at a time, for all active paths through the tree.
 .P
-8. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not
+9. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not
 supported. (*FAIL) is supported, and behaves like a failing negative assertion.
+.P
+10. The PCRE2_MATCH_INVALID_UTF option for \fBpcre2_compile()\fP is not
+supported by \fBpcre2_dfa_match()\fP.
 .
 .
 .SH "ADVANTAGES OF THE ALTERNATIVE ALGORITHM"
@@ -188,7 +194,8 @@ The alternative algorithm suffers from a number of disadvantages:
 because it has to search for all possible matches, but is also because it is
 less susceptible to optimization.
 .P
-2. Capturing parentheses and backreferences are not supported.
+2. Capturing parentheses, backreferences, script runs, and matching within
+invalid UTF string are not supported.
 .P
 3. Although atomic groups are supported, their use does not provide the
 performance advantage that it does for the standard algorithm.
@@ -208,6 +215,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 29 September 2014
-Copyright (c) 1997-2014 University of Cambridge.
+Last updated: 23 May 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 72a12ed27b684a1d1a22e2d214f2af7e27dd167a..3ff939f708e47ce111c18c9993bbd48a5476ecc4 100644 (file)
-.TH PCRE2PARTIAL 3 "22 December 2014" "PCRE2 10.00"
+.TH PCRE2PARTIAL 3 "04 September 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions
 .SH "PARTIAL MATCHING IN PCRE2"
 .rs
 .sp
-In normal use of PCRE2, if the subject string that is passed to a matching
-function matches as far as it goes, but is too short to match the entire
-pattern, PCRE2_ERROR_NOMATCH is returned. There are circumstances where it
-might be helpful to distinguish this case from other cases in which there is no
-match.
+In normal use of PCRE2, if there is a match up to the end of a subject string,
+but more characters are needed to match the entire pattern, PCRE2_ERROR_NOMATCH
+is returned, just like any other failing match. There are circumstances where
+it might be helpful to distinguish this "partial match" case.
 .P
-Consider, for example, an application where a human is required to type in data
-for a field with specific formatting requirements. An example might be a date
-in the form \fIddmmmyy\fP, defined by this pattern:
-.sp
-  ^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$
-.sp
-If the application sees the user's keystrokes one by one, and can check that
-what has been typed so far is potentially valid, it is able to raise an error
-as soon as a mistake is made, by beeping and not reflecting the character that
-has been typed, for example. This immediate feedback is likely to be a better
-user interface than a check that is delayed until the entire string has been
-entered. Partial matching can also be useful when the subject string is very
-long and is not all available at once.
+One example is an application where the subject string is very long, and not
+all available at once. The requirement here is to be able to do the matching
+segment by segment, but special action is needed when a matched substring spans
+the boundary between two segments.
 .P
-PCRE2 supports partial matching by means of the PCRE2_PARTIAL_SOFT and
-PCRE2_PARTIAL_HARD options, which can be set when calling a matching function.
-The difference between the two options is whether or not a partial match is
-preferred to an alternative complete match, though the details differ between
-the two types of matching function. If both options are set, PCRE2_PARTIAL_HARD
-takes precedence.
+Another example is checking a user input string as it is typed, to ensure that
+it conforms to a required format. Invalid characters can be immediately
+diagnosed and rejected, giving instant feedback.
 .P
-If you want to use partial matching with just-in-time optimized code, you must
-call \fBpcre2_jit_compile()\fP with one or both of these options:
+Partial matching is a PCRE2-specific feature; it is not Perl-compatible. It is
+requested by setting one of the PCRE2_PARTIAL_HARD or PCRE2_PARTIAL_SOFT
+options when calling a matching function. The difference between the two
+options is whether or not a partial match is preferred to an alternative
+complete match, though the details differ between the two types of matching
+function. If both options are set, PCRE2_PARTIAL_HARD takes precedence.
+.P
+If you want to use partial matching with just-in-time optimized code, as well
+as setting a partial match option for the matching function, you must also call
+\fBpcre2_jit_compile()\fP with one or both of these options:
 .sp
-  PCRE2_JIT_PARTIAL_SOFT
   PCRE2_JIT_PARTIAL_HARD
+  PCRE2_JIT_PARTIAL_SOFT
 .sp
 PCRE2_JIT_COMPLETE should also be set if you are going to run non-partial
-matches on the same pattern. If the appropriate JIT mode has not been compiled,
-interpretive matching code is used.
+matches on the same pattern. Separate code is compiled for each mode. If the
+appropriate JIT mode has not been compiled, interpretive matching code is used.
 .P
 Setting a partial matching option disables two of PCRE2's standard
-optimizations. PCRE2 remembers the last literal code unit in a pattern, and
-abandons matching immediately if it is not present in the subject string. This
-optimization cannot be used for a subject string that might match only
-partially. PCRE2 also knows the minimum length of a matching string, and does
+optimization hints. PCRE2 remembers the last literal code unit in a pattern,
+and abandons matching immediately if it is not present in the subject string.
+This optimization cannot be used for a subject string that might match only
+partially. PCRE2 also remembers a minimum length of a matching string, and does
 not bother to run the matching function on shorter strings. This optimization
 is also disabled for partial matching.
 .
 .
+.SH "REQUIREMENTS FOR A PARTIAL MATCH"
+.rs
+.sp
+A possible partial match occurs during matching when the end of the subject
+string is reached successfully, but either more characters are needed to
+complete the match, or the addition of more characters might change what is
+matched.
+.P
+Example 1: if the pattern is /abc/ and the subject is "ab", more characters are
+definitely needed to complete a match. In this case both hard and soft matching
+options yield a partial match.
+.P
+Example 2: if the pattern is /ab+/ and the subject is "ab", a complete match
+can be found, but the addition of more characters might change what is
+matched. In this case, only PCRE2_PARTIAL_HARD returns a partial match;
+PCRE2_PARTIAL_SOFT returns the complete match.
+.P
+On reaching the end of the subject, when PCRE2_PARTIAL_HARD is set, if the next
+pattern item is \ez, \eZ, \eb, \eB, or $ there is always a partial match.
+Otherwise, for both options, the next pattern item must be one that inspects a
+character, and at least one of the following must be true:
+.P
+(1) At least one character has already been inspected. An inspected character
+need not form part of the final matched string; lookbehind assertions and the
+\eK escape sequence provide ways of inspecting characters before the start of a
+matched string.
+.P
+(2) The pattern contains one or more lookbehind assertions. This condition
+exists in case there is a lookbehind that inspects characters before the start
+of the match.
+.P
+(3) There is a special case when the whole pattern can match an empty string.
+When the starting point is at the end of the subject, the empty string match is
+a possibility, and if PCRE2_PARTIAL_SOFT is set and neither of the above
+conditions is true, it is returned. However, because adding more characters
+might result in a non-empty match, PCRE2_PARTIAL_HARD returns a partial match,
+which in this case means "there is going to be a match at this point, but until
+some more characters are added, we do not know if it will be an empty string or
+something longer".
+.
+.
+.
 .SH "PARTIAL MATCHING USING pcre2_match()"
 .rs
 .sp
-A partial match occurs during a call to \fBpcre2_match()\fP when the end of the
-subject string is reached successfully, but matching cannot continue because
-more characters are needed. However, at least one character in the subject must
-have been inspected. This character need not form part of the final matched
-string; lookbehind assertions and the \eK escape sequence provide ways of
-inspecting characters before the start of a matched string. The requirement for
-inspecting at least one character exists because an empty string can always be
-matched; without such a restriction there would always be a partial match of an
-empty string at the end of the subject.
+When a partial matching option is set, the result of calling
+\fBpcre2_match()\fP can be one of the following:
+.TP 2
+\fBA successful match\fP
+A complete match has been found, starting and ending within this subject.
+.TP
+\fBPCRE2_ERROR_NOMATCH\fP
+No match can start anywhere in this subject.
+.TP
+\fBPCRE2_ERROR_PARTIAL\fP
+Adding more characters may result in a complete match that uses one or more
+characters from the end of this subject.
 .P
 When a partial match is returned, the first two elements in the ovector point
 to the portion of the subject that was matched, but the values in the rest of
@@ -77,53 +117,40 @@ is "456abc12", a partial match is found for the string "abc12", because all
 these characters are needed for a subsequent re-match with additional
 characters.
 .P
-What happens when a partial match is identified depends on which of the two
-partial matching options are set.
-.
-.
-.SS "PCRE2_PARTIAL_SOFT WITH pcre2_match()"
-.rs
-.sp
-If PCRE2_PARTIAL_SOFT is set when \fBpcre2_match()\fP identifies a partial
-match, the partial match is remembered, but matching continues as normal, and
-other alternatives in the pattern are tried. If no complete match can be found,
-PCRE2_ERROR_PARTIAL is returned instead of PCRE2_ERROR_NOMATCH.
-.P
-This option is "soft" because it prefers a complete match over a partial match.
-All the various matching items in a pattern behave as if the subject string is
-potentially complete. For example, \ez, \eZ, and $ match at the end of the
-subject, as normal, and for \eb and \eB the end of the subject is treated as a
-non-alphanumeric.
-.P
 If there is more than one partial match, the first one that was found provides
 the data that is returned. Consider this pattern:
 .sp
   /123\ew+X|dogY/
 .sp
-If this is matched against the subject string "abc123dog", both
-alternatives fail to match, but the end of the subject is reached during
-matching, so PCRE2_ERROR_PARTIAL is returned. The offsets are set to 3 and 9,
-identifying "123dog" as the first partial match that was found. (In this
-example, there are two partial matches, because "dog" on its own partially
-matches the second alternative.)
+If this is matched against the subject string "abc123dog", both alternatives
+fail to match, but the end of the subject is reached during matching, so
+PCRE2_ERROR_PARTIAL is returned. The offsets are set to 3 and 9, identifying
+"123dog" as the first partial match. (In this example, there are two partial
+matches, because "dog" on its own partially matches the second alternative.)
 .
 .
-.SS "PCRE2_PARTIAL_HARD WITH pcre2_match()"
-.rs
-.sp
-If PCRE2_PARTIAL_HARD is set for \fBpcre2_match()\fP, PCRE2_ERROR_PARTIAL is
-returned as soon as a partial match is found, without continuing to search for
-possible complete matches. This option is "hard" because it prefers an earlier
-partial match over a later complete match. For this reason, the assumption is
-made that the end of the supplied subject string may not be the true end of the
-available data, and so, if \ez, \eZ, \eb, \eB, or $ are encountered at the end
-of the subject, the result is PCRE2_ERROR_PARTIAL, provided that at least one
-character in the subject has been inspected.
-.
-.
-.SS "Comparing hard and soft partial matching"
+.SS "How a partial match is processed by pcre2_match()"
 .rs
 .sp
+What happens when a partial match is identified depends on which of the two
+partial matching options is set.
+.P
+If PCRE2_PARTIAL_HARD is set, PCRE2_ERROR_PARTIAL is returned as soon as a
+partial match is found, without continuing to search for possible complete
+matches. This option is "hard" because it prefers an earlier partial match over
+a later complete match. For this reason, the assumption is made that the end of
+the supplied subject string is not the true end of the available data, which is
+why \ez, \eZ, \eb, \eB, and $ always give a partial match.
+.P
+If PCRE2_PARTIAL_SOFT is set, the partial match is remembered, but matching
+continues as normal, and other alternatives in the pattern are tried. If no
+complete match can be found, PCRE2_ERROR_PARTIAL is returned instead of
+PCRE2_ERROR_NOMATCH. This option is "soft" because it prefers a complete match
+over a partial match. All the various matching items in a pattern behave as if
+the subject string is potentially complete; \ez, \eZ, and $ match at the end of
+the subject, as normal, and for \eb and \eB the end of the subject is treated
+as a non-alphanumeric.
+.P
 The difference between the two partial matching options can be illustrated by a
 pattern such as:
 .sp
@@ -148,89 +175,151 @@ The second pattern will never match "dogsbody", because it will always find the
 shorter match first.
 .
 .
-.SH "PARTIAL MATCHING USING pcre2_dfa_match()"
+.SS "Example of partial matching using pcre2test"
 .rs
 .sp
-The DFA functions move along the subject string character by character, without
-backtracking, searching for all possible matches simultaneously. If the end of
-the subject is reached before the end of the pattern, there is the possibility
-of a partial match, again provided that at least one character has been
-inspected.
-.P
-When PCRE2_PARTIAL_SOFT is set, PCRE2_ERROR_PARTIAL is returned only if there
-have been no complete matches. Otherwise, the complete matches are returned.
-However, if PCRE2_PARTIAL_HARD is set, a partial match takes precedence over
-any complete matches. The portion of the string that was matched when the
-longest partial match was found is set as the first matching string.
-.P
-Because the DFA functions always search for all possible matches, and there is
-no difference between greedy and ungreedy repetition, their behaviour is
-different from the standard functions when PCRE2_PARTIAL_HARD is set. Consider
-the string "dog" matched against the ungreedy pattern shown above:
+The \fBpcre2test\fP data modifiers \fBpartial_hard\fP (or \fBph\fP) and
+\fBpartial_soft\fP (or \fBps\fP) set PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT,
+respectively, when calling \fBpcre2_match()\fP. Here is a run of
+\fBpcre2test\fP using a pattern that matches the whole subject in the form of a
+date:
 .sp
-  /dog(sbody)??/
+    re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/
+  data> 25dec3\e=ph
+  Partial match: 23dec3
+  data> 3ju\e=ph
+  Partial match: 3ju
+  data> 3juj\e=ph
+  No match
 .sp
-Whereas the standard function stops as soon as it finds the complete match for
-"dog", the DFA function also finds the partial match for "dogsbody", and so
-returns that when PCRE2_PARTIAL_HARD is set.
+This example gives the same results for both hard and soft partial matching
+options. Here is an example where there is a difference:
+.sp
+    re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/
+  data> 25jun04\e=ps
+   0: 25jun04
+   1: jun
+  data> 25jun04\e=ph
+  Partial match: 25jun04
+.sp
+With PCRE2_PARTIAL_SOFT, the subject is matched completely. For
+PCRE2_PARTIAL_HARD, however, the subject is assumed not to be complete, so
+there is only a partial match.
+.
 .
 .
-.SH "PARTIAL MATCHING AND WORD BOUNDARIES"
+.SH "MULTI-SEGMENT MATCHING WITH pcre2_match()"
 .rs
 .sp
-If a pattern ends with one of sequences \eb or \eB, which test for word
-boundaries, partial matching with PCRE2_PARTIAL_SOFT can give counter-intuitive
-results. Consider this pattern:
+PCRE was not originally designed with multi-segment matching in mind. However,
+over time, features (including partial matching) that make multi-segment
+matching possible have been added. A very long string can be searched segment
+by segment by calling \fBpcre2_match()\fP repeatedly, with the aim of achieving
+the same results that would happen if the entire string was available for
+searching all the time. Normally, the strings that are being sought are much
+shorter than each individual segment, and are in the middle of very long
+strings, so the pattern is normally not anchored.
+.P
+Special logic must be implemented to handle a matched substring that spans a
+segment boundary. PCRE2_PARTIAL_HARD should be used, because it returns a
+partial match at the end of a segment whenever there is the possibility of
+changing the match by adding more characters. The PCRE2_NOTBOL option should
+also be set for all but the first segment.
+.P
+When a partial match occurs, the next segment must be added to the current
+subject and the match re-run, using the \fIstartoffset\fP argument of
+\fBpcre2_match()\fP to begin at the point where the partial match started.
+For example:
 .sp
-  /\ebcat\eb/
+    re> /\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed/
+  data> ...the date is 23ja\e=ph
+  Partial match: 23ja
+  data> ...the date is 23jan19 and on that day...\e=offset=15
+   0: 23jan19
+   1: jan
+.sp
+Note the use of the \fBoffset\fP modifier to start the new match where the
+partial match was found. In this example, the next segment was added to the one
+in which the partial match was found. This is the most straightforward
+approach, typically using a memory buffer that is twice the size of each
+segment. After a partial match, the first half of the buffer is discarded, the
+second half is moved to the start of the buffer, and a new segment is added
+before repeating the match as in the example above. After a no match, the
+entire buffer can be discarded.
+.P
+If there are memory constraints, you may want to discard text that precedes a
+partial match before adding the next segment. Unfortunately, this is not at
+present straightforward. In cases such as the above, where the pattern does not
+contain any lookbehinds, it is sufficient to retain only the partially matched
+substring. However, if the pattern contains a lookbehind assertion, characters
+that precede the start of the partial match may have been inspected during the
+matching process. When \fBpcre2test\fP displays a partial match, it indicates
+these characters with '<' if the \fBallusedtext\fP modifier is set:
 .sp
-This matches "cat", provided there is a word boundary at either end. If the
-subject string is "the cat", the comparison of the final "t" with a following
-character cannot take place, so a partial match is found. However, normal
-matching carries on, and \eb matches at the end of the subject when the last
-character is a letter, so a complete match is found. The result, therefore, is
-\fInot\fP PCRE2_ERROR_PARTIAL. Using PCRE2_PARTIAL_HARD in this case does yield
-PCRE2_ERROR_PARTIAL, because then the partial match takes precedence.
+    re> "(?<=123)abc"
+  data> xx123ab\e=ph,allusedtext
+  Partial match: 123ab
+                 <<<
+.sp
+However, the \fPallusedtext\fP modifier is not available for JIT matching,
+because JIT matching does not record the first (or last) consulted characters.
+For this reason, this information is not available via the API. It is therefore
+not possible in general to obtain the exact number of characters that must be
+retained in order to get the right match result. If you cannot retain the
+entire segment, you must find some heuristic way of choosing.
+.P
+If you know the approximate length of the matching substrings, you can use that
+to decide how much text to retain. The only lookbehind information that is
+currently available via the API is the length of the longest individual
+lookbehind in a pattern, but this can be misleading if there are nested
+lookbehinds. The value returned by calling \fBpcre2_pattern_info()\fP with the
+PCRE2_INFO_MAXLOOKBEHIND option is the maximum number of characters (not code
+units) that any individual lookbehind moves back when it is processed. A
+pattern such as "(?<=(?<!b)a)" has a maximum lookbehind value of one, but
+inspects two characters before its starting point.
+.P
+In a non-UTF or a 32-bit case, moving back is just a subtraction, but in
+UTF-8 or UTF-16 you have to count characters while moving back through the code
+units.
 .
 .
-.SH "EXAMPLE OF PARTIAL MATCHING USING PCRE2TEST"
+.SH "PARTIAL MATCHING USING pcre2_dfa_match()"
 .rs
 .sp
-If the \fBpartial_soft\fP (or \fBps\fP) modifier is present on a
-\fBpcre2test\fP data line, the PCRE2_PARTIAL_SOFT option is used for the match.
-Here is a run of \fBpcre2test\fP that uses the date example quoted above:
+The DFA function moves along the subject string character by character, without
+backtracking, searching for all possible matches simultaneously. If the end of
+the subject is reached before the end of the pattern, there is the possibility
+of a partial match.
+.P
+When PCRE2_PARTIAL_SOFT is set, PCRE2_ERROR_PARTIAL is returned only if there
+have been no complete matches. Otherwise, the complete matches are returned.
+If PCRE2_PARTIAL_HARD is set, a partial match takes precedence over any
+complete matches. The portion of the string that was matched when the longest
+partial match was found is set as the first matching string.
+.P
+Because the DFA function always searches for all possible matches, and there is
+no difference between greedy and ungreedy repetition, its behaviour is
+different from the \fBpcre2_match()\fP. Consider the string "dog" matched
+against this ungreedy pattern:
 .sp
-    re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/
-  data> 25jun04\e=ps
-   0: 25jun04
-   1: jun
-  data> 25dec3\e=ps
-  Partial match: 23dec3
-  data> 3ju\e=ps
-  Partial match: 3ju
-  data> 3juj\e=ps
-  No match
-  data> j\e=ps
-  No match
+  /dog(sbody)??/
 .sp
-The first data string is matched completely, so \fBpcre2test\fP shows the
-matched substrings. The remaining four strings do not match the complete
-pattern, but the first two are partial matches. Similar output is obtained
-if DFA matching is used.
-.P
-If the \fBpartial_hard\fP (or \fBph\fP) modifier is present on a
-\fBpcre2test\fP data line, the PCRE2_PARTIAL_HARD option is set for the match.
+Whereas the standard function stops as soon as it finds the complete match for
+"dog", the DFA function also finds the partial match for "dogsbody", and so
+returns that when PCRE2_PARTIAL_HARD is set.
 .
 .
 .SH "MULTI-SEGMENT MATCHING WITH pcre2_dfa_match()"
 .rs
 .sp
-When a partial match has been found using a DFA matching function, it is
+When a partial match has been found using the DFA matching function, it is
 possible to continue the match by providing additional subject data and calling
 the function again with the same compiled regular expression, this time setting
 the PCRE2_DFA_RESTART option. You must pass the same working space as before,
-because this is where details of the previous partial match are stored. Here is
-an example using \fBpcre2test\fP:
+because this is where details of the previous partial match are stored. You can
+set the PCRE2_PARTIAL_SOFT or PCRE2_PARTIAL_HARD options with PCRE2_DFA_RESTART
+to continue partial matching over multiple segments. Here is an example using
+\fBpcre2test\fP:
 .sp
     re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/
   data> 23ja\e=dfa,ps
@@ -242,147 +331,10 @@ The first call has "23ja" as the subject, and requests partial matching; the
 second call has "n05" as the subject for the continued (restarted) match.
 Notice that when the match is complete, only the last part is shown; PCRE2 does
 not retain the previously partially-matched string. It is up to the calling
-program to do that if it needs to.
-.P
-That means that, for an unanchored pattern, if a continued match fails, it is
-not possible to try again at a new starting point. All this facility is capable
-of doing is continuing with the previous match attempt. In the previous
-example, if the second set of data is "ug23" the result is no match, even
-though there would be a match for "aug23" if the entire string were given at
-once. Depending on the application, this may or may not be what you want.
-The only way to allow for starting again at the next character is to retain the
-matched part of the subject and try a new complete match.
-.P
-You can set the PCRE2_PARTIAL_SOFT or PCRE2_PARTIAL_HARD options with
-PCRE2_DFA_RESTART to continue partial matching over multiple segments. This
-facility can be used to pass very long subject strings to the DFA matching
-functions.
-.
-.
-.SH "MULTI-SEGMENT MATCHING WITH pcre2_match()"
-.rs
-.sp
-Unlike the DFA function, it is not possible to restart the previous match with
-a new segment of data when using \fBpcre2_match()\fP. Instead, new data must be
-added to the previous subject string, and the entire match re-run, starting
-from the point where the partial match occurred. Earlier data can be discarded.
-.P
-It is best to use PCRE2_PARTIAL_HARD in this situation, because it does not
-treat the end of a segment as the end of the subject when matching \ez, \eZ,
-\eb, \eB, and $. Consider an unanchored pattern that matches dates:
-.sp
-    re> /\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed/
-  data> The date is 23ja\e=ph
-  Partial match: 23ja
-.sp
-At this stage, an application could discard the text preceding "23ja", add on
-text from the next segment, and call the matching function again. Unlike the
-DFA matching function, the entire matching string must always be available,
-and the complete matching process occurs for each call, so more memory and more
-processing time is needed.
-.
-.
-.SH "ISSUES WITH MULTI-SEGMENT MATCHING"
-.rs
-.sp
-Certain types of pattern may give problems with multi-segment matching,
-whichever matching function is used.
-.P
-1. If the pattern contains a test for the beginning of a line, you need to pass
-the PCRE2_NOTBOL option when the subject string for any call does start at the
-beginning of a line. There is also a PCRE2_NOTEOL option, but in practice when
-doing multi-segment matching you should be using PCRE2_PARTIAL_HARD, which
-includes the effect of PCRE2_NOTEOL.
-.P
-2. If a pattern contains a lookbehind assertion, characters that precede the
-start of the partial match may have been inspected during the matching process.
-When using \fBpcre2_match()\fP, sufficient characters must be retained for the
-next match attempt. You can ensure that enough characters are retained by doing
-the following:
-.P
-Before doing any matching, find the length of the longest lookbehind in the
-pattern by calling \fBpcre2_pattern_info()\fP with the PCRE2_INFO_MAXLOOKBEHIND
-option. Note that the resulting count is in characters, not code units. After a
-partial match, moving back from the ovector[0] offset in the subject by the
-number of characters given for the maximum lookbehind gets you to the earliest
-character that must be retained. In a non-UTF or a 32-bit situation, moving
-back is just a subtraction, but in UTF-8 or UTF-16 you have to count characters
-while moving back through the code units.
-.P
-Characters before the point you have now reached can be discarded, and after
-the next segment has been added to what is retained, you should run the next
-match with the \fBstartoffset\fP argument set so that the match begins at the
-same point as before.
-.P
-For example, if the pattern "(?<=123)abc" is partially matched against the
-string "xx123ab", the ovector offsets are 5 and 7 ("ab"). The maximum
-lookbehind count is 3, so all characters before offset 2 can be discarded. The
-value of \fBstartoffset\fP for the next match should be 3. When \fBpcre2test\fP
-displays a partial match, it indicates the lookbehind characters with '<'
-characters:
-.sp
-    re> "(?<=123)abc"
-  data> xx123ab\e=ph
-  Partial match: 123ab
-                 <<<
-.P
-3. Because a partial match must always contain at least one character, what
-might be considered a partial match of an empty string actually gives a "no
-match" result. For example:
-.sp
-    re> /c(?<=abc)x/
-  data> ab\e=ps
-  No match
-.sp
-If the next segment begins "cx", a match should be found, but this will only
-happen if characters from the previous segment are retained. For this reason, a
-"no match" result should be interpreted as "partial match of an empty string"
-when the pattern contains lookbehinds.
-.P
-4. Matching a subject string that is split into multiple segments may not
-always produce exactly the same result as matching over one single long string,
-especially when PCRE2_PARTIAL_SOFT is used. The section "Partial Matching and
-Word Boundaries" above describes an issue that arises if the pattern ends with
-\eb or \eB. Another kind of difference may occur when there are multiple
-matching possibilities, because (for PCRE2_PARTIAL_SOFT) a partial match result
-is given only when there are no completed matches. This means that as soon as
-the shortest match has been found, continuation to a new subject segment is no
-longer possible. Consider this \fBpcre2test\fP example:
-.sp
-    re> /dog(sbody)?/
-  data> dogsb\e=ps
-   0: dog
-  data> do\e=ps,dfa
-  Partial match: do
-  data> gsb\e=ps,dfa,dfa_restart
-   0: g
-  data> dogsbody\e=dfa
-   0: dogsbody
-   1: dog
-.sp
-The first data line passes the string "dogsb" to a standard matching function,
-setting the PCRE2_PARTIAL_SOFT option. Although the string is a partial match
-for "dogsbody", the result is not PCRE2_ERROR_PARTIAL, because the shorter
-string "dog" is a complete match. Similarly, when the subject is presented to
-a DFA matching function in several parts ("do" and "gsb" being the first two)
-the match stops when "dog" has been found, and it is not possible to continue.
-On the other hand, if "dogsbody" is presented as a single string, a DFA
-matching function finds both matches.
-.P
-Because of these problems, it is best to use PCRE2_PARTIAL_HARD when matching
-multi-segment data. The example above then behaves differently:
-.sp
-    re> /dog(sbody)?/
-  data> dogsb\e=ph
-  Partial match: dogsb
-  data> do\e=ps,dfa
-  Partial match: do
-  data> gsb\e=ph,dfa,dfa_restart
-  Partial match: gsb
-.sp
-5. Patterns that contain alternatives at the top level which do not all start
-with the same pattern item may not work as expected when PCRE2_DFA_RESTART is
-used. For example, consider this pattern:
+program to do that if it needs to. This means that, for an unanchored pattern,
+if a continued match fails, it is not possible to try again at a new starting
+point. All this facility is capable of doing is continuing with the previous
+match attempt. For example, consider this pattern:
 .sp
   1234|3789
 .sp
@@ -391,28 +343,15 @@ alternative is found at offset 3. There is no partial match for the second
 alternative, because such a match does not start at the same point in the
 subject string. Attempting to continue with the string "7890" does not yield a
 match because only those alternatives that match at one point in the subject
-are remembered. The problem arises because the start of the second alternative
-matches within the first alternative. There is no problem with anchored
-patterns or patterns such as:
-.sp
-  1234|ABCD
-.sp
-where no string can be a partial match for both alternatives. This is not a
-problem if a standard matching function is used, because the entire match has
-to be rerun each time:
-.sp
-    re> /1234|3789/
-  data> ABC123\e=ph
-  Partial match: 123
-  data> 1237890
-   0: 3789
-.sp
-Of course, instead of using PCRE2_DFA_RESTART, the same technique of re-running
-the entire match can also be used with the DFA matching function. Another
-possibility is to work with two buffers. If a partial match at offset \fIn\fP
-in the first buffer is followed by "no match" when PCRE2_DFA_RESTART is used on
-the second buffer, you can then try a new match starting at offset \fIn+1\fP in
-the first buffer.
+are remembered. Depending on the application, this may or may not be what you
+want.
+.P
+If you do want to allow for starting again at the next character, one way of
+doing it is to retain some or all of the segment and try a new complete match,
+as described for \fBpcre2_match()\fP above. Another possibility is to work with
+two buffers. If a partial match at offset \fIn\fP in the first buffer is
+followed by "no match" when PCRE2_DFA_RESTART is used on the second buffer, you
+can then try a new match starting at offset \fIn+1\fP in the first buffer.
 .
 .
 .SH AUTHOR
@@ -429,6 +368,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 22 December 2014
-Copyright (c) 1997-2014 University of Cambridge.
+Last updated: 04 September 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 0247c524a307f52fe2546429322bf5e47b0495e5..d5228f3dde8bbe1964935fad48473fa6f3ebe092 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2PATTERN 3 "04 September 2018" "PCRE2 10.32"
+.TH PCRE2PATTERN 3 "29 July 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 REGULAR EXPRESSION DETAILS"
@@ -20,13 +20,13 @@ 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.
 .P
-This document discusses the patterns that are supported by PCRE2 when its main
-matching function, \fBpcre2_match()\fP, is used. PCRE2 also has an alternative
-matching function, \fBpcre2_dfa_match()\fP, 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 advantages and disadvantages of
-the alternative function, and how it differs from the normal function, are
-discussed in the
+This document discusses the regular expression patterns that are supported by
+PCRE2 when its main matching function, \fBpcre2_match()\fP, is used. PCRE2 also
+has an alternative matching function, \fBpcre2_dfa_match()\fP, 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 advantages and
+disadvantages of the alternative function, and how it differs from the normal
+function, are discussed in the
 .\" HREF
 \fBpcre2matching\fP
 .\"
@@ -52,10 +52,11 @@ 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
+you must either call the compiling function with one or both of the PCRE2_UTF
+or PCRE2_MATCH_INVALID_UTF options, or the pattern must start with the special
+sequence (*UTF), which is equivalent to setting the relevant PCRE2_UTF. How
+setting a UTF mode affects pattern matching is mentioned in several places
+below. There is also a summary of features in the
 .\" HREF
 \fBpcre2unicode\fP
 .\"
@@ -149,8 +150,8 @@ this indirectly restricts the amount of heap memory that is used, but there is
 also an explicit memory limit that can be set.
 .P
 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 applied to a long string that does not match). When one of
+patterns with huge matching trees. A common example is a pattern with nested
+unlimited repeats applied to a long string that does not match. When one of
 these limits is reached, \fBpcre2_match()\fP gives an error return. The limits
 can also be set by items at the start of the pattern of the form
 .sp
@@ -264,10 +265,10 @@ 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.
 .P
-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
-\fImetacharacters\fP, which do not stand for themselves but instead are
-interpreted in some special way.
+The power of regular expressions comes from the ability to include wild cards,
+character classes, alternatives, and repetitions in the pattern. These are
+encoded in the pattern by the use of \fImetacharacters\fP, which do not stand
+for themselves but instead are interpreted in some special way.
 .P
 There are two different sets of metacharacters: those that are recognized
 anywhere in the pattern except within square brackets, and those that are
@@ -280,14 +281,11 @@ are as follows:
   .      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
+  (      start group or control verb
+  )      end group or control verb
   *      0 or more quantifier
-  +      1 or more quantifier
-         also "possessive quantifier"
+  +      1 or more quantifier; also "possessive quantifier"
+  ?      0 or 1 quantifier; also quantifier minimizer
   {      start min/max quantifier
 .sp
 Part of a pattern that is in square brackets is called a "character class". In
@@ -296,9 +294,7 @@ a character class the only metacharacters are:
   \e      general escape character
   ^      negate the class, but only if the first character
   -      indicates character range
-.\" JOIN
-  [      POSIX character class (only if followed by POSIX
-           syntax)
+  [      POSIX character class (if followed by POSIX syntax)
   ]      terminates the character class
 .sp
 The following sections describe the use of each of the metacharacters.
@@ -308,7 +304,7 @@ The following sections describe the use of each of the metacharacters.
 .rs
 .sp
 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
+character that is not a digit 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.
 .P
@@ -318,7 +314,7 @@ 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 backslash, you write \e\e.
 .P
-In a UTF mode, only ASCII numbers and letters have any special meaning after a
+In a UTF mode, only ASCII digits and letters have any special meaning after a
 backslash. All other characters (in particular, those whose code points are
 greater than 127) are treated as literals.
 .P
@@ -328,13 +324,13 @@ 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.
 .P
-If you want to remove the special meaning from a sequence of characters, you
-can do so by putting them between \eQ and \eE. This is different from Perl in
-that $ and @ are handled as literals in \eQ...\eE sequences in PCRE2, whereas
-in Perl, $ and @ cause variable interpolation. Also, Perl does "double-quotish
-backslash interpolation" on any backslashes between \eQ and \eE which, its
-documentation says, "may lead to confusing results". PCRE2 treats a backslash
-between \eQ and \eE just like any other character. Note the following examples:
+If you want to treat all characters in a sequence as literals, you can do so by
+putting them between \eQ and \eE. This is different from Perl in that $ and @
+are handled as literals in \eQ...\eE sequences in PCRE2, whereas in Perl, $ and
+@ cause variable interpolation. Also, Perl does "double-quotish backslash
+interpolation" on any backslashes between \eQ and \eE which, its documentation
+says, "may lead to confusing results". PCRE2 treats a backslash between \eQ and
+\eE just like any other character. Note the following examples:
 .sp
   Pattern            PCRE2 matches   Perl matches
 .sp
@@ -362,15 +358,15 @@ A second use of backslash provides a way of encoding non-printing characters
 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:
+instead of the binary character it represents. In an ASCII or Unicode
+environment, these escapes are as follows:
 .sp
   \ea          alarm, that is, the BEL character (hex 07)
   \ecx         "control-x", where x is any printable ASCII character
   \ee          escape (hex 1B)
   \ef          form feed (hex 0C)
   \en          linefeed (hex 0A)
-  \er          carriage return (hex 0D)
+  \er          carriage return (hex 0D) (but see below)
   \et          tab (hex 09)
   \e0dd        character with octal code 0dd
   \eddd        character with octal code ddd, or backreference
@@ -378,13 +374,41 @@ these escapes are as follows:
   \exhh        character with hex code hh
   \ex{hhh..}   character with hex code hhh..
   \eN{U+hhh..} character with Unicode hex code point hhh..
-  \euhhhh      character with hex code hhhh (when PCRE2_ALT_BSUX is set)
 .sp
-The \eN{U+hhh..} escape sequence is recognized only when the PCRE2_UTF option
-is set, that is, when PCRE2 is operating in a Unicode mode. Perl also uses
-\eN{name} to specify characters by Unicode name; PCRE2 does not support this.
-Note that when \eN is not followed by an opening brace (curly bracket) it has
-an entirely different meaning, matching any character that is not a newline.
+By default, after \ex that is not followed by {, from zero to two hexadecimal
+digits are read (letters can be in upper or lower case). Any number of
+hexadecimal digits may appear between \ex{ and }. If a character other than a
+hexadecimal digit appears between \ex{ and }, or if there is no terminating },
+an error occurs.
+.P
+Characters whose code points are less than 256 can be defined by either of the
+two syntaxes for \ex or by an octal sequence. There is no difference in the way
+they are handled. For example, \exdc is exactly the same as \ex{dc} or \e334.
+However, using the braced versions does make such sequences easier to read.
+.P
+Support is available for some ECMAScript (aka JavaScript) escape sequences via
+two compile-time options. If PCRE2_ALT_BSUX is set, the sequence \ex followed
+by { is not recognized. Only if \ex is followed by two hexadecimal digits is it
+recognized as a character escape. Otherwise it is interpreted as a literal "x"
+character. In this mode, support for code points greater than 256 is provided
+by \eu, which must be followed by four hexadecimal digits; otherwise it is
+interpreted as a literal "u" character.
+.P
+PCRE2_EXTRA_ALT_BSUX has the same effect as PCRE2_ALT_BSUX and, in addition,
+\eu{hhh..} is recognized as the character specified by hexadecimal code point.
+There may be any number of hexadecimal digits. This syntax is from ECMAScript
+6.
+.P
+The \eN{U+hhh..} escape sequence is recognized only when PCRE2 is operating in
+UTF mode. Perl also uses \eN{name} to specify characters by Unicode name; PCRE2
+does not support this. Note that when \eN is not followed by an opening brace
+(curly bracket) it has an entirely different meaning, matching any character
+that is not a newline.
+.P
+There are some legacy applications where the escape sequence \er is expected to
+match a newline. If the PCRE2_EXTRA_ESCAPED_CR_IS_LF option is set, \er in a
+pattern is converted to \en so that it matches a LF (linefeed) instead of a CR
+(carriage return) character.
 .P
 The precise effect of \ecx 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
@@ -436,17 +460,17 @@ and Perl has changed over time, causing PCRE2 also to change.
 .P
 Outside a character class, PCRE2 reads the digit and any following digits 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 \fIbackreference\fP. A
-description of how this works is given
+if there are at least that many previous capture groups in the expression, the
+entire sequence is taken as a \fIbackreference\fP. A description of how this
+works is given
 .\" HTML <a href="#backreferences">
 .\" </a>
 later,
 .\"
 following the discussion of
-.\" HTML <a href="#subpattern">
+.\" HTML <a href="#group">
 .\" </a>
-parenthesized subpatterns.
+parenthesized groups.
 .\"
 Otherwise, up to three octal digits are read to form a character code.
 .P
@@ -458,7 +482,7 @@ for themselves. For example, outside a character class:
   \e040   is another way of writing an ASCII space
 .\" JOIN
   \e40    is the same, provided there are fewer than 40
-            previous capturing subpatterns
+            previous capture groups
   \e7     is always a backreference
 .\" JOIN
   \e11    might be a backreference, or another way of
@@ -477,23 +501,6 @@ for themselves. For example, outside a character class:
 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.
-.P
-By default, after \ex that is not followed by {, from zero to two hexadecimal
-digits are read (letters can be in upper or lower case). Any number of
-hexadecimal digits may appear between \ex{ and }. If a character other than
-a hexadecimal digit appears between \ex{ and }, or if there is no terminating
-}, an error occurs.
-.P
-If the PCRE2_ALT_BSUX option is set, the interpretation of \ex is as just
-described only when it is followed by two hexadecimal digits. Otherwise, it
-matches a literal "x" character. In this mode, support for code points greater
-than 256 is provided by \eu, which must be followed by four hexadecimal digits;
-otherwise it matches a literal "u" character.
-.P
-Characters whose value is less than 256 can be defined by either of the two
-syntaxes for \ex (or by \eu in PCRE2_ALT_BSUX mode). There is no difference in
-the way they are handled. For example, \exdc is exactly the same as \ex{dc} (or
-\eu00dc in PCRE2_ALT_BSUX mode).
 .
 .
 .SS "Constraints on character values"
@@ -532,9 +539,10 @@ character class, these sequences have different meanings.
 .sp
 In Perl, the sequences \eF, \el, \eL, \eu, and \eU 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, \eU matches a "U" character, and \eu can be used to define a character
-by code point, as described above.
+does not support these escape sequences in patterns. However, if either of the
+PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX options is set, \eU matches a "U"
+character, and \eu can be used to define a character by code point, as
+described above.
 .
 .
 .SS "Absolute and relative backreferences"
@@ -548,9 +556,9 @@ can be coded as \eg{name}. Backreferences are discussed
 later,
 .\"
 following the discussion of
-.\" HTML <a href="#subpattern">
+.\" HTML <a href="#group">
 .\" </a>
-parenthesized subpatterns.
+parenthesized groups.
 .\"
 .
 .
@@ -559,14 +567,14 @@ parenthesized subpatterns.
 .sp
 For compatibility with Oniguruma, the non-Perl syntax \eg 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
+syntax for referencing a capture group as a subroutine. Details are discussed
 .\" HTML <a href="#onigurumasubroutines">
 .\" </a>
 later.
 .\"
 Note that \eg{...} (Perl syntax) and \eg<...> (Oniguruma syntax) are \fInot\fP
 synonymous. The former is a backreference; the latter is a
-.\" HTML <a href="#subpatternsassubroutines">
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
 subroutine
 .\"
@@ -746,21 +754,22 @@ an error.
 .rs
 .sp
 When PCRE2 is built with Unicode support (the default), three additional 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 code points are less than 256, but they do work in this mode.
-In 32-bit non-UTF mode, code points greater than 0x10ffff (the Unicode limit)
-may be encountered. These are all treated as being in the Common script and
-with an unassigned type. The extra escape sequences are:
+sequences that match characters with specific properties are available. They
+can be used in any mode, though in 8-bit and 16-bit non-UTF modes these
+sequences are of course limited to testing characters whose code points are
+less than U+0100 and U+10000, respectively. In 32-bit non-UTF mode, code points
+greater than 0x10ffff (the Unicode limit) may be encountered. These are all
+treated as being in the Unknown script and with an unassigned type. The extra
+escape sequences are:
 .sp
   \ep{\fIxx\fP}   a character with the \fIxx\fP property
   \eP{\fIxx\fP}   a character without the \fIxx\fP property
   \eX       a Unicode extended grapheme cluster
 .sp
-The property names represented by \fIxx\fP 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
+The property names represented by \fIxx\fP above are case-sensitive. There is
+support for Unicode script names, Unicode general category properties, "Any",
+which matches any character (including newline), and some special PCRE2
+properties (described in the
 .\" HTML <a href="#extraprops">
 .\" </a>
 next section).
@@ -776,8 +785,10 @@ example:
   \ep{Greek}
   \eP{Han}
 .sp
-Those that are not part of an identified script are lumped together as
-"Common". The current list of scripts is:
+Unassigned characters (and in non-UTF 32-bit mode, characters with code points
+greater than 0x10FFFF) are assigned the "Unknown" script. Others that are not
+part of an identified script are lumped together as "Common". The current list
+of scripts is:
 .P
 Adlam,
 Ahom,
@@ -813,6 +824,7 @@ Dogra,
 Duployan,
 Egyptian_Hieroglyphs,
 Elbasan,
+Elymaic,
 Ethiopic,
 Georgian,
 Glagolitic,
@@ -870,10 +882,12 @@ Mro,
 Multani,
 Myanmar,
 Nabataean,
+Nandinagari,
 New_Tai_Lue,
 Newa,
 Nko,
 Nushu,
+Nyakeng_Puachue_Hmong,
 Ogham,
 Ol_Chiki,
 Old_Hungarian,
@@ -923,7 +937,9 @@ Tibetan,
 Tifinagh,
 Tirhuta,
 Ugaritic,
+Unknown,
 Vai,
+Wancho,
 Warang_Citi,
 Yi,
 Zanabazar_Square.
@@ -991,14 +1007,16 @@ 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".
 .P
-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
+The Cs (Surrogate) property applies only to characters whose code points are in
+the range U+D800 to U+DFFF. These characters are no different to any other
+character when PCRE2 is not in UTF mode (using the 16-bit or 32-bit library).
+However, they are not valid in Unicode strings and so cannot be tested by PCRE2
+in UTF mode, unless UTF validity checking has been turned off (see the
+discussion of PCRE2_NO_UTF_CHECK in the
 .\" HREF
 \fBpcre2api\fP
 .\"
-page). Perl does not support the Cs property.
+page).
 .P
 The long synonyms for property names that Perl supports (such as \ep{Letter})
 are not supported by PCRE2, nor is it permitted to prefix any of these
@@ -1122,7 +1140,7 @@ a lookbehind assertion
 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 \eK does
 not interfere with the setting of
-.\" HTML <a href="#subpattern">
+.\" HTML <a href="#group">
 .\" </a>
 captured substrings.
 .\"
@@ -1153,7 +1171,7 @@ start of the reported match is earlier than where the match started.
 The final use of backslash is for certain simple assertions. An assertion
 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
+groups for more complicated assertions is described
 .\" HTML <a href="#bigassertions">
 .\" </a>
 below.
@@ -1175,12 +1193,12 @@ character. If any other of these assertions appears in a character class, an
 A word boundary is a position in the subject string where the current character
 and the previous character do not both match \ew or \eW (i.e. one matches
 \ew and the other matches \eW), or the start or end of the string if the
-first or last character matches \ew, respectively. In a UTF mode, the meanings
-of \ew and \eW can be changed by setting the PCRE2_UCP option. When this is
-done, it also affects \eb and \eB. Neither PCRE2 nor Perl has a separate "start
-of word" or "end of word" metasequence. However, whatever follows \eb normally
-determines which it is. For example, the fragment \eba matches "a" at the start
-of a word.
+first or last character matches \ew, respectively. When PCRE2 is built with
+Unicode support, the meanings of \ew and \eW can be changed by setting the
+PCRE2_UCP option. When this is done, it also affects \eb and \eB. Neither PCRE2
+nor Perl has a separate "start of word" or "end of word" metasequence. However,
+whatever follows \eb normally determines which it is. For example, the fragment
+\eba matches "a" at the start of a word.
 .P
 The \eA, \eZ, and \ez assertions differ from the traditional circumflex and
 dollar (described in the next section) in that they only ever match at the very
@@ -1339,7 +1357,7 @@ 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).
+unless the PCRE2_NO_UTF_CHECK or PCRE2_MATCH_INVALID_UTF 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
@@ -1372,9 +1390,9 @@ could be used with a UTF-8 string (ignore white space and line breaks):
 .sp
 In this example, a group that starts with (?| resets the capturing parentheses
 numbers in each alternative (see
-.\" HTML <a href="#dupsubpatternnumber">
+.\" HTML <a href="#dupgroupnumber">
 .\" </a>
-"Duplicate Subpattern Numbers"
+"Duplicate Group Numbers"
 .\"
 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
@@ -1616,13 +1634,13 @@ the pattern
 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
-.\" HTML <a href="#subpattern">
+that succeeds is used. If the alternatives are within a group
+.\" HTML <a href="#group">
 .\" </a>
 (defined below),
 .\"
 "succeeds" means matching the rest of the main pattern as well as the
-alternative in the subpattern.
+alternative in the group.
 .
 .
 .SH "INTERNAL OPTION SETTING"
@@ -1665,16 +1683,16 @@ the same way as the Perl-compatible options by using the characters J and U
 respectively. However, these are not unset by (?^).
 .P
 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. An option change within a subpattern (see below for a description
-of subpatterns) affects only that part of the subpattern that follows it, so
+group parentheses), the change applies to the remainder of the pattern
+that follows. An option change within a group (see below for a description
+of groups) affects only that part of the group that follows it, so
 .sp
   (a(?i)b)c
 .sp
 matches abc and aBc and no other strings (assuming PCRE2_CASELESS is not used).
 By this means, options can be made to have different settings in different
 parts of the pattern. Any changes made in one alternative do carry on
-into subsequent branches within the same subpattern. For example,
+into subsequent branches within the same group. For example,
 .sp
   (a(?i)b|c)
 .sp
@@ -1684,7 +1702,7 @@ option settings happen at compile time. There would be some very weird
 behaviour otherwise.
 .P
 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
+a non-capturing group (see the next section), the option letters may
 appear between the "?" and the ":". Thus the two patterns
 .sp
   (?i:saturday|sunday)
@@ -1692,10 +1710,11 @@ appear between the "?" and the ":". Thus the two patterns
 .sp
 match exactly the same set of strings.
 .P
-\fBNote:\fP There are other PCRE2-specific options that can be set by the
-application when the compiling function is called. The pattern can contain
-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
+\fBNote:\fP There are other PCRE2-specific options, applying to the whole
+pattern, which can be set by the application when the compiling function is
+called. In addition, the pattern can contain 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
 .\" HTML <a href="#newlineseq">
 .\" </a>
 "Newline sequences"
@@ -1707,12 +1726,12 @@ the PCRE2_NEVER_UTF and PCRE2_NEVER_UCP options, which lock out the use of the
 (*UTF) and (*UCP) sequences.
 .
 .
-.\" HTML <a name="subpattern"></a>
-.SH SUBPATTERNS
+.\" HTML <a name="group"></a>
+.SH GROUPS
 .rs
 .sp
-Subpatterns are delimited by parentheses (round brackets), which can be nested.
-Turning part of a pattern into a subpattern does two things:
+Groups are delimited by parentheses (round brackets), which can be nested.
+Turning part of a pattern into a group does two things:
 .sp
 1. It localizes a set of alternatives. For example, the pattern
 .sp
@@ -1721,15 +1740,15 @@ Turning part of a pattern into a subpattern does two things:
 matches "cataract", "caterpillar", or "cat". Without the parentheses, it would
 match "cataract", "erpillar" or an empty string.
 .sp
-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.)
+2. It creates a "capture group". This means that, when the whole pattern
+matches, the portion of the subject string that matched the group 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.)
 .P
 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
+numbers for capture groups. For example, if the string "the red king" is
+matched against the pattern
 .sp
   the ((red|white) (king|queen))
 .sp
@@ -1737,38 +1756,37 @@ the captured substrings are "red king", "red", and "king", and are numbered 1,
 2, and 3, respectively.
 .P
 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 capturing, 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
+There are often times when grouping is required without capturing. If an
+opening parenthesis is followed by a question mark and a colon, the group
+does not do any capturing, and is not counted when computing the number of any
+subsequent capture groups. For example, if the string "the white queen"
+is matched against the pattern
 .sp
   the ((?:red|white) (king|queen))
 .sp
 the captured substrings are "white queen" and "queen", and are numbered 1 and
-2. The maximum number of capturing subpatterns is 65535.
+2. The maximum number of capture groups is 65535.
 .P
 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
+a non-capturing group, the option letters may appear between the "?" and the
+":". Thus the two patterns
 .sp
   (?i:saturday|sunday)
   (?:(?i)saturday|sunday)
 .sp
 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
+from left to right, and options are not reset until the end of the group is
+reached, an option setting in one branch does affect subsequent branches, so
 the above patterns match "SUNDAY" as well as "Saturday".
 .
 .
-.\" HTML <a name="dupsubpatternnumber"></a>
-.SH "DUPLICATE SUBPATTERN NUMBERS"
+.\" HTML <a name="dupgroupnumber"></a>
+.SH "DUPLICATE GROUP NUMBERS"
 .rs
 .sp
-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:
+Perl 5.10 introduced a feature whereby each alternative in a group uses the
+same numbers for its capturing parentheses. Such a group starts with (?| and is
+itself a non-capturing group. For example, consider this pattern:
 .sp
   (?|(Sat)ur|(Sun))day
 .sp
@@ -1778,7 +1796,7 @@ 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, parentheses 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
+parentheses that follow the whole group start after the highest number used in
 any branch. The following example is taken from the Perl documentation. The
 numbers underneath show in which buffer the captured content will be stored.
 .sp
@@ -1786,13 +1804,12 @@ numbers underneath show in which buffer the captured content will be stored.
   / ( a )  (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x
   # 1            2         2  3        2     3     4
 .sp
-A backreference 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":
+A backreference to a capture group uses the most recent value that is set for
+the group. The following pattern matches "abcabc" or "defdef":
 .sp
   /(?|(abc)|(def))\e1/
 .sp
-In contrast, a subroutine call to a numbered subpattern always refers to the
+In contrast, a subroutine call to a capture group always refers to the
 first one in the pattern with the given number. The following pattern matches
 "abcabc" or "defabc":
 .sp
@@ -1806,29 +1823,35 @@ If a
 .\" </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 number have matched.
+for a group's having matched refers to a non-unique number, the test is
+true if any group with that number has matched.
 .P
 An alternative approach to using this "branch reset" feature is to use
-duplicate named subpatterns, as described in the next section.
+duplicate named groups, as described in the next section.
 .
 .
-.SH "NAMED SUBPATTERNS"
+.SH "NAMED CAPTURE GROUPS"
 .rs
 .sp
-Identifying capturing parentheses by number is simple, but it can be very hard
-to keep track of the numbers in complicated patterns. Furthermore, if an
-expression is modified, the numbers may change. To help with this difficulty,
-PCRE2 supports the naming of capturing subpatterns. 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.
+Identifying capture groups by number is simple, but it can be very hard to keep
+track of the numbers in complicated patterns. Furthermore, if an expression is
+modified, the numbers may change. To help with this difficulty, PCRE2 supports
+the naming of capture groups. 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.
 .P
-In PCRE2, a capturing subpattern can be named in one of three ways:
-(?<name>...) or (?'name'...) as in Perl, or (?P<name>...) as in Python. Names
-consist of up to 32 alphanumeric characters and underscores, but must start
-with a non-digit. References to capturing parentheses from other parts of the
-pattern, such as
+In PCRE2, a capture group can be named in one of three ways: (?<name>...) or
+(?'name'...) as in Perl, or (?P<name>...) as in Python. Names may be up to 32
+code units long. When PCRE2_UTF is not set, they may contain only ASCII
+alphanumeric characters and underscores, but must start with a non-digit. When
+PCRE2_UTF is set, the syntax of group names is extended to allow any Unicode
+letter or Unicode decimal digit. In other words, group names must match one of
+these patterns:
+.sp
+  ^[_A-Za-z][_A-Za-z0-9]*\ez   when PCRE2_UTF is not set
+  ^[_\ep{L}][_\ep{L}\ep{Nd}]*\ez  when PCRE2_UTF is set
+.sp
+References to capture groups from other parts of the pattern, such as
 .\" HTML <a href="#backreferences">
 .\" </a>
 backreferences,
@@ -1844,17 +1867,17 @@ conditions,
 .\"
 can all be made by name as well as by number.
 .P
-Named capturing parentheses are allocated numbers as well as names, exactly as
-if the names were not present. In both PCRE2 and Perl, capturing subpatterns
+Named capture groups are allocated numbers as well as names, exactly as
+if the names were not present. In both PCRE2 and Perl, capture groups
 are primarily identified by numbers; any names are just aliases for these
 numbers. The PCRE2 API provides function calls for extracting the complete
 name-to-number translation table from a compiled pattern, as well as
 convenience functions for extracting captured substrings by name.
 .P
-\fBWarning:\fP When more than one subpattern has the same number, as described
-in the previous section, a name given to one of them applies to all of them.
-Perl allows identically numbered subpatterns to have different names. Consider
-this pattern, where there are two capturing subpatterns, both numbered 1:
+\fBWarning:\fP When more than one capture group has the same number, as
+described in the previous section, a name given to one of them applies to all
+of them. Perl allows identically numbered groups to have different names.
+Consider this pattern, where there are two capture groups, both numbered 1:
 .sp
   (?|(?<AA>aa)|(?<BB>bb))
 .sp
@@ -1868,20 +1891,20 @@ pattern:
 .sp
   (?|(?<AA>aa)|(bb))
 .sp
-Although the second subpattern number 1 is not explicitly named, the name AA is
-still an alias for subpattern 1. Whether the pattern matches "aa" or "bb", a
+Although the second group number 1 is not explicitly named, the name AA is
+still an alias for any group 1. Whether the pattern matches "aa" or "bb", a
 reference by name to group AA yields the matched string.
 .P
 By default, a name must be unique within a pattern, except that duplicate names
-are permitted for subpatterns with the same number, for example:
+are permitted for groups with the same number, for example:
 .sp
   (?|(?<AA>aa)|(?<AA>bb))
 .sp
 The duplicate name constraint can be disabled by setting the PCRE2_DUPNAMES
 option at compile time, or by the use of (?J) within the pattern. 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
+names can be useful for patterns where only one instance of the named capture
+group 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:
 .sp
   (?<DN>Mon|Fri|Sun)(?:day)?|
@@ -1890,23 +1913,23 @@ extract the abbreviation. This pattern (ignoring the line breaks) does the job:
   (?<DN>Thu)(?:rsday)?|
   (?<DN>Sat)(?:urday)?
 .sp
-There are five capturing substrings, but only one is ever set after a match.
-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. (An
-alternative way of solving this problem is to use a "branch reset" subpattern,
-as described in the previous section.)
+There are five capture groups, but only one is ever set after a match. The
+convenience functions for extracting the data by name returns the substring for
+the first (and in this example, the only) group of that name that matched. This
+saves searching to find which numbered group it was. (An alternative way of
+solving this problem is to use a "branch reset" group, as described in the
+previous section.)
 .P
-If you make a backreference 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 pattern matches both "foofoo" and
-"barbar" but not "foobar" or "barfoo":
+If you make a backreference to a non-unique named group from elsewhere in the
+pattern, the groups 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 pattern matches both "foofoo" and "barbar" but not
+"foobar" or "barfoo":
 .sp
   (?:(?<n>foo)|(?<n>bar))\ek<n>
 .sp
 .P
-If you make a subroutine call to a non-unique named subpattern, the one that
+If you make a subroutine call to a non-unique named group, the one that
 corresponds to the first occurrence of the name is used. In the absence of
 duplicate numbers this is the one with the lowest number.
 .P
@@ -1917,11 +1940,11 @@ test (see the
 .\" </a>
 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
+below), either to check whether a capture group has matched, or to check for
+recursion, all groups 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
+capture groups, see the
 .\" HREF
 \fBpcre2api\fP
 .\"
@@ -1937,18 +1960,18 @@ items:
   a literal data character
   the dot metacharacter
   the \eC escape sequence
-  the \eX escape sequence
   the \eR escape sequence
+  the \eX escape sequence
   an escape such as \ed or \epL that matches a single character
   a character class
   a backreference
-  a parenthesized subpattern (including most assertions)
-  a subroutine call to a subpattern (recursive or otherwise)
+  a parenthesized group (including most assertions)
+  a subroutine call (recursive or otherwise)
 .sp
 The general repetition quantifier specifies a minimum and maximum number 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:
+be less than or equal to the second. For example,
 .sp
   z{2,4}
 .sp
@@ -1976,18 +1999,18 @@ several code units long (and they may be of different lengths).
 .P
 The quantifier {0} is permitted, causing the expression to behave as if the
 previous item and the quantifier were not present. This may be useful for
-subpatterns that are referenced as
-.\" HTML <a href="#subpatternsassubroutines">
+capture groups that are referenced as
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
 subroutines
 .\"
 from elsewhere in the pattern (but see also the section entitled
 .\" HTML <a href="#subdefine">
 .\" </a>
-"Defining subpatterns for use by reference only"
+"Defining capture groups for use by reference only"
 .\"
-below). Items other than subpatterns that have a {0} quantifier are omitted
-from the compiled pattern.
+below). Except for parenthesized groups, items that have a {0} quantifier are
+omitted from the compiled pattern.
 .P
 For convenience, the three most common quantifiers have single-character
 abbreviations:
@@ -1996,22 +2019,24 @@ abbreviations:
   +    is equivalent to {1,}
   ?    is equivalent to {0,1}
 .sp
-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:
+It is possible to construct infinite loops by following a group that can match
+no characters with a quantifier that has no upper limit, for example:
 .sp
   (a?)*
 .sp
 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 broken.
-.P
-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
+patterns are now accepted, but whenever an iteration of such a group matches no
+characters, matching moves on to the next item in the pattern instead of
+repeatedly matching an empty string. This does not prevent backtracking into
+any of the iterations if a subsequent item fails to match.
+.P
+By default, 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
 .sp
   /\e*.*\e*/
 .sp
@@ -2020,10 +2045,9 @@ to the string
   /* first comment */  not comment  /* second comment */
 .sp
 fails, because it matches the entire string owing to the greediness of the .*
-item.
-.P
-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 pattern
+item. However, 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
+pattern
 .sp
   /\e*.*?\e*/
 .sp
@@ -2042,7 +2066,7 @@ 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.
 .P
-When a parenthesized subpattern is quantified with a minimum repeat count that
+When a parenthesized group 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.
 .P
@@ -2077,15 +2101,14 @@ It matches "ab" in the subject "aab". The use of the backtracking control verbs
 (*PRUNE) and (*SKIP) also disable this optimization, and there is an option,
 PCRE2_NO_DOTSTAR_ANCHOR, to do so explicitly.
 .P
-When a capturing subpattern is repeated, the value captured is the substring
-that matched the final iteration. For example, after
+When a capture group is repeated, the value captured is the substring that
+matched the final iteration. For example, after
 .sp
   (tweedle[dume]{3}\es*)+
 .sp
 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 iterations. For
-example, after
+"tweedledee". However, if there are nested capture groups, the corresponding
+captured values may have been set in previous iterations. For example, after
 .sp
   (a|(b))+
 .sp
@@ -2111,7 +2134,7 @@ 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 \ed+
 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.
+that once a group has matched, it is not to be re-evaluated in this way.
 .P
 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
@@ -2119,23 +2142,28 @@ special parenthesis, starting with (?> as in this example:
 .sp
   (?>\ed+)foo
 .sp
-This kind of parenthesis "locks up" the  part of the pattern it contains 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.
+Perl 5.28 introduced an experimental alphabetic form starting with (* which may
+be easier to remember:
+.sp
+  (*atomic:\ed+)foo
+.sp
+This kind of parenthesized group "locks up" the  part of the pattern it
+contains 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.
 .P
-An alternative description is that a subpattern of this type matches exactly
-the string of characters that an identical standalone pattern would match, if
+An alternative description is that a group 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.
 .P
-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 \ed+ and \ed+? are prepared to adjust the
-number of digits they match in order to make the rest of the pattern match,
-(?>\ed+) can only match an entire sequence of digits.
+Atomic groups are not capture groups. Simple cases such as the above example
+can be thought of as a maximizing repeat that must swallow everything it can.
+So, while both \ed+ and \ed+? are prepared to adjust the number of digits they
+match in order to make the rest of the pattern match, (?>\ed+) can only match
+an entire sequence of digits.
 .P
 Atomic groups in general can of course contain arbitrarily complicated
-subpatterns, and can be nested. However, when the subpattern for an atomic
+expressions, and can be nested. However, when the contents of 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
@@ -2157,8 +2185,8 @@ difference; possessive quantifiers should be slightly faster.
 The possessive quantifier syntax is an extension to the Perl 5.8 syntax.
 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.
+package, and PCRE1 copied it from there. It found its way into Perl at release
+5.10.
 .P
 PCRE2 has an optimization that automatically "possessifies" certain simple
 pattern constructs. For example, the sequence A+B is treated as A++B because
@@ -2166,10 +2194,9 @@ 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_AUTOPOSSESS option, or starting
 the pattern with (*NO_AUTO_POSSESS).
 .P
-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
+When a pattern contains an unlimited repeat inside a group 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
 .sp
   (\eD+|<\ed+>)*[!?]
 .sp
@@ -2198,29 +2225,28 @@ sequences of non-digits cannot be broken, and failure happens quickly.
 .rs
 .sp
 Outside a character class, a backslash followed by a digit greater than 0 (and
-possibly further digits) is a backreference to a capturing subpattern earlier
-(that is, to its left) in the pattern, provided there have been that many
-previous capturing left parentheses.
+possibly further digits) is a backreference to a capture group earlier (that
+is, to its left) in the pattern, provided there have been that many previous
+capture groups.
 .P
 However, if the decimal number following the backslash is less than 8, it is
-always taken as a backreference, and causes an error only if there are not
-that many capturing left parentheses in the entire pattern. In other words, the
-parentheses that are referenced need not be to the left of the reference for
-numbers less than 8. A "forward backreference" of this type can make sense
-when a repetition is involved and the subpattern to the right has participated
-in an earlier iteration.
-.P
-It is not possible to have a numerical "forward backreference" to a subpattern
-whose number is 8 or more using this syntax because a sequence such as \e50 is
+always taken as a backreference, and causes an error only if there are not that
+many capture groups in the entire pattern. In other words, the group that is
+referenced need not be to the left of the reference for numbers less than 8. A
+"forward backreference" of this type can make sense when a repetition is
+involved and the group to the right has participated in an earlier iteration.
+.P
+It is not possible to have a numerical "forward backreference" to a group whose
+number is 8 or more using this syntax because a sequence such as \e50 is
 interpreted as a character defined in octal. See the subsection entitled
 "Non-printing characters"
 .\" HTML <a href="#digitsafterbackslash">
 .\" </a>
 above
 .\"
-for further details of the handling of digits following a backslash. There is
-no such problem when named parentheses are used. A backreference to any
-subpattern is possible using named parentheses (see below).
+for further details of the handling of digits following a backslash. Other
+forms of backreferencing do not suffer from this restriction. In particular,
+there is no problem when named capture groups are used (see below).
 .P
 Another way of avoiding the ambiguity inherent in the use of digits following a
 backslash is to use the \eg escape sequence. This escape must be followed by a
@@ -2237,22 +2263,22 @@ the reference. A signed number is a relative reference. Consider this example:
 .sp
   (abc(def)ghi)\eg{-1}
 .sp
-The sequence \eg{-1} is a reference to the most recently started capturing
-subpattern before \eg, that is, is it equivalent to \e2 in this example.
-Similarly, \eg{-2} would be equivalent to \e1. 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.
+The sequence \eg{-1} is a reference to the most recently started capture group
+before \eg, that is, is it equivalent to \e2 in this example. Similarly,
+\eg{-2} would be equivalent to \e1. 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.
 .P
-The sequence \eg{+1} is a reference to the next capturing subpattern. This kind
-of forward reference can be useful it patterns that repeat. Perl does not
-support the use of + in this way.
+The sequence \eg{+1} is a reference to the next capture group. This kind of
+forward reference can be useful in patterns that repeat. Perl does not support
+the use of + in this way.
 .P
-A backreference matches whatever actually matched the capturing subpattern in
-the current subject string, rather than anything matching the subpattern
-itself (see
-.\" HTML <a href="#subpatternsassubroutines">
+A backreference matches whatever actually most recently matched the capture
+group in the current subject string, rather than anything at all that matches
+the group (see
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
-"Subpatterns as subroutines"
+"Groups as subroutines"
 .\"
 below for a way of doing that). So the pattern
 .sp
@@ -2265,26 +2291,26 @@ backreference, the case of letters is relevant. For example,
   ((?i)rah)\es+\e1
 .sp
 matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original
-capturing subpattern is matched caselessly.
+capture group is matched caselessly.
 .P
-There are several different ways of writing backreferences to named
-subpatterns. The .NET syntax \ek{name} and the Perl syntax \ek<name> or
-\ek'name' are supported, as is the Python syntax (?P=name). Perl 5.10's unified
+There are several different ways of writing backreferences to named capture
+groups. The .NET syntax \ek{name} and the Perl syntax \ek<name> or \ek'name'
+are supported, as is the Python syntax (?P=name). Perl 5.10's unified
 backreference syntax, in which \eg can be used for both numeric and named
-references, is also supported. We could rewrite the above example in any of
-the following ways:
+references, is also supported. We could rewrite the above example in any of the
+following ways:
 .sp
   (?<p1>(?i)rah)\es+\ek<p1>
   (?'p1'(?i)rah)\es+\ek{p1}
   (?P<p1>(?i)rah)\es+(?P=p1)
   (?<p1>(?i)rah)\es+\eg{p1}
 .sp
-A subpattern that is referenced by name may appear in the pattern before or
+A capture group that is referenced by name may appear in the pattern before or
 after the reference.
 .P
-There may be more than one backreference to the same subpattern. If a
-subpattern has not actually been used in a particular match, any backreferences
-to it always fail by default. For example, the pattern
+There may be more than one backreference to the same group. If a group has not
+actually been used in a particular match, backreferences to it always fail by
+default. For example, the pattern
 .sp
   (a|(bc))\e2
 .sp
@@ -2292,12 +2318,11 @@ 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 backreference to an
 unset value matches an empty string.
 .P
-Because there may be many capturing parentheses in a pattern, all digits
-following a backslash are taken as part of a potential backreference number.
-If the pattern continues with a digit character, some delimiter must be used to
-terminate the backreference. If the PCRE2_EXTENDED or PCRE2_EXTENDED_MORE
-option is set, this can be white space. Otherwise, the \eg{ syntax or an empty
-comment (see
+Because there may be many capture groups in a pattern, all digits following a
+backslash are taken as part of a potential backreference number. If the pattern
+continues with a digit character, some delimiter must be used to terminate the
+backreference. If the PCRE2_EXTENDED or PCRE2_EXTENDED_MORE option is set, this
+can be white space. Otherwise, the \eg{} syntax or an empty comment (see
 .\" HTML <a href="#comments">
 .\" </a>
 "Comments"
@@ -2308,19 +2333,18 @@ below) can be used.
 .SS "Recursive backreferences"
 .rs
 .sp
-A backreference that occurs inside the parentheses to which it refers fails
-when the subpattern is first used, so, for example, (a\e1) never matches.
-However, such references can be useful inside repeated subpatterns. For
-example, the pattern
+A backreference that occurs inside the group to which it refers fails when the
+group is first used, so, for example, (a\e1) never matches. However, such
+references can be useful inside repeated groups. For example, the pattern
 .sp
   (a|b\e1)+
 .sp
 matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of
-the subpattern, the backreference 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 backreference. This can be
-done using alternation, as in the example above, or by a quantifier with a
-minimum of zero.
+the group, the backreference 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 backreference. This can be done
+using alternation, as in the example above, or by a quantifier with a minimum
+of zero.
 .P
 Backreferences of this type cause the group that they reference to be treated
 as an
@@ -2344,24 +2368,42 @@ coded as \eb, \eB, \eA, \eG, \eZ, \ez, ^ and $ are described
 above.
 .\"
 .P
-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, and in each case an assertion may be positive (must
-succeed for matching to continue) or negative (must not succeed for matching to
-continue). An assertion subpattern is matched in the normal way, except that,
-when matching continues after a successful assertion, the matching position in
-the subject string is as it was before the assertion was processed.
+More complicated assertions are coded as parenthesized groups. There are two
+kinds: those that look ahead of the current position in the subject string, and
+those that look behind it, and in each case an assertion may be positive (must
+match for the assertion to be true) or negative (must not match for the
+assertion to be true). An assertion group is matched in the normal way,
+and if it is true, matching continues after it, but with the matching position
+in the subject string reset to what it was before the assertion was processed.
 .P
-Assertion subpatterns are not capturing subpatterns. If an assertion contains
-capturing subpatterns within it, these are counted for the purposes of
-numbering the capturing subpatterns in the whole pattern. Within each branch of
-an assertion, locally captured substrings may be referenced in the usual way.
-For example, a sequence such as (.)\eg{-1} can be used to check that two
-adjacent characters are the same.
+The Perl-compatible lookaround assertions are atomic. If an assertion is true,
+but there is a subsequent matching failure, there is no backtracking into the
+assertion. However, there are some cases where non-atomic assertions can be
+useful. PCRE2 has some support for these, described in the section entitled
+.\" HTML <a href="#nonatomicassertions">
+.\" </a>
+"Non-atomic assertions"
+.\"
+below, but they are not Perl-compatible.
+.P
+A lookaround assertion may appear as the condition in a
+.\" HTML <a href="#conditions">
+.\" </a>
+conditional group
+.\"
+(see below). In this case, the result of matching the assertion determines
+which branch of the condition is followed.
+.P
+Assertion groups are not capture groups. If an assertion contains capture
+groups within it, these are counted for the purposes of numbering the capture
+groups in the whole pattern. Within each branch of an assertion, locally
+captured substrings may be referenced in the usual way. For example, a sequence
+such as (.)\eg{-1} can be used to check that two adjacent characters are the
+same.
 .P
 When a branch within an assertion fails to match, any substrings that were
 captured are discarded (as happens with any pattern branch that fails to
-match). A negative assertion succeeds only when all its branches fail to match;
+match). A negative assertion is true only when all its branches fail to match;
 this means that no captured substrings are ever retained after a successful
 negative assertion. When an assertion contains a matching branch, what happens
 depends on the type of assertion.
@@ -2369,26 +2411,26 @@ depends on the type of assertion.
 For a positive assertion, internally captured substrings in the successful
 branch are retained, and matching continues with the next pattern item after
 the assertion. For a negative assertion, a matching branch means that the
-assertion has failed. If the assertion is being used as a condition in a
+assertion is not true. If such an assertion is being used as a condition in a
 .\" HTML <a href="#conditions">
 .\" </a>
-conditional subpattern
+conditional group
 .\"
 (see below), captured substrings are retained, because matching continues with
 the "no" branch of the condition. For other failing negative assertions,
 control passes to the previous backtracking point, thus discarding any captured
 strings within the assertion.
 .P
-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 conditional subpattern may not be quantified. In
-practice, for other assertions, there only three cases:
+For compatibility with Perl, most assertion groups may be repeated; though it
+makes no sense to assert the same thing several times, the side effect of
+capturing may occasionally be useful. However, an assertion that forms the
+condition for a conditional group may not be quantified. In practice, for
+other assertions, there only three cases:
 .sp
 (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
-.\" HTML <a href="#subpatternsassubroutines">
+However, it may contain internal capture groups that are called from elsewhere
+via the
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
 subroutine mechanism.
 .\"
@@ -2401,6 +2443,25 @@ without the assertion, the order depending on the greediness of the quantifier.
 The assertion is obeyed just once when encountered during matching.
 .
 .
+.SS "Alphabetic assertion names"
+.rs
+.sp
+Traditionally, symbolic sequences such as (?= and (?<= have been used to
+specify lookaround assertions. Perl 5.28 introduced some experimental
+alphabetic alternatives which might be easier to remember. They all start with
+(* instead of (? and must be written using lower case letters. PCRE2 supports
+the following synonyms:
+.sp
+  (*positive_lookahead:  or (*pla: is the same as (?=
+  (*negative_lookahead:  or (*nla: is the same as (?!
+  (*positive_lookbehind: or (*plb: is the same as (?<=
+  (*negative_lookbehind: or (*nlb: is the same as (?<!
+.sp
+For example, (*pla:foo) is the same assertion as (?=foo). In the following
+sections, the various assertions are described using the original symbolic
+forms.
+.
+.
 .SS "Lookahead assertions"
 .rs
 .sp
@@ -2482,12 +2543,12 @@ because it makes it impossible to calculate the length of the lookbehind. The
 \eX and \eR escapes, which can match different numbers of code units, are never
 permitted in lookbehinds.
 .P
-.\" HTML <a href="#subpatternsassubroutines">
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
 "Subroutine"
 .\"
 calls (see below) such as (?2) or (?&X) are permitted in lookbehinds, as long
-as the subpattern matches a fixed-length string. However,
+as the called capture group matches a fixed-length string. However,
 .\" HTML <a href="#recursion">
 .\" </a>
 recursion,
@@ -2498,10 +2559,10 @@ is not supported.
 Perl does not support backreferences in lookbehinds. PCRE2 does support them,
 but only if certain conditions are met. The PCRE2_MATCH_UNSET_BACKREF option
 must not be set, there must be no use of (?| in the pattern (it creates
-duplicate subpattern numbers), and if the backreference is by name, the name
-must be unique. Of course, the referenced subpattern must itself be of fixed
-length. The following pattern matches words containing at least two characters
-that begin and end with the same character:
+duplicate group numbers), and if the backreference is by name, the name
+must be unique. Of course, the referenced group must itself match a fixed
+length substring. The following pattern matches words containing at least two
+characters that begin and end with the same character:
 .sp
    \eb(\ew)\ew++(?<=\e1)
 .P
@@ -2566,14 +2627,138 @@ is another pattern that matches "foo" preceded by three digits and any three
 characters that are not "999".
 .
 .
+.\" HTML <a name="nonatomicassertions"></a>
+.SH "NON-ATOMIC ASSERTIONS"
+.rs
+.sp
+The traditional Perl-compatible lookaround assertions are atomic. That is, if
+an assertion is true, but there is a subsequent matching failure, there is no
+backtracking into the assertion. However, there are some cases where non-atomic
+positive assertions can be useful. PCRE2 provides these using the following
+syntax:
+.sp
+  (*non_atomic_positive_lookahead:  or (*napla:
+  (*non_atomic_positive_lookbehind: or (*naplb:
+.sp
+Consider the problem of finding the right-most word in a string that also
+appears earlier in the string, that is, it must appear at least twice in total.
+This pattern returns the required result as captured substring 1:
+.sp
+  ^(?x)(*napla: .* \eb(\ew++)) (?> .*? \eb\e1\eb ){2}
+.sp
+For a subject such as "word1 word2 word3 word2 word3 word4" the result is
+"word3". How does it work? At the start, ^(?x) anchors the pattern and sets the
+"x" option, which causes white space (introduced for readability) to be
+ignored. Inside the assertion, the greedy .* at first consumes the entire
+string, but then has to backtrack until the rest of the assertion can match a
+word, which is captured by group 1. In other words, when the assertion first
+succeeds, it captures the right-most word in the string.
+.P
+The current matching point is then reset to the start of the subject, and the
+rest of the pattern match checks for two occurrences of the captured word,
+using an ungreedy .*? to scan from the left. If this succeeds, we are done, but
+if the last word in the string does not occur twice, this part of the pattern
+fails. If a traditional atomic lookhead (?= or (*pla: had been used, the
+assertion could not be re-entered, and the whole match would fail. The pattern
+would succeed only if the very last word in the subject was found twice.
+.P
+Using a non-atomic lookahead, however, means that when the last word does not
+occur twice in the string, the lookahead can backtrack and find the second-last
+word, and so on, until either the match succeeds, or all words have been
+tested.
+.P
+Two conditions must be met for a non-atomic assertion to be useful: the
+contents of one or more capturing groups must change after a backtrack into the
+assertion, and there must be a backreference to a changed group later in the
+pattern. If this is not the case, the rest of the pattern match fails exactly
+as before because nothing has changed, so using a non-atomic assertion just
+wastes resources.
+.P
+Non-atomic assertions are not supported by the alternative matching function
+\fBpcre2_dfa_match()\fP. They are also not supported by JIT (but may be in
+future). Note that assertions that appear as conditions for
+.\" HTML <a href="#conditions">
+.\" </a>
+conditional groups
+.\"
+(see below) must be atomic.
+.
+.
+.SH "SCRIPT RUNS"
+.rs
+.sp
+In concept, a script run is a sequence of characters that are all from the same
+Unicode script such as Latin or Greek. However, because some scripts are
+commonly used together, and because some diacritical and other marks are used
+with multiple scripts, it is not that simple. There is a full description of
+the rules that PCRE2 uses in the section entitled
+.\" HTML <a href="pcre2unicode.html#scriptruns">
+.\" </a>
+"Script Runs"
+.\"
+in the
+.\" HREF
+\fBpcre2unicode\fP
+.\"
+documentation.
+.P
+If part of a pattern is enclosed between (*script_run: or (*sr: and a closing
+parenthesis, it fails if the sequence of characters that it matches are not a
+script run. After a failure, normal backtracking occurs. Script runs can be
+used to detect spoofing attacks using characters that look the same, but are
+from different scripts. The string "paypal.com" is an infamous example, where
+the letters could be a mixture of Latin and Cyrillic. This pattern ensures that
+the matched characters in a sequence of non-spaces that follow white space are
+a script run:
+.sp
+  \es+(*sr:\eS+)
+.sp
+To be sure that they are all from the Latin script (for example), a lookahead
+can be used:
+.sp
+  \es+(?=\ep{Latin})(*sr:\eS+)
+.sp
+This works as long as the first character is expected to be a character in that
+script, and not (for example) punctuation, which is allowed with any script. If
+this is not the case, a more creative lookahead is needed. For example, if
+digits, underscore, and dots are permitted at the start:
+.sp
+  \es+(?=[0-9_.]*\ep{Latin})(*sr:\eS+)
+.sp
+.P
+In many cases, backtracking into a script run pattern fragment is not
+desirable. The script run can employ an atomic group to prevent this. Because
+this is a common requirement, a shorthand notation is provided by
+(*atomic_script_run: or (*asr:
+.sp
+  (*asr:...) is the same as (*sr:(?>...))
+.sp
+Note that the atomic group is inside the script run. Putting it outside would
+not prevent backtracking into the script run pattern.
+.P
+Support for script runs is not available if PCRE2 is compiled without Unicode
+support. A compile-time error is given if any of the above constructs is
+encountered. Script runs are not supported by the alternate matching function,
+\fBpcre2_dfa_match()\fP because they use the same mechanism as capturing
+parentheses.
+.P
+\fBWarning:\fP The (*ACCEPT) control verb
+.\" HTML <a href="#acceptverb">
+.\" </a>
+(see below)
+.\"
+should not be used within a script run group, because it causes an immediate
+exit from the group, bypassing the script run checking.
+.
+.
 .\" HTML <a name="conditions"></a>
-.SH "CONDITIONAL SUBPATTERNS"
+.SH "CONDITIONAL GROUPS"
 .rs
 .sp
-It is possible to cause the matching process to obey a subpattern
-conditionally or to choose between two alternative subpatterns, depending on
-the result of an assertion, or whether a specific capturing subpattern has
-already been matched. The two possible forms of conditional subpattern are:
+It is possible to cause the matching process to obey a pattern fragment
+conditionally or to choose between two alternative fragments, depending on
+the result of an assertion, or whether a specific capture group has
+already been matched. The two possible forms of conditional group are:
 .sp
   (?(condition)yes-pattern)
   (?(condition)yes-pattern|no-pattern)
@@ -2581,38 +2766,36 @@ already been matched. The two possible forms of conditional subpattern are:
 If the condition is satisfied, the yes-pattern is used; otherwise the
 no-pattern (if present) is used. An absent no-pattern is equivalent to an empty
 string (it always matches). If there are more than two alternatives in the
-subpattern, a compile-time error occurs. Each of the two alternatives may
-itself contain nested subpatterns of any form, including 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:
+group, a compile-time error occurs. Each of the two alternatives may itself
+contain nested groups of any form, including conditional groups; the
+restriction to two alternatives applies only at the level of the condition
+itself. This pattern fragment is an example where the alternatives are complex:
 .sp
   (?(1) (A|B|C) | (D | (?(2)E|F) | E) )
 .sp
 .P
-There are five kinds of condition: references to subpatterns, references to
+There are five kinds of condition: references to capture groups, references to
 recursion, two pseudo-conditions called DEFINE and VERSION, and assertions.
 .
 .
-.SS "Checking for a used subpattern by number"
+.SS "Checking for a used capture group by number"
 .rs
 .sp
 If the text between the parentheses consists of a sequence of digits, the
-condition is true if a capturing subpattern of that number has previously
-matched. If there is more than one capturing subpattern with the same number
-(see the earlier
+condition is true if a capture group of that number has previously matched. If
+there is more than one capture group with the same number (see the earlier
 .\"
 .\" HTML <a href="#recursion">
 .\" </a>
-section about duplicate subpattern numbers),
+section about duplicate group numbers),
 .\"
 the condition is true if any of them have matched. An alternative 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.)
+to precede the digits with a plus or minus sign. In this case, the group number
+is relative rather than absolute. The most recently opened capture group 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 capture group
+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.)
 .P
 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
@@ -2623,12 +2806,12 @@ three parts for ease of discussion:
 The first part matches an optional opening parenthesis, and if that
 character is present, sets it as the first captured substring. The second 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,
+conditional group that tests whether or not the first capture group
+matched. If it 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. Otherwise, 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.
+conditional group matches nothing. In other words, this pattern matches a
+sequence of non-parentheses, optionally enclosed in parentheses.
 .P
 If you were embedding this pattern in a larger one, you could use a relative
 reference:
@@ -2638,21 +2821,20 @@ reference:
 This makes the fragment independent of the parentheses in the larger pattern.
 .
 .
-.SS "Checking for a used subpattern by name"
+.SS "Checking for a used capture group by name"
 .rs
 .sp
 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. Note,
-however, that undelimited names consisting of the letter R followed by digits
-are ambiguous (see the following section).
-.P
-Rewriting the above example to use a named subpattern gives this:
+capture group by name. For compatibility with earlier versions of PCRE1, which
+had this facility before Perl, the syntax (?(name)...) is also recognized.
+Note, however, that undelimited names consisting of the letter R followed by
+digits are ambiguous (see the following section). Rewriting the above example
+to use a named group gives this:
 .sp
   (?<OPEN> \e( )?    [^()]+    (?(<OPEN>) \e) )
 .sp
 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
+applied to all groups of the same name, and is true if any one of them has
 matched.
 .
 .
@@ -2667,22 +2849,22 @@ sections entitled
 "Recursive patterns"
 .\"
 and
-.\" HTML <a href="#subpatternsassubroutines">
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
-"Subpatterns as subroutines"
+"Groups as subroutines"
 .\"
-below for details of recursion and subpattern calls.
+below for details of recursion and subroutine calls.
 .P
-If a condition is the string (R), and there is no subpattern with the name R,
-the condition is true if matching is currently in a recursion or subroutine
-call to the whole pattern or any subpattern. If digits follow the letter R, and
-there is no subpattern with that name, the condition is true if the most recent
-call is into a subpattern with the given number, which must exist somewhere in
-the overall pattern. This is a contrived example that is equivalent to a+b:
+If a condition is the string (R), and there is no capture group with the name
+R, the condition is true if matching is currently in a recursion or subroutine
+call to the whole pattern or any capture group. If digits follow the letter R,
+and there is no group with that name, the condition is true if the most recent
+call is into a group with the given number, which must exist somewhere in the
+overall pattern. This is a contrived example that is equivalent to a+b:
 .sp
   ((?(R1)a+|(?1)b))
 .sp
-However, in both cases, if there is a subpattern with a matching name, the
+However, in both cases, if there is a capture group with a matching name, the
 condition tests for its being set, as described in the section above, instead
 of testing for recursion. For example, creating a group with the name R1 by
 adding (?<R1>) to the above pattern completely changes its meaning.
@@ -2691,27 +2873,27 @@ If a name preceded by ampersand follows the letter R, for example:
 .sp
   (?(R&name)...)
 .sp
-the condition is true if the most recent recursion is into a subpattern of that
-name (which must exist within the pattern).
+the condition is true if the most recent recursion is into a group of that name
+(which must exist within the pattern).
 .P
 This condition does not check the entire recursion stack. It tests only the
 current level. 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
+test is applied to all groups of the same name, and is true if any one of
 them is the most recent recursion.
 .P
 At "top level", all these recursion test conditions are false.
 .
 .
 .\" HTML <a name="subdefine"></a>
-.SS "Defining subpatterns for use by reference only"
+.SS "Defining capture groups for use by reference only"
 .rs
 .sp
 If the condition is the string (DEFINE), the condition is always false, even if
 there is a group with the name DEFINE. 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 referenced from elsewhere. (The use of
-.\" HTML <a href="#subpatternsassubroutines">
+alternative in the rest of the conditional group. 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 referenced from elsewhere. (The use of
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
 subroutines
 .\"
@@ -2751,10 +2933,17 @@ than two digits.
 .SS "Assertion conditions"
 .rs
 .sp
-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:
+If the condition is not in any of the above formats, it must be a parenthesized
+assertion. This may be a positive or negative lookahead or lookbehind
+assertion. However, it must be a traditional atomic assertion, not one of the
+PCRE2-specific
+.\" HTML <a href="#nonatomicassertions">
+.\" </a>
+non-atomic assertions.
+.\"
+.P
+Consider this pattern, again containing non-significant white space, and with
+the two alternatives on the second line:
 .sp
   (?(?=[^a-z]*[a-z])
   \ed{2}-[a-z]{3}-\ed{2}  |  \ed{2}-\ed{2}-\ed{2} )
@@ -2766,11 +2955,11 @@ 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.
 .P
-When an assertion that is a condition contains capturing subpatterns, any
+When an assertion that is a condition contains capture groups, any
 capturing that occurs in a matching branch is retained afterwards, for both
 positive and negative assertions, because matching always continues after the
 assertion, whether it succeeds or fails. (Compare non-conditional assertions,
-when captures are retained only for positive assertions that succeed.)
+for which captures are retained only for positive assertions that succeed.)
 .
 .
 .\" HTML <a name="comments"></a>
@@ -2780,7 +2969,7 @@ when captures are retained only for positive assertions that succeed.)
 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
+(?: or a group name or number. The characters that make up a comment play
 no part in the pattern matching.
 .P
 The sequence (?# marks the start of a comment that continues up to the next
@@ -2830,13 +3019,13 @@ recursively to the pattern in which it appears.
 .P
 Obviously, PCRE2 cannot support the interpolation of Perl code. Instead, it
 supports special syntax for recursion of the entire pattern, and also for
-individual subpattern recursion. After its introduction in PCRE1 and Python,
+individual capture group recursion. After its introduction in PCRE1 and Python,
 this kind of recursion was subsequently introduced into Perl at release 5.10.
 .P
 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
-.\" HTML <a href="#subpatternsassubroutines">
+closing parenthesis is a recursive subroutine call of the capture group of the
+given number, provided that it occurs inside that group. (If not, it is a
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
 non-recursive subroutine
 .\"
@@ -2869,26 +3058,26 @@ 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">
+.\" HTML <a href="#dupgroupnumber">
 .\" </a>
-duplicate subpattern numbers
+duplicate capture group numbers
 .\"
-are in use, relative references refer to the earliest subpattern with the
+are in use, relative references refer to the earliest group 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)
+The first two capture 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
+It is also possible to refer to subsequent capture groups, 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
-.\" HTML <a href="#subpatternsassubroutines">
+.\" HTML <a href="#groupsassubroutines">
 .\" </a>
 non-recursive subroutine
 .\"
@@ -2900,7 +3089,7 @@ rewrite the above example as follows:
 .sp
   (?<pn> \e( ( [^()]++ | (?&pn) )* \e) )
 .sp
-If there is more than one subpattern with the same name, the earliest one is
+If there is more than one group with the same name, the earliest one is
 used.
 .P
 The example pattern that we have been looking at contains nested unlimited
@@ -2926,9 +3115,9 @@ documentation). If the pattern above is matched against
   (ab(cd)ef)
 .sp
 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 subpattern 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.
+the last value taken on at the top level. If a capture group 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.
 .P
 Do not confuse the (?R) item with the condition (R), which tests for recursion.
 Consider this pattern, which matches text in angle brackets, allowing for
@@ -2937,9 +3126,9 @@ recursing), whereas any characters are permitted at the outer level.
 .sp
   < (?: (?(R) \ed++  | [^<>]*+) | (?R)) * >
 .sp
-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.
+In this pattern, (?(R) is the start of a conditional group, with two different
+alternatives for the recursive and non-recursive cases. The (?R) item is the
+actual recursive call.
 .
 .
 .\" HTML <a name="recursiondifference"></a>
@@ -2949,7 +3138,7 @@ is the actual recursive call.
 Some former differences between PCRE2 and Perl no longer exist.
 .P
 Before release 10.30, recursion processing in PCRE2 differed from Perl in that
-a recursive subpattern call was always treated as an atomic group. That is,
+a recursive subroutine call was always treated as an atomic group. That is,
 once it had matched some of the subject string, it was never re-entered, even
 if it contained untried alternatives and there was a subsequent matching
 failure. (Historical note: PCRE implemented recursion before Perl did.)
@@ -2982,7 +3171,7 @@ Perl takes so long that you think it has gone into a loop.
 .P
 Another way in which PCRE2 and Perl used to differ in their recursion
 processing is in the handling of captured values. Formerly in Perl, when a
-subpattern was called recursively or as a subpattern (see the next section), it
+group was called recursively or as a subroutine (see the next section), it
 had no access to any values that were captured outside the recursion, whereas
 in PCRE2 these values can be referenced. Consider this pattern:
 .sp
@@ -2995,17 +3184,16 @@ alternative matches "a" and then recurses. In the recursion, \e1 does now match
 later versions (I tried 5.024) it now works.
 .
 .
-.\" HTML <a name="subpatternsassubroutines"></a>
-.SH "SUBPATTERNS AS SUBROUTINES"
+.\" HTML <a name="groupsassubroutines"></a>
+.SH "GROUPS AS SUBROUTINES"
 .rs
 .sp
-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 a bit
-like a subroutine in a programming language. More accurately, PCRE2 treats the
-referenced subpattern as an independent subpattern which it tries to match at
-the current matching position. The called subpattern may be defined before or
-after the reference. A numbered reference can be absolute or relative, as in
-these examples:
+If the syntax for a recursive group call (either by number or by name) is used
+outside the parentheses to which it refers, it operates a bit like a subroutine
+in a programming language. More accurately, PCRE2 treats the referenced group
+as an independent subpattern which it tries to match at the current matching
+position. The called group may be defined before or after the reference. A
+numbered reference can be absolute or relative, as in these examples:
 .sp
   (...(absolute)...)...(?2)...
   (...(relative)...)...(?-1)...
@@ -3028,21 +3216,21 @@ changed at PCRE2 release 10.30, so backtracking into subroutine calls can now
 occur. However, any capturing parentheses that are set during the subroutine
 call revert to their previous values afterwards.
 .P
-Processing options such as case-independence are fixed when a subpattern is
+Processing options such as case-independence are fixed when a group is
 defined, so if it is used as a subroutine, such options cannot be changed for
 different calls. For example, consider this pattern:
 .sp
   (abc)(?i:(?-1))
 .sp
 It matches "abcabc". It does not match "abcABC" because the change of
-processing option does not affect the called subpattern.
+processing option does not affect the called group.
 .P
 The behaviour of
 .\" HTML <a href="#backtrackcontrol">
 .\" </a>
 backtracking control verbs
 .\"
-in subpatterns when called as subroutines is described in the section entitled
+in groups when called as subroutines is described in the section entitled
 .\" HTML <a href="#btsub">
 .\" </a>
 "Backtracking verbs in subroutines"
@@ -3056,8 +3244,8 @@ below.
 .sp
 For compatibility with Oniguruma, the non-Perl syntax \eg 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, rewritten using this syntax:
+syntax for calling a group as a subroutine, possibly recursively. Here are two
+of the examples used above, rewritten using this syntax:
 .sp
   (?<pn> \e( ( (?>[^()]+) | \eg<pn> )* \e) )
   (sens|respons)e and \eg'1'ibility
@@ -3154,7 +3342,8 @@ The doubling is removed before the string is passed to the callout function.
 There are a number of special "Backtracking Control Verbs" (to use Perl's
 terminology) that modify the behaviour of backtracking during matching. 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.
+and may behave differently depending on whether or not a name argument is
+present. The names are not required to be unique within the pattern.
 .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
@@ -3178,7 +3367,8 @@ PCRE2_ALT_VERBNAMES is also set.
 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.
+not there. Any number of these verbs may occur in a pattern. Except for
+(*ACCEPT), they may not be quantified.
 .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
@@ -3198,7 +3388,7 @@ assertions,
 and in
 .\" HTML <a href="#btsub">
 .\" </a>
-subpatterns called as subroutines
+capture groups called as subroutines
 .\"
 (whether or not recursively) is documented below.
 .
@@ -3230,6 +3420,7 @@ Experiments with Perl suggest that it too has similar optimizations, and like
 PCRE2, turning them off can change the result of a match.
 .
 .
+.\" HTML <a name="acceptverb"></a>
 .SS "Verbs that act immediately"
 .rs
 .sp
@@ -3238,8 +3429,8 @@ The following verbs act as soon as they are encountered.
    (*ACCEPT) or (*ACCEPT:NAME)
 .sp
 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
+pattern. However, when it is inside a capture group that is called as a
+subroutine, only that group is ended successfully. Matching then continues
 at the outer level. If (*ACCEPT) in triggered in a positive assertion, the
 assertion succeeds; in a negative assertion, the assertion fails.
 .P
@@ -3250,6 +3441,21 @@ example:
 .sp
 This matches "AB", "AAD", or "ACD"; when it matches "AB", "B" is captured by
 the outer parentheses.
+.P
+(*ACCEPT) is the only backtracking verb that is allowed to be quantified
+because an ungreedy quantification with a minimum of zero acts only when a
+backtrack happens. Consider, for example,
+.sp
+  (A(*ACCEPT)??B)C
+.sp
+where A, B, and C may be complex expressions. After matching "A", the matcher
+processes "BC"; if that fails, causing a backtrack, (*ACCEPT) is triggered and
+the match succeeds. In both cases, all but C is captured. Whereas (*COMMIT)
+(see below) means "fail on backtrack", a repeated (*ACCEPT) of this type means
+"succeed on backtrack".
+.P
+\fBWarning:\fP (*ACCEPT) should not be used within a script run group, because
+it causes an immediate exit from the group, bypassing the script run checking.
 .sp
   (*FAIL) or (*FAIL:NAME)
 .sp
@@ -3264,8 +3470,9 @@ nearest equivalent is the callout feature, as for example in this pattern:
 A match with the string "aaaa" always fails, but the callout is taken before
 each backtrack happens (in this example, 10 times).
 .P
-(*ACCEPT:NAME) and (*FAIL:NAME) behave exactly the same as
-(*MARK:NAME)(*ACCEPT) and (*MARK:NAME)(*FAIL), respectively.
+(*ACCEPT:NAME) and (*FAIL:NAME) behave the same as (*MARK:NAME)(*ACCEPT) and
+(*MARK:NAME)(*FAIL), respectively, that is, a (*MARK) is recorded just before
+the verb acts.
 .
 .
 .SS "Recording which path was taken"
@@ -3277,10 +3484,10 @@ starting point (see (*SKIP) below).
 .sp
   (*MARK:NAME) or (*:NAME)
 .sp
-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.
+A name is always required with this verb. For all the other backtracking
+control verbs, a NAME argument is optional.
 .P
-When a match succeeds, the name of the last-encountered (*MARK:NAME) on the
+When a match succeeds, the name of the last-encountered mark name on the
 matching path is passed back to the caller as described in the section entitled
 .\" HTML <a href="pcre2api.html#matchotherdata">
 .\" </a>
@@ -3290,16 +3497,15 @@ in the
 .\" HREF
 \fBpcre2api\fP
 .\"
-documentation. This applies to all instances of (*MARK), including those inside
-assertions and atomic groups. (There are differences in those cases when
-(*MARK) is used in conjunction with (*SKIP) as described below.)
-.P
-As well as (*MARK), the (*COMMIT), (*PRUNE) and (*THEN) verbs may have
-associated NAME arguments. Whichever is last on the matching path is passed
-back. See below for more details of these other verbs.
+documentation. This applies to all instances of (*MARK) and other verbs,
+including those inside assertions and atomic groups. However, there are
+differences in those cases when (*MARK) is used in conjunction with (*SKIP) as
+described below.
 .P
-Here is an example of \fBpcre2test\fP output, where the "mark" modifier
-requests the retrieval and outputting of (*MARK) data:
+The mark name that was last encountered on the matching path is passed back. A
+verb without a NAME argument is ignored for this purpose. Here is an example of
+\fBpcre2test\fP output, where the "mark" modifier requests the retrieval and
+outputting of (*MARK) data:
 .sp
     re> /X(*MARK:A)Y|X(*MARK:B)Z/mark
   data> XY
@@ -3349,7 +3555,7 @@ to the left of the verb. However, when one of these verbs appears inside an
 atomic group or in a lookaround assertion that is true, its effect is confined
 to that group, because once the group has been matched, there is never any
 backtracking into it. Backtracking from beyond an assertion or an atomic group
-ignores the entire group, and seeks a preceeding backtracking point.
+ignores the entire group, and seeks a preceding backtracking point.
 .P
 These verbs differ in exactly what kind of failure occurs when backtracking
 reaches them. The behaviour described below is what happens when the verb is
@@ -3372,8 +3578,8 @@ dynamic anchor, or "I've started, so I must finish."
 .P
 The behaviour of (*COMMIT:NAME) is not the same as (*MARK:NAME)(*COMMIT). 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 (*COMMIT), (*PRUNE) and (*THEN).
+caller. However, (*SKIP:NAME) searches only for names that are set with
+(*MARK), ignoring those set by any of the other backtracking verbs.
 .P
 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
@@ -3414,7 +3620,7 @@ as (*COMMIT).
 The behaviour of (*PRUNE:NAME) is 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 (*COMMIT), (*PRUNE) or (*THEN).
+ignoring those set by other backtracking verbs.
 .sp
   (*SKIP)
 .sp
@@ -3432,6 +3638,11 @@ next attempt at "c". Note that a possessive quantifer 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".
+.P
+If (*SKIP) is used to specify a new starting position that is the same as the
+starting position of the current match, or (by being inside a lookbehind)
+earlier, the position specified by (*SKIP) is ignored, and instead the normal
+"bumpalong" occurs.
 .sp
   (*SKIP:NAME)
 .sp
@@ -3467,7 +3678,7 @@ never seen because "a" does not match "b", so the matcher immediately jumps to
 the second branch of the pattern.
 .P
 Note that (*SKIP:NAME) searches only for names set by (*MARK:NAME). It ignores
-names that are set by (*COMMIT:NAME), (*PRUNE:NAME) or (*THEN:NAME).
+names that are set by other backtracking verbs.
 .sp
   (*THEN) or (*THEN:NAME)
 .sp
@@ -3488,32 +3699,30 @@ group. If (*THEN) is not inside an alternation, it acts like (*PRUNE).
 The behaviour of (*THEN:NAME) is 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 (*COMMIT), (*PRUNE) and (*THEN).
+ignoring those set by other backtracking verbs.
 .P
-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 group 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 group to the enclosing alternative.
+Consider this pattern, where A, B, etc. are complex pattern fragments that do
+not contain any | characters at this level:
 .sp
   A (B(*THEN)C) | D
 .sp
 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
+However, if the group containing (*THEN) is given an alternative, it
 behaves differently:
 .sp
   A (B(*THEN)C | (*FAIL)) | D
 .sp
-The effect of (*THEN) is now confined to the inner subpattern. After a failure
-in C, matching moves to (*FAIL), which causes the whole subpattern to fail
-because there are no more alternatives to try. In this case, matching does now
-backtrack into A.
+The effect of (*THEN) is now confined to the inner group. After a failure in C,
+matching moves to (*FAIL), which causes the whole group to fail because there
+are no more alternatives to try. In this case, matching does backtrack into A.
 .P
-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:
+Note that a conditional group is not considered as having two alternatives,
+because only one is ever used. In other words, the | character in a conditional
+group has a different meaning. Ignoring white space, consider:
 .sp
   ^.*? (?(?=a) a | b(*THEN)c )
 .sp
@@ -3521,7 +3730,7 @@ 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
+character. The conditional group 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.)
 .P
@@ -3578,24 +3787,35 @@ acts.
 (*FAIL) in any assertion has its normal effect: it forces an immediate
 backtrack. The behaviour of the other backtracking verbs depends on whether or
 not the assertion is standalone or acting as the condition in a conditional
-subpattern.
+group.
 .P
 (*ACCEPT) in a standalone positive assertion causes the assertion to succeed
-without any further processing; captured strings and a (*MARK) name (if set)
-are retained. In a standalone negative assertion, (*ACCEPT) causes the
-assertion to fail without any further processing; captured substrings and any
-(*MARK) name are discarded.
+without any further processing; captured strings and a mark name (if set) are
+retained. In a standalone negative assertion, (*ACCEPT) causes the assertion to
+fail without any further processing; captured substrings and any mark name are
+discarded.
 .P
 If the assertion is a condition, (*ACCEPT) causes the condition to be true for
 a positive assertion and false for a negative one; captured substrings are
 retained in both cases.
 .P
 The remaining verbs act only when a later failure causes a backtrack to
-reach them. This means that their effect is confined to the assertion,
-because lookaround assertions are atomic. A backtrack that occurs after an
-assertion is complete does not jump back into the assertion. Note in particular
-that a (*MARK) name that is set in an assertion is not "seen" by an instance of
-(*SKIP:NAME) latter in the pattern.
+reach them. This means that, for the Perl-compatible assertions, their effect
+is confined to the assertion, because Perl lookaround assertions are atomic. A
+backtrack that occurs after such an assertion is complete does not jump back
+into the assertion. Note in particular that a (*MARK) name that is set in an
+assertion is not "seen" by an instance of (*SKIP:NAME) later in the pattern.
+.P
+PCRE2 now supports non-atomic positive assertions, as described in the section
+entitled
+.\" HTML <a href="#nonatomicassertions">
+.\" </a>
+"Non-atomic assertions"
+.\"
+above. These assertions must be standalone (not used as conditions). They are
+not Perl-compatible. For these assertions, a later backtrack does jump back
+into the assertion, and therefore verbs such as (*COMMIT) can be triggered by
+backtracks from later in the pattern.
 .P
 The effect of (*THEN) is not allowed to escape beyond an assertion. If there
 are no more branches to try, (*THEN) causes a positive assertion to be false,
@@ -3613,25 +3833,24 @@ the assertion to be true, without considering any further alternative branches.
 .SS "Backtracking verbs in subroutines"
 .rs
 .sp
-These behaviours occur whether or not the subpattern is called recursively.
+These behaviours occur whether or not the group is called recursively.
 .P
-(*ACCEPT) in a subpattern called as a subroutine causes the subroutine match to
+(*ACCEPT) in a group called as a subroutine causes the subroutine match to
 succeed without any further processing. Matching then continues after the
 subroutine call. Perl documents this behaviour. Perl's treatment of the other
 verbs in subroutines is different in some cases.
 .P
-(*FAIL) in a subpattern called as a subroutine has its normal effect: it forces
+(*FAIL) in a group called as a subroutine has its normal effect: it forces
 an immediate backtrack.
 .P
 (*COMMIT), (*SKIP), and (*PRUNE) cause the subroutine match to fail when
-triggered by being backtracked to in a subpattern called as a subroutine. There
-is then a backtrack at the outer level.
+triggered by being backtracked to in a group called as a subroutine. There is
+then a backtrack at the outer level.
 .P
 (*THEN), when triggered, skips to the next alternative in the innermost
-enclosing group within the subpattern that has alternatives (its normal
-behaviour). However, if there is no such group within the subroutine
-subpattern, the subroutine match fails and there is a backtrack at the outer
-level.
+enclosing group that has alternatives (its normal behaviour). However, if there
+is no such group within the subroutine's group, the subroutine match fails and
+there is a backtrack at the outer level.
 .
 .
 .SH "SEE ALSO"
@@ -3655,6 +3874,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 04 September 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 29 July 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 91ca22a928b63a8aa3759a69559199cf7c53223b..040369a75ece72e71daff98ca09b6815a928bf51 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2PERFORM 3 "25 April 2018" "PCRE2 10.32"
+.TH PCRE2PERFORM 3 "03 February 2019" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 PERFORMANCE"
@@ -14,9 +14,9 @@ of them.
 Patterns are compiled by PCRE2 into a reasonably efficient interpretive code,
 so that most simple patterns do not use much memory for storing the compiled
 version. 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
+pattern can be unexpectedly large. If a parenthesized group has a quantifier
+with a minimum greater than 1 and/or a limited maximum, the whole group is
+repeated in the compiled code. For example, the pattern
 .sp
   (abc|def){2,4}
 .sp
@@ -239,6 +239,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 25 April 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 03 February 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 0d8b2c2409a09d1d53860460842ed845cee90d75..35e68e2d98e913c193a41f8a029c5b7f9b165efe 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2POSIX 3 "15 June 2017" "PCRE2 10.30"
+.TH PCRE2POSIX 3 "30 January 2019" "PCRE2 10.33"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "SYNOPSIS"
@@ -7,37 +7,60 @@ PCRE2 - Perl-compatible regular expressions (revised API)
 .B #include <pcre2posix.h>
 .PP
 .nf
-.B int regcomp(regex_t *\fIpreg\fP, const char *\fIpattern\fP,
+.B int pcre2_regcomp(regex_t *\fIpreg\fP, const char *\fIpattern\fP,
 .B "     int \fIcflags\fP);"
 .sp
-.B int regexec(const regex_t *\fIpreg\fP, const char *\fIstring\fP,
+.B int pcre2_regexec(const regex_t *\fIpreg\fP, const char *\fIstring\fP,
 .B "     size_t \fInmatch\fP, regmatch_t \fIpmatch\fP[], int \fIeflags\fP);"
 .sp
-.B "size_t regerror(int \fIerrcode\fP, const regex_t *\fIpreg\fP,"
+.B "size_t pcre2_regerror(int \fIerrcode\fP, const regex_t *\fIpreg\fP,"
 .B "     char *\fIerrbuf\fP, size_t \fIerrbuf_size\fP);"
 .sp
-.B void regfree(regex_t *\fIpreg\fP);
+.B void pcre2_regfree(regex_t *\fIpreg\fP);
 .fi
 .
 .SH DESCRIPTION
 .rs
 .sp
 This set of functions provides a POSIX-style API for the PCRE2 regular
-expression 8-bit library. See the
+expression 8-bit library. There are no POSIX-style wrappers for PCRE2's 16-bit
+and 32-bit libraries. See the
 .\" HREF
 \fBpcre2api\fP
 .\"
 documentation for a description of PCRE2's native API, which contains much
-additional functionality. There are no POSIX-style wrappers for PCRE2's 16-bit
-and 32-bit libraries.
+additional functionality.
 .P
-The functions described here are just wrapper functions that ultimately call
-the PCRE2 native API. Their prototypes are defined in the \fBpcre2posix.h\fP
-header file, and on Unix systems the library itself is called
-\fBlibpcre2-posix.a\fP, so can be accessed by adding \fB-lpcre2-posix\fP to the
-command for linking an application that uses them. Because the POSIX functions
-call the native ones, it is also necessary to add \fB-lpcre2-8\fP.
+The functions described here are wrapper functions that ultimately call the
+PCRE2 native API. Their prototypes are defined in the \fBpcre2posix.h\fP header
+file, and they all have unique names starting with \fBpcre2_\fP. However, the
+\fBpcre2posix.h\fP header also contains macro definitions that convert the
+standard POSIX names such \fBregcomp()\fP into \fBpcre2_regcomp()\fP etc. This
+means that a program can use the usual POSIX names without running the risk of
+accidentally linking with POSIX functions from a different library.
 .P
+On Unix-like systems the PCRE2 POSIX library is called \fBlibpcre2-posix\fP, so
+can be accessed by adding \fB-lpcre2-posix\fP to the command for linking an
+application. Because the POSIX functions call the native ones, it is also
+necessary to add \fB-lpcre2-8\fP.
+.P
+Although they are not defined as protypes in \fBpcre2posix.h\fP, the library
+does contain functions with the POSIX names \fBregcomp()\fP etc. These simply
+pass their arguments to the PCRE2 functions. These functions are provided for
+backwards compatibility with earlier versions of PCRE2, so that existing
+programs do not have to be recompiled.
+.P
+Calling the header file \fBpcre2posix.h\fP avoids any conflict with other POSIX
+libraries. It can, of course, be renamed or aliased as \fBregex.h\fP, which is
+the "correct" name, if there is no clash. It provides two structure types,
+\fIregex_t\fP for compiled internal forms, and \fIregmatch_t\fP for returning
+captured substrings. It also defines some constants whose names start with
+"REG_"; these are used for setting options and identifying error codes.
+.
+.
+.SH "USING THE POSIX FUNCTIONS"
+.rs
+.sp
 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
@@ -55,19 +78,15 @@ 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.
 .P
-The header for these functions is supplied as \fBpcre2posix.h\fP to avoid any
-potential clash with other POSIX libraries. It can, of course, be renamed or
-aliased as \fBregex.h\fP, which is the "correct" name. It provides two
-structure types, \fIregex_t\fP for compiled internal forms, and
-\fIregmatch_t\fP for returning captured substrings. It also defines some
-constants whose names start with "REG_"; these are used for setting options and
-identifying error codes.
+The descriptions below use the actual names of the functions, but, as described
+above, the standard POSIX names (without the \fBpcre2_\fP prefix) may also be
+used.
 .
 .
 .SH "COMPILING A PATTERN"
 .rs
 .sp
-The function \fBregcomp()\fP is called to compile a pattern into an
+The function \fBpcre2_regcomp()\fP is called to compile a pattern into an
 internal form. By default, the pattern is a C string terminated by a binary
 zero (but see REG_PEND below). The \fIpreg\fP argument is a pointer to a
 \fBregex_t\fP structure that is used as a base for storing information about
@@ -104,18 +123,18 @@ REG_UTF. Note that REG_NOSPEC is not part of the POSIX standard.
 .sp
   REG_NOSUB
 .sp
-When a pattern that is compiled with this flag is passed to \fBregexec()\fP for
-matching, the \fInmatch\fP and \fIpmatch\fP arguments are ignored, and no
-captured strings are returned. Versions of the PCRE library prior to 10.22 used
-to set the PCRE2_NO_AUTO_CAPTURE compile option, but this no longer happens
-because it disables the use of backreferences.
+When a pattern that is compiled with this flag is passed to
+\fBpcre2_regexec()\fP for matching, the \fInmatch\fP and \fIpmatch\fP arguments
+are ignored, and no captured strings are returned. Versions of the PCRE library
+prior to 10.22 used to set the PCRE2_NO_AUTO_CAPTURE compile option, but this
+no longer happens because it disables the use of backreferences.
 .sp
   REG_PEND
 .sp
 If this option is set, the \fBreg_endp\fP field in the \fIpreg\fP structure
 (which has the type const char *) must be set to point to the character beyond
-the end of the pattern before calling \fBregcomp()\fP. The pattern itself may
-now contain binary zeros, which are treated as data characters. Without
+the end of the pattern before calling \fBpcre2_regcomp()\fP. The pattern itself
+may now contain binary zeros, which are treated as data characters. Without
 REG_PEND, a binary zero terminates the pattern and the \fBre_endp\fP field is
 ignored. This is a GNU extension to the POSIX standard and should be used with
 caution in software intended to be portable to other systems.
@@ -148,15 +167,16 @@ Perl way, not the POSIX way. Note that setting PCRE2_MULTILINE has only
 newlines are matched by the dot metacharacter (they are not) or by a negative
 class such as [^a] (they are).
 .P
-The yield of \fBregcomp()\fP is zero on success, and non-zero otherwise. The
-\fIpreg\fP structure is filled in on success, and one other member of the
+The yield of \fBpcre2_regcomp()\fP is zero on success, and non-zero otherwise.
+The \fIpreg\fP structure is filled in on success, and one other member of the
 structure (as well as \fIre_endp\fP) is public: \fIre_nsub\fP contains the
 number of capturing subpatterns in the regular expression. Various error codes
 are defined in the header file.
 .P
-NOTE: If the yield of \fBregcomp()\fP is non-zero, you must not attempt to
-use the contents of the \fIpreg\fP structure. If, for example, you pass it to
-\fBregexec()\fP, the result is undefined and your program is likely to crash.
+NOTE: If the yield of \fBpcre2_regcomp()\fP is non-zero, you must not attempt
+to use the contents of the \fIpreg\fP structure. If, for example, you pass it
+to \fBpcre2_regexec()\fP, the result is undefined and your program is likely to
+crash.
 .
 .
 .SH "MATCHING NEWLINE CHARACTERS"
@@ -193,7 +213,7 @@ 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 \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
+the POSIX API, passing REG_NEWLINE to PCRE2's \fBpcre2_regcomp()\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.
 .
@@ -201,10 +221,10 @@ passes PCRE2_DOTALL. There is no way to pass PCRE2_DOLLAR_ENDONLY.
 .SH "MATCHING A PATTERN"
 .rs
 .sp
-The function \fBregexec()\fP is called to match a compiled pattern \fIpreg\fP
-against a given \fIstring\fP, which is by default terminated by a zero byte
-(but see REG_STARTEND below), subject to the options in \fIeflags\fP. These can
-be:
+The function \fBpcre2_regexec()\fP is called to match a compiled pattern
+\fIpreg\fP against a given \fIstring\fP, which is by default terminated by a
+zero byte (but see REG_STARTEND below), subject to the options in \fIeflags\fP.
+These can be:
 .sp
   REG_NOTBOL
 .sp
@@ -245,7 +265,7 @@ 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
-\fBregexec()\fP are ignored (except possibly as input for REG_STARTEND).
+\fBpcre2_regexec()\fP are ignored (except possibly as input for REG_STARTEND).
 .P
 The value of \fInmatch\fP may be zero, and the value \fIpmatch\fP may be NULL
 (unless REG_STARTEND is set); in both these cases no data about any matched
@@ -268,22 +288,23 @@ header file, of which REG_NOMATCH is the "expected" failure code.
 .SH "ERROR MESSAGES"
 .rs
 .sp
-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. 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.
+The \fBpcre2_regerror()\fP function maps a non-zero errorcode from either
+\fBpcre2_regcomp()\fP or \fBpcre2_regexec()\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. 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
 .rs
 .sp
 Compiling a regular expression causes memory to be allocated and associated
-with the \fIpreg\fP structure. The function \fBregfree()\fP frees all such
-memory, after which \fIpreg\fP may no longer be used as a compiled expression.
+with the \fIpreg\fP structure. The function \fBpcre2_regfree()\fP frees all
+such memory, after which \fIpreg\fP may no longer be used as a compiled
+expression.
 .
 .
 .SH AUTHOR
@@ -300,6 +321,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 15 June 2017
-Copyright (c) 1997-2017 University of Cambridge.
+Last updated: 30 January 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index c392bfb01cd07a7f829cda0a3f269e365a2638d4..bbe418ad04c0b08cd78d8404f4ba89070164056a 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2SYNTAX 3 "02 September 2018" "PCRE2 10.32"
+.TH PCRE2SYNTAX 3 "29 July 2019" "PCRE2 10.34"
 .SH NAME
 PCRE2 - Perl-compatible regular expressions (revised API)
 .SH "PCRE2 REGULAR EXPRESSION SYNTAX SUMMARY"
@@ -22,7 +22,8 @@ documentation. This document contains a quick-reference summary of the syntax.
 .SH "ESCAPED CHARACTERS"
 .rs
 .sp
-This table applies to ASCII and Unicode environments.
+This table applies to ASCII and Unicode environments. An unrecognized escape
+sequence causes an error.
 .sp
   \ea         alarm, that is, the BEL character (hex 07)
   \ecx        "control-x", where x is any ASCII printing character
@@ -34,12 +35,24 @@ This table applies to ASCII and Unicode environments.
   \e0dd       character with octal code 0dd
   \eddd       character with octal code ddd, or backreference
   \eo{ddd..}  character with octal code ddd..
-  \eU         "U" if PCRE2_ALT_BSUX is set (otherwise is an error)
   \eN{U+hh..} character with Unicode code point hh.. (Unicode mode only)
-  \euhhhh     character with hex code hhhh (if PCRE2_ALT_BSUX is set)
   \exhh       character with hex code hh
   \ex{hh..}   character with hex code hh..
 .sp
+If PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set ("ALT_BSUX mode"), the
+following are also recognized:
+.sp
+  \eU         the character "U"
+  \euhhhh     character with hex code hhhh
+  \eu{hh..}   character with hex code hh.. but only for EXTRA_ALT_BSUX
+.sp
+When \ex is not followed by {, from zero to two hexadecimal digits are read,
+but in ALT_BSUX mode \ex must be followed by two hexadecimal digits to be
+recognized as a hexadecimal escape; otherwise it matches a literal "x".
+Likewise, if \eu (in ALT_BSUX mode) is not followed by four hexadecimal digits
+or (in EXTRA_ALT_BSUX mode) a sequence of hex digits in curly brackets, it
+matches a literal "u".
+.P
 Note that \e0dd is always an octal code. The treatment of backslash followed by
 a non-zero digit is complicated; for details see the section
 .\" HTML <a href="pcre2pattern.html#digitsafterbackslash">
@@ -54,12 +67,6 @@ documentation, where details of escape processing in EBCDIC environments are
 also given. \eN{U+hh..} is synonymous with \ex{hh..} in PCRE2 but is not
 supported in EBCDIC environments. Note that \eN not followed by an opening
 curly bracket has a different meaning (see below).
-.P
-When \ex is not followed by {, from zero to two hexadecimal digits are read,
-but if PCRE2_ALT_BSUX is set, \ex must be followed by two hexadecimal digits to
-be recognized as a hexadecimal escape; otherwise it matches a literal "x".
-Likewise, if \eu (in ALT_BSUX mode) is not followed by four hexadecimal digits,
-it matches a literal "u".
 .
 .
 .SH "CHARACTER TYPES"
@@ -197,6 +204,7 @@ Dogra,
 Duployan,
 Egyptian_Hieroglyphs,
 Elbasan,
+Elymaic,
 Ethiopic,
 Georgian,
 Glagolitic,
@@ -254,10 +262,12 @@ Mro,
 Multani,
 Myanmar,
 Nabataean,
+Nandinagari,
 New_Tai_Lue,
 Newa,
 Nko,
 Nushu,
+Nyakeng_Puachue_Hmong,
 Ogham,
 Ol_Chiki,
 Old_Hungarian,
@@ -308,6 +318,7 @@ Tifinagh,
 Tirhuta,
 Ugaritic,
 Vai,
+Wancho,
 Warang_Citi,
 Yi,
 Zanabazar_Square.
@@ -398,19 +409,24 @@ but some of them use Unicode properties if PCRE2_UCP is set. You can use
 .SH "CAPTURING"
 .rs
 .sp
-  (...)           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
+  (...)           capture group
+  (?<name>...)    named capture group (Perl)
+  (?'name'...)    named capture group (Perl)
+  (?P<name>...)   named capture group (Python)
+  (?:...)         non-capture group
+  (?|...)         non-capture group; reset group numbers for
+                   capture groups in each alternative
+.sp
+In non-UTF modes, names may contain underscores and ASCII letters and digits;
+in UTF modes, any Unicode letters and Unicode decimal digits are permitted. In
+both cases, a name must not start with a digit.
 .
 .
 .SH "ATOMIC GROUPS"
 .rs
 .sp
-  (?>...)         atomic, non-capturing group
+  (?>...)         atomic non-capture group
+  (*atomic:...)   atomic non-capture group
 .
 .
 .SH "COMMENT"
@@ -438,7 +454,7 @@ of the group.
 Unsetting x or xx unsets both. Several options may be set at once, and a
 mixture of setting and unsetting such as (?i-x) is allowed, but there may be
 only one hyphen. Setting (but no unsetting) is allowed after (?^ for example
-(?^in). An option setting may appear at the start of a non-capturing group, for
+(?^in). An option setting may appear at the start of a non-capture group, for
 example (?i:...).
 .P
 The following are recognized only at the very start of a pattern or after one
@@ -491,12 +507,45 @@ setting with a similar syntax.
 .SH "LOOKAHEAD AND LOOKBEHIND ASSERTIONS"
 .rs
 .sp
-  (?=...)         positive look ahead
-  (?!...)         negative look ahead
-  (?<=...)        positive look behind
-  (?<!...)        negative look behind
+  (?=...)                     )
+  (*pla:...)                  ) positive lookahead
+  (*positive_lookahead:...)   )
+.sp
+  (?!...)                     )
+  (*nla:...)                  ) negative lookahead
+  (*negative_lookahead:...)   )
+.sp
+  (?<=...)                    )
+  (*plb:...)                  ) positive lookbehind
+  (*positive_lookbehind:...)  )
+.sp
+  (?<!...)                    )
+  (*nlb:...)                  ) negative lookbehind
+  (*negative_lookbehind:...)  )
+.sp
+Each top-level branch of a lookbehind must be of a fixed length.
+.
+.
+.SH "NON-ATOMIC LOOKAROUND ASSERTIONS"
+.rs
+.sp
+These assertions are specific to PCRE2 and are not Perl-compatible.
+.sp
+  (*napla:...)
+  (*non_atomic_positive_lookahead:...)
+.sp
+  (*naplb:...)
+  (*non_atomic_positive_lookbehind:...)
+.
+.
+.SH "SCRIPT RUNS"
+.rs
+.sp
+  (*script_run:...)           ) script run, can be backtracked into
+  (*sr:...)                   )
 .sp
-Each top-level branch of a look behind must be of a fixed length.
+  (*atomic_script_run:...)    ) atomic script run
+  (*asr:...)                  )
 .
 .
 .SH "BACKREFERENCES"
@@ -520,19 +569,19 @@ Each top-level branch of a look behind must be of a fixed length.
 .rs
 .sp
   (?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)
-  \eg<name>        call subpattern by name (Oniguruma)
-  \eg'name'        call subpattern by name (Oniguruma)
-  \eg<n>           call subpattern by absolute number (Oniguruma)
-  \eg'n'           call subpattern by absolute number (Oniguruma)
-  \eg<+n>          call subpattern by relative number (PCRE2 extension)
-  \eg'+n'          call subpattern by relative number (PCRE2 extension)
-  \eg<-n>          call subpattern by relative number (PCRE2 extension)
-  \eg'-n'          call subpattern by relative number (PCRE2 extension)
+  (?n)            call subroutine by absolute number
+  (?+n)           call subroutine by relative number
+  (?-n)           call subroutine by relative number
+  (?&name)        call subroutine by name (Perl)
+  (?P>name)       call subroutine by name (Python)
+  \eg<name>        call subroutine by name (Oniguruma)
+  \eg'name'        call subroutine by name (Oniguruma)
+  \eg<n>           call subroutine by absolute number (Oniguruma)
+  \eg'n'           call subroutine by absolute number (Oniguruma)
+  \eg<+n>          call subroutine by relative number (PCRE2 extension)
+  \eg'+n'          call subroutine by relative number (PCRE2 extension)
+  \eg<-n>          call subroutine by relative number (PCRE2 extension)
+  \eg'-n'          call subroutine by relative number (PCRE2 extension)
 .
 .
 .SH "CONDITIONAL PATTERNS"
@@ -550,7 +599,7 @@ Each top-level branch of a look behind must be of a fixed length.
   (?(R)               overall recursion condition
   (?(Rn)              specific numbered group recursion condition
   (?(R&name)          specific named group recursion condition
-  (?(DEFINE)          define subpattern for reference
+  (?(DEFINE)          define groups for reference
   (?(VERSION[>]=n.m)  test PCRE2 version
   (?(assert)          assertion condition
 .sp
@@ -621,6 +670,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 02 September 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 29 July 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index f590fe16460866933cdef12e54532556dc2f4b2d..355dc75f7bdf87f4f6b5bd629d814c5a223a81e7 100644 (file)
@@ -1,4 +1,4 @@
-.TH PCRE2TEST 1 "21 July 2018" "PCRE 10.32"
+.TH PCRE2TEST 1 "30 July 2019" "PCRE 10.34"
 .SH NAME
 pcre2test - a program for testing Perl-compatible regular expressions.
 .SH SYNOPSIS
@@ -202,10 +202,16 @@ compiled pattern is given after compilation.
 Behave as if each pattern line has the \fBjit\fP modifier; after successful
 compilation, each pattern is passed to the just-in-time compiler, if available.
 .TP 10
+\fB-jitfast\fP
+Behave as if each pattern line has the \fBjitfast\fP modifier; after
+successful compilation, each pattern is passed to the just-in-time compiler, if
+available, and each subject line is passed directly to the JIT matcher via its
+"fast path".
+.TP 10
 \fB-jitverify\fP
 Behave as if each pattern line has the \fBjitverify\fP modifier; after
 successful compilation, each pattern is passed to the just-in-time compiler, if
-available, and the use of JIT is verified.
+available, and the use of JIT for matching is verified.
 .TP 10
 \fB-LM\fP
 List modifiers: write a list of available pattern and subject modifiers to the
@@ -565,11 +571,14 @@ for a description of the effects of these options.
   /s  dotall                    set PCRE2_DOTALL
       dupnames                  set PCRE2_DUPNAMES
       endanchored               set PCRE2_ENDANCHORED
+      escaped_cr_is_lf          set PCRE2_EXTRA_ESCAPED_CR_IS_LF
   /x  extended                  set PCRE2_EXTENDED
   /xx extended_more             set PCRE2_EXTENDED_MORE
+      extra_alt_bsux            set PCRE2_EXTRA_ALT_BSUX
       firstline                 set PCRE2_FIRSTLINE
       literal                   set PCRE2_LITERAL
       match_line                set PCRE2_EXTRA_MATCH_LINE
+      match_invalid_utf         set PCRE2_MATCH_INVALID_UTF
       match_unset_backref       set PCRE2_MATCH_UNSET_BACKREF
       match_word                set PCRE2_EXTRA_MATCH_WORD
   /m  multiline                 set PCRE2_MULTILINE
@@ -671,14 +680,14 @@ information is obtained from the \fBpcre2_pattern_info()\fP function. Here are
 some typical examples:
 .sp
     re> /(?i)(^a|^b)/m,info
-  Capturing subpattern count = 1
+  Capture group count = 1
   Compile options: multiline
   Overall options: caseless multiline
   First code unit at start or follows newline
   Subject length lower bound = 1
 .sp
     re> /(?i)abc/info
-  Capturing subpattern count = 0
+  Capture group count = 0
   Compile options: <none>
   Overall options: caseless
   First code unit = 'a' (caseless)
@@ -692,7 +701,9 @@ 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.
+ending code units are recorded. The subject length line is omitted when
+\fBno_start_optimize\fP is set because the minimum length is not calculated
+when it can never be used.
 .P
 The \fBframesize\fP modifier shows the size, in bytes, of the storage frames
 used by \fBpcre2_match()\fP for handling backtracking. The size depends on the
@@ -1003,6 +1014,7 @@ process.
       aftertext                  show text after match
       allaftertext               show text after captures
       allcaptures                show all captures
+      allvector                  show the entire ovector
       allusedtext                show all consulted text
       altglobal                  alternative global matching
   /g  global                     global matching
@@ -1010,8 +1022,11 @@ process.
       mark                       show mark values
       replace=<string>           specify a replacement string
       startchar                  show starting character when relevant
+      substitute_callout         use substitution callouts
       substitute_extended        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_skip=<n>        skip substitution number n
       substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_stop=<n>        skip substitution number n and greater
       substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
       substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
 .sp
@@ -1154,6 +1169,7 @@ pattern.
       aftertext                  show text after match
       allaftertext               show text after captures
       allcaptures                show all captures
+      allvector                  show the entire ovector
       allusedtext                show all consulted text (non-JIT only)
       altglobal                  alternative global matching
       callout_capture            show captures at callout time
@@ -1183,8 +1199,11 @@ pattern.
       replace=<string>           specify a replacement string
       startchar                  show startchar when relevant
       startoffset=<n>            same as offset=<n>
+      substitute_callout         use substitution callouts
       substitute_extedded        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_skip=<n>        skip substitution number n
       substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_stop=<n>        skip substitution number n and greater
       substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
       substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
       zero_terminate             pass the subject as zero-terminated
@@ -1207,22 +1226,27 @@ well as the main matched substring. In each case the remainder is output on the
 following line with a plus character following the capture number.
 .P
 The \fBallusedtext\fP modifier requests that all the text that was consulted
-during a successful pattern match by the interpreter should be shown. This
-feature is not supported for JIT matching, and if requested with JIT it is
-ignored (with a warning message). Setting this modifier affects the output if
-there is a lookbehind at the start of a match, or a lookahead at the end, or if
-\eK is used in the pattern. Characters that precede or follow the start and end
-of the actual match are indicated in the output by '<' or '>' characters
-underneath them. Here is an example:
+during a successful pattern match by the interpreter should be shown, for both
+full and partial matches. This feature is not supported for JIT matching, and
+if requested with JIT it is ignored (with a warning message). Setting this
+modifier affects the output if there is a lookbehind at the start of a match,
+or, for a complete match, a lookahead at the end, or if \eK is used in the
+pattern. Characters that precede or follow the start and end of the actual
+match are indicated in the output by '<' or '>' characters underneath them.
+Here is an example:
 .sp
     re> /(?<=pqr)abc(?=xyz)/
   data> 123pqrabcxyz456\e=allusedtext
    0: pqrabcxyz
       <<<   >>>
+  data> 123pqrabcxy\e=ph,allusedtext
+  Partial match: pqrabcxy
+                 <<<
 .sp
-This shows that the matched string is "abc", with the preceding and following
-strings "pqr" and "xyz" having been consulted during the match (when processing
-the assertions).
+The first, complete match shows that the matched string is "abc", with the
+preceding and following strings "pqr" and "xyz" having been consulted during
+the match (when processing the assertions). The partial match can indicate only
+the preceding string.
 .P
 The \fBstartchar\fP modifier requests that the starting character for the match
 be indicated, if it is different to the start of the matched string. The only
@@ -1248,10 +1272,28 @@ captured parentheses be output after a match. By default, only those up to the
 highest one actually used in the match are output (corresponding to the return
 code from \fBpcre2_match()\fP). Groups that did not take part in the match
 are output as "<unset>". This modifier is not relevant for DFA matching (which
-does no capturing); it is ignored, with a warning message, if present.
+does no capturing) and does not apply when \fBreplace\fP is specified; it is
+ignored, with a warning message, if present.
 .
 .
-.SS "Testing callouts"
+.SS "Showing the entire ovector, for all outcomes"
+.rs
+.sp
+The \fBallvector\fP modifier requests that the entire ovector be shown,
+whatever the outcome of the match. Compare \fBallcaptures\fP, which shows only
+up to the maximum number of capture groups for the pattern, and then only for a
+successful complete non-DFA match. This modifier, which acts after any match
+result, and also for DFA matching, provides a means of checking that there are
+no unexpected modifications to ovector fields. Before each match attempt, the
+ovector is filled with a special value, and if this is found in both elements
+of a capturing pair, "<unchanged>" is output. After a successful match, this
+applies to all groups after the maximum capture group for the pattern. In other
+cases it applies to the entire ovector. After a partial match, the first two
+elements are the only ones that should be set. After a DFA match, the amount of
+ovector that is used depends on the number of matches that were found.
+.
+.
+.SS "Testing pattern callouts"
 .rs
 .sp
 A callout function is supplied when \fBpcre2test\fP calls the library matching
@@ -1262,6 +1304,12 @@ controlled by various modifiers listed above whose names begin with
 .\" </a>
 below.
 .\"
+Testing callouts from \fBpcre2_substitute()\fP is decribed separately in
+"Testing the substitution function"
+.\" HTML <a href="#substitution">
+.\" </a>
+below.
+.\"
 .
 .
 .SS "Finding all matches in a string"
@@ -1292,8 +1340,8 @@ current character is CR followed by LF, an advance of two characters occurs.
 .sp
 The \fBcopy\fP and \fBget\fP modifiers can be used to test the
 \fBpcre2_substring_copy_xxx()\fP and \fBpcre2_substring_get_xxx()\fP functions.
-They can be given more than once, and each can specify a group name or number,
-for example:
+They can be given more than once, and each can specify a capture group name or
+number, for example:
 .sp
    abcd\e=copy=1,copy=3,get=G1
 .sp
@@ -1312,6 +1360,7 @@ parentheses after each substring, followed by the name when the extraction was
 by name.
 .
 .
+.\" HTML <a name="substitution"></a>
 .SS "Testing the substitution function"
 .rs
 .sp
@@ -1364,10 +1413,10 @@ 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:
+to go through the motions of matching and substituting (but not doing any
+callouts), 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
@@ -1378,6 +1427,48 @@ matching provokes an error return ("bad option value") from
 \fBpcre2_substitute()\fP.
 .
 .
+.SS "Testing substitute callouts"
+.rs
+.sp
+If the \fBsubstitute_callout\fP modifier is set, a substitution callout
+function is set up. The \fBnull_context\fP modifier must not be set, because
+the address of the callout function is passed in a match context. When the
+callout function is called (after each substitution), details of the the input
+and output strings are output. For example:
+.sp
+  /abc/g,replace=<$0>,substitute_callout
+      abcdefabcpqr
+   1(1) Old 0 3 "abc" New 0 5 "<abc>"
+   2(1) Old 6 9 "abc" New 8 13 "<abc>"
+   2: <abc>def<abc>pqr
+.sp
+The first number on each callout line is the count of matches. The
+parenthesized number is the number of pairs that are set in the ovector (that
+is, one more than the number of capturing groups that were set). Then are
+listed the offsets of the old substring, its contents, and the same for the
+replacement.
+.P
+By default, the substitution callout function returns zero, which accepts the
+replacement and causes matching to continue if /g was used. Two further
+modifiers can be used to test other return values. If \fBsubstitute_skip\fP is
+set to a value greater than zero the callout function returns +1 for the match
+of that number, and similarly \fBsubstitute_stop\fP returns -1. These cause the
+replacement to be rejected, and -1 causes no further matching to take place. If
+either of them are set, \fBsubstitute_callout\fP is assumed. For example:
+.sp
+  /abc/g,replace=<$0>,substitute_skip=1
+      abcdefabcpqr
+   1(1) Old 0 3 "abc" New 0 5 "<abc> SKIPPED"
+   2(1) Old 6 9 "abc" New 6 11 "<abc>"
+   2: abcdef<abc>pqr
+      abcdefabcpqr\e=substitute_stop=1
+   1(1) Old 0 3 "abc" New 0 5 "<abc> STOPPED"
+   1: abcdefabcpqr
+.sp
+If both are set for the same number, stop takes precedence. Only a single skip
+or stop is supported, which is sufficient for testing that the feature works.
+.
+.
 .SS "Setting the JIT stack size"
 .rs
 .sp
@@ -1512,11 +1603,11 @@ passing the replacement string as zero-terminated.
 .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.
+\fBpcre2_dfa_match()\fP, \fBpcre2_jit_match()\fP or \fBpcre2_substitute()\fP.
+If the \fBnull_context\fP modifier is set, however, NULL is passed. This is for
+testing that the matching and substitution functions behave correctly in this
+case (they use default values). This modifier cannot be used with the
+\fBfind_limits\fP or \fBsubstitute_callout\fP modifiers.
 .
 .
 .SH "THE ALTERNATIVE MATCHING FUNCTION"
@@ -1668,7 +1759,7 @@ restart the match with additional subject data by means of the
 \fBdfa_restart\fP modifier. For example:
 .sp
     re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/
-  data> 23ja\e=P,dfa
+  data> 23ja\e=ps,dfa
   Partial match: 23ja
   data> n05\e=dfa,dfa_restart
    0: n05
@@ -1982,6 +2073,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 21 July 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 30 July 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 44727a72a120a49f5d62c290fe9232a9ba5b9e32..fcd830f1e2b05ace2dd08a35660c37081728dc5d 100644 (file)
@@ -13,8 +13,8 @@ SYNOPSIS
        but it can also be used for  experimenting  with  regular  expressions.
        This  document  describes the features of the test program; for details
        of the regular expressions themselves, see the pcre2pattern  documenta-
-       tion.  For  details  of  the  PCRE2  library  function  calls and their
-       options, see the pcre2api documentation.
+       tion.  For  details  of  the PCRE2 library function calls and their op-
+       tions, see the pcre2api documentation.
 
        The input for pcre2test is a sequence of  regular  expression  patterns
        and  subject  strings  to  be matched. There are also command lines for
@@ -33,26 +33,26 @@ SYNOPSIS
        which are specifically designed for use in conjunction  with  the  test
        script  and  data  files that are distributed as part of PCRE2. All the
        modifiers are documented here, some  without  much  justification,  but
-       many  of  them  are  unlikely  to  be  of  use  except when testing the
-       libraries.
+       many  of  them  are  unlikely  to be of use except when testing the li-
+       braries.
 
 
 PCRE2's 8-BIT, 16-BIT AND 32-BIT LIBRARIES
 
        Different versions of the PCRE2 library can be built to support charac-
        ter  strings  that  are encoded in 8-bit, 16-bit, or 32-bit code units.
-       One, two, or  all  three  of  these  libraries  may  be  simultaneously
-       installed. The pcre2test program can be used to test all the libraries.
+       One, two, or all three of these libraries  may  be  simultaneously  in-
+       stalled.  The  pcre2test program can be used to test all the libraries.
        However, its own input and output are  always  in  8-bit  format.  When
        testing  the  16-bit  or 32-bit libraries, patterns and subject strings
-       are converted to 16-bit or 32-bit format before  being  passed  to  the
-       library  functions.  Results are converted back to 8-bit code units for
+       are converted to 16-bit or 32-bit format before being passed to the li-
+       brary  functions.  Results  are  converted back to 8-bit code units for
        output.
 
        In the rest of this document, the names of library functions and struc-
-       tures  are  given  in  generic  form,  for example, pcre_compile(). The
-       actual names used in the libraries have a suffix _8, _16,  or  _32,  as
-       appropriate.
+       tures  are  given in generic form, for example, pcre_compile(). The ac-
+       tual names used in the libraries have a suffix _8, _16, or _32, as  ap-
+       propriate.
 
 
 INPUT ENCODING
@@ -70,18 +70,18 @@ INPUT ENCODING
        processed for backslash escapes, which makes it possible to include any
        data value in strings that are passed to the library for matching.  For
        patterns,  there  is a facility for specifying some or all of the 8-bit
-       input characters as hexadecimal  pairs,  which  makes  it  possible  to
-       include binary zeros.
+       input characters as hexadecimal pairs, which makes it possible  to  in-
+       clude binary zeros.
 
    Input for the 16-bit and 32-bit libraries
 
        When testing the 16-bit or 32-bit libraries, there is a need to be able
        to generate character code points greater than 255 in the strings  that
        are  passed to the library. For subject lines, backslash escapes can be
-       used. In addition, when the  utf  modifier  (see  "Setting  compilation
-       options" below) is set, the pattern and any following subject lines are
-       interpreted as UTF-8 strings and translated  to  UTF-16  or  UTF-32  as
-       appropriate.
+       used. In addition, when the utf modifier (see "Setting compilation  op-
+       tions"  below)  is set, the pattern and any following subject lines are
+       interpreted as UTF-8 strings and translated to UTF-16 or UTF-32 as  ap-
+       propriate.
 
        For  non-UTF testing of wide characters, the utf8_input modifier can be
        used. This is mutually exclusive with  utf,  and  is  allowed  only  in
@@ -121,8 +121,8 @@ COMMAND LINE OPTIONS
                  piled.
 
        -AC       As  for  -ac,  but in addition behave as if each subject line
-                 has the callout_extra  modifier,  that  is,  show  additional
-                 information from callouts.
+                 has the callout_extra modifier, that is, show additional  in-
+                 formation from callouts.
 
        -b        Behave  as  if each pattern has the fullbincode modifier; the
                  full internal binary form of the pattern is output after com-
@@ -130,9 +130,9 @@ COMMAND LINE OPTIONS
 
        -C        Output  the  version  number  of  the  PCRE2 library, and all
                  available information about the optional  features  that  are
-                 included,  and  then  exit  with  zero  exit  code. All other
-                 options are ignored. If both -C and -LM are  present,  which-
-                 ever is first is recognized.
+                 included,  and  then  exit with zero exit code. All other op-
+                 tions are ignored. If both -C and -LM are present,  whichever
+                 is first is recognized.
 
        -C option Output  information  about a specific build-time option, then
                  exit. This functionality is intended for use in scripts  such
@@ -190,15 +190,20 @@ COMMAND LINE OPTIONS
                  successful compilation, each pattern is passed to  the  just-
                  in-time compiler, if available.
 
+       -jitfast  Behave  as if each pattern line has the jitfast modifier; af-
+                 ter successful compilation, each pattern  is  passed  to  the
+                 just-in-time compiler, if available, and each subject line is
+                 passed directly to the JIT matcher via its "fast path".
+
        -jitverify
-                 Behave  as  if  each pattern line has the jitverify modifier;
-                 after successful compilation, each pattern is passed  to  the
-                 just-in-time  compiler,  if  available, and the use of JIT is
-                 verified.
+                 Behave as if each pattern line has  the  jitverify  modifier;
+                 after  successful  compilation, each pattern is passed to the
+                 just-in-time compiler, if available, and the use of  JIT  for
+                 matching is verified.
 
        -LM       List modifiers: write a list of available pattern and subject
-                 modifiers  to  the  standard output, then exit with zero exit
-                 code. All other options are ignored.  If both -C and -LM  are
+                 modifiers to the standard output, then exit  with  zero  exit
+                 code.  All other options are ignored.  If both -C and -LM are
                  present, whichever is first is recognized.
 
        -pattern modifier-list
@@ -207,25 +212,25 @@ COMMAND LINE OPTIONS
        -q        Do not output the version number of pcre2test at the start of
                  execution.
 
-       -S size   On Unix-like systems, set the size of the run-time  stack  to
+       -S size   On  Unix-like  systems, set the size of the run-time stack to
                  size mebibytes (units of 1024*1024 bytes).
 
        -subject modifier-list
                  Behave as if each subject line contains the given modifiers.
 
-       -t        Run  each compile and match many times with a timer, and out-
-                 put the resulting times per compile or  match.  When  JIT  is
-                 used,  separate  times  are given for the initial compile and
-                 the JIT compile. You can control  the  number  of  iterations
-                 that  are used for timing by following -t with a number (as a
-                 separate item on the command line). For  example,  "-t  1000"
+       -t        Run each compile and match many times with a timer, and  out-
+                 put  the  resulting  times  per compile or match. When JIT is
+                 used, separate times are given for the  initial  compile  and
+                 the  JIT  compile.  You  can control the number of iterations
+                 that are used for timing by following -t with a number (as  a
+                 separate  item  on  the command line). For example, "-t 1000"
                  iterates 1000 times. The default is to iterate 500,000 times.
 
        -tm       This is like -t except that it times only the matching phase,
                  not the compile phase.
 
-       -T -TM    These behave like -t and -tm, but in addition, at the end  of
-                 a  run, the total times for all compiles and matches are out-
+       -T -TM    These  behave like -t and -tm, but in addition, at the end of
+                 a run, the total times for all compiles and matches are  out-
                  put.
 
        -version  Output the PCRE2 version number and then exit.
@@ -233,140 +238,140 @@ COMMAND LINE OPTIONS
 
 DESCRIPTION
 
-       If pcre2test is given two filename arguments, it reads from  the  first
+       If  pcre2test  is given two filename arguments, it reads from the first
        and writes to the second. If the first name is "-", input is taken from
-       the standard input. If pcre2test is given only one argument,  it  reads
+       the  standard  input. If pcre2test is given only one argument, it reads
        from that file and writes to stdout. Otherwise, it reads from stdin and
        writes to stdout.
 
-       When pcre2test is built, a configuration option  can  specify  that  it
-       should  be linked with the libreadline or libedit library. When this is
-       done, if the input is from a terminal, it is read using the  readline()
+       When  pcre2test  is  built,  a configuration option can specify that it
+       should be linked with the libreadline or libedit library. When this  is
+       done,  if the input is from a terminal, it is read using the readline()
        function. This provides line-editing and history facilities. The output
        from the -help option states whether or not readline() will be used.
 
-       The program handles any number of tests, each of which  consists  of  a
-       set  of input lines. Each set starts with a regular expression pattern,
+       The  program  handles  any number of tests, each of which consists of a
+       set of input lines. Each set starts with a regular expression  pattern,
        followed by any number of subject lines to be matched against that pat-
        tern. In between sets of test data, command lines that begin with # may
        appear. This file format, with some restrictions, can also be processed
-       by  the perltest.sh script that is distributed with PCRE2 as a means of
+       by the perltest.sh script that is distributed with PCRE2 as a means  of
        checking that the behaviour of PCRE2 and Perl is the same. For a speci-
        fication of perltest.sh, see the comments near its beginning.
 
        When the input is a terminal, pcre2test prompts for each line of input,
-       using "re>" to prompt for regular expression patterns, and  "data>"  to
-       prompt  for subject lines. Command lines starting with # can be entered
+       using  "re>"  to prompt for regular expression patterns, and "data>" to
+       prompt for subject lines. Command lines starting with # can be  entered
        only in response to the "re>" prompt.
 
-       Each subject line is matched separately and independently. If you  want
+       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  are  replication features that makes it possible to
-       generate long repetitive pattern or subject  lines  without  having  to
+       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 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
-       expected if there is still input to be read.
+       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 ex-
+       pected 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
+       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-
+       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  de-
+       fault.  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-
+       acceptable  as the default. The types must be one of CR, LF, CRLF, ANY-
        CRLF, ANY, or NUL (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
+       erwise,  except  when  testing  the  POSIX API, a newline modifier that
+       specifies the first newline convention in the list (LF in the above ex-
+       ample)  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  or
-       posix_nosub  modifier is used when #newline_default would set a default
+       When  the POSIX API is being tested there is no way to override the de-
+       fault newline convention, though it is possible to set the newline con-
+       vention  from  within  the  pattern. A warning is given if the posix or
+       posix_nosub 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, #pattern commands, and #subject  commands  that  set  or
-       unset  "mark", no command lines are permitted, because they and many of
+       to confirm that Perl gives the same results as PCRE2. Also, apart  from
+       comment lines, #pattern commands, and #subject commands that set or un-
+       set "mark", no 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
+       files that are also processed by  perltest.sh.  The  #perltest  command
        helps detect tests that are accidentally put in the wrong file.
 
          #pop [<modifiers>]
          #popcopy [<modifiers>]
 
-       These commands are used to manipulate the stack of  compiled  patterns,
-       as  described  in  the  section entitled "Saving and restoring compiled
+       These  commands  are used to manipulate the stack of compiled patterns,
+       as described in the section entitled  "Saving  and  restoring  compiled
        patterns" 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.
 
 
@@ -374,58 +379,58 @@ MODIFIER SYNTAX
 
        Modifier lists are used with both pattern and subject lines. Items in a
        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
+       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 "an-
+       chored", 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).
@@ -433,7 +438,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, unless the subject_literal modi-
        fier was set for the pattern. The following provide a means of encoding
@@ -454,23 +459,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
@@ -478,31 +483,31 @@ 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
 
-       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
+       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
+       A backslash followed by any other non-alphanumeric character  just  es-
+       capes  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
        data input.
 
        If the subject_literal modifier is set for a pattern, all subject lines
@@ -513,23 +518,23 @@ SUBJECT LINE SYNTAX
 
 PATTERN MODIFIERS
 
-       There  are  several types of modifier that can appear in pattern lines.
+       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
+       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(). Most  of  them
-       set  bits  in  the  options  argument of that function, but those whose
+       The  following  modifiers set options for pcre2_compile(). Most of them
+       set bits in the options argument of  that  function,  but  those  whose
        names start with PCRE2_EXTRA are additional options that are set in the
-       compile  context.  For  the  main options, there are some single-letter
-       abbreviations that are the same as Perl options. There is special  han-
-       dling  for  /x:  if  a second x is present, PCRE2_EXTENDED is converted
-       into  PCRE2_EXTENDED_MORE  as  in  Perl.  A   third   appearance   adds
-       PCRE2_EXTENDED  as  well,  though  this  makes no difference to the way
-       pcre2_compile() behaves. See pcre2api for a description of the  effects
-       of these options.
+       compile context. For the main options, there are some single-letter ab-
+       breviations  that  are  the same as Perl options. There is special han-
+       dling for /x: if a second x is  present,  PCRE2_EXTENDED  is  converted
+       into  PCRE2_EXTENDED_MORE as in Perl. A third appearance adds PCRE2_EX-
+       TENDED as well, though this makes no difference to the  way  pcre2_com-
+       pile()  behaves. See pcre2api for a description of the effects of these
+       options.
 
              allow_empty_class         set PCRE2_ALLOW_EMPTY_CLASS
              allow_surrogate_escapes   set PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES
@@ -544,11 +549,14 @@ PATTERN MODIFIERS
          /s  dotall                    set PCRE2_DOTALL
              dupnames                  set PCRE2_DUPNAMES
              endanchored               set PCRE2_ENDANCHORED
+             escaped_cr_is_lf          set PCRE2_EXTRA_ESCAPED_CR_IS_LF
          /x  extended                  set PCRE2_EXTENDED
          /xx extended_more             set PCRE2_EXTENDED_MORE
+             extra_alt_bsux            set PCRE2_EXTRA_ALT_BSUX
              firstline                 set PCRE2_FIRSTLINE
              literal                   set PCRE2_LITERAL
              match_line                set PCRE2_EXTRA_MATCH_LINE
+             match_invalid_utf         set PCRE2_MATCH_INVALID_UTF
              match_unset_backref       set PCRE2_MATCH_UNSET_BACKREF
              match_word                set PCRE2_EXTRA_MATCH_WORD
          /m  multiline                 set PCRE2_MULTILINE
@@ -566,17 +574,17 @@ PATTERN MODIFIERS
              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
-       without the curly brackets. Setting utf in 16-bit or 32-bit  mode  also
-       causes  pattern  and  subject  strings  to  be  translated to UTF-16 or
+       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 utf in 16-bit or 32-bit mode also
+       causes pattern and subject  strings  to  be  translated  to  UTF-16  or
        UTF-32, respectively, before being passed to library functions.
 
    Setting compilation controls
 
-       The following modifiers  affect  the  compilation  process  or  request
-       information  about  the  pattern. There are single-letter abbreviations
-       for some that are heavily used in the test files.
+       The  following  modifiers affect the compilation process or request in-
+       formation about the pattern. There are single-letter abbreviations  for
+       some that are heavily used in the test files.
 
              bsr=[anycrlf|unicode]     specify \R handling
          /B  bincode                   show binary code without lengths
@@ -613,161 +621,163 @@ 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 can  be
+       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 can be
        specified when PCRE2 is built; if it is not, the default is set to Uni-
        code.
 
-       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, ANY, or NUL (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
-         Capturing subpattern count = 1
+         Capture group count = 1
          Compile options: multiline
          Overall options: caseless multiline
          First code unit at start or follows newline
          Subject length lower bound = 1
 
            re> /(?i)abc/info
-         Capturing subpattern count = 0
+         Capture group count = 0
          Compile options: <none>
          Overall options: caseless
          First code unit = 'a' (caseless)
          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
-       units are recorded.
-
-       The  framesize modifier shows the size, in bytes, of the storage frames
-       used by pcre2_match() for handling backtracking. The  size  depends  on
+       "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  subject  length  line   is   omitted   when
+       no_start_optimize  is  set because the minimum length is not calculated
+       when it can never be used.
+
+       The framesize modifier shows the size, in bytes, of the storage  frames
+       used  by  pcre2_match()  for handling backtracking. The size depends on
        the number of capturing parentheses in the pattern.
 
-       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
+       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 pattern characters in hexadecimal
 
-       The  hex  modifier specifies that the characters of the pattern, except
-       for substrings enclosed in single or double quotes, are  to  be  inter-
-       preted  as  pairs  of hexadecimal digits. This feature is provided as a
+       The hex modifier specifies that the characters of the  pattern,  except
+       for  substrings  enclosed  in single or double quotes, are to be inter-
+       preted as pairs of hexadecimal digits. This feature is  provided  as  a
        way of creating patterns that contain binary zeros and other non-print-
-       ing  characters.  White space is permitted between pairs of digits. For
+       ing characters. White space is permitted between pairs of  digits.  For
        example, this pattern contains three characters:
 
          /ab 32 59/hex
 
-       Parts of such a pattern are taken literally  if  quoted.  This  pattern
-       contains  nine characters, only two of which are specified in hexadeci-
+       Parts  of  such  a  pattern are taken literally if quoted. This pattern
+       contains nine characters, only two of which are specified in  hexadeci-
        mal:
 
          /ab "literal" 32/hex
 
-       Either single or double quotes may be used. There is no way of  includ-
-       ing  the delimiter within a substring. The hex and expand modifiers are
+       Either  single or double quotes may be used. There is no way of includ-
+       ing the delimiter within a substring. The hex and expand modifiers  are
        mutually exclusive.
 
    Specifying the pattern's length
 
        By default, patterns are passed to the compiling functions as zero-ter-
-       minated  strings but can be passed by length instead of being zero-ter-
-       minated. The use_length modifier causes this to happen. Using a  length
-       happens  automatically  (whether  or not use_length is set) when hex is
-       set, because patterns  specified  in  hexadecimal  may  contain  binary
-       zeros.
+       minated strings but can be passed by length instead of being  zero-ter-
+       minated.  The use_length modifier causes this to happen. Using a length
+       happens automatically (whether or not use_length is set)  when  hex  is
+       set,  because  patterns specified in hexadecimal may contain binary ze-
+       ros.
 
        If hex or use_length is used with the POSIX wrapper API (see "Using the
-       POSIX wrapper API" below), the REG_PEND extension is used to  pass  the
+       POSIX  wrapper  API" below), the REG_PEND extension is used to pass the
        pattern's length.
 
    Specifying wide characters in 16-bit and 32-bit modes
 
        In 16-bit and 32-bit modes, all input is automatically treated as UTF-8
-       and translated to UTF-16 or UTF-32 when the utf modifier  is  set.  For
+       and  translated  to  UTF-16 or UTF-32 when the utf modifier is set. For
        testing the 16-bit and 32-bit libraries in non-UTF mode, the utf8_input
-       modifier can be used. It is mutually exclusive with  utf.  Input  lines
+       modifier  can  be  used. It is mutually exclusive with utf. Input lines
        are interpreted as UTF-8 as a means of specifying wide characters. More
        details are given in "Input encoding" above.
 
    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
+       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
+       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. The expand and hex
        modifiers are mutually exclusive.
 
-       If  part  of an expanded pattern looks like an expansion, but is really
+       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
+       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
 
-       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
+       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
+       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 compilation is requested by the jit pattern modifier, which may op-
+       tionally  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
@@ -784,31 +794,31 @@ PATTERN MODIFIERS
          6  soft and hard partial matching only
          7  all three modes
 
-       If no number is given, 7 is  assumed.  The  phrase  "partial  matching"
+       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-
+       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
+       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
+       If JIT compilation is successful, the compiled JIT code will  automati-
+       cally be used when an appropriate type of match is run, except when in-
+       compatible 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-
-       ity  checks that are done by pcre2_match(), and of course does not work
-       when JIT is not supported. If jitfast is specified without  jit,  jit=7
+       If the jitfast modifier is specified, matching is done  using  the  JIT
+       "fast  path" interface, pcre2_jit_match(), which skips some of the san-
+       ity checks that are done by pcre2_match(), and of course does not  work
+       when  JIT  is not supported. If jitfast is specified without jit, jit=7
        is assumed.
 
-       If  the jitverify modifier is specified, information about the compiled
-       pattern shows whether JIT compilation was or  was  not  successful.  If
-       jitverify  is  specified without jit, jit=7 is assumed. If JIT compila-
-       tion is successful when jitverify is set, the text "(JIT)" is added  to
+       If the jitverify modifier is specified, information about the  compiled
+       pattern  shows  whether  JIT  compilation was or was not successful. If
+       jitverify is specified without jit, jit=7 is assumed. If  JIT  compila-
+       tion  is successful when jitverify is set, the text "(JIT)" is added to
        the first output line after a match or non match when JIT-compiled code
        was actually used in the match.
 
@@ -819,19 +829,19 @@ PATTERN MODIFIERS
          /pattern/locale=fr_FR
 
        The given locale is set, pcre2_maketables() is called to build a set of
-       character  tables for the locale, and this is then passed to pcre2_com-
-       pile() when compiling the regular expression. The same tables are  used
-       when  matching the following subject lines. The locale modifier applies
+       character tables for the locale, and this is then passed to  pcre2_com-
+       pile()  when compiling the regular expression. The same tables are used
+       when matching the following subject lines. The locale modifier  applies
        only to the pattern on which it appears, but can be given in a #pattern
-       command  if a default is needed. Setting a locale and alternate charac-
+       command if a default is needed. Setting a locale and alternate  charac-
        ter tables are mutually exclusive.
 
    Showing pattern memory
 
        The memory modifier causes the size in bytes of the memory used to hold
-       the  compiled  pattern  to be output. This does not include the size of
-       the pcre2_code block; it is just the actual compiled data. If the  pat-
-       tern  is  subsequently  passed to the JIT compiler, the size of the JIT
+       the compiled pattern to be output. This does not include  the  size  of
+       the  pcre2_code block; it is just the actual compiled data. If the pat-
+       tern is subsequently passed to the JIT compiler, the size  of  the  JIT
        compiled code is also output. Here is an example:
 
            re> /a(b)c/jit,memory
@@ -841,27 +851,27 @@ PATTERN MODIFIERS
 
    Limiting nested parentheses
 
-       The parens_nest_limit modifier sets a limit  on  the  depth  of  nested
-       parentheses  in  a  pattern.  Breaching  the limit causes a compilation
-       error.  The default for the library is set when  PCRE2  is  built,  but
-       pcre2test  sets  its  own default of 220, which is required for running
+       The  parens_nest_limit  modifier  sets  a  limit on the depth of nested
+       parentheses in a pattern. Breaching the limit causes a compilation  er-
+       ror.   The  default  for  the  library  is set when PCRE2 is built, but
+       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
+       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
+       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  and posix_nosub modifiers cause pcre2test to call PCRE2 via
-       the POSIX wrapper API rather than its native API. When  posix_nosub  is
-       used,  the  POSIX  option  REG_NOSUB  is passed to regcomp(). The POSIX
-       wrapper supports only the 8-bit library. Note that it  does  not  imply
+       The posix and posix_nosub modifiers cause pcre2test to call  PCRE2  via
+       the  POSIX  wrapper API rather than its native API. When posix_nosub is
+       used, the POSIX option REG_NOSUB is  passed  to  regcomp().  The  POSIX
+       wrapper  supports  only  the 8-bit library. Note that it does not imply
        POSIX matching semantics; for more detail see the pcre2posix documenta-
-       tion. The following pattern modifiers set  options  for  the  regcomp()
+       tion.  The  following  pattern  modifiers set options for the regcomp()
        function:
 
          caseless           REG_ICASE
@@ -871,39 +881,39 @@ PATTERN MODIFIERS
          ucp                REG_UCP        )   the POSIX standard
          utf                REG_UTF8       )
 
-       The  regerror_buffsize  modifier  specifies a size for the error buffer
-       that is passed to regerror() in the event of a compilation  error.  For
+       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
+       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 are either ignored, with a warning  message,
-       or cause an error.
+       The aftertext and allaftertext subject modifiers work as described  be-
+       low. All other modifiers are either ignored, with a warning message, or
+       cause an error.
 
-       The  pattern  is  passed  to  regcomp()  as a zero-terminated string by
-       default, but if the use_length or hex modifiers are set,  the  REG_PEND
-       extension is used to pass it by length.
+       The pattern is passed to regcomp() as a zero-terminated string  by  de-
+       fault, but if the use_length or hex modifiers are set, the REG_PEND ex-
+       tension is used to pass it by length.
 
    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
@@ -914,21 +924,22 @@ 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
-       tables and a locale are mutually exclusive.
+       In table 2, some characters whose codes are greater than 128 are  iden-
+       tified as letters, digits, spaces, etc. Setting alternate character ta-
+       bles and a locale are mutually exclusive.
 
    Setting certain match controls
 
        The following modifiers are really subject modifiers, and are described
-       under "Subject Modifiers" below. However, they may  be  included  in  a
-       pattern's  modifier  list, in which case they are applied to every sub-
-       ject line that is processed with that pattern. These modifiers  do  not
+       under  "Subject  Modifiers"  below.  However, they may be included in a
+       pattern's modifier list, in which case they are applied to  every  sub-
+       ject  line  that is processed with that pattern. These modifiers do not
        affect the compilation process.
 
              aftertext                  show text after match
              allaftertext               show text after captures
              allcaptures                show all captures
+             allvector                  show the entire ovector
              allusedtext                show all consulted text
              altglobal                  alternative global matching
          /g  global                     global matching
@@ -936,44 +947,47 @@ PATTERN MODIFIERS
              mark                       show mark values
              replace=<string>           specify a replacement string
              startchar                  show starting character when relevant
+             substitute_callout         use substitution callouts
              substitute_extended        use PCRE2_SUBSTITUTE_EXTENDED
+             substitute_skip=<n>        skip substitution number n
              substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+             substitute_stop=<n>        skip substitution number n and greater
              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
+       These modifiers may not appear in a #pattern command. If you want  them
        as defaults, set them in a #subject command.
 
    Specifying literal subject lines
 
-       If the subject_literal modifier is present on a pattern, all  the  sub-
+       If  the  subject_literal modifier is present on a pattern, all the sub-
        ject lines that it matches are taken as literal strings, with no inter-
-       pretation of backslashes. It is not possible to set  subject  modifiers
-       on  such  lines, but any that are set as defaults by a #subject command
+       pretation  of  backslashes. It is not possible to set subject modifiers
+       on such lines, but any that are set as defaults by a  #subject  command
        are recognized.
 
    Saving a compiled pattern
 
-       When a pattern with the 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 a command) instead of a  subject
+       When  a  pattern with the 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 a command) instead of a subject
        line. This facility is used when saving compiled patterns to a file, as
-       described in the section entitled "Saving and restoring  compiled  pat-
-       terns"  below.  If pushcopy is used instead of push, a copy of the com-
-       piled pattern is stacked, leaving the original  as  current,  ready  to
-       match  the  following  input  lines. This provides a way of testing the
-       pcre2_code_copy() function.   The  push  and  pushcopy   modifiers  are
-       incompatible  with  compilation  modifiers  such  as global that act at
-       match time. Any that are specified are ignored (for the stacked  copy),
-       with a warning message, except for replace, which causes an error. Note
-       that jitverify, which is allowed, does not carry through to any  subse-
-       quent matching that uses a stacked pattern.
+       described  in  the section entitled "Saving and restoring compiled pat-
+       terns" below.  If pushcopy is used instead of push, a copy of the  com-
+       piled  pattern  is  stacked,  leaving the original as current, ready to
+       match the following input lines. This provides a  way  of  testing  the
+       pcre2_code_copy()  function.   The push and pushcopy  modifiers are in-
+       compatible with compilation modifiers such as global that act at  match
+       time. Any that are specified are ignored (for the stacked copy), with a
+       warning message, except for replace, which causes an error.  Note  that
+       jitverify,  which  is allowed, does not carry through to any subsequent
+       matching that uses a stacked pattern.
 
    Testing foreign pattern conversion
 
-       The  experimental  foreign pattern conversion functions in PCRE2 can be
-       tested by setting the convert modifier. Its argument is  a  colon-sepa-
-       rated  list  of  options,  which  set  the  equivalent  option  for the
+       The experimental foreign pattern conversion functions in PCRE2  can  be
+       tested  by  setting the convert modifier. Its argument is a colon-sepa-
+       rated list  of  options,  which  set  the  equivalent  option  for  the
        pcre2_pattern_convert() function:
 
          glob                    PCRE2_CONVERT_GLOB
@@ -985,19 +999,19 @@ PATTERN MODIFIERS
 
        The "unset" value is useful for turning off a default that has been set
        by a #pattern command. When one of these options is set, the input pat-
-       tern is passed to pcre2_pattern_convert(). If the  conversion  is  suc-
-       cessful,  the  result  is  reflected  in  the output and then passed to
+       tern  is  passed  to pcre2_pattern_convert(). If the conversion is suc-
+       cessful, the result is reflected in  the  output  and  then  passed  to
        pcre2_compile(). The normal utf and no_utf_check options, if set, cause
-       the  PCRE2_CONVERT_UTF  and  PCRE2_CONVERT_NO_UTF_CHECK  options  to be
+       the PCRE2_CONVERT_UTF  and  PCRE2_CONVERT_NO_UTF_CHECK  options  to  be
        passed to pcre2_pattern_convert().
 
        By default, the conversion function is allowed to allocate a buffer for
-       its  output.  However, if the convert_length modifier is set to a value
-       greater than zero, pcre2test passes a buffer of the given length.  This
+       its output. However, if the convert_length modifier is set to  a  value
+       greater  than zero, pcre2test passes a buffer of the given length. This
        makes it possible to test the length check.
 
-       The  convert_glob_escape  and  convert_glob_separator  modifiers can be
-       used to specify the escape and separator characters for  glob  process-
+       The convert_glob_escape and  convert_glob_separator  modifiers  can  be
+       used  to  specify the escape and separator characters for glob process-
        ing, overriding the defaults, which are operating-system dependent.
 
 
@@ -1008,7 +1022,7 @@ SUBJECT MODIFIERS
 
    Setting match options
 
-       The   following   modifiers   set   options   for   pcre2_match()    or
+       The    following   modifiers   set   options   for   pcre2_match()   or
        pcre2_dfa_match(). See pcreapi for a description of their effects.
 
              anchored                  set PCRE2_ANCHORED
@@ -1024,39 +1038,40 @@ SUBJECT MODIFIERS
              partial_hard (or ph)      set PCRE2_PARTIAL_HARD
              partial_soft (or ps)      set PCRE2_PARTIAL_SOFT
 
-       The  partial matching modifiers are provided with abbreviations because
+       The partial matching modifiers are provided with abbreviations  because
        they appear frequently in tests.
 
-       If the posix or posix_nosub modifier was present on the pattern,  caus-
+       If  the posix or posix_nosub modifier was present on the pattern, caus-
        ing the POSIX wrapper API to be used, the only option-setting modifiers
        that have any effect are notbol, notempty, and noteol, causing REG_NOT-
-       BOL,  REG_NOTEMPTY,  and  REG_NOTEOL,  respectively,  to  be  passed to
+       BOL, REG_NOTEMPTY,  and  REG_NOTEOL,  respectively,  to  be  passed  to
        regexec(). The other modifiers are ignored, with a warning message.
 
-       There is one additional modifier that can be used with the POSIX  wrap-
+       There  is one additional modifier that can be used with the POSIX wrap-
        per. It is ignored (with a warning) if used for non-POSIX matching.
 
              posix_startend=<n>[:<m>]
 
-       This  causes  the  subject  string  to be passed to regexec() using the
-       REG_STARTEND option, which uses offsets to specify which  part  of  the
-       string  is  searched.  If  only  one number is given, the end offset is
-       passed as the end of the subject string. For more detail  of  REG_STAR-
-       TEND,  see the pcre2posix documentation. If the subject string contains
-       binary zeros (coded as escapes such as \x{00}  because  pcre2test  does
+       This causes the subject string to be  passed  to  regexec()  using  the
+       REG_STARTEND  option,  which  uses offsets to specify which part of the
+       string is searched. If only one number is  given,  the  end  offset  is
+       passed  as  the end of the subject string. For more detail of REG_STAR-
+       TEND, see the pcre2posix documentation. If the subject string  contains
+       binary  zeros  (coded  as escapes such as \x{00} because pcre2test does
        not support actual binary zeros in its input), you must use posix_star-
        tend to specify its length.
 
    Setting match controls
 
-       The following modifiers affect the matching process  or  request  addi-
-       tional  information.  Some  of  them may also be specified on a pattern
-       line (see above), in which case they apply to every subject  line  that
+       The  following  modifiers  affect the matching process or request addi-
+       tional 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.
 
              aftertext                  show text after match
              allaftertext               show text after captures
              allcaptures                show all captures
+             allvector                  show the entire ovector
              allusedtext                show all consulted text (non-JIT only)
              altglobal                  alternative global matching
              callout_capture            show captures at callout time
@@ -1086,54 +1101,61 @@ SUBJECT MODIFIERS
              replace=<string>           specify a replacement string
              startchar                  show startchar when relevant
              startoffset=<n>            same as offset=<n>
+             substitute_callout         use substitution callouts
              substitute_extedded        use PCRE2_SUBSTITUTE_EXTENDED
+             substitute_skip=<n>        skip substitution number n
              substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+             substitute_stop=<n>        skip substitution number n and greater
              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.
-       When matching via the POSIX wrapper API, the  aftertext,  allaftertext,
-       and  ovector subject modifiers work as described below. All other modi-
+       When  matching  via the POSIX wrapper API, the aftertext, allaftertext,
+       and ovector subject modifiers work as described below. All other  modi-
        fiers are either ignored, with a warning message, or cause an error.
 
    Showing more text
 
-       The aftertext modifier requests that as well as outputting the part  of
+       The  aftertext modifier requests that as well as outputting the part of
        the subject string that matched the entire pattern, pcre2test should in
        addition output the remainder of the subject string. This is useful for
        tests where the subject contains multiple copies of the same substring.
-       The allaftertext modifier requests the same action  for  captured  sub-
+       The  allaftertext  modifier  requests the same action for captured sub-
        strings as well as the main matched substring. In each case the remain-
        der is output on the following line with a plus character following the
        capture number.
 
-       The  allusedtext modifier requests that all the text that was consulted
-       during a successful pattern match by the interpreter should  be  shown.
-       This  feature  is not supported for JIT matching, and if requested with
-       JIT it is ignored (with  a  warning  message).  Setting  this  modifier
-       affects the output if there is a lookbehind at the start of a match, or
-       a lookahead at the end, or if \K is used  in  the  pattern.  Characters
-       that  precede or follow the start and end of the actual match are indi-
-       cated in the output by '<' or '>' characters underneath them.  Here  is
-       an example:
+       The allusedtext modifier requests that all the text that was  consulted
+       during  a  successful pattern match by the interpreter should be shown,
+       for both full and partial matches. This feature is  not  supported  for
+       JIT  matching,  and if requested with JIT it is ignored (with a warning
+       message). Setting this modifier affects the output if there is a  look-
+       behind  at  the start of a match, or, for a complete match, a lookahead
+       at the end, or if \K is used in the pattern. Characters that precede or
+       follow  the start and end of the actual match are indicated in the out-
+       put by '<' or '>' characters underneath them.  Here is an example:
 
            re> /(?<=pqr)abc(?=xyz)/
          data> 123pqrabcxyz456\=allusedtext
           0: pqrabcxyz
              <<<   >>>
+         data> 123pqrabcxy\=ph,allusedtext
+         Partial match: pqrabcxy
+                        <<<
 
-       This  shows  that  the  matched string is "abc", with the preceding and
-       following strings "pqr" and "xyz"  having  been  consulted  during  the
-       match (when processing the assertions).
+       The first, complete match shows that the matched string is "abc",  with
+       the  preceding  and  following strings "pqr" and "xyz" having been con-
+       sulted during the match (when processing the assertions).  The  partial
+       match can indicate only the preceding string.
 
        The  startchar  modifier  requests  that the starting character for the
        match be indicated, if it is different to  the  start  of  the  matched
        string. The only time when this occurs is when \K has been processed as
        part of the match. In this situation, the output for the matched string
        is  displayed  from  the  starting  character instead of from the match
-       point, with circumflex characters under  the  earlier  characters.  For
-       example:
+       point, with circumflex characters under the earlier characters. For ex-
+       ample:
 
            re> /abc\Kxyz/
          data> abcxyz\=startchar
@@ -1150,76 +1172,95 @@ SUBJECT MODIFIERS
        the highest one actually used in the match are output (corresponding to
        the  return  code from pcre2_match()). Groups that did not take part in
        the match are output as "<unset>". This modifier is  not  relevant  for
-       DFA  matching  (which does no capturing); it is ignored, with a warning
-       message, if present.
-
-   Testing callouts
-
-       A callout function is supplied when pcre2test calls the library  match-
-       ing  functions,  unless callout_none is specified. Its behaviour can be
-       controlled by various modifiers listed above  whose  names  begin  with
-       callout_. Details are given in the section entitled "Callouts" below.
+       DFA  matching (which does no capturing) and does not apply when replace
+       is specified; it is ignored, with a warning message, if present.
+
+   Showing the entire ovector, for all outcomes
+
+       The allvector modifier requests that the entire ovector be shown, what-
+       ever the outcome of the match. Compare allcaptures, which shows only up
+       to the maximum number of capture groups for the pattern, and then  only
+       for  a successful complete non-DFA match. This modifier, which acts af-
+       ter any match result, and also for DFA matching, provides  a  means  of
+       checking  that there are no unexpected modifications to ovector fields.
+       Before each match attempt, the ovector is filled with a special  value,
+       and  if  this  is  found  in  both  elements of a capturing pair, "<un-
+       changed>" is output. After a successful  match,  this  applies  to  all
+       groups  after the maximum capture group for the pattern. In other cases
+       it applies to the entire ovector. After a partial match, the first  two
+       elements  are  the only ones that should be set. After a DFA match, the
+       amount of ovector that is used depends on the number  of  matches  that
+       were found.
+
+   Testing pattern callouts
+
+       A  callout function is supplied when pcre2test calls the library match-
+       ing functions, unless callout_none is specified. Its behaviour  can  be
+       controlled  by  various  modifiers  listed above whose names begin with
+       callout_. Details are given in the section entitled  "Callouts"  below.
+       Testing  callouts  from  pcre2_substitute()  is  decribed separately in
+       "Testing the substitution function" below.
 
    Finding all matches in a string
 
        Searching for all possible matches within a subject can be requested by
-       the global or altglobal modifier. After finding a match,  the  matching
-       function  is  called  again to search the remainder of the subject. The
-       difference between global and altglobal is that  the  former  uses  the
-       start_offset  argument  to  pcre2_match() or pcre2_dfa_match() to start
-       searching at a new point within the entire string (which is  what  Perl
+       the  global  or altglobal modifier. After finding a match, the matching
+       function is called again to search the remainder of  the  subject.  The
+       difference  between  global  and  altglobal is that the former uses the
+       start_offset argument to pcre2_match() or  pcre2_dfa_match()  to  start
+       searching  at  a new point within the entire string (which is what Perl
        does), whereas the latter passes over a shortened subject. This makes a
        difference to the matching process if the pattern begins with a lookbe-
        hind assertion (including \b or \B).
 
-       If  an  empty  string  is  matched,  the  next  match  is done with the
+       If an empty string  is  matched,  the  next  match  is  done  with  the
        PCRE2_NOTEMPTY_ATSTART and PCRE2_ANCHORED flags set, in order to search
        for another, non-empty, match at the same point in the subject. If this
-       match fails, the start offset is advanced,  and  the  normal  match  is
-       retried.  This  imitates the way Perl handles such cases when using the
-       /g modifier or the split() function.  Normally,  the  start  offset  is
-       advanced  by  one  character,  but if the newline convention recognizes
-       CRLF as a newline, and the current character is CR followed by  LF,  an
-       advance of two characters occurs.
+       match  fails, the start offset is advanced, and the normal match is re-
+       tried. This imitates the way Perl handles such cases when using the  /g
+       modifier  or  the  split()  function. Normally, the start offset is ad-
+       vanced by one character, but if the newline convention recognizes  CRLF
+       as  a  newline,  and the current character is CR followed by LF, an ad-
+       vance of two characters occurs.
 
    Testing substring extraction functions
 
-       The  copy  and  get  modifiers  can  be  used  to  test  the pcre2_sub-
+       The copy  and  get  modifiers  can  be  used  to  test  the  pcre2_sub-
        string_copy_xxx() and pcre2_substring_get_xxx() functions.  They can be
-       given  more than once, and each can specify a group name or number, for
-       example:
+       given more than once, and each can specify a capture group name or num-
+       ber, for example:
 
           abcd\=copy=1,copy=3,get=G1
 
-       If the #subject command is used to set default copy and/or  get  lists,
-       these  can  be unset by specifying a negative number to cancel all num-
+       If  the  #subject command is used to set default copy and/or get lists,
+       these can be unset by specifying a negative number to cancel  all  num-
        bered groups and an empty name to cancel all named groups.
 
-       The getall modifier tests  pcre2_substring_list_get(),  which  extracts
+       The  getall  modifier  tests pcre2_substring_list_get(), which extracts
        all captured substrings.
 
-       If  the  subject line is successfully matched, the substrings extracted
-       by the convenience functions are output with  C,  G,  or  L  after  the
-       string  number  instead  of  a colon. This is in addition to the normal
-       full list. The string length (that is, the return from  the  extraction
+       If the subject line is successfully matched, the  substrings  extracted
+       by  the  convenience  functions  are  output  with C, G, or L after the
+       string number instead of a colon. This is in  addition  to  the  normal
+       full  list.  The string length (that is, the return from the extraction
        function) is given in parentheses after each substring, followed by the
        name when the extraction was by name.
 
    Testing the substitution function
 
-       If the replace modifier is  set,  the  pcre2_substitute()  function  is
-       called  instead of one of the matching functions. Note that replacement
-       strings cannot contain commas, because a comma signifies the end  of  a
+       If  the  replace  modifier  is  set, the pcre2_substitute() function is
+       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-
+       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
+       The  following modifiers set options (in additional to the normal match
        options) for pcre2_substitute():
 
          global                      PCRE2_SUBSTITUTE_GLOBAL
@@ -1229,8 +1270,8 @@ SUBJECT MODIFIERS
          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
+       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
@@ -1239,12 +1280,12 @@ SUBJECT MODIFIERS
              =abc=abc=\=global
           2: =xxx=xxx=
 
-       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
+       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  re-
+       placement  string  starting  at  the next character. Here is an example
        that tests the edge case:
 
          /abc/
@@ -1253,14 +1294,15 @@ 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:
+       The  default  action  of  pcre2_substitute()  is  to  return  PCRE2_ER-
+       ROR_NOMEMORY  when  the  output  buffer  is  too small. However, if the
+       PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set (by  using  the  substi-
+       tute_overflow_length  modifier),  pcre2_substitute()  continues  to  go
+       through the motions of matching and substituting  (but  not  doing  any
+       callouts),  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
@@ -1270,162 +1312,204 @@ SUBJECT MODIFIERS
        partial  matching  provokes  an  error return ("bad option value") from
        pcre2_substitute().
 
+   Testing substitute callouts
+
+       If the substitute_callout modifier is set, a substitution callout func-
+       tion  is set up. The null_context modifier must not be set, because the
+       address of the callout function is passed in a match context. When  the
+       callout  function  is  called (after each substitution), details of the
+       the input and output strings are output. For example:
+
+         /abc/g,replace=<$0>,substitute_callout
+             abcdefabcpqr
+          1(1) Old 0 3 "abc" New 0 5 "<abc>"
+          2(1) Old 6 9 "abc" New 8 13 "<abc>"
+          2: <abc>def<abc>pqr
+
+       The first number on each callout line is  the  count  of  matches.  The
+       parenthesized number is the number of pairs that are set in the ovector
+       (that is, one more than the number of capturing groups that were  set).
+       Then are listed the offsets of the old substring, its contents, and the
+       same for the replacement.
+
+       By default, the substitution callout function returns zero,  which  ac-
+       cepts  the  replacement and causes matching to continue if /g was used.
+       Two further modifiers can be used to test other return values. If  sub-
+       stitute_skip  is  set to a value greater than zero the callout function
+       returns +1 for the match of that number, and similarly  substitute_stop
+       returns  -1.  These cause the replacement to be rejected, and -1 causes
+       no further matching to take place. If either of them are  set,  substi-
+       tute_callout is assumed. For example:
+
+         /abc/g,replace=<$0>,substitute_skip=1
+             abcdefabcpqr
+          1(1) Old 0 3 "abc" New 0 5 "<abc> SKIPPED"
+          2(1) Old 6 9 "abc" New 6 11 "<abc>"
+          2: abcdef<abc>pqr
+             abcdefabcpqr\=substitute_stop=1
+          1(1) Old 0 3 "abc" New 0 5 "<abc> STOPPED"
+          1: abcdefabcpqr
+
+       If both are set for the same number, stop takes precedence. Only a sin-
+       gle skip or stop is supported, which is sufficient for testing that the
+       feature works.
+
    Setting the JIT stack size
 
-       The jitstack modifier provides a way of setting the maximum stack  size
-       that  is  used  by the just-in-time optimization code. It is ignored if
-       JIT optimization is not being used. The value is a number of  kibibytes
-       (units  of  1024  bytes). Setting zero reverts to the default of 32KiB.
+       The  jitstack modifier provides a way of setting the maximum stack size
+       that is used by the just-in-time optimization code. It  is  ignored  if
+       JIT  optimization is not being used. The value is a number of kibibytes
+       (units of 1024 bytes). Setting zero reverts to the  default  of  32KiB.
        Providing a stack that is larger than the default is necessary only for
-       very  complicated  patterns.  If  jitstack is set non-zero on a subject
+       very complicated patterns. If jitstack is set  non-zero  on  a  subject
        line it overrides any value that was set on the pattern.
 
    Setting heap, match, and depth limits
 
-       The heap_limit, match_limit, and depth_limit modifiers set  the  appro-
-       priate  limits  in the match context. These values are ignored when the
+       The  heap_limit,  match_limit, and depth_limit modifiers set the appro-
+       priate limits in the match context. These values are ignored  when  the
        find_limits modifier is specified.
 
    Finding minimum limits
 
-       If the find_limits modifier is present on  a  subject  line,  pcre2test
-       calls  the  relevant matching function several times, setting different
-       values   in   the    match    context    via    pcre2_set_heap_limit(),
-       pcre2_set_match_limit(),  or pcre2_set_depth_limit() until it finds the
-       minimum values for each parameter that allows  the  match  to  complete
+       If  the  find_limits  modifier  is present on a subject line, pcre2test
+       calls the relevant matching function several times,  setting  different
+       values    in    the    match    context   via   pcre2_set_heap_limit(),
+       pcre2_set_match_limit(), or pcre2_set_depth_limit() until it finds  the
+       minimum  values  for  each  parameter that allows the match to complete
        without error. If JIT is being used, only the match limit is relevant.
 
        When using this modifier, the pattern should not contain any limit set-
-       tings such as (*LIMIT_MATCH=...)  within  it.  If  such  a  setting  is
+       tings  such  as  (*LIMIT_MATCH=...)  within  it.  If  such a setting is
        present and is lower than the minimum matching value, the minimum value
-       cannot be found because pcre2_set_match_limit() etc. are only  able  to
+       cannot  be  found because pcre2_set_match_limit() etc. are only able to
        reduce the value of an in-pattern limit; they cannot increase it.
 
-       For  non-DFA  matching,  the minimum depth_limit number is a measure of
+       For non-DFA matching, the minimum depth_limit number is  a  measure  of
        how much nested backtracking happens (that is, how deeply the pattern's
-       tree  is  searched).  In the case of DFA matching, depth_limit controls
-       the depth of recursive calls of the internal function that is used  for
+       tree is searched). In the case of DFA  matching,  depth_limit  controls
+       the  depth of recursive calls of the internal function that is used for
        handling pattern recursion, lookaround assertions, and atomic groups.
 
        For non-DFA matching, the match_limit number is a measure of the amount
        of backtracking that takes place, and learning the minimum value can be
-       instructive.  For  most  simple matches, the number is quite small, but
-       for patterns with very large numbers of matching possibilities, it  can
-       become  large very quickly with increasing length of subject string. In
-       the case of DFA matching, match_limit  controls  the  total  number  of
+       instructive. For most simple matches, the number is  quite  small,  but
+       for  patterns with very large numbers of matching possibilities, it can
+       become large very quickly with increasing length of subject string.  In
+       the  case  of  DFA  matching,  match_limit controls the total number of
        calls, both recursive and non-recursive, to the internal matching func-
        tion, thus controlling the overall amount of computing resource that is
        used.
 
-       For  both  kinds  of  matching,  the  heap_limit  number,  which  is in
-       kibibytes (units of 1024 bytes), limits the amount of heap memory  used
+       For both  kinds  of  matching,  the  heap_limit  number,  which  is  in
+       kibibytes  (units of 1024 bytes), limits the amount of heap memory used
        for matching. A value of zero disables the use of any heap memory; many
-       simple pattern matches can be done without using the heap, so  zero  is
+       simple  pattern  matches can be done without using the heap, so zero is
        not an unreasonable setting.
 
    Showing MARK names
 
 
        The mark modifier causes the names from backtracking control verbs that
-       are returned from calls to pcre2_match() to be displayed. If a mark  is
-       returned  for a match, non-match, or partial match, pcre2test shows it.
-       For a match, it is on a line by itself, tagged with  "MK:".  Otherwise,
+       are  returned from calls to pcre2_match() to be displayed. If a mark is
+       returned for a match, non-match, or partial match, pcre2test shows  it.
+       For  a  match, it is on a line by itself, tagged with "MK:". Otherwise,
        it is added to the non-match message.
 
    Showing memory usage
 
-       The  memory modifier causes pcre2test to log the sizes of all heap mem-
-       ory  allocation  and  freeing  calls  that  occur  during  a  call   to
-       pcre2_match()  or  pcre2_dfa_match().  These  occur  only  when a match
-       requires a bigger vector than the default for remembering  backtracking
-       points  (pcre2_match())  or for internal workspace (pcre2_dfa_match()).
-       In many cases there will be no heap memory used and therefore no  addi-
+       The memory modifier causes pcre2test to log the sizes of all heap  mem-
+       ory   allocation  and  freeing  calls  that  occur  during  a  call  to
+       pcre2_match() or pcre2_dfa_match(). These occur only when a  match  re-
+       quires  a  bigger  vector than the default for remembering backtracking
+       points (pcre2_match()) or for internal  workspace  (pcre2_dfa_match()).
+       In  many cases there will be no heap memory used and therefore no addi-
        tional output. No heap memory is allocated during matching with JIT, so
-       in that case the memory modifier never has any effect. For  this  modi-
-       fier  to  work,  the  null_context modifier must not be set on both the
+       in  that  case the memory modifier never has any effect. For this modi-
+       fier to work, the null_context modifier must not be  set  on  both  the
        pattern and the subject, though it can be set on one or the other.
 
    Setting a starting offset
 
-       The offset modifier sets an offset  in  the  subject  string  at  which
+       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
+       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-
+       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
-       appears, though of course it can also be used to set  a  default  in  a
-       #subject  command. It specifies the number of pairs of offsets that are
+       The ovector modifier applies only to the subject line in which  it  ap-
+       pears, though of course it can also be used to set a default in a #sub-
+       ject command. It specifies the number of  pairs  of  offsets  that  are
        available for storing matching information. The default is 15.
 
-       A value of zero is useful when testing the POSIX API because it  causes
+       A  value of zero is useful when testing the POSIX API because it causes
        regexec() to be called with a NULL capture vector. When not testing the
-       POSIX API, a value of  zero  is  used  to  cause  pcre2_match_data_cre-
-       ate_from_pattern()  to  be  called, in order to create a match block of
+       POSIX  API,  a  value  of  zero  is used to cause pcre2_match_data_cre-
+       ate_from_pattern() to be called, in order to create a  match  block  of
        exactly the right size for the pattern. (It is not possible to create a
-       match  block  with  a zero-length ovector; there is always at least one
+       match block with a zero-length ovector; there is always  at  least  one
        pair of offsets.)
 
    Passing the subject as zero-terminated
 
        By default, the subject string is passed to a native API matching func-
        tion with its correct length. In order to test the facility for passing
-       a zero-terminated string, the zero_terminate modifier is  provided.  It
-       causes  the length to be passed as PCRE2_ZERO_TERMINATED. When matching
+       a  zero-terminated  string, the zero_terminate modifier is provided. It
+       causes the length to be passed as PCRE2_ZERO_TERMINATED. When  matching
        via the POSIX interface, this modifier is ignored, with a warning.
 
-       When testing pcre2_substitute(), this modifier also has the  effect  of
+       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.
+       Normally,  pcre2test  passes  a   context   block   to   pcre2_match(),
+       pcre2_dfa_match(),  pcre2_jit_match()  or  pcre2_substitute().   If the
+       null_context modifier is set, however, NULL  is  passed.  This  is  for
+       testing  that  the matching and substitution functions behave correctly
+       in this case (they use default values). This modifier  cannot  be  used
+       with the find_limits or substitute_callout modifiers.
 
 
 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
-       lookbehind assertion, \K, \b, or \B was involved.)
+       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_ER-
+       ROR_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
@@ -1441,8 +1525,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)/
@@ -1454,11 +1538,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
@@ -1466,8 +1550,8 @@ DEFAULT OUTPUT FROM pcre2test
           0: cat
           0+ aract
 
-       If  global  matching  is  requested, the results of successive matching
-       attempts are output in sequence, like this:
+       If global matching is requested, the results of successive matching at-
+       tempts are output in sequence, like this:
 
            re> /\Bi(\w\w)/g
          data> Mississippi
@@ -1478,8 +1562,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/
@@ -1487,7 +1571,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).
 
@@ -1495,7 +1579,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)/
@@ -1504,13 +1588,13 @@ 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
-       include characters before the actual match start if a lookbehind asser-
-       tion, \b, or \B was involved. (\K is not supported for DFA matching.)
+       Using the normal matching function on this data finds only "tang".  The
+       longest  matching string is always given first (and numbered zero). Af-
+       ter a PCRE2_ERROR_PARTIAL return, the output is "Partial match:",  fol-
+       lowed 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 assertion, \b,
+       or \B was involved. (\K is not supported for DFA matching.)
 
        If global matching is requested, the search for further matches resumes
        at the end of the longest match. For example:
@@ -1524,55 +1608,55 @@ 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$/
-         data> 23ja\=P,dfa
+         data> 23ja\=ps,dfa
          Partial match: 23ja
          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, and with JIT, though there are some
-       differences  in behaviour. The output for callouts with numerical argu-
+       differences in behaviour. The output for callouts with numerical  argu-
        ments 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
-       positions are the same, or if the current position precedes  the  start
-       position, which can happen if the callout is in a lookbehind assertion.
+       This  output  indicates  that callout number 0 occurred for a match at-
+       tempt 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  posi-
+       tions are the same, or if the current position precedes the start posi-
+       tion, which can happen if the callout is in a lookbehind assertion.
 
        Callouts numbered 255 are assumed to be automatic callouts, inserted as
        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
+       showing the callout number, the offset in the pattern,  preceded  by  a
        plus, is output. For example:
 
            re> /\d?[A-E]\*/auto_callout
@@ -1585,8 +1669,8 @@ 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
-       example:
+       ever a change of latest mark is passed to the callout function. For ex-
+       ample:
 
            re> /a(*MARK:X)bc/auto_callout
          data> abc
@@ -1599,17 +1683,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  be-
+       fore  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/
@@ -1625,26 +1709,26 @@ CALLOUTS
 
    Callout modifiers
 
-       The  callout  function in pcre2test returns zero (carry on matching) by
-       default, but you can use a callout_fail modifier in a subject  line  to
+       The callout function in pcre2test returns zero (carry on  matching)  by
+       default,  but  you can use a callout_fail modifier in a subject line to
        change this and other parameters of the callout (see below).
 
        If the callout_capture modifier is set, the current captured groups are
        output when a callout occurs. This is useful only for non-DFA matching,
-       as  pcre2_dfa_match()  does  not  support capturing, so no captures are
+       as pcre2_dfa_match() does not support capturing,  so  no  captures  are
        ever shown.
 
        The normal callout output, showing the callout number or pattern offset
-       (as  described above) is suppressed if the callout_no_where modifier is
+       (as described above) is suppressed if the callout_no_where modifier  is
        set.
 
-       When using the interpretive  matching  function  pcre2_match()  without
-       JIT,  setting  the callout_extra modifier causes additional output from
-       pcre2test's callout function to be generated. For the first callout  in
-       a  match  attempt at a new starting position in the subject, "New match
-       attempt" is output. If there has been a backtrack since the last  call-
+       When  using  the  interpretive  matching function pcre2_match() without
+       JIT, setting the callout_extra modifier causes additional  output  from
+       pcre2test's  callout function to be generated. For the first callout in
+       a match attempt at a new starting position in the subject,  "New  match
+       attempt"  is output. If there has been a backtrack since the last call-
        out (or start of matching if this is the first callout), "Backtrack" is
-       output, followed by "No other matching paths" if  the  backtrack  ended
+       output,  followed  by  "No other matching paths" if the backtrack ended
        the previous match attempt. For example:
 
           re> /(a+)b/auto_callout,no_start_optimize,no_auto_possess
@@ -1681,86 +1765,86 @@ CALLOUTS
           +1    ^    a+
          No match
 
-       Notice  that  various  optimizations must be turned off if you want all
-       possible matching paths to be  scanned.  If  no_start_optimize  is  not
-       used,  there  is an immediate "no match", without any callouts, because
-       the starting optimization fails to find "b" in the  subject,  which  it
-       knows  must  be  present for any match. If no_auto_possess is not used,
-       the "a+" item is turned into "a++", which reduces the number  of  back-
+       Notice that various optimizations must be turned off if  you  want  all
+       possible  matching  paths  to  be  scanned. If no_start_optimize is not
+       used, there is an immediate "no match", without any  callouts,  because
+       the  starting  optimization  fails to find "b" in the subject, which it
+       knows must be present for any match. If no_auto_possess  is  not  used,
+       the  "a+"  item is turned into "a++", which reduces the number of back-
        tracks.
 
-       The  callout_extra modifier has no effect if used with the DFA matching
+       The callout_extra modifier has no effect if used with the DFA  matching
        function, or with JIT.
 
    Return values from callouts
 
-       The default return from the callout  function  is  zero,  which  allows
+       The  default  return  from  the  callout function is zero, which allows
        matching to continue. The callout_fail modifier can be given one or two
        numbers. If there is only one number, 1 is returned instead of 0 (caus-
        ing matching to backtrack) when a callout of that number is reached. If
-       two numbers (<n>:<m>) are given, 1 is  returned  when  callout  <n>  is
-       reached  and  there  have been at least <m> callouts. The callout_error
+       two  numbers  (<n>:<m>)  are  given,  1 is returned when callout <n> is
+       reached and there have been at least <m>  callouts.  The  callout_error
        modifier is similar, except that PCRE2_ERROR_CALLOUT is returned, caus-
-       ing  the entire matching process to be aborted. If both these modifiers
-       are set for the same callout number,  callout_error  takes  precedence.
-       Note  that  callouts  with string arguments are always given the number
+       ing the entire matching process to be aborted. If both these  modifiers
+       are  set  for  the same callout number, callout_error takes precedence.
+       Note that callouts with string arguments are always  given  the  number
        zero.
 
-       The callout_data modifier can be given an unsigned or a  negative  num-
-       ber.   This  is  set  as the "user data" that is passed to the matching
-       function, and passed back when the callout  function  is  invoked.  Any
-       value  other  than  zero  is  used as a return from pcre2test's callout
+       The  callout_data  modifier can be given an unsigned or a negative num-
+       ber.  This is set as the "user data" that is  passed  to  the  matching
+       function,  and  passed  back  when the callout function is invoked. Any
+       value other than zero is used as  a  return  from  pcre2test's  callout
        function.
 
        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.
 
 
 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
-       characters.
+       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 is-
+       print() function is used to distinguish printing and non-printing char-
+       acters.
 
 
 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
-       tables. A single copy of the tables is included in the byte stream (its
+       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  ta-
+       bles.  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-
-       ize  documentation.  In  this  section  we  describe  the  features  of
-       pcre2test that can be used to test these functions.
+       The functions whose names begin with pcre2_serialize_ are used for  se-
+       rializing  and de-serializing. They are described in the pcre2serialize
+       documentation. In this section we describe the  features  of  pcre2test
+       that can be used to test these functions.
 
-       Note that "serialization" in PCRE2 does not convert  compiled  patterns
-       to  an  abstract  format  like Java or .NET. It just makes a reloadable
+       Note  that  "serialization" in PCRE2 does not convert compiled patterns
+       to an abstract format like Java or .NET. It  just  makes  a  reloadable
        byte code stream.  Hence the restrictions on reloading mentioned above.
 
-       In pcre2test, when a pattern with push modifier  is  successfully  com-
-       piled,  it  is  pushed onto a stack of compiled patterns, and pcre2test
-       expects the next line to contain a new pattern (or command) instead  of
+       In  pcre2test,  when  a pattern with push modifier is successfully com-
+       piled, 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 contrast, the pushcopy modifier causes a copy of the
-       compiled pattern to be stacked,  leaving  the  original  available  for
-       immediate matching. By using push and/or pushcopy, a number of patterns
-       can be compiled and retained. These  modifiers  are  incompatible  with
+       compiled  pattern to be stacked, leaving the original available for im-
+       mediate matching. By using push and/or pushcopy, a number  of  patterns
+       can  be  compiled  and  retained. These modifiers are incompatible with
        posix, and control modifiers that act at match time are ignored (with a
-       message) for the stacked patterns. The jitverify modifier applies  only
+       message)  for the stacked patterns. The jitverify modifier applies only
        at compile time.
 
        The command
@@ -1768,21 +1852,21 @@ SAVING AND RESTORING COMPILED PATTERNS
          #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,  posix_nosub,  push,  and  pushcopy  are  not
-       allowed,  nor are any option-setting modifiers.  The JIT modifiers are,
-       however permitted. Here is an example that saves and reloads  two  pat-
+       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,  posix_nosub,  push, and pushcopy are not al-
+       lowed, nor are any option-setting modifiers.  The  JIT  modifiers  are,
+       however  permitted.  Here is an example that saves and reloads two pat-
        terns.
 
          /abc/push
@@ -1795,10 +1879,10 @@ 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.
 
-       The #popcopy command is analagous to the pushcopy modifier in  that  it
+       The  #popcopy  command is analagous to the pushcopy modifier in that it
        makes current a copy of the topmost stack pattern, leaving the original
        still on the stack.
 
@@ -1818,5 +1902,5 @@ AUTHOR
 
 REVISION
 
-       Last updated: 21 July 2018
-       Copyright (c) 1997-2018 University of Cambridge.
+       Last updated: 30 July 2019
+       Copyright (c) 1997-2019 University of Cambridge.
index 877d8878fcfe11e7d9d42b28c8c40c48d5b2ce3c..10efd7d13a4a52e8c5853b932c11a8a0f542083a 100644 (file)
@@ -1,36 +1,49 @@
-.TH PCRE2UNICODE 3 "02 September 2018" "PCRE2 10.32"
+.TH PCRE2UNICODE 3 "24 May 2019" "PCRE2 10.34"
 .SH NAME
 PCRE - Perl-compatible regular expressions (revised API)
 .SH "UNICODE AND UTF SUPPORT"
 .rs
 .sp
-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 is normally built with Unicode support, though if you do not need it, you
+can build it without, in which case the library will be smaller. With Unicode
+support, PCRE2 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), but this is not the default. Unless specifically requested, PCRE2
+treats each code unit in a string as one character.
+.P
+There are two ways of telling PCRE2 to switch to UTF mode, where characters may
+consist of more than one code unit and the range of values is constrained. The
+program can call
 .\" HREF
 \fBpcre2_compile()\fP
 .\"
-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 subject
-strings that are matched against it are treated as UTF strings instead of
-strings of individual one-code-unit characters. There are also some other
-changes to the way characters are handled, as documented below.
-.P
-If you do not need Unicode support you can build PCRE2 without it, in which
-case the library will be smaller.
+with the PCRE2_UTF option, or the pattern may start with the sequence (*UTF).
+However, the latter facility can be locked out by the PCRE2_NEVER_UTF option.
+That is, the programmer can prevent the supplier of the pattern from switching
+to UTF mode.
+.P
+Note that the PCRE2_MATCH_INVALID_UTF option (see
+.\" HTML <a href="#matchinvalid">
+.\" </a>
+below)
+.\"
+forces PCRE2_UTF to be set.
+.P
+In UTF mode, both the pattern and any subject strings that are matched against
+it are treated as UTF strings instead of strings of individual one-code-unit
+characters. There are also some other changes to the way characters are
+handled, as documented below.
 .
 .
 .SH "UNICODE PROPERTY SUPPORT"
 .rs
 .sp
 When PCRE2 is built with Unicode support, the escape sequences \ep{..},
-\eP{..}, and \eX 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
+\eP{..}, and \eX can be used. This is not dependent on the PCRE2_UTF setting.
+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
 .\" HREF
 \fBpcre2pattern\fP
 .\"
@@ -54,21 +67,26 @@ also recognized; larger ones can be coded using \eo{...}.
 .P
 The escape sequence \eN{U+<hex digits>} is recognized as another way of
 specifying a Unicode character by code point in a UTF mode. It is not allowed
-in non-UTF modes.
+in non-UTF mode.
 .P
-In UTF modes, repeat quantifiers apply to complete UTF characters, not to
+In UTF mode, repeat quantifiers apply to complete UTF characters, not to
 individual code units.
 .P
-In UTF modes, the dot metacharacter matches one UTF character instead of a
+In UTF mode, the dot metacharacter matches one UTF character instead of a
 single code unit.
 .P
-The escape sequence \eC can be used to match a single code unit in a UTF mode,
+In UTF mode, capture group names are not restricted to ASCII, and may contain
+any Unicode letters and decimal digits, as well as underscore.
+.P
+The escape sequence \eC can be used to match a single code unit in UTF mode,
 but its use can lead to some strange effects because it breaks up multi-unit
 characters (see the description of \eC in the
 .\" HREF
 \fBpcre2pattern\fP
 .\"
-documentation).
+documentation). For this reason, there is a build-time option that disables
+support for \eC completely. There is also a less draconian compile-time option
+for locking out the use of \eC when a pattern is compiled.
 .P
 The use of \eC is not supported by the alternative matching function
 \fBpcre2_dfa_match()\fP when in UTF-8 or UTF-16 mode, that is, when a character
@@ -76,7 +94,7 @@ may consist of more than one code unit. The use of \eC in these modes provokes
 a match-time error. Also, the JIT optimization does not support \eC in these
 modes. If JIT optimization is requested for a UTF-8 or UTF-16 pattern that
 contains \eC, it will not succeed, and so when \fBpcre2_match()\fP is called,
-the matching will be carried out by the normal interpretive function.
+the matching will be carried out by the 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
@@ -108,37 +126,159 @@ However, the special horizontal and vertical white space matching escapes (\eh,
 not PCRE2_UCP is set.
 .
 .
-.SH "CASE-EQUIVALENCE IN UTF MODES"
+.SH "CASE-EQUIVALENCE IN UTF MODE"
 .rs
 .sp
-Case-insensitive matching in UTF mode makes use of Unicode properties except
+Case-insensitive matching in UTF mode makes use of Unicode properties except
 for characters whose code points are less than 128 and that have at most two
 case-equivalent values. For these, a direct table lookup is used for speed. A
 few Unicode characters such as Greek sigma have more than two code points that
-are case-equivalent, and these are treated as such.
+are case-equivalent, and these are treated specially.
+.
+.
+.\" HTML <a name="scriptruns"></a>
+.SH "SCRIPT RUNS"
+.rs
+.sp
+The pattern constructs (*script_run:...) and (*atomic_script_run:...), with
+synonyms (*sr:...) and (*asr:...), verify that the string matched within the
+parentheses is a script run. In concept, a script run is a sequence of
+characters that are all from the same Unicode script. However, because some
+scripts are commonly used together, and because some diacritical and other
+marks are used with multiple scripts, it is not that simple.
+.P
+Every Unicode character has a Script property, mostly with a value
+corresponding to the name of a script, such as Latin, Greek, or Cyrillic. There
+are also three special values:
+.P
+"Unknown" is used for code points that have not been assigned, and also for the
+surrogate code points. In the PCRE2 32-bit library, characters whose code
+points are greater than the Unicode maximum (U+10FFFF), which are accessible
+only in non-UTF mode, are assigned the Unknown script.
+.P
+"Common" is used for characters that are used with many scripts. These include
+punctuation, emoji, mathematical, musical, and currency symbols, and the ASCII
+digits 0 to 9.
+.P
+"Inherited" is used for characters such as diacritical marks that modify a
+previous character. These are considered to take on the script of the character
+that they modify.
+.P
+Some Inherited characters are used with many scripts, but many of them are only
+normally used with a small number of scripts. For example, U+102E0 (Coptic
+Epact thousands mark) is used only with Arabic and Coptic. In order to make it
+possible to check this, a Unicode property called Script Extension exists. Its
+value is a list of scripts that apply to the character. For the majority of
+characters, the list contains just one script, the same one as the Script
+property. However, for characters such as U+102E0 more than one Script is
+listed. There are also some Common characters that have a single, non-Common
+script in their Script Extension list.
+.P
+The next section describes the basic rules for deciding whether a given string
+of characters is a script run. Note, however, that there are some special cases
+involving the Chinese Han script, and an additional constraint for decimal
+digits. These are covered in subsequent sections.
+.
+.
+.SS "Basic script run rules"
+.rs
+.sp
+A string that is less than two characters long is a script run. This is the
+only case in which an Unknown character can be part of a script run. Longer
+strings are checked using only the Script Extensions property, not the basic
+Script property.
+.P
+If a character's Script Extension property is the single value "Inherited", it
+is always accepted as part of a script run. This is also true for the property
+"Common", subject to the checking of decimal digits described below. All the
+remaining characters in a script run must have at least one script in common in
+their Script Extension lists. In set-theoretic terminology, the intersection of
+all the sets of scripts must not be empty.
+.P
+A simple example is an Internet name such as "google.com". The letters are all
+in the Latin script, and the dot is Common, so this string is a script run.
+However, the Cyrillic letter "o" looks exactly the same as the Latin "o"; a
+string that looks the same, but with Cyrillic "o"s is not a script run.
+.P
+More interesting examples involve characters with more than one script in their
+Script Extension. Consider the following characters:
+.sp
+  U+060C  Arabic comma
+  U+06D4  Arabic full stop
+.sp
+The first has the Script Extension list Arabic, Hanifi Rohingya, Syriac, and
+Thaana; the second has just Arabic and Hanifi Rohingya. Both of them could
+appear in script runs of either Arabic or Hanifi Rohingya. The first could also
+appear in Syriac or Thaana script runs, but the second could not.
+.
+.
+.SS "The Chinese Han script"
+.rs
+.sp
+The Chinese Han script is commonly used in conjunction with other scripts for
+writing certain languages. Japanese uses the Hiragana and Katakana scripts
+together with Han; Korean uses Hangul and Han; Taiwanese Mandarin uses Bopomofo
+and Han. These three combinations are treated as special cases when checking
+script runs and are, in effect, "virtual scripts". Thus, a script run may
+contain a mixture of Hiragana, Katakana, and Han, or a mixture of Hangul and
+Han, or a mixture of Bopomofo and Han, but not, for example, a mixture of
+Hangul and Bopomofo and Han. PCRE2 (like Perl) follows Unicode's Technical
+Standard 39 ("Unicode Security Mechanisms", http://unicode.org/reports/tr39/)
+in allowing such mixtures.
+.
+.
+.SS "Decimal digits"
+.rs
+.sp
+Unicode contains many sets of 10 decimal digits in different scripts, and some
+scripts (including the Common script) contain more than one set. Some of these
+decimal digits them are visually indistinguishable from the common ASCII
+digits. In addition to the script checking described above, if a script run
+contains any decimal digits, they must all come from the same set of 10
+adjacent characters.
 .
 .
 .SH "VALIDITY OF UTF STRINGS"
 .rs
 .sp
 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 \fBpcre2_get_startchar()\fP, which is used for this
-purpose after a UTF error.
+are (by default) checked for validity on entry to the relevant functions. If an
+invalid UTF string is passed, a negative error code is returned. The code unit
+offset to the offending character can be extracted from the match data block by
+calling \fBpcre2_get_startchar()\fP, which is used for this purpose after a UTF
+error.
+.P
+In some situations, you may already know that your strings are valid, and
+therefore want to skip these checks in order to improve performance, 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 compile time or at match time,
+PCRE2 assumes that the pattern or subject it is given (respectively) contains
+only valid UTF code unit sequences.
+.P
+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 or give incorrect
+results. There is, however, one mode of matching that can handle invalid UTF
+subject strings. This is enabled by passing PCRE2_MATCH_INVALID_UTF to
+\fBpcre2_compile()\fP and is discussed below in the next section. The rest of
+this section covers the case when PCRE2_MATCH_INVALID_UTF is not set.
+.P
+Passing PCRE2_NO_UTF_CHECK to \fBpcre2_compile()\fP just disables the UTF 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 same option to
+\fBpcre2_match()\fP or \fBpcre2_dfa_match()\fP.
 .P
 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
-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
+Unless PCRE2_NO_UTF_CHECK is set, 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.
@@ -155,28 +295,12 @@ 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.)
 .P
-In some situations, you may already know that your strings are valid, and
-therefore want to skip these checks in order to improve performance, 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 compile time or at match time,
-PCRE2 assumes that the pattern or subject it is given (respectively) contains
-only valid UTF code unit sequences.
-.P
-Passing PCRE2_NO_UTF_CHECK to \fBpcre2_compile()\fP 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 \fBpcre2_match()\fP
-or \fBpcre2_dfa_match()\fP.
-.P
-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.
-.P
-Note that setting PCRE2_NO_UTF_CHECK at compile time does not disable the error
-that is given if an escape sequence for an invalid Unicode code point is
-encountered in the pattern. If you want to allow escape sequences such as
-\ex{d800} (a surrogate code point) you can set the
-PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES extra option. However, this is possible
-only in UTF-8 and UTF-32 modes, because these values are not representable in
-UTF-16.
+Setting PCRE2_NO_UTF_CHECK at compile time does not disable the error that is
+given if an escape sequence for an invalid Unicode code point is encountered in
+the pattern. If you want to allow escape sequences such as \ex{d800} (a
+surrogate code point) you can set the PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES extra
+option. However, this is possible only in UTF-8 and UTF-32 modes, because these
+values are not representable in UTF-16.
 .
 .
 .\" HTML <a name="utf8strings"></a>
@@ -215,7 +339,7 @@ these code points are excluded by RFC 3629.
 .sp
   PCRE2_ERROR_UTF8_ERR13
 .sp
-A 4-byte character has a value greater than 0x10fff; these code points are
+A 4-byte character has a value greater than 0x10ffff; these code points are
 excluded by RFC 3629.
 .sp
   PCRE2_ERROR_UTF8_ERR14
@@ -271,6 +395,52 @@ The following negative error codes are given for invalid UTF-32 strings:
 .sp
 .
 .
+.\" HTML <a name="matchinvalid"></a>
+.SH "MATCHING IN INVALID UTF STRINGS"
+.rs
+.sp
+You can run pattern matches on subject strings that may contain invalid UTF
+sequences if you call \fBpcre2_compile()\fP with the PCRE2_MATCH_INVALID_UTF
+option. This is supported by \fBpcre2_match()\fP, including JIT matching, but
+not by \fBpcre2_dfa_match()\fP. When PCRE2_MATCH_INVALID_UTF is set, it forces
+PCRE2_UTF to be set as well. Note, however, that the pattern itself must be a
+valid UTF string.
+.P
+Setting PCRE2_MATCH_INVALID_UTF does not affect what \fBpcre2_compile()\fP
+generates, but if \fBpcre2_jit_compile()\fP is subsequently called, it does
+generate different code. If JIT is not used, the option affects the behaviour
+of the interpretive code in \fBpcre2_match()\fP. When PCRE2_MATCH_INVALID_UTF
+is set at compile time, PCRE2_NO_UTF_CHECK is ignored at match time.
+.P
+In this mode, an invalid code unit sequence in the subject never matches any
+pattern item. It does not match dot, it does not match \ep{Any}, it does not
+even match negative items such as [^X]. A lookbehind assertion fails if it
+encounters an invalid sequence while moving the current point backwards. In
+other words, an invalid UTF code unit sequence acts as a barrier which no match
+can cross.
+.P
+You can also think of this as the subject being split up into fragments of
+valid UTF, delimited internally by invalid code unit sequences. The pattern is
+matched fragment by fragment. The result of a successful match, however, is
+given as code unit offsets in the entire subject string in the usual way. There
+are a few points to consider:
+.P
+The internal boundaries are not interpreted as the beginnings or ends of lines
+and so do not match circumflex or dollar characters in the pattern.
+.P
+If \fBpcre2_match()\fP is called with an offset that points to an invalid
+UTF-sequence, that sequence is skipped, and the match starts at the next valid
+UTF character, or the end of the subject.
+.P
+At internal fragment boundaries, \eb and \eB behave in the same way as at the
+beginning and end of the subject. For example, a sequence such as \ebWORD\eb
+would match an instance of WORD that is surrounded by invalid UTF code units.
+.P
+Using PCRE2_MATCH_INVALID_UTF, an application can run matches on arbitrary
+data, knowing that any matched strings that are returned are valid UTF. This
+can be useful when searching for UTF text in executable or other binary files.
+.
+.
 .SH AUTHOR
 .rs
 .sp
@@ -285,6 +455,6 @@ Cambridge, England.
 .rs
 .sp
 .nf
-Last updated: 02 September 2018
-Copyright (c) 1997-2018 University of Cambridge.
+Last updated: 24 May 2019
+Copyright (c) 1997-2019 University of Cambridge.
 .fi
index 0360b79e7d020a2059f5127a03cd14269969bde9..8175c640fe6288a75cc846567ea5506086f326f4 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-11.20; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -271,15 +271,18 @@ do
     fi
     dst=$dst_arg
 
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
+    # If destination is a directory, append the input filename.
     if test -d "$dst"; then
       if test "$is_target_a_directory" = never; then
         echo "$0: $dst_arg: Is a directory" >&2
         exit 1
       fi
       dstdir=$dst
-      dst=$dstdir/`basename "$src"`
+      dstbase=`basename "$src"`
+      case $dst in
+       */) dst=$dst$dstbase;;
+       *)  dst=$dst/$dstbase;;
+      esac
       dstdir_status=0
     else
       dstdir=`dirname "$dst"`
@@ -288,6 +291,11 @@ do
     fi
   fi
 
+  case $dstdir in
+    */) dstdirslash=$dstdir;;
+    *)  dstdirslash=$dstdir/;;
+  esac
+
   obsolete_mkdir_used=false
 
   if test $dstdir_status != 0; then
@@ -324,34 +332,43 @@ do
             # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
             ;;
           *)
+            # Note that $RANDOM variable is not portable (e.g. dash);  Use it
+            # here however when possible just to lower collision chance.
             tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
 
+            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            # Because "mkdir -p" follows existing symlinks and we likely work
+            # directly in world-writeable /tmp, make sure that the '$tmpdir'
+            # directory is successfully created first before we actually test
+            # 'mkdir -p' feature.
             if (umask $mkdir_umask &&
-                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+                $mkdirprog $mkdir_mode "$tmpdir" &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
             then
               if test -z "$dir_arg" || {
                    # Check for POSIX incompatibilities with -m.
                    # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                    # other-writable bit of parent directory when it shouldn't.
                    # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                   test_tmpdir="$tmpdir/a"
+                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
                    case $ls_ld_tmpdir in
                      d????-?r-*) different_mode=700;;
                      d????-?--*) different_mode=755;;
                      *) false;;
                    esac &&
-                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
                      test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                    }
                  }
               then posix_mkdir=:
               fi
-              rmdir "$tmpdir/d" "$tmpdir"
+              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
             else
               # Remove any dirs left behind by ancient mkdir implementations.
-              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
             fi
             trap '' 0;;
         esac;;
@@ -427,8 +444,8 @@ do
   else
 
     # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
+    dsttmp=${dstdirslash}_inst.$$_
+    rmtmp=${dstdirslash}_rm.$$_
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
@@ -493,7 +510,7 @@ do
 done
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 857338fef373601d4ead0729b18d89a9dbc4a0ba..d3ab94d6f4bc67c430343cfd0548fe138a17a45c 100644 (file)
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,12 +1,12 @@
 #! /bin/sh
 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
-##               by inline-source v2016-02-21.11
+##               by inline-source v2018-07-24.06
 
-# libtool (GNU libtool) 2.4.6.40-6ca5-dirty
+# libtool (GNU libtool) 2.4.6.42-b88ce
 # Provide generalized library-building support services.
 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -31,8 +31,8 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4.6.40-6ca5-dirty
-package_revision=2.4.6.40
+VERSION=2.4.6.42-b88ce
+package_revision=2.4.6.42
 
 
 ## ------ ##
@@ -64,7 +64,7 @@ package_revision=2.4.6.40
 # libraries, which are installed to $pkgauxdir.
 
 # Set a version string for this script.
-scriptversion=2017-04-19.12; # UTC
+scriptversion=2018-07-24.06; # UTC
 
 # General shell script boiler plate, and helper functions.
 # Written by Gary V. Vaughan, 2004
@@ -72,7 +72,7 @@ scriptversion=2017-04-19.12; # UTC
 # This is free software.  There is NO warranty; not even for
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# Copyright (C) 2004-2017 Bootstrap Authors
+# Copyright (C) 2004-2018 Bootstrap Authors
 #
 # This file is dual licensed under the terms of the MIT license
 # <https://opensource.org/license/MIT>, and GPL version 3 or later
@@ -1497,7 +1497,7 @@ func_lt_ver ()
 # This is free software.  There is NO warranty; not even for
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# Copyright (C) 2010-2017 Bootstrap Authors
+# Copyright (C) 2010-2018 Bootstrap Authors
 #
 # This file is dual licensed under the terms of the MIT license
 # <https://opensource.org/license/MIT>, and GPL version 3 or later
@@ -1510,7 +1510,7 @@ func_lt_ver ()
 # <https://github.com/gnulib-modules/bootstrap/issues>
 
 # Set a version string for this script.
-scriptversion=2016-03-06.01; # UTC
+scriptversion=2018-07-24.06; # UTC
 
 
 ## ------ ##
@@ -2171,12 +2171,12 @@ func_version ()
 # mode: shell-script
 # sh-indentation: 2
 # eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
 # time-stamp-time-zone: "UTC"
 # End:
 
 # Set a version string.
-scriptversion='(GNU libtool) 2.4.6.40-6ca5-dirty'
+scriptversion='(GNU libtool) 2.4.6.42-b88ce'
 
 
 # func_echo ARG...
@@ -2267,7 +2267,7 @@ include the following information:
        compiler:       $LTCC
        compiler flags: $LTCFLAGS
        linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname (GNU libtool) 2.4.6.40-6ca5-dirty
+       version:        $progname (GNU libtool) 2.4.6.42-b88ce
        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
 
index 597c6042bd162dd0975071d763426ff7b6ae44f7..b55a6e57f2a19603f304dcd5a95b65c7896de27d 100644 (file)
@@ -1,6 +1,6 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
-#   Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc.
+#   Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -219,8 +219,8 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
+# All known linkers require a '.a' archive for static linking (except MSVC and
+# ICC, which need '.lib').
 libext=a
 
 with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -2587,8 +2587,8 @@ m4_if([$1], [],[
     dynamic_linker='Win32 ld.exe'
     ;;
 
-  *,cl*)
-    # Native MSVC
+  *,cl* | *,icl*)
+    # Native MSVC or ICC
     libname_spec='$name'
     soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
     library_names_spec='$libname.dll.lib'
@@ -2644,7 +2644,7 @@ m4_if([$1], [],[
     ;;
 
   *)
-    # Assume MSVC wrapper
+    # Assume MSVC and ICC wrapper
     library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
@@ -4032,7 +4032,7 @@ for ac_symprfx in "" "_"; do
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
     # Fake it for dumpbin and say T for any non-static function,
     # D for any global variable and I for any imported variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
+    # Also find C++ and __fastcall symbols from MSVC++ or ICC,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
@@ -4949,7 +4949,7 @@ m4_if([$1], [CXX], [
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
-    cl*)
+    cl* | icl*)
       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
       ;;
     *)
@@ -5006,15 +5006,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
 
   case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
+    # Microsoft Visual C++ or Intel C++ Compiler.
     if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
   interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
     with_gnu_ld=yes
     ;;
   openbsd* | bitrig*)
@@ -5579,12 +5579,12 @@ _LT_EOF
 
     cygwin* | mingw* | pw32* | cegcc*)
       # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
+      # Microsoft Visual C++ or Intel C++ Compiler.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
       case $cc_basename in
-      cl*)
-       # Native MSVC
+      cl* | icl*)
+       # Native MSVC or ICC
        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
        _LT_TAGVAR(always_export_symbols, $1)=yes
@@ -5625,7 +5625,7 @@ _LT_EOF
           fi'
        ;;
       *)
-       # Assume MSVC wrapper
+       # Assume MSVC and ICC wrapper
        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
        # Tell ltmain to make .lib files, not .a files.
@@ -6655,8 +6655,8 @@ if test yes != "$_lt_caught_CXX_error"; then
 
       cygwin* | mingw* | pw32* | cegcc*)
        case $GXX,$cc_basename in
-       ,cl* | no,cl*)
-         # Native MSVC
+       ,cl* | no,cl* | ,icl* | no,icl*)
+         # Native MSVC or ICC
          # hardcode_libdir_flag_spec is actually meaningless, as there is
          # no search path for DLLs.
          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
index 621bd18b2f3e41f5390236ce7df031f2c5fbc2e3..07421d929ef087cbc43078ced90a5816c7b0a3e0 100644 (file)
@@ -1,6 +1,6 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004-2005, 2007-2009, 2011-2017 Free Software
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software
 #   Foundation, Inc.
 #   Written by Gary V. Vaughan, 2004
 #
index ab69a6b96b0750673eabc5cacfc8ed5a9e53c6da..3985c5683a7d8503b5a5397b0983fad7ca5df0be 100644 (file)
@@ -1,6 +1,6 @@
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 #
-# Copyright (C) 2004-2005, 2007-2008, 2011-2017 Free Software
+# Copyright (C) 2004-2005, 2007-2008, 2011-2018 Free Software
 # Foundation, Inc.
 # Written by Gary V. Vaughan, 2004
 #
index 8250ea47cf7952e078432c9a8aa50a468e76b50f..86b2ad72358db0e8c4921ebce8d277eaf28be114 100644 (file)
@@ -1,6 +1,6 @@
 # ltversion.m4 -- version numbers                      -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2011-2017 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2011-2018 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 4219 ltversion.m4
+# serial 4221 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4.6.40-6ca5-dirty])
-m4_define([LT_PACKAGE_REVISION], [2.4.6.40])
+m4_define([LT_PACKAGE_VERSION], [2.4.6.42-b88ce])
+m4_define([LT_PACKAGE_REVISION], [2.4.6.42])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.6.40-6ca5-dirty'
-macro_revision='2.4.6.40'
+[macro_version='2.4.6.42-b88ce'
+macro_revision='2.4.6.42'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
index 9919d4de5e8b6c596ba190674c6e9f8b525c1c0c..54ea1c421c9d013611c1a86eb755f1d250305446 100644 (file)
@@ -1,6 +1,6 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004-2005, 2007, 2009, 2011-2017 Free Software
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2018 Free Software
 #   Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
diff --git a/missing b/missing
index c6e379584baf766f931c6ec18292a2c3dbe0eb90..625aeb11897a2221d5cda1d55b6866d61d21f660 100755 (executable)
--- a/missing
+++ b/missing
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
 # 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/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@ else
   exit $st
 fi
 
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
 
 program_details ()
 {
@@ -207,7 +207,7 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
 exit $st
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 5e6c466bfb51236f86051a88071cdea60d285ff9..8368781767d49d7ff4b85384f79ec076d93b2f12 100755 (executable)
@@ -1,8 +1,10 @@
 #! /bin/sh
 
 # Script for testing regular expressions with perl to check that PCRE2 handles
-# them the same. If the first argument to this script is "-w", Perl is also
-# called with "-w", which turns on its warning mode.
+# them the same. For testing with different versions of Perl, if the first
+# argument is -perl then the second is taken as the Perl command to use, and
+# both are then removed. If the next argument is "-w", Perl is called with
+# "-w", which turns on its warning mode.
 #
 # The Perl code has to have "use utf8" and "require Encode" at the start when
 # running UTF-8 tests, but *not* for non-utf8 tests. (The "require" would
@@ -10,8 +12,8 @@
 # the script will always run for these tests.)
 #
 # The desired effect is achieved by making this a shell script that passes the
-# Perl script to Perl through a pipe. If the first argument (possibly after
-# removing "-w") is "-utf8", a suitable prefix is set up.
+# Perl script to Perl through a pipe. If the next argument is "-utf8", a
+# suitable prefix is set up.
 #
 # The remaining arguments, if any, are passed to Perl. They are an input file
 # and an output file. If there is one argument, the output is written to
@@ -23,6 +25,12 @@ perl=perl
 perlarg=''
 prefix=''
 
+if [ $# -gt 1 -a "$1" = "-perl" ] ; then
+  shift
+  perl=$1
+  shift
+fi
+
 if [ $# -gt 0 -a "$1" = "-w" ] ; then
   perlarg="-w"
   shift
@@ -75,6 +83,11 @@ fi
 
 (echo "$prefix" ; cat <<'PERLEND'
 
+# The alpha assertions currently give warnings even when -w is not specified.
+
+no warnings "experimental::alpha_assertions";
+no warnings "experimental::script_run";
+
 # Function for turning a string into a string of printing chars.
 
 sub pchars {
@@ -127,7 +140,10 @@ if (@ARGV > 1)
   }
 else { $outfile = "STDOUT"; }
 
-printf($outfile "Perl $] Regular Expressions\n\n");
+printf($outfile "Perl $^V\n\n");
+
+$extra_modifiers = "";
+$default_show_mark = 0;
 
 # Main loop
 
@@ -370,7 +386,10 @@ for (;;)
     }
   }
 
-# printf $outfile "\n";
+# By closing OUTFILE explicitly, we avoid a Perl warning in -w mode
+# "main::OUTFILE" used only once".
+
+close(OUTFILE) if $outfile eq "OUTFILE";
 
 PERLEND
 ) | $perl $perlarg - $@
index 89a52ef8485122cdec5c885934d7cdb8794c695e..787bb9c99989a71edd178047c9d84a2e26ac66bf 100644 (file)
@@ -35,6 +35,10 @@ sure both macros are undefined; an emulation function will then be used. */
    */
 /* #undef BSR_ANYCRLF */
 
+/* Define to any value to disable the use of the z and t modifiers in
+   formatting settings such as %zu or %td (this is rarely needed). */
+/* #undef DISABLE_PERCENT_ZT */
+
 /* If you are compiling for a system that uses EBCDIC instead of ASCII
    character codes, define this macro to any value. When EBCDIC is set, PCRE2
    assumes that all input strings are in EBCDIC. If you do not define this
@@ -214,7 +218,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.32"
+#define PACKAGE_STRING "PCRE2 10.34"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "pcre2"
@@ -223,7 +227,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.32"
+#define PACKAGE_VERSION "10.34"
 
 /* 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
@@ -299,6 +303,11 @@ sure both macros are undefined; an emulation function will then be used. */
 /* Define to any value to enable callout script support in pcre2grep. */
 /* #undef SUPPORT_PCRE2GREP_CALLOUT */
 
+/* Define to any value to enable fork support in pcre2grep callout scripts.
+   This will have no effect unless SUPPORT_PCRE2GREP_CALLOUT is also defined.
+   */
+/* #undef SUPPORT_PCRE2GREP_CALLOUT_FORK */
+
 /* Define to any value to enable JIT support in pcre2grep. Note that this will
    have no effect unless SUPPORT_JIT is also defined. */
 /* #undef SUPPORT_PCRE2GREP_JIT */
@@ -343,7 +352,7 @@ sure both macros are undefined; an emulation function will then be used. */
 #endif
 
 /* Version number of package */
-#define VERSION "10.32"
+#define VERSION "10.34"
 
 /* Define to 1 if on MINIX. */
 /* #undef _MINIX */
index d8a5280f51443544bd84fef9e78317defb77a8f6..6b8eb7e945dfb9423682dabbc487a2891df86873 100644 (file)
@@ -35,6 +35,10 @@ sure both macros are undefined; an emulation function will then be used. */
    */
 #undef BSR_ANYCRLF
 
+/* Define to any value to disable the use of the z and t modifiers in
+   formatting settings such as %zu or %td (this is rarely needed). */
+#undef DISABLE_PERCENT_ZT
+
 /* If you are compiling for a system that uses EBCDIC instead of ASCII
    character codes, define this macro to any value. When EBCDIC is set, PCRE2
    assumes that all input strings are in EBCDIC. If you do not define this
@@ -286,6 +290,11 @@ sure both macros are undefined; an emulation function will then be used. */
 /* Define to any value to enable callout script support in pcre2grep. */
 #undef SUPPORT_PCRE2GREP_CALLOUT
 
+/* Define to any value to enable fork support in pcre2grep callout scripts.
+   This will have no effect unless SUPPORT_PCRE2GREP_CALLOUT is also defined.
+   */
+#undef SUPPORT_PCRE2GREP_CALLOUT_FORK
+
 /* Define to any value to enable JIT support in pcre2grep. Note that this will
    have no effect unless SUPPORT_JIT is also defined. */
 #undef SUPPORT_PCRE2GREP_JIT
index c0af36252a81303f49e5f86a169d2be958be9478..02796cc62ae5ec1bc658a75f05daf5c589dc6301 100644 (file)
@@ -183,10 +183,10 @@ fprintf(f,
   "/* This table identifies various classes of character by individual bits:\n"
   "  0x%02x   white space character\n"
   "  0x%02x   letter\n"
+  "  0x%02x   lower case letter\n"
   "  0x%02x   decimal digit\n"
-  "  0x%02x   hexadecimal digit\n"
   "  0x%02x   alphanumeric or '_'\n*/\n\n",
-  ctype_space, ctype_letter, ctype_digit, ctype_xdigit, ctype_word);
+  ctype_space, ctype_letter, ctype_lcletter, ctype_digit, ctype_word);
 
 fprintf(f, "  ");
 for (i = 0; i < 256; i++)
index 3d2feb7a6bdb9d2b002be4a316d227834b347eaa..cb9d61a35b14efb848c8a03c7d55c0ab143190c7 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) 2016-2018 University of Cambridge
+           Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -42,15 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
 /* The current PCRE version information. */
 
 #define PCRE2_MAJOR           10
-#define PCRE2_MINOR           32
+#define PCRE2_MINOR           34
 #define PCRE2_PRERELEASE      
-#define PCRE2_DATE            2018-09-10
-
-/* For the benefit of systems without stdint.h, an alternative is to use
-inttypes.h. The existence of these headers is checked by configure or CMake. */
-
-#define PCRE2_HAVE_STDINT_H   1
-#define PCRE2_HAVE_INTTYPES_H 1
+#define PCRE2_DATE            2019-11-21
 
 /* 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
@@ -87,18 +81,15 @@ set, we ensure here that it has no effect. */
 #define PCRE2_CALL_CONVENTION
 #endif
 
-/* Have to include limits.h, stdlib.h and stdint.h (or inttypes.h) to ensure
-that size_t and uint8_t, UCHAR_MAX, etc are defined. If the system has neither
-header, the relevant values must be provided by some other means. */
+/* Have to include limits.h, stdlib.h, and inttypes.h to ensure that size_t and
+uint8_t, UCHAR_MAX, etc are defined. Some systems that do have inttypes.h do
+not have stdint.h, which is why we use inttypes.h, which according to the C
+standard is a superset of stdint.h. If none of these headers are available,
+the relevant values must be provided by some other means. */
 
 #include <limits.h>
 #include <stdlib.h>
-
-#if PCRE2_HAVE_STDINT_H
-#include <stdint.h>
-#elif PCRE2_HAVE_INTTYPES_H
 #include <inttypes.h>
-#endif
 
 /* Allow for C++ users compiling this directly. */
 
@@ -151,6 +142,7 @@ D   is inspected during pcre2_dfa_match() execution
 #define PCRE2_USE_OFFSET_LIMIT    0x00800000u  /*   J M D */
 #define PCRE2_EXTENDED_MORE       0x01000000u  /* C       */
 #define PCRE2_LITERAL             0x02000000u  /* C       */
+#define PCRE2_MATCH_INVALID_UTF   0x04000000u  /*   J M D */
 
 /* An additional compile options word is available in the compile context. */
 
@@ -158,43 +150,37 @@ D   is inspected during pcre2_dfa_match() execution
 #define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL    0x00000002u  /* C */
 #define PCRE2_EXTRA_MATCH_WORD               0x00000004u  /* C */
 #define PCRE2_EXTRA_MATCH_LINE               0x00000008u  /* C */
+#define PCRE2_EXTRA_ESCAPED_CR_IS_LF         0x00000010u  /* C */
+#define PCRE2_EXTRA_ALT_BSUX                 0x00000020u  /* C */
 
 /* These are for pcre2_jit_compile(). */
 
 #define PCRE2_JIT_COMPLETE        0x00000001u  /* For full matching */
 #define PCRE2_JIT_PARTIAL_SOFT    0x00000002u
 #define PCRE2_JIT_PARTIAL_HARD    0x00000004u
-
-/* These are for pcre2_match(), pcre2_dfa_match(), and pcre2_jit_match(). Note
-that PCRE2_ANCHORED and PCRE2_NO_UTF_CHECK can also be passed to these
-functions (though pcre2_jit_match() ignores the latter since it bypasses all
-sanity checks). */
-
-#define PCRE2_NOTBOL              0x00000001u
-#define PCRE2_NOTEOL              0x00000002u
-#define PCRE2_NOTEMPTY            0x00000004u  /* ) These two must be kept */
-#define PCRE2_NOTEMPTY_ATSTART    0x00000008u  /* ) adjacent to each other. */
-#define PCRE2_PARTIAL_SOFT        0x00000010u
-#define PCRE2_PARTIAL_HARD        0x00000020u
-
-/* These are additional options for pcre2_dfa_match(). */
-
-#define PCRE2_DFA_RESTART         0x00000040u
-#define PCRE2_DFA_SHORTEST        0x00000080u
-
-/* These are additional options for pcre2_substitute(), which passes any others
-through to pcre2_match(). */
-
-#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
-
-/* A further option for pcre2_match(), not allowed for pcre2_dfa_match(),
-ignored for pcre2_jit_match(). */
-
-#define PCRE2_NO_JIT              0x00002000u
+#define PCRE2_JIT_INVALID_UTF     0x00000100u
+
+/* These are for pcre2_match(), pcre2_dfa_match(), pcre2_jit_match(), and
+pcre2_substitute(). Some are allowed only for one of the functions, and in
+these cases it is noted below. Note that PCRE2_ANCHORED, PCRE2_ENDANCHORED and
+PCRE2_NO_UTF_CHECK can also be passed to these functions (though
+pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */
+
+#define PCRE2_NOTBOL                      0x00000001u
+#define PCRE2_NOTEOL                      0x00000002u
+#define PCRE2_NOTEMPTY                    0x00000004u  /* ) These two must be kept */
+#define PCRE2_NOTEMPTY_ATSTART            0x00000008u  /* ) adjacent to each other. */
+#define PCRE2_PARTIAL_SOFT                0x00000010u
+#define PCRE2_PARTIAL_HARD                0x00000020u
+#define PCRE2_DFA_RESTART                 0x00000040u  /* pcre2_dfa_match() only */
+#define PCRE2_DFA_SHORTEST                0x00000080u  /* pcre2_dfa_match() only */
+#define PCRE2_SUBSTITUTE_GLOBAL           0x00000100u  /* pcre2_substitute() only */
+#define PCRE2_SUBSTITUTE_EXTENDED         0x00000200u  /* pcre2_substitute() only */
+#define PCRE2_SUBSTITUTE_UNSET_EMPTY      0x00000400u  /* pcre2_substitute() only */
+#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET    0x00000800u  /* pcre2_substitute() only */
+#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH  0x00001000u  /* pcre2_substitute() only */
+#define PCRE2_NO_JIT                      0x00002000u  /* Not for pcre2_dfa_match() */
+#define PCRE2_COPY_MATCHED_SUBJECT        0x00004000u
 
 /* Options for pcre2_pattern_convert(). */
 
@@ -318,6 +304,10 @@ pcre2_pattern_convert(). */
 #define PCRE2_ERROR_BAD_LITERAL_OPTIONS            192
 #define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE      193
 #define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS      194
+#define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN        195
+#define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE       196
+#define PCRE2_ERROR_TOO_MANY_CAPTURES              197
+#define PCRE2_ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED  198
 
 
 /* "Expected" matching error codes: no match and partial match. */
@@ -403,6 +393,7 @@ released, the numbers must not be changed. */
 #define PCRE2_ERROR_HEAPLIMIT         (-63)
 #define PCRE2_ERROR_CONVERT_SYNTAX    (-64)
 #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
+#define PCRE2_ERROR_DFA_UINVALID_UTF  (-66)
 
 
 /* Request types for pcre2_pattern_info() */
@@ -504,10 +495,10 @@ typedef struct pcre2_real_jit_stack pcre2_jit_stack; \
 typedef pcre2_jit_stack *(*pcre2_jit_callback)(void *);
 
 
-/* The structure for passing out data via the pcre_callout_function. We use a
-structure so that new fields can be added on the end in future versions,
-without changing the API of the function, thereby allowing old clients to work
-without modification. Define the generic version in a macro; the width-specific
+/* The structures for passing out data via callout functions. We use structures
+so that new fields can be added on the end in future versions, without changing
+the API of the function, thereby allowing old clients to work without
+modification. Define the generic versions in a macro; the width-specific
 versions are generated from this macro below. */
 
 /* Flags for the callout_flags field. These are cleared after a callout. */
@@ -549,7 +540,19 @@ typedef struct pcre2_callout_enumerate_block { \
   PCRE2_SIZE    callout_string_length; /* Length of string compiled into pattern */ \
   PCRE2_SPTR    callout_string;    /* String compiled into pattern */ \
   /* ------------------------------------------------------------------ */ \
-} pcre2_callout_enumerate_block;
+} pcre2_callout_enumerate_block; \
+\
+typedef struct pcre2_substitute_callout_block { \
+  uint32_t      version;           /* Identifies version of block */ \
+  /* ------------------------ Version 0 ------------------------------- */ \
+  PCRE2_SPTR    input;             /* Pointer to input subject string */ \
+  PCRE2_SPTR    output;            /* Pointer to output buffer */ \
+  PCRE2_SIZE    output_offsets[2]; /* Changed portion of the output */ \
+  PCRE2_SIZE   *ovector;           /* Pointer to current ovector */ \
+  uint32_t      oveccount;         /* Count of pairs set in ovector */ \
+  uint32_t      subscount;         /* Substitution number */ \
+  /* ------------------------------------------------------------------ */ \
+} pcre2_substitute_callout_block;
 
 
 /* List the generic forms of all other functions in macros, which will be
@@ -581,7 +584,7 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
-  pcre2_set_character_tables(pcre2_compile_context *, const unsigned char *); \
+  pcre2_set_character_tables(pcre2_compile_context *, const uint8_t *); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -604,6 +607,9 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_callout(pcre2_match_context *, \
     int (*)(pcre2_callout_block *, void *), void *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+  pcre2_set_substitute_callout(pcre2_match_context *, \
+    int (*)(pcre2_substitute_callout_block *, void *), void *); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -673,6 +679,8 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
   pcre2_match_data_free(pcre2_match_data *); \
 PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
   pcre2_get_mark(pcre2_match_data *); \
+PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
+  pcre2_get_match_data_size(pcre2_match_data *); \
 PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
   pcre2_get_ovector_count(pcre2_match_data *); \
 PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
@@ -771,7 +779,8 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \
 PCRE2_EXP_DECL const uint8_t PCRE2_CALL_CONVENTION \
   *pcre2_maketables(pcre2_general_context *); \
-
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+  pcre2_maketables_free(pcre2_general_context *, const uint8_t *);
 
 /* Define macros that generate width-specific names from generic versions. The
 three-level macro scheme is necessary to get the macros expanded when we want
@@ -807,6 +816,7 @@ pcre2_compile are called by application code. */
 
 #define pcre2_callout_block            PCRE2_SUFFIX(pcre2_callout_block_)
 #define pcre2_callout_enumerate_block  PCRE2_SUFFIX(pcre2_callout_enumerate_block_)
+#define pcre2_substitute_callout_block PCRE2_SUFFIX(pcre2_substitute_callout_block_)
 #define pcre2_general_context          PCRE2_SUFFIX(pcre2_general_context_)
 #define pcre2_compile_context          PCRE2_SUFFIX(pcre2_compile_context_)
 #define pcre2_convert_context          PCRE2_SUFFIX(pcre2_convert_context_)
@@ -835,6 +845,7 @@ pcre2_compile are called by application code. */
 #define pcre2_general_context_free            PCRE2_SUFFIX(pcre2_general_context_free_)
 #define pcre2_get_error_message               PCRE2_SUFFIX(pcre2_get_error_message_)
 #define pcre2_get_mark                        PCRE2_SUFFIX(pcre2_get_mark_)
+#define pcre2_get_match_data_size             PCRE2_SUFFIX(pcre2_get_match_data_size_)
 #define pcre2_get_ovector_pointer             PCRE2_SUFFIX(pcre2_get_ovector_pointer_)
 #define pcre2_get_ovector_count               PCRE2_SUFFIX(pcre2_get_ovector_count_)
 #define pcre2_get_startchar                   PCRE2_SUFFIX(pcre2_get_startchar_)
@@ -845,6 +856,7 @@ pcre2_compile are called by application code. */
 #define pcre2_jit_stack_create                PCRE2_SUFFIX(pcre2_jit_stack_create_)
 #define pcre2_jit_stack_free                  PCRE2_SUFFIX(pcre2_jit_stack_free_)
 #define pcre2_maketables                      PCRE2_SUFFIX(pcre2_maketables_)
+#define pcre2_maketables_free                 PCRE2_SUFFIX(pcre2_maketables_free_)
 #define pcre2_match                           PCRE2_SUFFIX(pcre2_match_)
 #define pcre2_match_context_copy              PCRE2_SUFFIX(pcre2_match_context_copy_)
 #define pcre2_match_context_create            PCRE2_SUFFIX(pcre2_match_context_create_)
@@ -872,6 +884,7 @@ pcre2_compile are called by application code. */
 #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_substitute_callout          PCRE2_SUFFIX(pcre2_set_substitute_callout_)
 #define pcre2_substitute                      PCRE2_SUFFIX(pcre2_substitute_)
 #define pcre2_substring_copy_byname           PCRE2_SUFFIX(pcre2_substring_copy_byname_)
 #define pcre2_substring_copy_bynumber         PCRE2_SUFFIX(pcre2_substring_copy_bynumber_)
index a9396e0288429a80b509bfb9353fe403c7bf6719..9a0ad0bf39ad5cf1de4dba6db3b1b99b5d3c8bdc 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) 2016-2018 University of Cambridge
+           Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -46,12 +46,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #define PCRE2_PRERELEASE      @PCRE2_PRERELEASE@
 #define PCRE2_DATE            @PCRE2_DATE@
 
-/* For the benefit of systems without stdint.h, an alternative is to use
-inttypes.h. The existence of these headers is checked by configure or CMake. */
-
-#define PCRE2_HAVE_STDINT_H   @PCRE2_HAVE_STDINT_H@
-#define PCRE2_HAVE_INTTYPES_H @PCRE2_HAVE_INTTYPES_H@
-
 /* 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
 export setting is defined in pcre2_internal.h, which includes this file. So we
@@ -87,18 +81,15 @@ set, we ensure here that it has no effect. */
 #define PCRE2_CALL_CONVENTION
 #endif
 
-/* Have to include limits.h, stdlib.h and stdint.h (or inttypes.h) to ensure
-that size_t and uint8_t, UCHAR_MAX, etc are defined. If the system has neither
-header, the relevant values must be provided by some other means. */
+/* Have to include limits.h, stdlib.h, and inttypes.h to ensure that size_t and
+uint8_t, UCHAR_MAX, etc are defined. Some systems that do have inttypes.h do
+not have stdint.h, which is why we use inttypes.h, which according to the C
+standard is a superset of stdint.h. If none of these headers are available,
+the relevant values must be provided by some other means. */
 
 #include <limits.h>
 #include <stdlib.h>
-
-#if PCRE2_HAVE_STDINT_H
-#include <stdint.h>
-#elif PCRE2_HAVE_INTTYPES_H
 #include <inttypes.h>
-#endif
 
 /* Allow for C++ users compiling this directly. */
 
@@ -151,6 +142,7 @@ D   is inspected during pcre2_dfa_match() execution
 #define PCRE2_USE_OFFSET_LIMIT    0x00800000u  /*   J M D */
 #define PCRE2_EXTENDED_MORE       0x01000000u  /* C       */
 #define PCRE2_LITERAL             0x02000000u  /* C       */
+#define PCRE2_MATCH_INVALID_UTF   0x04000000u  /*   J M D */
 
 /* An additional compile options word is available in the compile context. */
 
@@ -158,43 +150,37 @@ D   is inspected during pcre2_dfa_match() execution
 #define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL    0x00000002u  /* C */
 #define PCRE2_EXTRA_MATCH_WORD               0x00000004u  /* C */
 #define PCRE2_EXTRA_MATCH_LINE               0x00000008u  /* C */
+#define PCRE2_EXTRA_ESCAPED_CR_IS_LF         0x00000010u  /* C */
+#define PCRE2_EXTRA_ALT_BSUX                 0x00000020u  /* C */
 
 /* These are for pcre2_jit_compile(). */
 
 #define PCRE2_JIT_COMPLETE        0x00000001u  /* For full matching */
 #define PCRE2_JIT_PARTIAL_SOFT    0x00000002u
 #define PCRE2_JIT_PARTIAL_HARD    0x00000004u
-
-/* These are for pcre2_match(), pcre2_dfa_match(), and pcre2_jit_match(). Note
-that PCRE2_ANCHORED and PCRE2_NO_UTF_CHECK can also be passed to these
-functions (though pcre2_jit_match() ignores the latter since it bypasses all
-sanity checks). */
-
-#define PCRE2_NOTBOL              0x00000001u
-#define PCRE2_NOTEOL              0x00000002u
-#define PCRE2_NOTEMPTY            0x00000004u  /* ) These two must be kept */
-#define PCRE2_NOTEMPTY_ATSTART    0x00000008u  /* ) adjacent to each other. */
-#define PCRE2_PARTIAL_SOFT        0x00000010u
-#define PCRE2_PARTIAL_HARD        0x00000020u
-
-/* These are additional options for pcre2_dfa_match(). */
-
-#define PCRE2_DFA_RESTART         0x00000040u
-#define PCRE2_DFA_SHORTEST        0x00000080u
-
-/* These are additional options for pcre2_substitute(), which passes any others
-through to pcre2_match(). */
-
-#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
-
-/* A further option for pcre2_match(), not allowed for pcre2_dfa_match(),
-ignored for pcre2_jit_match(). */
-
-#define PCRE2_NO_JIT              0x00002000u
+#define PCRE2_JIT_INVALID_UTF     0x00000100u
+
+/* These are for pcre2_match(), pcre2_dfa_match(), pcre2_jit_match(), and
+pcre2_substitute(). Some are allowed only for one of the functions, and in
+these cases it is noted below. Note that PCRE2_ANCHORED, PCRE2_ENDANCHORED and
+PCRE2_NO_UTF_CHECK can also be passed to these functions (though
+pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */
+
+#define PCRE2_NOTBOL                      0x00000001u
+#define PCRE2_NOTEOL                      0x00000002u
+#define PCRE2_NOTEMPTY                    0x00000004u  /* ) These two must be kept */
+#define PCRE2_NOTEMPTY_ATSTART            0x00000008u  /* ) adjacent to each other. */
+#define PCRE2_PARTIAL_SOFT                0x00000010u
+#define PCRE2_PARTIAL_HARD                0x00000020u
+#define PCRE2_DFA_RESTART                 0x00000040u  /* pcre2_dfa_match() only */
+#define PCRE2_DFA_SHORTEST                0x00000080u  /* pcre2_dfa_match() only */
+#define PCRE2_SUBSTITUTE_GLOBAL           0x00000100u  /* pcre2_substitute() only */
+#define PCRE2_SUBSTITUTE_EXTENDED         0x00000200u  /* pcre2_substitute() only */
+#define PCRE2_SUBSTITUTE_UNSET_EMPTY      0x00000400u  /* pcre2_substitute() only */
+#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET    0x00000800u  /* pcre2_substitute() only */
+#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH  0x00001000u  /* pcre2_substitute() only */
+#define PCRE2_NO_JIT                      0x00002000u  /* Not for pcre2_dfa_match() */
+#define PCRE2_COPY_MATCHED_SUBJECT        0x00004000u
 
 /* Options for pcre2_pattern_convert(). */
 
@@ -318,6 +304,10 @@ pcre2_pattern_convert(). */
 #define PCRE2_ERROR_BAD_LITERAL_OPTIONS            192
 #define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE      193
 #define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS      194
+#define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN        195
+#define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE       196
+#define PCRE2_ERROR_TOO_MANY_CAPTURES              197
+#define PCRE2_ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED  198
 
 
 /* "Expected" matching error codes: no match and partial match. */
@@ -403,6 +393,7 @@ released, the numbers must not be changed. */
 #define PCRE2_ERROR_HEAPLIMIT         (-63)
 #define PCRE2_ERROR_CONVERT_SYNTAX    (-64)
 #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
+#define PCRE2_ERROR_DFA_UINVALID_UTF  (-66)
 
 
 /* Request types for pcre2_pattern_info() */
@@ -504,10 +495,10 @@ typedef struct pcre2_real_jit_stack pcre2_jit_stack; \
 typedef pcre2_jit_stack *(*pcre2_jit_callback)(void *);
 
 
-/* The structure for passing out data via the pcre_callout_function. We use a
-structure so that new fields can be added on the end in future versions,
-without changing the API of the function, thereby allowing old clients to work
-without modification. Define the generic version in a macro; the width-specific
+/* The structures for passing out data via callout functions. We use structures
+so that new fields can be added on the end in future versions, without changing
+the API of the function, thereby allowing old clients to work without
+modification. Define the generic versions in a macro; the width-specific
 versions are generated from this macro below. */
 
 /* Flags for the callout_flags field. These are cleared after a callout. */
@@ -549,7 +540,19 @@ typedef struct pcre2_callout_enumerate_block { \
   PCRE2_SIZE    callout_string_length; /* Length of string compiled into pattern */ \
   PCRE2_SPTR    callout_string;    /* String compiled into pattern */ \
   /* ------------------------------------------------------------------ */ \
-} pcre2_callout_enumerate_block;
+} pcre2_callout_enumerate_block; \
+\
+typedef struct pcre2_substitute_callout_block { \
+  uint32_t      version;           /* Identifies version of block */ \
+  /* ------------------------ Version 0 ------------------------------- */ \
+  PCRE2_SPTR    input;             /* Pointer to input subject string */ \
+  PCRE2_SPTR    output;            /* Pointer to output buffer */ \
+  PCRE2_SIZE    output_offsets[2]; /* Changed portion of the output */ \
+  PCRE2_SIZE   *ovector;           /* Pointer to current ovector */ \
+  uint32_t      oveccount;         /* Count of pairs set in ovector */ \
+  uint32_t      subscount;         /* Substitution number */ \
+  /* ------------------------------------------------------------------ */ \
+} pcre2_substitute_callout_block;
 
 
 /* List the generic forms of all other functions in macros, which will be
@@ -581,7 +584,7 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
-  pcre2_set_character_tables(pcre2_compile_context *, const unsigned char *); \
+  pcre2_set_character_tables(pcre2_compile_context *, const uint8_t *); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -604,6 +607,9 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_callout(pcre2_match_context *, \
     int (*)(pcre2_callout_block *, void *), void *); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+  pcre2_set_substitute_callout(pcre2_match_context *, \
+    int (*)(pcre2_substitute_callout_block *, void *), void *); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -673,6 +679,8 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
   pcre2_match_data_free(pcre2_match_data *); \
 PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
   pcre2_get_mark(pcre2_match_data *); \
+PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
+  pcre2_get_match_data_size(pcre2_match_data *); \
 PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
   pcre2_get_ovector_count(pcre2_match_data *); \
 PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
@@ -771,7 +779,8 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \
 PCRE2_EXP_DECL const uint8_t PCRE2_CALL_CONVENTION \
   *pcre2_maketables(pcre2_general_context *); \
-
+PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
+  pcre2_maketables_free(pcre2_general_context *, const uint8_t *);
 
 /* Define macros that generate width-specific names from generic versions. The
 three-level macro scheme is necessary to get the macros expanded when we want
@@ -807,6 +816,7 @@ pcre2_compile are called by application code. */
 
 #define pcre2_callout_block            PCRE2_SUFFIX(pcre2_callout_block_)
 #define pcre2_callout_enumerate_block  PCRE2_SUFFIX(pcre2_callout_enumerate_block_)
+#define pcre2_substitute_callout_block PCRE2_SUFFIX(pcre2_substitute_callout_block_)
 #define pcre2_general_context          PCRE2_SUFFIX(pcre2_general_context_)
 #define pcre2_compile_context          PCRE2_SUFFIX(pcre2_compile_context_)
 #define pcre2_convert_context          PCRE2_SUFFIX(pcre2_convert_context_)
@@ -835,6 +845,7 @@ pcre2_compile are called by application code. */
 #define pcre2_general_context_free            PCRE2_SUFFIX(pcre2_general_context_free_)
 #define pcre2_get_error_message               PCRE2_SUFFIX(pcre2_get_error_message_)
 #define pcre2_get_mark                        PCRE2_SUFFIX(pcre2_get_mark_)
+#define pcre2_get_match_data_size             PCRE2_SUFFIX(pcre2_get_match_data_size_)
 #define pcre2_get_ovector_pointer             PCRE2_SUFFIX(pcre2_get_ovector_pointer_)
 #define pcre2_get_ovector_count               PCRE2_SUFFIX(pcre2_get_ovector_count_)
 #define pcre2_get_startchar                   PCRE2_SUFFIX(pcre2_get_startchar_)
@@ -845,6 +856,7 @@ pcre2_compile are called by application code. */
 #define pcre2_jit_stack_create                PCRE2_SUFFIX(pcre2_jit_stack_create_)
 #define pcre2_jit_stack_free                  PCRE2_SUFFIX(pcre2_jit_stack_free_)
 #define pcre2_maketables                      PCRE2_SUFFIX(pcre2_maketables_)
+#define pcre2_maketables_free                 PCRE2_SUFFIX(pcre2_maketables_free_)
 #define pcre2_match                           PCRE2_SUFFIX(pcre2_match_)
 #define pcre2_match_context_copy              PCRE2_SUFFIX(pcre2_match_context_copy_)
 #define pcre2_match_context_create            PCRE2_SUFFIX(pcre2_match_context_create_)
@@ -872,6 +884,7 @@ pcre2_compile are called by application code. */
 #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_substitute_callout          PCRE2_SUFFIX(pcre2_set_substitute_callout_)
 #define pcre2_substitute                      PCRE2_SUFFIX(pcre2_substitute_)
 #define pcre2_substring_copy_byname           PCRE2_SUFFIX(pcre2_substring_copy_byname_)
 #define pcre2_substring_copy_bynumber         PCRE2_SUFFIX(pcre2_substring_copy_bynumber_)
index 2ce152e9522f38842f7add02524f84dfc081470a..5b95b9b8a8b057224ae50bebcae1fb97d4d8edc9 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -605,6 +605,15 @@ for(;;)
       if (cb->had_recurse) return FALSE;
       break;
 
+      /* A script run might have to backtrack if the iterated item can match
+      characters from more than one script. So give up unless repeating an
+      explicit character. */
+
+      case OP_SCRIPT_RUN:
+      if (base_list[0] != OP_CHAR && base_list[0] != OP_CHARI)
+        return FALSE;
+      break;
+
       /* Atomic sub-patterns and assertions can always auto-possessify their
       last iterator. However, if the group was entered as a result of checking
       a previous iterator, this is not possible. */
@@ -614,8 +623,14 @@ for(;;)
       case OP_ASSERTBACK:
       case OP_ASSERTBACK_NOT:
       case OP_ONCE:
-
       return !entered_a_group;
+
+      /* Non-atomic assertions - don't possessify last iterator. This needs
+      more thought. */
+
+      case OP_ASSERT_NA:
+      case OP_ASSERTBACK_NA:
+      return FALSE;
       }
 
     /* Skip over the bracket and inspect what comes next. */
@@ -1043,7 +1058,7 @@ for(;;)
       if (chr > 255) break;
       class_bitset = (uint8_t *)
         ((list_ptr == list ? code : base_end) - list_ptr[2]);
-      if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE;
+      if ((class_bitset[chr >> 3] & (1u << (chr & 7))) != 0) return FALSE;
       break;
 
 #ifdef SUPPORT_WIDE_CHARS
index 4046500c00d0cc99cb9e202bd89bcb0392c58f6f..0e07edb4943d8a28f0dc722a9aa4a92ede91df22 100644 (file)
@@ -157,8 +157,8 @@ graph print, punct, and cntrl. Other classes are built from combinations. */
 /* This table identifies various classes of character by individual bits:
   0x01   white space character
   0x02   letter
-  0x04   decimal digit
-  0x08   hexadecimal digit
+  0x04   lower case letter
+  0x08   decimal digit
   0x10   alphanumeric or '_'
 */
 
@@ -168,16 +168,16 @@ graph print, punct, and cntrl. Other classes are built from combinations. */
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  24- 31 */
   0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*    - '  */
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  ( - /  */
-  0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /*  0 - 7  */
-  0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00, /*  8 - ?  */
-  0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /*  @ - G  */
+  0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, /*  0 - 7  */
+  0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /*  8 - ?  */
+  0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  @ - G  */
   0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  H - O  */
   0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  P - W  */
   0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x10, /*  X - _  */
-  0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /*  ` - g  */
-  0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  h - o  */
-  0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  p - w  */
-  0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00, /*  x -127 */
+  0x00,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /*  ` - g  */
+  0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /*  h - o  */
+  0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /*  p - w  */
+  0x16,0x16,0x16,0x00,0x00,0x00,0x00,0x00, /*  x -127 */
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
index 6bb1de3610011e370c5eae9ae53b0ca495f61674..f2e6b6b5bde4293dfefc77f421a9c040f867b35d 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -135,6 +135,9 @@ static BOOL
   set_lookbehind_lengths(uint32_t **, int *, int *, parsed_recurse_check *,
     compile_block *);
 
+static int
+  check_lookbehinds(uint32_t *, uint32_t **, parsed_recurse_check *,
+    compile_block *);
 
 
 /*************************************************
@@ -240,49 +243,62 @@ code (meta_extra_lengths, just below) must be updated to remain in step. */
 #define META_RANGE_LITERAL    0x801f0000u  /* range defined literally */
 #define META_RECURSE          0x80200000u  /* Recursion */
 #define META_RECURSE_BYNAME   0x80210000u  /* (?&name) */
+#define META_SCRIPT_RUN       0x80220000u  /* (*script_run:...) */
 
 /* These must be kept together to make it easy to check that an assertion
 is present where expected in a conditional group. */
 
-#define META_LOOKAHEAD        0x80220000u  /* (?= */
-#define META_LOOKAHEADNOT     0x80230000u  /* (?! */
-#define META_LOOKBEHIND       0x80240000u  /* (?<= */
-#define META_LOOKBEHINDNOT    0x80250000u  /* (?<! */
+#define META_LOOKAHEAD        0x80230000u  /* (?= */
+#define META_LOOKAHEADNOT     0x80240000u  /* (?! */
+#define META_LOOKBEHIND       0x80250000u  /* (?<= */
+#define META_LOOKBEHINDNOT    0x80260000u  /* (?<! */
+
+/* These cannot be conditions */
+
+#define META_LOOKAHEAD_NA     0x80270000u  /* (*napla: */
+#define META_LOOKBEHIND_NA    0x80280000u  /* (*naplb: */
 
 /* These must be kept in this order, with consecutive values, and the _ARG
 versions of COMMIT, PRUNE, SKIP, and THEN immediately after their non-argument
 versions. */
 
-#define META_MARK             0x80260000u  /* (*MARK) */
-#define META_ACCEPT           0x80270000u  /* (*ACCEPT) */
-#define META_FAIL             0x80280000u  /* (*FAIL) */
-#define META_COMMIT           0x80290000u  /* These               */
-#define META_COMMIT_ARG       0x802a0000u  /*   pairs             */
-#define META_PRUNE            0x802b0000u  /*     must            */
-#define META_PRUNE_ARG        0x802c0000u  /*       be            */
-#define META_SKIP             0x802d0000u  /*         kept        */
-#define META_SKIP_ARG         0x802e0000u  /*           in        */
-#define META_THEN             0x802f0000u  /*             this    */
-#define META_THEN_ARG         0x80300000u  /*               order */
+#define META_MARK             0x80290000u  /* (*MARK) */
+#define META_ACCEPT           0x802a0000u  /* (*ACCEPT) */
+#define META_FAIL             0x802b0000u  /* (*FAIL) */
+#define META_COMMIT           0x802c0000u  /* These               */
+#define META_COMMIT_ARG       0x802d0000u  /*   pairs             */
+#define META_PRUNE            0x802e0000u  /*     must            */
+#define META_PRUNE_ARG        0x802f0000u  /*       be            */
+#define META_SKIP             0x80300000u  /*         kept        */
+#define META_SKIP_ARG         0x80310000u  /*           in        */
+#define META_THEN             0x80320000u  /*             this    */
+#define META_THEN_ARG         0x80330000u  /*               order */
 
 /* These must be kept in groups of adjacent 3 values, and all together. */
 
-#define META_ASTERISK         0x80310000u  /* *  */
-#define META_ASTERISK_PLUS    0x80320000u  /* *+ */
-#define META_ASTERISK_QUERY   0x80330000u  /* *? */
-#define META_PLUS             0x80340000u  /* +  */
-#define META_PLUS_PLUS        0x80350000u  /* ++ */
-#define META_PLUS_QUERY       0x80360000u  /* +? */
-#define META_QUERY            0x80370000u  /* ?  */
-#define META_QUERY_PLUS       0x80380000u  /* ?+ */
-#define META_QUERY_QUERY      0x80390000u  /* ?? */
-#define META_MINMAX           0x803a0000u  /* {n,m}  repeat */
-#define META_MINMAX_PLUS      0x803b0000u  /* {n,m}+ repeat */
-#define META_MINMAX_QUERY     0x803c0000u  /* {n,m}? repeat */
+#define META_ASTERISK         0x80340000u  /* *  */
+#define META_ASTERISK_PLUS    0x80350000u  /* *+ */
+#define META_ASTERISK_QUERY   0x80360000u  /* *? */
+#define META_PLUS             0x80370000u  /* +  */
+#define META_PLUS_PLUS        0x80380000u  /* ++ */
+#define META_PLUS_QUERY       0x80390000u  /* +? */
+#define META_QUERY            0x803a0000u  /* ?  */
+#define META_QUERY_PLUS       0x803b0000u  /* ?+ */
+#define META_QUERY_QUERY      0x803c0000u  /* ?? */
+#define META_MINMAX           0x803d0000u  /* {n,m}  repeat */
+#define META_MINMAX_PLUS      0x803e0000u  /* {n,m}+ repeat */
+#define META_MINMAX_QUERY     0x803f0000u  /* {n,m}? repeat */
 
 #define META_FIRST_QUANTIFIER META_ASTERISK
 #define META_LAST_QUANTIFIER  META_MINMAX_QUERY
 
+/* This is a special "meta code" that is used only to distinguish (*asr: from
+(*sr: in the table of aphabetic assertions. It is never stored in the parsed
+pattern because (*asr: is turned into (*sr:(*atomic: at that stage. There is
+therefore no need for it to have a length entry, so use a high value. */
+
+#define META_ATOMIC_SCRIPT_RUN 0x8fff0000u
+
 /* Table of extra lengths for each of the meta codes. Must be kept in step with
 the definitions above. For some items these values are a basic length to which
 a variable amount has to be added. */
@@ -322,10 +338,13 @@ static unsigned char meta_extra_lengths[] = {
   0,             /* META_RANGE_LITERAL */
   SIZEOFFSET,    /* META_RECURSE */
   1+SIZEOFFSET,  /* META_RECURSE_BYNAME */
+  0,             /* META_SCRIPT_RUN */
   0,             /* META_LOOKAHEAD */
   0,             /* META_LOOKAHEADNOT */
   SIZEOFFSET,    /* META_LOOKBEHIND */
   SIZEOFFSET,    /* META_LOOKBEHINDNOT */
+  0,             /* META_LOOKAHEAD_NA */
+  SIZEOFFSET,    /* META_LOOKBEHIND_NA */
   1,             /* META_MARK - plus the string length */
   0,             /* META_ACCEPT */
   0,             /* META_FAIL */
@@ -359,17 +378,17 @@ enum { PSKIP_ALT, PSKIP_CLASS, PSKIP_KET };
 experimenting to figure out how to stop gcc 5.3.0 from warning with
 -Wconversion. This version gets a warning:
 
-  #define SETBIT(a,b) a[(b)/8] |= (uint8_t)(1 << ((b)&7))
+  #define SETBIT(a,b) a[(b)/8] |= (uint8_t)(1u << ((b)&7))
 
 Let's hope the apparently less efficient version isn't actually so bad if the
 compiler is clever with identical subexpressions. */
 
-#define SETBIT(a,b) a[(b)/8] = (uint8_t)(a[(b)/8] | (1 << ((b)&7)))
+#define SETBIT(a,b) a[(b)/8] = (uint8_t)(a[(b)/8] | (1u << ((b)&7)))
 
 /* Private flags added to firstcu and reqcu. */
 
-#define REQ_CASELESS    (1 << 0)        /* Indicates caselessness */
-#define REQ_VARY        (1 << 1)        /* reqcu followed non-literal item */
+#define REQ_CASELESS    (1u << 0)       /* Indicates caselessness */
+#define REQ_VARY        (1u << 1)       /* reqcu followed non-literal item */
 /* Negative values for the firstcu and reqcu flags */
 #define REQ_UNSET       (-2)            /* Not yet found anything */
 #define REQ_NONE        (-1)            /* Found not fixed char */
@@ -615,6 +634,54 @@ static const uint32_t verbops[] = {
   OP_MARK, OP_ACCEPT, OP_FAIL, OP_COMMIT, OP_COMMIT_ARG, OP_PRUNE,
   OP_PRUNE_ARG, OP_SKIP, OP_SKIP_ARG, OP_THEN, OP_THEN_ARG };
 
+/* Table of "alpha assertions" like (*pla:...), similar to the (*VERB) table. */
+
+typedef struct alasitem {
+  unsigned int len;          /* Length of name */
+  uint32_t meta;             /* Base META_ code */
+} alasitem;
+
+static const char alasnames[] =
+  STRING_pla0
+  STRING_plb0
+  STRING_napla0
+  STRING_naplb0
+  STRING_nla0
+  STRING_nlb0
+  STRING_positive_lookahead0
+  STRING_positive_lookbehind0
+  STRING_non_atomic_positive_lookahead0
+  STRING_non_atomic_positive_lookbehind0
+  STRING_negative_lookahead0
+  STRING_negative_lookbehind0
+  STRING_atomic0
+  STRING_sr0
+  STRING_asr0
+  STRING_script_run0
+  STRING_atomic_script_run;
+
+static const alasitem alasmeta[] = {
+  {  3, META_LOOKAHEAD         },
+  {  3, META_LOOKBEHIND        },
+  {  5, META_LOOKAHEAD_NA      },
+  {  5, META_LOOKBEHIND_NA     },
+  {  3, META_LOOKAHEADNOT      },
+  {  3, META_LOOKBEHINDNOT     },
+  { 18, META_LOOKAHEAD         },
+  { 19, META_LOOKBEHIND        },
+  { 29, META_LOOKAHEAD_NA      },
+  { 30, META_LOOKBEHIND_NA     },
+  { 18, META_LOOKAHEADNOT      },
+  { 19, META_LOOKBEHINDNOT     },
+  {  6, META_ATOMIC            },
+  {  2, META_SCRIPT_RUN        }, /* sr = script run */
+  {  3, META_ATOMIC_SCRIPT_RUN }, /* asr = atomic script run */
+  { 10, META_SCRIPT_RUN        }, /* script run */
+  { 17, META_ATOMIC_SCRIPT_RUN }  /* atomic script run */
+};
+
+static const int alascount = sizeof(alasmeta)/sizeof(alasitem);
+
 /* Offsets from OP_STAR for case-independent and negative repeat opcodes. */
 
 static uint32_t chartypeoffset[] = {
@@ -697,8 +764,8 @@ are allowed. */
 
 #define PUBLIC_LITERAL_COMPILE_OPTIONS \
   (PCRE2_ANCHORED|PCRE2_AUTO_CALLOUT|PCRE2_CASELESS|PCRE2_ENDANCHORED| \
-   PCRE2_FIRSTLINE|PCRE2_LITERAL|PCRE2_NO_START_OPTIMIZE| \
-   PCRE2_NO_UTF_CHECK|PCRE2_USE_OFFSET_LIMIT|PCRE2_UTF)
+   PCRE2_FIRSTLINE|PCRE2_LITERAL|PCRE2_MATCH_INVALID_UTF| \
+   PCRE2_NO_START_OPTIMIZE|PCRE2_NO_UTF_CHECK|PCRE2_USE_OFFSET_LIMIT|PCRE2_UTF)
 
 #define PUBLIC_COMPILE_OPTIONS \
   (PUBLIC_LITERAL_COMPILE_OPTIONS| \
@@ -714,7 +781,8 @@ are allowed. */
 
 #define PUBLIC_COMPILE_EXTRA_OPTIONS \
    (PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS| \
-    PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES|PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL)
+    PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES|PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL| \
+    PCRE2_EXTRA_ESCAPED_CR_IS_LF|PCRE2_EXTRA_ALT_BSUX)
 
 /* 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
@@ -731,7 +799,7 @@ enum { ERR0 = COMPILE_ERROR_BASE,
        ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70,
        ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, ERR80,
        ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88, ERR89, ERR90,
-       ERR91, ERR92, ERR93, ERR94 };
+       ERR91, ERR92, ERR93, ERR94, ERR95, ERR96, ERR97, ERR98 };
 
 /* 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
@@ -962,6 +1030,8 @@ for (;;)
     case META_NOCAPTURE: fprintf(stderr, "META (?:"); break;
     case META_LOOKAHEAD: fprintf(stderr, "META (?="); break;
     case META_LOOKAHEADNOT: fprintf(stderr, "META (?!"); break;
+    case META_LOOKAHEAD_NA: fprintf(stderr, "META (*napla:"); break;
+    case META_SCRIPT_RUN: fprintf(stderr, "META (*sr:"); break;
     case META_KET: fprintf(stderr, "META )"); break;
     case META_ALT: fprintf(stderr, "META | %d", meta_arg); break;
 
@@ -992,6 +1062,12 @@ for (;;)
     fprintf(stderr, "%zd", offset);
     break;
 
+    case META_LOOKBEHIND_NA:
+    fprintf(stderr, "META (*naplb: %d offset=", meta_arg);
+    GETOFFSET(offset, pptr);
+    fprintf(stderr, "%zd", offset);
+    break;
+
     case META_LOOKBEHINDNOT:
     fprintf(stderr, "META (?<! %d offset=", meta_arg);
     GETOFFSET(offset, pptr);
@@ -1191,7 +1267,7 @@ if (code != NULL)
   if ((code->flags & PCRE2_DEREF_TABLES) != 0)
     {
     /* Decoded tables belong to the codes after deserialization, and they must
-    be freed when there are no more reference to them. The *ref_count should
+    be freed when there are no more references to them. The *ref_count should
     always be > 0. */
 
     ref_count = (PCRE2_SIZE *)(code->tables + tables_length);
@@ -1368,9 +1444,6 @@ the result is "not a repeat quantifier". */
 EXIT:
 if (yield || *errorcodeptr != 0) *ptrptr = p;
 return yield;
-
-
-
 }
 
 
@@ -1398,7 +1471,7 @@ Arguments:
   errorcodeptr   points to the errorcode variable (containing zero)
   options        the current options bits
   isclass        TRUE if inside a character class
-  cb             compile data block
+  cb             compile data block or NULL when called from pcre2_substitute()
 
 Returns:         zero => a data character
                  positive => a special escape sequence
@@ -1408,7 +1481,8 @@ Returns:         zero => a data character
 
 int
 PRIV(check_escape)(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *chptr,
-  int *errorcodeptr, uint32_t options, BOOL isclass, compile_block *cb)
+  int *errorcodeptr, uint32_t options, uint32_t extra_options, BOOL isclass,
+  compile_block *cb)
 {
 BOOL utf = (options & PCRE2_UTF) != 0;
 PCRE2_SPTR ptr = *ptrptr;
@@ -1429,14 +1503,25 @@ GETCHARINCTEST(c, ptr);         /* Get character value, increment pointer */
 
 /* 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. */
+range. */
 
 if (c < ESCAPES_FIRST || c > ESCAPES_LAST) {}  /* Definitely literal */
 
+/* Otherwise, do a table lookup. Non-zero values need little processing here. A
+positive value is a literal value for something like \n. A negative value is
+the negation of one of the ESC_ macros that is passed back for handling by the
+calling function. Some extra checking is needed for \N because only \N{U+dddd}
+is supported. If the value is zero, further processing is handled below. */
+
 else if ((i = escapes[c - ESCAPES_FIRST]) != 0)
   {
-  if (i > 0) c = (uint32_t)i; else  /* Positive is a data character */
+  if (i > 0)
+    {
+    c = (uint32_t)i;
+    if (c == CHAR_CR && (extra_options & PCRE2_EXTRA_ESCAPED_CR_IS_LF) != 0)
+      c = CHAR_LF;
+    }
+  else  /* Negative table entry */
     {
     escape = -i;                    /* Else return a special escape */
     if (cb != NULL && (escape == ESC_P || escape == ESC_p || escape == ESC_X))
@@ -1486,23 +1571,29 @@ else if ((i = escapes[c - ESCAPES_FIRST]) != 0)
     }
   }
 
-/* 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). */
+/* Escapes that need further processing, including those that are unknown, have
+a zero entry in the lookup table. When called from pcre2_substitute(), only \c,
+\o, and \x are recognized (\u and \U can never appear as they are used for case
+forcing). */
 
 else
   {
+  int s;
   PCRE2_SPTR oldptr;
   BOOL overflow;
-  int s;
+  BOOL alt_bsux =
+    ((options & PCRE2_ALT_BSUX) | (extra_options & PCRE2_EXTRA_ALT_BSUX)) != 0;
 
   /* 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))
+  if (cb == NULL)
     {
-    *errorcodeptr = ERR3;
-    return 0;
+    if (c != CHAR_c && c != CHAR_o && c != CHAR_x)
+      {
+      *errorcodeptr = ERR3;
+      return 0;
+      }
+    alt_bsux = FALSE;   /* Do not modify \x handling */
     }
 
   switch (c)
@@ -1516,40 +1607,75 @@ else
     *errorcodeptr = ERR37;
     break;
 
-    /* \u is unrecognized when PCRE2_ALT_BSUX is not set. When it is treated
-    specially, \u must be followed by four hex digits. Otherwise it is a
-    lowercase u letter. */
+    /* \u is unrecognized when neither PCRE2_ALT_BSUX nor PCRE2_EXTRA_ALT_BSUX
+    is set. Otherwise, \u must be followed by exactly four hex digits or, if
+    PCRE2_EXTRA_ALT_BSUX is set, by any number of hex digits in braces.
+    Otherwise it is a lowercase u letter. This gives some compatibility with
+    ECMAScript (aka JavaScript). */
 
     case CHAR_u:
-    if ((options & PCRE2_ALT_BSUX) == 0) *errorcodeptr = ERR37; else
+    if (!alt_bsux) *errorcodeptr = ERR37; else
       {
       uint32_t xc;
-      if (ptrend - ptr < 4) break;              /* Less than 4 chars */
-      if ((cc = XDIGIT(ptr[0])) == 0xff) break;  /* Not a hex digit */
-      if ((xc = XDIGIT(ptr[1])) == 0xff) break;  /* Not a hex digit */
-      cc = (cc << 4) | xc;
-      if ((xc = XDIGIT(ptr[2])) == 0xff) break;  /* Not a hex digit */
-      cc = (cc << 4) | xc;
-      if ((xc = XDIGIT(ptr[3])) == 0xff) break;  /* Not a hex digit */
-      c = (cc << 4) | xc;
-      ptr += 4;
+
+      if (ptr >= ptrend) break;
+      if (*ptr == CHAR_LEFT_CURLY_BRACKET &&
+          (extra_options & PCRE2_EXTRA_ALT_BSUX) != 0)
+        {
+        PCRE2_SPTR hptr = ptr + 1;
+        cc = 0;
+
+        while (hptr < ptrend && (xc = XDIGIT(*hptr)) != 0xff)
+          {
+          if ((cc & 0xf0000000) != 0)  /* Test for 32-bit overflow */
+            {
+            *errorcodeptr = ERR77;
+            ptr = hptr;   /* Show where */
+            break;        /* *hptr != } will cause another break below */
+            }
+          cc = (cc << 4) | xc;
+          hptr++;
+          }
+
+        if (hptr == ptr + 1 ||   /* No hex digits */
+            hptr >= ptrend ||    /* Hit end of input */
+            *hptr != CHAR_RIGHT_CURLY_BRACKET)  /* No } terminator */
+          break;         /* Hex escape not recognized */
+
+        c = cc;          /* Accept the code point */
+        ptr = hptr + 1;
+        }
+
+      else  /* Must be exactly 4 hex digits */
+        {
+        if (ptrend - ptr < 4) break;               /* Less than 4 chars */
+        if ((cc = XDIGIT(ptr[0])) == 0xff) break;  /* Not a hex digit */
+        if ((xc = XDIGIT(ptr[1])) == 0xff) break;  /* Not a hex digit */
+        cc = (cc << 4) | xc;
+        if ((xc = XDIGIT(ptr[2])) == 0xff) break;  /* Not a hex digit */
+        cc = (cc << 4) | xc;
+        if ((xc = XDIGIT(ptr[3])) == 0xff) break;  /* Not a hex digit */
+        c = (cc << 4) | xc;
+        ptr += 4;
+        }
+
       if (utf)
         {
         if (c > 0x10ffffU) *errorcodeptr = ERR77;
         else
           if (c >= 0xd800 && c <= 0xdfff &&
-            (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)
-              *errorcodeptr = ERR73;
+              (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)
+                *errorcodeptr = ERR73;
         }
       else if (c > MAX_NON_UTF_CHAR) *errorcodeptr = ERR77;
       }
     break;
 
-    /* \U is unrecognized unless PCRE2_ALT_BSUX is set, in which case it is an
-    upper case letter. */
+    /* \U is unrecognized unless PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set,
+    in which case it is an upper case letter. */
 
     case CHAR_U:
-    if ((options & PCRE2_ALT_BSUX) == 0) *errorcodeptr = ERR37;
+    if (!alt_bsux) *errorcodeptr = ERR37;
     break;
 
     /* In a character class, \g is just a literal "g". Outside a character
@@ -1728,8 +1854,8 @@ else
         }
       else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET)
         {
-        if (utf && c >= 0xd800 && c <= 0xdfff && (cb == NULL ||
-            (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0))
+        if (utf && c >= 0xd800 && c <= 0xdfff &&
+            (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)
           {
           ptr--;
           *errorcodeptr = ERR73;
@@ -1743,11 +1869,11 @@ else
       }
     break;
 
-    /* \x is complicated. When PCRE2_ALT_BSUX is set, \x must be followed by
-    two hexadecimal digits. Otherwise it is a lowercase x letter. */
+    /* When PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set, \x must be followed
+    by two hexadecimal digits. Otherwise it is a lowercase x letter. */
 
     case CHAR_x:
-    if ((options & PCRE2_ALT_BSUX) != 0)
+    if (alt_bsux)
       {
       uint32_t xc;
       if (ptrend - ptr < 2) break;               /* Less than 2 characters */
@@ -1755,9 +1881,9 @@ else
       if ((xc = XDIGIT(ptr[1])) == 0xff) break;  /* Not a hex digit */
       c = (cc << 4) | xc;
       ptr += 2;
-      }    /* End PCRE2_ALT_BSUX handling */
+      }
 
-    /* Handle \x in Perl's style. \x{ddd} is a character number which can be
+    /* Handle \x in Perl's style. \x{ddd} is a character code which can be
     greater than 0xff in UTF-8 or non-8bit mode, but only if the ddd are hex
     digits. If not, { used to be treated as a data character. However, Perl
     seems to read hex digits up to the first non-such, and ignore the rest, so
@@ -1801,8 +1927,8 @@ else
           }
         else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET)
           {
-          if (utf && c >= 0xd800 && c <= 0xdfff && (cb == NULL ||
-              (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0))
+          if (utf && c >= 0xd800 && c <= 0xdfff &&
+              (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)
             {
             ptr--;
             *errorcodeptr = ERR73;
@@ -1874,9 +2000,9 @@ else
     c ^= 0x40;
 
     /* Handle \c in an EBCDIC environment. The special case \c? is converted to
-    255 (0xff) or 95 (0x5f) if other character suggest we are using th POSIX-BC
-    encoding. (This is the way Perl indicates that it handles \c?.) The other
-    valid sequences correspond to a list of specific characters. */
+    255 (0xff) or 95 (0x5f) if other characters suggest we are using the
+    POSIX-BC encoding. (This is the way Perl indicates that it handles \c?.)
+    The other valid sequences correspond to a list of specific characters. */
 
 #else
     if (c == CHAR_QUESTION_MARK)
@@ -2120,9 +2246,10 @@ return -1;
 *************************************************/
 
 /* This function is called from parse_regex() below whenever it needs to read
-the name of a subpattern or a (*VERB). The initial pointer must be to the
-character before the name. If that character is '*' we are reading a verb name.
-The pointer is updated to point after the name, for a VERB, or after tha name's
+the name of a subpattern or a (*VERB) or an (*alpha_assertion). The initial
+pointer must be to the character before the name. If that character is '*' we
+are reading a verb or alpha assertion name. The pointer is updated to point
+after the name, for a VERB or alpha assertion name, or after tha name's
 terminator for a subpattern name. Returning both the offset and the name
 pointer is redundant information, but some callers use one and some the other,
 so it is simplest just to return both.
@@ -2130,6 +2257,7 @@ so it is simplest just to return both.
 Arguments:
   ptrptr      points to the character pointer variable
   ptrend      points to the end of the input string
+  utf         true if the input is UTF-encoded
   terminator  the terminator of a subpattern name must be this
   offsetptr   where to put the offset from the start of the pattern
   nameptr     where to put a pointer to the name in the input
@@ -2142,48 +2270,88 @@ Returns:    TRUE if a name was read
 */
 
 static BOOL
-read_name(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t terminator,
+read_name(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, BOOL utf, uint32_t terminator,
   PCRE2_SIZE *offsetptr, PCRE2_SPTR *nameptr, uint32_t *namelenptr,
   int *errorcodeptr, compile_block *cb)
 {
 PCRE2_SPTR ptr = *ptrptr;
-BOOL is_verb = (*ptr == CHAR_ASTERISK);
-uint32_t namelen = 0;
-uint32_t ctype = is_verb? ctype_letter : ctype_word;
+BOOL is_group = (*ptr != CHAR_ASTERISK);
 
-if (++ptr >= ptrend)
+if (++ptr >= ptrend)               /* No characters in name */
   {
-  *errorcodeptr = is_verb? ERR60:  /* Verb not recognized or malformed */
-                           ERR62;  /* Subpattern name expected */
+  *errorcodeptr = is_group? ERR62: /* Subpattern name expected */
+                            ERR60; /* Verb not recognized or malformed */
   goto FAILED;
   }
 
 *nameptr = ptr;
 *offsetptr = (PCRE2_SIZE)(ptr - cb->start_pattern);
 
-if (IS_DIGIT(*ptr))
+/* In UTF mode, a group name may contain letters and decimal digits as defined
+by Unicode properties, and underscores, but must not start with a digit. */
+
+#ifdef SUPPORT_UNICODE
+if (utf && is_group)
   {
-  *errorcodeptr = ERR44;   /* Group name must not start with digit */
-  goto FAILED;
+  uint32_t c, type;
+
+  GETCHAR(c, ptr);
+  type = UCD_CHARTYPE(c);
+
+  if (type == ucp_Nd)
+    {
+    *errorcodeptr = ERR44;
+    goto FAILED;
+    }
+
+  for(;;)
+    {
+    if (type != ucp_Nd && PRIV(ucp_gentype)[type] != ucp_L &&
+        c != CHAR_UNDERSCORE) break;
+    ptr++;
+    FORWARDCHARTEST(ptr, ptrend);
+    if (ptr >= ptrend) break;
+    GETCHAR(c, ptr);
+    type = UCD_CHARTYPE(c);
+    }
   }
+else
+#else
+(void)utf;  /* Avoid compiler warning */
+#endif      /* SUPPORT_UNICODE */
+
+/* Handle non-group names and group names in non-UTF modes. A group name must
+not start with a digit. If either of the others start with a digit it just
+won't be recognized. */
 
-while (ptr < ptrend && MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype) != 0)
   {
-  ptr++;
-  namelen++;
-  if (namelen > MAX_NAME_SIZE)
+  if (is_group && IS_DIGIT(*ptr))
     {
-    *errorcodeptr = ERR48;
+    *errorcodeptr = ERR44;
     goto FAILED;
     }
+
+  while (ptr < ptrend && MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) != 0)
+    {
+    ptr++;
+    }
+  }
+
+/* Check name length */
+
+if (ptr > *nameptr + MAX_NAME_SIZE)
+  {
+  *errorcodeptr = ERR48;
+  goto FAILED;
   }
+*namelenptr = ptr - *nameptr;
 
 /* Subpattern names must not be empty, and their terminator is checked here.
-(What follows a verb name is checked separately.) */
+(What follows a verb or alpha assertion name is checked separately.) */
 
-if (!is_verb)
+if (is_group)
   {
-  if (namelen == 0)
+  if (ptr == *nameptr)
     {
     *errorcodeptr = ERR62;   /* Subpattern name expected */
     goto FAILED;
@@ -2196,7 +2364,6 @@ if (!is_verb)
   ptr++;
   }
 
-*namelenptr = namelen;
 *ptrptr = ptr;
 return TRUE;
 
@@ -2289,6 +2456,7 @@ typedef struct nest_save {
 
 #define NSF_RESET          0x0001u
 #define NSF_CONDASSERT     0x0002u
+#define NSF_ATOMICSR       0x0004u
 
 /* Options that are changeable within the pattern must be tracked during
 parsing. Some (e.g. PCRE2_EXTENDED) are implemented entirely during parsing,
@@ -2304,8 +2472,9 @@ must be last. */
 
 enum { RANGE_NO, RANGE_STARTED, RANGE_OK_ESCAPED, RANGE_OK_LITERAL };
 
-/* Only in 32-bit mode can there be literals > META_END. A macros encapsulates
-the storing of literal values in the parsed pattern. */
+/* Only in 32-bit mode can there be literals > META_END. A macro encapsulates
+the storing of literal values in the main parsed pattern, where they can always
+be quantified. */
 
 #if PCRE2_CODE_UNIT_WIDTH == 32
 #define PARSED_LITERAL(c, p) \
@@ -2328,11 +2497,13 @@ uint32_t delimiter;
 uint32_t namelen;
 uint32_t class_range_state;
 uint32_t *verblengthptr = NULL;     /* Value avoids compiler warning */
+uint32_t *verbstartptr = NULL;
 uint32_t *previous_callout = NULL;
 uint32_t *parsed_pattern = cb->parsed_pattern;
 uint32_t *parsed_pattern_end = cb->parsed_pattern_end;
 uint32_t meta_quantifier = 0;
 uint32_t add_after_mark = 0;
+uint32_t extra_options = cb->cx->extra_options;
 uint16_t nest_depth = 0;
 int after_manual_callout = 0;
 int expect_cond_assert = 0;
@@ -2356,12 +2527,12 @@ nest_save *top_nest, *end_nests;
 /* Insert leading items for word and line matching (features provided for the
 benefit of pcre2grep). */
 
-if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_LINE) != 0)
+if ((extra_options & PCRE2_EXTRA_MATCH_LINE) != 0)
   {
   *parsed_pattern++ = META_CIRCUMFLEX;
   *parsed_pattern++ = META_NOCAPTURE;
   }
-else if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_WORD) != 0)
+else if ((extra_options & PCRE2_EXTRA_MATCH_WORD) != 0)
   {
   *parsed_pattern++ = META_ESCAPE + ESC_b;
   *parsed_pattern++ = META_NOCAPTURE;
@@ -2453,10 +2624,20 @@ while (ptr < ptrend)
         errorcode = ERR28;
         goto FAILED;
         }
-      if (!inverbname && after_manual_callout-- <= 0)
-        parsed_pattern = manage_callouts(thisptr, &previous_callout,
-          auto_callout, parsed_pattern, cb);
-      PARSED_LITERAL(c, parsed_pattern);
+      if (inverbname)
+        {                          /* Don't use PARSED_LITERAL() because it */
+#if PCRE2_CODE_UNIT_WIDTH == 32    /* sets okquantifier. */
+        if (c >= META_END) *parsed_pattern++ = META_BIGVALUE;
+#endif
+        *parsed_pattern++ = c;
+        }
+      else
+        {
+        if (after_manual_callout-- <= 0)
+          parsed_pattern = manage_callouts(thisptr, &previous_callout,
+            auto_callout, parsed_pattern, cb);
+        PARSED_LITERAL(c, parsed_pattern);
+        }
       meta_quantifier = 0;
       }
     continue;  /* Next character */
@@ -2493,13 +2674,15 @@ while (ptr < ptrend)
 
     switch(c)
       {
-      default:
-      PARSED_LITERAL(c, parsed_pattern);
+      default:                     /* Don't use PARSED_LITERAL() because it */
+#if PCRE2_CODE_UNIT_WIDTH == 32    /* sets okquantifier. */
+      if (c >= META_END) *parsed_pattern++ = META_BIGVALUE;
+#endif
+      *parsed_pattern++ = c;
       break;
 
       case CHAR_RIGHT_PARENTHESIS:
       inverbname = FALSE;
-      okquantifier = FALSE;   /* Was probably set by literals */
       /* This is the length in characters */
       verbnamelength = (PCRE2_SIZE)(parsed_pattern - verblengthptr - 1);
       /* But the limit on the length is in code units */
@@ -2526,15 +2709,18 @@ while (ptr < ptrend)
       if ((options & PCRE2_ALT_VERBNAMES) != 0)
         {
         escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options,
-          FALSE, cb);
+          cb->cx->extra_options, FALSE, cb);
         if (errorcode != 0) goto FAILED;
         }
       else escape = 0;   /* Treat all as literal */
 
       switch(escape)
         {
-        case 0:
-        PARSED_LITERAL(c, parsed_pattern);
+        case 0:                    /* Don't use PARSED_LITERAL() because it */
+#if PCRE2_CODE_UNIT_WIDTH == 32    /* sets okquantifier. */
+        if (c >= META_END) *parsed_pattern++ = META_BIGVALUE;
+#endif
+        *parsed_pattern++ = c;
         break;
 
         case ESC_Q:
@@ -2639,23 +2825,30 @@ while (ptr < ptrend)
   if (expect_cond_assert > 0)
     {
     BOOL ok = c == CHAR_LEFT_PARENTHESIS && ptrend - ptr >= 3 &&
-              ptr[0] == CHAR_QUESTION_MARK;
-    if (ok) switch(ptr[1])
+              (ptr[0] == CHAR_QUESTION_MARK || ptr[0] == CHAR_ASTERISK);
+    if (ok)
       {
-      case CHAR_C:
-      ok = expect_cond_assert == 2;
-      break;
+      if (ptr[0] == CHAR_ASTERISK)  /* New alpha assertion format, possibly */
+        {
+        ok = MAX_255(ptr[1]) && (cb->ctypes[ptr[1]] & ctype_lcletter) != 0;
+        }
+      else switch(ptr[1])  /* Traditional symbolic format */
+        {
+        case CHAR_C:
+        ok = expect_cond_assert == 2;
+        break;
 
-      case CHAR_EQUALS_SIGN:
-      case CHAR_EXCLAMATION_MARK:
-      break;
+        case CHAR_EQUALS_SIGN:
+        case CHAR_EXCLAMATION_MARK:
+        break;
 
-      case CHAR_LESS_THAN_SIGN:
-      ok = ptr[2] == CHAR_EQUALS_SIGN || ptr[2] == CHAR_EXCLAMATION_MARK;
-      break;
+        case CHAR_LESS_THAN_SIGN:
+        ok = ptr[2] == CHAR_EQUALS_SIGN || ptr[2] == CHAR_EXCLAMATION_MARK;
+        break;
 
-      default:
-      ok = FALSE;
+        default:
+        ok = FALSE;
+        }
       }
 
     if (!ok)
@@ -2709,11 +2902,11 @@ while (ptr < ptrend)
     case CHAR_BACKSLASH:
     tempptr = ptr;
     escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options,
-      FALSE, cb);
+      cb->cx->extra_options, FALSE, cb);
     if (errorcode != 0)
       {
       ESCAPE_FAILED:
-      if ((cb->cx->extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0)
+      if ((extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0)
         goto FAILED;
       ptr = tempptr;
       if (ptr >= ptrend) c = CHAR_BACKSLASH; else
@@ -2907,7 +3100,7 @@ while (ptr < ptrend)
 
       /* Not a numerical recursion */
 
-      if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen,
+      if (!read_name(&ptr, ptrend, utf, terminator, &offset, &name, &namelen,
           &errorcode, cb)) goto ESCAPE_FAILED;
 
       /* \k and \g when used with braces are back references, whereas \g used
@@ -2981,6 +3174,21 @@ while (ptr < ptrend)
       goto FAILED_BACK;
       }
 
+    /* Most (*VERB)s are not allowed to be quantified, but an ungreedy
+    quantifier can be useful for (*ACCEPT) - meaning "succeed on backtrack", a
+    sort of negated (*COMMIT). We therefore allow (*ACCEPT) to be quantified by
+    wrapping it in non-capturing brackets, but we have to allow for a preceding
+    (*MARK) for when (*ACCEPT) has an argument. */
+
+    if (parsed_pattern[-1] == META_ACCEPT)
+      {
+      uint32_t *p;
+      for (p = parsed_pattern - 1; p >= verbstartptr; p--) p[1] = p[0];
+      *verbstartptr = META_NOCAPTURE;
+      parsed_pattern[1] = META_KET;
+      parsed_pattern += 2;
+      }
+
     /* Now we can put the quantifier into the parsed pattern vector. At this
     stage, we have only the basic quantifier. The check for a following + or ?
     modifier happens at the top of the loop, after any intervening comments
@@ -3270,12 +3478,12 @@ while (ptr < ptrend)
       else
         {
         tempptr = ptr;
-        escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode,
-          options, TRUE, cb);
+        escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options,
+          cb->cx->extra_options, TRUE, cb);
+
         if (errorcode != 0)
           {
-          CLASS_ESCAPE_FAILED:
-          if ((cb->cx->extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0)
+          if ((extra_options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) == 0)
             goto FAILED;
           ptr = tempptr;
           if (ptr >= ptrend) c = CHAR_BACKSLASH; else
@@ -3285,30 +3493,32 @@ while (ptr < ptrend)
           escape = 0;                 /* Treat as literal character */
           }
 
-        if (escape == 0)  /* Escaped character code point is in c */
+        switch(escape)
           {
+          case 0:  /* Escaped character code point is in c */
           char_is_literal = FALSE;
           goto CLASS_LITERAL;
-          }
 
-        /* These three escapes do not alter the class range state. */
-
-        if (escape == ESC_b)
-          {
-          c = CHAR_BS;   /* \b is backspace in a class */
+          case ESC_b:
+          c = CHAR_BS;    /* \b is backspace in a class */
           char_is_literal = FALSE;
           goto CLASS_LITERAL;
-          }
 
-        else if (escape == ESC_Q)
-          {
+          case ESC_Q:
           inescq = TRUE;  /* Enter literal mode */
           goto CLASS_CONTINUE;
-          }
 
-        else if (escape == ESC_E)  /* Ignore orphan \E */
+          case ESC_E:     /* Ignore orphan \E */
           goto CLASS_CONTINUE;
 
+          case ESC_B:     /* Always an error in a class */
+          case ESC_R:
+          case ESC_X:
+          errorcode = ERR7;
+          ptr--;
+          goto FAILED;
+          }
+
         /* The second part of a range can be a single-character escape
         sequence (detected above), but not any of the other escapes. Perl
         treats a hyphen as a literal in such circumstances. However, in Perl's
@@ -3318,7 +3528,7 @@ while (ptr < ptrend)
         if (class_range_state == RANGE_STARTED)
           {
           errorcode = ERR50;
-          goto CLASS_ESCAPE_FAILED;
+          goto FAILED;  /* Not CLASS_ESCAPE_FAILED; always an error */
           }
 
         /* Of the remaining escapes, only those that define characters are
@@ -3328,8 +3538,8 @@ while (ptr < ptrend)
         switch(escape)
           {
           case ESC_N:
-          errorcode = ERR71;  /* Not supported in a class */
-          goto CLASS_ESCAPE_FAILED;
+          errorcode = ERR71;
+          goto FAILED;
 
           case ESC_H:
           case ESC_h:
@@ -3392,14 +3602,14 @@ while (ptr < ptrend)
             }
 #else
           errorcode = ERR45;
-          goto CLASS_ESCAPE_FAILED;
+          goto FAILED;
 #endif
           break;  /* End \P and \p */
 
           default:    /* All others are not allowed in a class */
           errorcode = ERR7;
           ptr--;
-          goto CLASS_ESCAPE_FAILED;
+          goto FAILED;
           }
 
         /* Perl gives a warning unless a following hyphen is the last character
@@ -3425,6 +3635,8 @@ while (ptr < ptrend)
       if (c == CHAR_RIGHT_SQUARE_BRACKET && !inescq) break;
       }     /* End of class-processing loop */
 
+    /* -] at the end of a class is a literal '-' */
+
     if (class_range_state == RANGE_STARTED)
       {
       parsed_pattern[-1] = CHAR_MINUS;
@@ -3440,7 +3652,8 @@ while (ptr < ptrend)
     case CHAR_LEFT_PARENTHESIS:
     if (ptr >= ptrend) goto UNCLOSED_PARENTHESIS;
 
-    /* If ( is not followed by ? it is either a capture or a special verb. */
+    /* If ( is not followed by ? it is either a capture or a special verb or an
+    alpha assertion. */
 
     if (*ptr != CHAR_QUESTION_MARK)
       {
@@ -3454,23 +3667,140 @@ while (ptr < ptrend)
         nest_depth++;
         if ((options & PCRE2_NO_AUTO_CAPTURE) == 0)
           {
+          if (cb->bracount >= MAX_GROUP_NUMBER)
+            {
+            errorcode = ERR97;
+            goto FAILED;
+            }
           cb->bracount++;
           *parsed_pattern++ = META_CAPTURE | cb->bracount;
           }
         else *parsed_pattern++ = META_NOCAPTURE;
         }
 
+      /* Do nothing for (* followed by end of pattern or ) so it gives a "bad
+      quantifier" error rather than "(*MARK) must have an argument". */
 
-      /* ---- Handle (*VERB) and (*VERB:NAME) ---- */
+      else if (ptrend - ptr <= 1 || (c = ptr[1]) == CHAR_RIGHT_PARENTHESIS)
+        break;
+
+      /* Handle "alpha assertions" such as (*pla:...). Most of these are
+      synonyms for the historical symbolic assertions, but the script run ones
+      are new. They are distinguished by starting with a lower case letter.
+      Checking both ends of the alphabet makes this work in all character
+      codes. */
+
+      else if (CHMAX_255(c) && (cb->ctypes[c] & ctype_lcletter) != 0)
+        {
+        uint32_t meta;
+
+        vn = alasnames;
+        if (!read_name(&ptr, ptrend, utf, 0, &offset, &name, &namelen,
+          &errorcode, cb)) goto FAILED;
+        if (ptr >= ptrend || *ptr != CHAR_COLON)
+          {
+          errorcode = ERR95;  /* Malformed */
+          goto FAILED;
+          }
+
+        /* Scan the table of alpha assertion names */
+
+        for (i = 0; i < alascount; i++)
+          {
+          if (namelen == alasmeta[i].len &&
+              PRIV(strncmp_c8)(name, vn, namelen) == 0)
+            break;
+          vn += alasmeta[i].len + 1;
+          }
+
+        if (i >= alascount)
+          {
+          errorcode = ERR95;  /* Alpha assertion not recognized */
+          goto FAILED;
+          }
+
+        /* Check for expecting an assertion condition. If so, only atomic
+        lookaround assertions are valid. */
+
+        meta = alasmeta[i].meta;
+        if (prev_expect_cond_assert > 0 &&
+            (meta < META_LOOKAHEAD || meta > META_LOOKBEHINDNOT))
+          {
+          errorcode = (meta == META_LOOKAHEAD_NA || meta == META_LOOKBEHIND_NA)?
+            ERR98 : ERR28;  /* (Atomic) assertion expected */
+          goto FAILED;
+          }
+
+        /* The lookaround alphabetic synonyms can mostly be handled by jumping
+        to the code that handles the traditional symbolic forms. */
+
+        switch(meta)
+          {
+          default:
+          errorcode = ERR89;  /* Unknown code; should never occur because */
+          goto FAILED;        /* the meta values come from a table above. */
+
+          case META_ATOMIC:
+          goto ATOMIC_GROUP;
+
+          case META_LOOKAHEAD:
+          goto POSITIVE_LOOK_AHEAD;
+
+          case META_LOOKAHEAD_NA:
+          *parsed_pattern++ = meta;
+          ptr++;
+          goto POST_ASSERTION;
+
+          case META_LOOKAHEADNOT:
+          goto NEGATIVE_LOOK_AHEAD;
+
+          case META_LOOKBEHIND:
+          case META_LOOKBEHINDNOT:
+          case META_LOOKBEHIND_NA:
+          *parsed_pattern++ = meta;
+          ptr--;
+          goto POST_LOOKBEHIND;
+
+          /* The script run facilities are handled here. Unicode support is
+          required (give an error if not, as this is a security issue). Always
+          record a META_SCRIPT_RUN item. Then, for the atomic version, insert
+          META_ATOMIC and remember that we need two META_KETs at the end. */
+
+          case META_SCRIPT_RUN:
+          case META_ATOMIC_SCRIPT_RUN:
+#ifdef SUPPORT_UNICODE
+          *parsed_pattern++ = META_SCRIPT_RUN;
+          nest_depth++;
+          ptr++;
+          if (meta == META_ATOMIC_SCRIPT_RUN)
+            {
+            *parsed_pattern++ = META_ATOMIC;
+            if (top_nest == NULL) top_nest = (nest_save *)(cb->start_workspace);
+            else if (++top_nest >= end_nests)
+              {
+              errorcode = ERR84;
+              goto FAILED;
+              }
+            top_nest->nest_depth = nest_depth;
+            top_nest->flags = NSF_ATOMICSR;
+            top_nest->options = options & PARSE_TRACKED_OPTIONS;
+            }
+          break;
+#else  /* SUPPORT_UNICODE */
+          errorcode = ERR96;
+          goto FAILED;
+#endif
+          }
+        }
 
-      /* Do nothing for (*) so it gives a "bad quantifier" error rather than
-      "(*MARK) must have an argument". */
 
-      else if (ptrend - ptr > 1 && ptr[1] != CHAR_RIGHT_PARENTHESIS)
+      /* ---- Handle (*VERB) and (*VERB:NAME) ---- */
+
+      else
         {
         vn = verbnames;
-        if (!read_name(&ptr, ptrend, 0, &offset, &name, &namelen, &errorcode,
-          cb)) goto FAILED;
+        if (!read_name(&ptr, ptrend, utf, 0, &offset, &name, &namelen,
+          &errorcode, cb)) goto FAILED;
         if (ptr >= ptrend || (*ptr != CHAR_COLON &&
                               *ptr != CHAR_RIGHT_PARENTHESIS))
           {
@@ -3508,6 +3838,12 @@ while (ptr < ptrend)
           goto FAILED;
           }
 
+        /* Remember where this verb, possibly with a preceding (*MARK), starts,
+        for handling quantified (*ACCEPT). */
+
+        verbstartptr = parsed_pattern;
+        okquantifier = (verbs[i].meta == META_ACCEPT);
+
         /* It appears that Perl allows any characters whatsoever, other than a
         closing parenthesis, to appear in arguments ("names"), so we no longer
         insist on letters, digits, and underscores. Perl does not, however, do
@@ -3725,7 +4061,7 @@ while (ptr < ptrend)
         errorcode = ERR41;
         goto FAILED;
         }
-      if (!read_name(&ptr, ptrend, CHAR_RIGHT_PARENTHESIS, &offset, &name,
+      if (!read_name(&ptr, ptrend, utf, CHAR_RIGHT_PARENTHESIS, &offset, &name,
           &namelen, &errorcode, cb)) goto FAILED;
       *parsed_pattern++ = META_BACKREF_BYNAME;
       *parsed_pattern++ = namelen;
@@ -3785,7 +4121,7 @@ while (ptr < ptrend)
 
       case CHAR_AMPERSAND:
       RECURSE_BY_NAME:
-      if (!read_name(&ptr, ptrend, CHAR_RIGHT_PARENTHESIS, &offset, &name,
+      if (!read_name(&ptr, ptrend, utf, CHAR_RIGHT_PARENTHESIS, &offset, &name,
           &namelen, &errorcode, cb)) goto FAILED;
       *parsed_pattern++ = META_RECURSE_BYNAME;
       *parsed_pattern++ = namelen;
@@ -3933,14 +4269,15 @@ while (ptr < ptrend)
       if (++ptr >= ptrend) goto UNCLOSED_PARENTHESIS;
       nest_depth++;
 
-      /* If the next character is ? there must be an assertion next (optionally
-      preceded by a callout). We do not check this here, but instead we set
-      expect_cond_assert to 2. If this is still greater than zero (callouts
-      decrement it) when the next assertion is read, it will be marked as a
-      condition that must not be repeated. A value greater than zero also
-      causes checking that an assertion (possibly with callout) follows. */
+      /* If the next character is ? or * there must be an assertion next
+      (optionally preceded by a callout). We do not check this here, but
+      instead we set expect_cond_assert to 2. If this is still greater than
+      zero (callouts decrement it) when the next assertion is read, it will be
+      marked as a condition that must not be repeated. A value greater than
+      zero also causes checking that an assertion (possibly with callout)
+      follows. */
 
-      if (*ptr == CHAR_QUESTION_MARK)
+      if (*ptr == CHAR_QUESTION_MARK || *ptr == CHAR_ASTERISK)
         {
         *parsed_pattern++ = META_COND_ASSERT;
         ptr--;   /* Pull pointer back to the opening parenthesis. */
@@ -4032,7 +4369,7 @@ while (ptr < ptrend)
           terminator = CHAR_RIGHT_PARENTHESIS;
           ptr--;   /* Point to char before name */
           }
-        if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen,
+        if (!read_name(&ptr, ptrend, utf, terminator, &offset, &name, &namelen,
             &errorcode, cb)) goto FAILED;
 
         /* Handle (?(R&name) */
@@ -4086,6 +4423,7 @@ while (ptr < ptrend)
       /* ---- Atomic group ---- */
 
       case CHAR_GREATER_THAN_SIGN:
+      ATOMIC_GROUP:                          /* Come from (*atomic: */
       *parsed_pattern++ = META_ATOMIC;
       nest_depth++;
       ptr++;
@@ -4095,11 +4433,13 @@ while (ptr < ptrend)
       /* ---- Lookahead assertions ---- */
 
       case CHAR_EQUALS_SIGN:
+      POSITIVE_LOOK_AHEAD:                   /* Come from (*pla: */
       *parsed_pattern++ = META_LOOKAHEAD;
       ptr++;
       goto POST_ASSERTION;
 
       case CHAR_EXCLAMATION_MARK:
+      NEGATIVE_LOOK_AHEAD:                   /* Come from (*nla: */
       *parsed_pattern++ = META_LOOKAHEADNOT;
       ptr++;
       goto POST_ASSERTION;
@@ -4119,6 +4459,8 @@ while (ptr < ptrend)
         }
       *parsed_pattern++ = (ptr[1] == CHAR_EQUALS_SIGN)?
         META_LOOKBEHIND : META_LOOKBEHINDNOT;
+
+      POST_LOOKBEHIND:              /* Come from (*plb: (*naplb: and (*nlb: */
       *has_lookbehind = TRUE;
       offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 2);
       PUTOFFSET(offset, parsed_pattern);
@@ -4161,12 +4503,17 @@ while (ptr < ptrend)
       terminator = CHAR_APOSTROPHE;    /* Terminator */
 
       DEFINE_NAME:
-      if (!read_name(&ptr, ptrend, terminator, &offset, &name, &namelen,
+      if (!read_name(&ptr, ptrend, utf, terminator, &offset, &name, &namelen,
           &errorcode, cb)) goto FAILED;
 
       /* We have a name for this capturing group. It is also assigned a number,
       which is its primary means of identification. */
 
+      if (cb->bracount >= MAX_GROUP_NUMBER)
+        {
+        errorcode = ERR97;
+        goto FAILED;
+        }
       cb->bracount++;
       *parsed_pattern++ = META_CAPTURE | cb->bracount;
       nest_depth++;
@@ -4280,6 +4627,14 @@ while (ptr < ptrend)
         cb->bracount = top_nest->max_group;
       if ((top_nest->flags & NSF_CONDASSERT) != 0)
         okquantifier = FALSE;
+
+      if ((top_nest->flags & NSF_ATOMICSR) != 0)
+        {
+        *parsed_pattern++ = META_KET;
+        }
+
+
+
       if (top_nest == (nest_save *)(cb->start_workspace)) top_nest = NULL;
         else top_nest--;
       }
@@ -4311,12 +4666,12 @@ parsed_pattern = manage_callouts(ptr, &previous_callout, auto_callout,
 /* Insert trailing items for word and line matching (features provided for the
 benefit of pcre2grep). */
 
-if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_LINE) != 0)
+if ((extra_options & PCRE2_EXTRA_MATCH_LINE) != 0)
   {
   *parsed_pattern++ = META_KET;
   *parsed_pattern++ = META_DOLLAR;
   }
-else if ((cb->cx->extra_options & PCRE2_EXTRA_MATCH_WORD) != 0)
+else if ((extra_options & PCRE2_EXTRA_MATCH_WORD) != 0)
   {
   *parsed_pattern++ = META_KET;
   *parsed_pattern++ = META_ESCAPE + ESC_b;
@@ -4385,6 +4740,7 @@ for (;;)
     case OP_ASSERT_NOT:
     case OP_ASSERTBACK:
     case OP_ASSERTBACK_NOT:
+    case OP_ASSERTBACK_NA:
     if (!skipassert) return code;
     do code += GET(code, 1); while (*code == OP_ALT);
     code += PRIV(OP_lengths)[*code];
@@ -4421,6 +4777,14 @@ for (;;)
     code += GET(code, 1) + 1 + LINK_SIZE;
     break;
 
+    case OP_MARK:
+    case OP_COMMIT_ARG:
+    case OP_PRUNE_ARG:
+    case OP_SKIP_ARG:
+    case OP_THEN_ARG:
+    code += code[1] + PRIV(OP_lengths)[*code];
+    break;
+
     default:
     return code;
     }
@@ -4937,8 +5301,10 @@ PCRE2_UCHAR *tempcode;
 PCRE2_UCHAR *previous = NULL;
 PCRE2_UCHAR op_previous;
 BOOL groupsetfirstcu = FALSE;
+BOOL had_accept = FALSE;
 BOOL matched_char = FALSE;
 BOOL previous_matched_char = FALSE;
+BOOL reset_caseful = FALSE;
 const uint8_t *cbits = cb->cbits;
 uint8_t classbits[32];
 
@@ -5071,7 +5437,7 @@ for (;; pptr++)
   if (meta < META_ASTERISK || meta > META_MINMAX_QUERY)
     {
     previous = code;
-    if (matched_char) okreturn = 1;
+    if (matched_char && !had_accept) okreturn = 1;
     }
 
   previous_matched_char = matched_char;
@@ -5215,7 +5581,45 @@ for (;; pptr++)
       }        /* End of 1-char optimization */
 
     /* Handle character classes that contain more than just one literal
-    character. */
+    character. If there are exactly two characters in a positive class, see if
+    they are case partners. This can be optimized to generate a caseless single
+    character match (which also sets first/required code units if relevant). */
+
+    if (meta == META_CLASS && pptr[1] < META_END && pptr[2] < META_END &&
+        pptr[3] == META_CLASS_END)
+      {
+      uint32_t c = pptr[1];
+
+#ifdef SUPPORT_UNICODE
+      if (UCD_CASESET(c) == 0)
+#endif
+        {
+        uint32_t d;
+
+#ifdef SUPPORT_UNICODE
+        if (utf && c > 127) d = UCD_OTHERCASE(c); else
+#endif
+          {
+#if PCRE2_CODE_UNIT_WIDTH != 8
+          if (c > 255) d = c; else
+#endif
+          d = TABLE_GET(c, cb->fcc, c);
+          }
+
+        if (c != d && pptr[2] == d)
+          {
+          pptr += 3;                 /* Move on to class end */
+          meta = c;
+          if ((options & PCRE2_CASELESS) == 0)
+            {
+            reset_caseful = TRUE;
+            options |= PCRE2_CASELESS;
+            req_caseopt = REQ_CASELESS;
+            }
+          goto CLASS_CASELESS_CHAR;
+          }
+        }
+      }
 
     /* 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
@@ -5516,10 +5920,10 @@ for (;; pptr++)
           if (range_is_literal &&
                (cb->ctypes[c] & ctype_letter) != 0 &&
                (cb->ctypes[d] & ctype_letter) != 0 &&
-               (d <= CHAR_z) == (d <= CHAR_z))
+               (c <= CHAR_z) == (d <= CHAR_z))
             {
             uint32_t uc = (d <= CHAR_z)? 0 : 64;
-            uint32_t C = d - uc;
+            uint32_t C = c - uc;
             uint32_t D = d - uc;
 
             if (C <= CHAR_i)
@@ -5664,7 +6068,10 @@ for (;; pptr++)
         (void)memmove(code + (32 / sizeof(PCRE2_UCHAR)), code,
           CU2BYTES(class_uchardata - code));
         if (negate_class && !xclass_has_prop)
-          for (i = 0; i < 32; i++) classbits[i] = ~classbits[i];
+          {
+          /* Using 255 ^ instead of ~ avoids clang sanitize warning. */
+          for (i = 0; i < 32; i++) classbits[i] = 255 ^ classbits[i];
+          }
         memcpy(code, classbits, 32);
         code = class_uchardata + (32 / sizeof(PCRE2_UCHAR));
         }
@@ -5687,7 +6094,10 @@ for (;; pptr++)
     if (lengthptr == NULL)    /* Save time in the pre-compile phase */
       {
       if (negate_class)
-        for (i = 0; i < 32; i++) classbits[i] = ~classbits[i];
+        {
+       /* Using 255 ^ instead of ~ avoids clang sanitize warning. */
+       for (i = 0; i < 32; i++) classbits[i] = 255 ^ classbits[i];
+       }
       memcpy(code, classbits, 32);
       }
     code += 32 / sizeof(PCRE2_UCHAR);
@@ -5704,7 +6114,7 @@ for (;; pptr++)
     workspace overflow. Do not set firstcu after *ACCEPT. */
 
     case META_ACCEPT:
-    cb->had_accept = TRUE;
+    cb->had_accept = had_accept = TRUE;
     for (oc = cb->open_caps;
          oc != NULL && oc->assert_depth >= cb->assert_depth;
          oc = oc->next)
@@ -5901,7 +6311,7 @@ for (;; pptr++)
       }
     goto GROUP_PROCESS_NOTE_EMPTY;
 
-    /* The DEFINE condition is always false. It's internal groups may never
+    /* The DEFINE condition is always false. Its internal groups may never
     be called, so matched_char must remain false, hence the jump to
     GROUP_PROCESS rather than GROUP_PROCESS_NOTE_EMPTY. */
 
@@ -5962,6 +6372,11 @@ for (;; pptr++)
     cb->assert_depth += 1;
     goto GROUP_PROCESS;
 
+    case META_LOOKAHEAD_NA:
+    bravalue = OP_ASSERT_NA;
+    cb->assert_depth += 1;
+    goto GROUP_PROCESS;
+
     /* Optimize (?!) to (*FAIL) unless it is quantified - which is a weird
     thing to do, but Perl allows all assertions to be quantified, and when
     they contain capturing parentheses there may be a potential use for
@@ -5993,10 +6408,19 @@ for (;; pptr++)
     cb->assert_depth += 1;
     goto GROUP_PROCESS;
 
+    case META_LOOKBEHIND_NA:
+    bravalue = OP_ASSERTBACK_NA;
+    cb->assert_depth += 1;
+    goto GROUP_PROCESS;
+
     case META_ATOMIC:
     bravalue = OP_ONCE;
     goto GROUP_PROCESS_NOTE_EMPTY;
 
+    case META_SCRIPT_RUN:
+    bravalue = OP_SCRIPT_RUN;
+    goto GROUP_PROCESS_NOTE_EMPTY;
+
     case META_NOCAPTURE:
     bravalue = OP_BRA;
     /* Fall through */
@@ -6047,7 +6471,7 @@ for (;; pptr++)
 
     /* If we've just compiled an assertion, pop the assert depth. */
 
-    if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT)
+    if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NA)
       cb->assert_depth -= 1;
 
     /* At the end of compiling, code is still pointing to the start of the
@@ -6197,8 +6621,8 @@ for (;; pptr++)
     we must only take the reqcu when the group also set a firstcu. Otherwise,
     in that example, 'X' ends up set for both. */
 
-    else if (bravalue == OP_ASSERT && subreqcuflags >= 0 &&
-             subfirstcuflags >= 0)
+    else if ((bravalue == OP_ASSERT || bravalue == OP_ASSERT_NA) &&
+             subreqcuflags >= 0 && subfirstcuflags >= 0)
       {
       reqcu = subreqcu;
       reqcuflags = subreqcuflags;
@@ -6237,8 +6661,8 @@ for (;; pptr++)
           groupnumber = ng->number;
 
           /* For a recursion, that's all that is needed. We can now go to
-          the code above that handles numerical recursion, applying it to
-          the first group with the given name. */
+          the code that handles numerical recursion, applying it to the first
+          group with the given name. */
 
           if (meta == META_RECURSE_BYNAME)
             {
@@ -6419,10 +6843,6 @@ for (;; pptr++)
     reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY;
     op_type = 0;
 
-    /* If the repeat is {1} we can ignore it. */
-
-    if (repeat_max == 1 && repeat_min == 1) goto END_REPEAT;
-
     /* Adjust first and required code units for a zero repeat. */
 
     if (repeat_min == 0)
@@ -6465,7 +6885,10 @@ for (;; pptr++)
     tempcode = previous;
     op_previous = *previous;
 
-    /* Now handle repetition for the different types of item. */
+    /* Now handle repetition for the different types of item. If the repeat
+    minimum and the repeat maximum are both 1, we can ignore the quantifier for
+    non-parenthesized items, as they have only one alternative. For anything in
+    parentheses, we must not ignore if {1} is possessive. */
 
     switch (op_previous)
       {
@@ -6479,6 +6902,7 @@ for (;; pptr++)
       case OP_CHARI:
       case OP_NOT:
       case OP_NOTI:
+      if (repeat_max == 1 && repeat_min == 1) goto END_REPEAT;
       op_type = chartypeoffset[op_previous - OP_CHAR];
 
       /* Deal with UTF characters that take up more than one code unit. */
@@ -6525,6 +6949,7 @@ for (;; pptr++)
         code = previous;
         goto END_REPEAT;
         }
+      if (repeat_max == 1 && repeat_min == 1) goto END_REPEAT;
 
       if (repeat_min == 0 && repeat_max == REPEAT_UNLIMITED)
         *code++ = OP_CRSTAR + repeat_type;
@@ -6559,6 +6984,8 @@ for (;; pptr++)
       repetition. */
 
       case OP_RECURSE:
+      if (repeat_max == 1 && repeat_min == 1 && !possessive_quantifier)
+        goto END_REPEAT;
 
       /* Generate unwrapped repeats for a non-zero minimum, except when the
       minimum is 1 and the maximum unlimited, because that can be handled with
@@ -6629,9 +7056,12 @@ for (;; pptr++)
 
       case OP_ASSERT:
       case OP_ASSERT_NOT:
+      case OP_ASSERT_NA:
       case OP_ASSERTBACK:
       case OP_ASSERTBACK_NOT:
+      case OP_ASSERTBACK_NA:
       case OP_ONCE:
+      case OP_SCRIPT_RUN:
       case OP_BRA:
       case OP_CBRA:
       case OP_COND:
@@ -6640,6 +7070,9 @@ for (;; pptr++)
         PCRE2_UCHAR *bralink = NULL;
         PCRE2_UCHAR *brazeroptr = NULL;
 
+        if (repeat_max == 1 && repeat_min == 1 && !possessive_quantifier)
+          goto END_REPEAT;
+
         /* Repeating a DEFINE group (or any group where the condition is always
         FALSE and there is only one branch) is pointless, but Perl allows the
         syntax, so we just ignore the repeat. */
@@ -6844,23 +7277,24 @@ for (;; pptr++)
           }
 
         /* If the maximum is unlimited, set a repeater in the final copy. For
-        ONCE brackets, that's all we need to do. However, possessively repeated
-        ONCE brackets can be converted into non-capturing brackets, as the
-        behaviour of (?:xx)++ is the same as (?>xx)++ and this saves having to
-        deal with possessive ONCEs specially.
+        SCRIPT_RUN and ONCE brackets, that's all we need to do. However,
+        possessively repeated ONCE brackets can be converted into non-capturing
+        brackets, as the behaviour of (?:xx)++ is the same as (?>xx)++ and this
+        saves having to deal with possessive ONCEs specially.
 
         Otherwise, when we are doing the actual compile phase, check to see
         whether this group is one that could match an empty string. If so,
         convert the initial operator to the S form (e.g. OP_BRA -> OP_SBRA) so
         that runtime checking can be done. [This check is also applied to ONCE
-        groups at runtime, but in a different way.]
+        and SCRIPT_RUN groups at runtime, but in a different way.]
 
         Then, if the quantifier was possessive and the bracket is not a
-        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 pcre2_match(). If
-        the group is preceded by OP_BRAZERO, convert this to OP_BRAPOSZERO.
+        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
+        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
         flag so that the default action below, of wrapping everything inside
@@ -6877,13 +7311,14 @@ for (;; pptr++)
 
           if (*bracode == OP_ONCE && possessive_quantifier) *bracode = OP_BRA;
 
-          /* For non-possessive ONCE brackets, all we need to do is to
-          set the KET. */
+          /* For non-possessive ONCE and for SCRIPT_RUN brackets, all we need
+          to do is to set the KET. */
 
-          if (*bracode == OP_ONCE) *ketcode = OP_KETRMAX + repeat_type;
+          if (*bracode == OP_ONCE || *bracode == OP_SCRIPT_RUN)
+            *ketcode = OP_KETRMAX + repeat_type;
 
-          /* Handle non-ONCE brackets and possessive ONCEs (which have been
-          converted to non-capturing above). */
+          /* Handle non-SCRIPT_RUN and non-ONCE brackets and possessive ONCEs
+          (which have been converted to non-capturing above). */
 
           else
             {
@@ -6960,6 +7395,8 @@ for (;; pptr++)
         int prop_type, prop_value;
         PCRE2_UCHAR *oldcode;
 
+        if (repeat_max == 1 && repeat_min == 1) goto END_REPEAT;
+
         op_type = OP_TYPESTAR - OP_STAR;      /* Use type opcodes */
         mclength = 0;                         /* Not a character */
 
@@ -7267,9 +7704,8 @@ for (;; pptr++)
     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). */
+    implementations). Note that a recursion does not have a set first
+    character. */
 
     case META_RECURSE:
     GETPLUSOFFSET(offset, pptr);
@@ -7286,6 +7722,8 @@ for (;; pptr++)
     groupsetfirstcu = FALSE;
     cb->had_recurse = TRUE;
     if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE;
+    zerofirstcu = firstcu;
+    zerofirstcuflags = firstcuflags;
     break;
 
 
@@ -7340,9 +7778,20 @@ for (;; pptr++)
       {
       uint32_t ptype = *(++pptr) >> 16;
       uint32_t pdata = *pptr & 0xffff;
-      *code++ = (meta_arg == ESC_p)? OP_PROP : OP_NOTPROP;
-      *code++ = ptype;
-      *code++ = pdata;
+
+      /* The special case of \p{Any} is compiled to OP_ALLANY so as to benefit
+      from the auto-anchoring code. */
+
+      if (meta_arg == ESC_p && ptype == PT_ANY)
+        {
+        *code++ = OP_ALLANY;
+        }
+      else
+        {
+        *code++ = (meta_arg == ESC_p)? OP_PROP : OP_NOTPROP;
+        *code++ = ptype;
+        *code++ = pdata;
+        }
       break;  /* End META_ESCAPE */
       }
 #endif
@@ -7410,9 +7859,15 @@ for (;; pptr++)
       }
 #endif
 
-    /* Caseful matches, or not one of the multicase characters. Get the
-    character's code units into mcbuffer, with the length in mclength. When not
-    in UTF mode, the length is always 1. */
+    /* Caseful matches, or caseless and not one of the multicase characters. We
+    come here by goto in the case of a positive class that contains only
+    case-partners of a character with just two cases; matched_char has already
+    been set TRUE and options fudged if necessary. */
+
+    CLASS_CASELESS_CHAR:
+
+    /* Get the character's code units into mcbuffer, with the length in
+    mclength. When not in UTF mode, the length is always 1. */
 
 #ifdef SUPPORT_UNICODE
     if (utf) mclength = PRIV(ord2utf)(meta, mcbuffer); else
@@ -7444,8 +7899,9 @@ for (;; pptr++)
       zeroreqcu = reqcu;
       zeroreqcuflags = reqcuflags;
 
-      /* If the character is more than one code unit long, we can set firstcu
-      only if it is not to be matched caselessly. */
+      /* If the character is more than one code unit long, we can set a single
+      firstcu only if it is not to be matched caselessly. Multiple possible
+      starting code units may be picked up later in the studying code. */
 
       if (mclength == 1 || req_caseopt == 0)
         {
@@ -7475,7 +7931,17 @@ for (;; pptr++)
         reqcuflags = req_caseopt | cb->req_varyopt;
         }
       }
-    break;    /* End default meta handling */
+
+    /* If caselessness was temporarily instated, reset it. */
+
+    if (reset_caseful)
+      {
+      options &= ~PCRE2_CASELESS;
+      req_caseopt = 0;
+      reset_caseful = FALSE;
+      }
+
+    break;    /* End literal character handling */
     }         /* End of big switch */
   }           /* End of big loop */
 
@@ -7566,7 +8032,10 @@ length = 2 + 2*LINK_SIZE + skipunits;
 /* Remember if this is a lookbehind assertion, and if it is, save its length
 and skip over the pattern offset. */
 
-lookbehind = *code == OP_ASSERTBACK || *code == OP_ASSERTBACK_NOT;
+lookbehind = *code == OP_ASSERTBACK ||
+             *code == OP_ASSERTBACK_NOT ||
+             *code == OP_ASSERTBACK_NA;
+
 if (lookbehind)
   {
   lookbehindlength = META_DATA(pptr[-1]);
@@ -7640,7 +8109,7 @@ for (;;)
     /* If this is not the first branch, the first char and reqcu have to
     match the values from all the previous branches, except that if the
     previous value for reqcu didn't have REQ_VARY set, it can still match,
-    and we set REQ_VARY for the regex. */
+    and we set REQ_VARY for the group from this branch's value. */
 
     else
       {
@@ -7679,7 +8148,7 @@ for (;;)
       else
         {
         reqcu = branchreqcu;
-        reqcuflags |= branchreqcuflags; /* To "or" REQ_VARY */
+        reqcuflags |= branchreqcuflags; /* To "or" REQ_VARY if present */
         }
       }
     }
@@ -7859,7 +8328,7 @@ do {
 
    /* Positive forward assertion */
 
-   else if (op == OP_ASSERT)
+   else if (op == OP_ASSERT || op == OP_ASSERT_NA)
      {
      if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE)) return FALSE;
      }
@@ -7997,7 +8466,7 @@ do {
 
    /* Positive forward assertions */
 
-   else if (op == OP_ASSERT)
+   else if (op == OP_ASSERT || op == OP_ASSERT_NA)
      {
      if (!is_startline(scode, bracket_map, cb, atomcount, TRUE))
        return FALSE;
@@ -8239,8 +8708,11 @@ do {
      case OP_CBRAPOS:
      case OP_SCBRAPOS:
      case OP_ASSERT:
+     case OP_ASSERT_NA:
      case OP_ONCE:
-     d = find_firstassertedcu(scode, &dflags, inassert + ((op==OP_ASSERT)?1:0));
+     case OP_SCRIPT_RUN:
+     d = find_firstassertedcu(scode, &dflags, inassert +
+       ((op == OP_ASSERT || op == OP_ASSERT_NA)?1:0));
      if (dflags < 0)
        return 0;
      if (cflags < 0) { c = d; cflags = dflags; }
@@ -8269,6 +8741,19 @@ do {
      case OP_MINPLUSI:
      case OP_POSPLUSI:
      if (inassert == 0) return 0;
+
+     /* If the character is more than one code unit long, we cannot set its
+     first code unit when matching caselessly. Later scanning may pick up
+     multiple code units. */
+
+#ifdef SUPPORT_UNICODE
+#if PCRE2_CODE_UNIT_WIDTH == 8
+     if (scode[1] >= 0x80) return 0;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+     if (scode[1] >= 0xd800 && scode[1] <= 0xdfff) return 0;
+#endif
+#endif
+
      if (cflags < 0) { c = scode[1]; cflags = REQ_CASELESS; }
        else if (c != scode[1]) return 0;
      break;
@@ -8436,9 +8921,12 @@ for (;; pptr++)
     case META_COND_VERSION:
     case META_LOOKAHEAD:
     case META_LOOKAHEADNOT:
+    case META_LOOKAHEAD_NA:
     case META_LOOKBEHIND:
     case META_LOOKBEHINDNOT:
+    case META_LOOKBEHIND_NA:
     case META_NOCAPTURE:
+    case META_SCRIPT_RUN:
     nestlevel++;
     break;
 
@@ -8488,7 +8976,7 @@ Returns:      the group length or a negative number
 
 static int
 get_grouplength(uint32_t **pptrptr, BOOL isinline, int *errcodeptr, int *lcptr,
-  int group, parsed_recurse_check *recurses, compile_block *cb)
+   int group, parsed_recurse_check *recurses, compile_block *cb)
 {
 int branchlength;
 int grouplength = -1;
@@ -8537,8 +9025,7 @@ return -1;
 *************************************************/
 
 /* Return a fixed length for a branch in a lookbehind, giving an error if the
-length is not fixed. If any lookbehinds are encountered on the way, they get
-their length set. On entry, *pptrptr points to the first element inside the
+length is not fixed. On entry, *pptrptr points to the first element inside the
 branch. On exit it is set to point to the ALT or KET.
 
 Arguments:
@@ -8668,15 +9155,16 @@ for (;; pptr++)
       }
     break;
 
-    /* Lookaheads can be ignored, but we must start the skip inside the group
-    so that it isn't treated as a group within the branch. */
+    /* Lookaheads do not contribute to the length of this branch, but they may
+    contain lookbehinds within them whose lengths need to be set. */
 
     case META_LOOKAHEAD:
     case META_LOOKAHEADNOT:
-    pptr = parsed_skip(pptr + 1, PSKIP_KET);
-    if (pptr == NULL) goto PARSED_SKIP_FAILED;
+    case META_LOOKAHEAD_NA:
+    *errcodeptr = check_lookbehinds(pptr + 1, &pptr, recurses, cb);
+    if (*errcodeptr != 0) return -1;
 
-    /* Also ignore any qualifiers that follow a lookahead assertion. */
+    /* Ignore any qualifiers that follow a lookahead assertion. */
 
     switch (pptr[1])
       {
@@ -8703,10 +9191,12 @@ for (;; pptr++)
       }
     break;
 
-    /* Lookbehinds can be ignored, but must themselves be checked. */
+    /* A nested lookbehind does not contribute any length to this lookbehind,
+    but must itself be checked and have its lengths set. */
 
     case META_LOOKBEHIND:
     case META_LOOKBEHINDNOT:
+    case META_LOOKBEHIND_NA:
     if (!set_lookbehind_lengths(&pptr, errcodeptr, lcptr, recurses, cb))
       return -1;
     break;
@@ -8851,6 +9341,7 @@ for (;; pptr++)
 
     case META_ATOMIC:
     case META_NOCAPTURE:
+    case META_SCRIPT_RUN:
     pptr++;
     CHECK_GROUP:
     grouplength = get_grouplength(&pptr, TRUE, errcodeptr, lcptr, group,
@@ -8867,8 +9358,26 @@ for (;; pptr++)
     case META_MINMAX_QUERY:
     if (pptr[1] == pptr[2])
       {
-      if (pptr[1] == 0) branchlength -= lastitemlength;
-        else itemlength = (pptr[1] - 1) * lastitemlength;
+      switch(pptr[1])
+        {
+        case 0:
+        branchlength -= lastitemlength;
+        break;
+
+        case 1:
+        itemlength = 0;
+        break;
+
+        default:  /* Check for integer overflow */
+        if (lastitemlength != 0 &&  /* Should not occur, but just in case */
+            INT_MAX/lastitemlength < pptr[1] - 1)
+          {
+          *errcodeptr = ERR87;  /* Integer overflow; lookbehind too big */
+          return -1;
+          }
+        itemlength = (pptr[1] - 1) * lastitemlength;
+        break;
+        }
       pptr += 2;
       break;
       }
@@ -8882,24 +9391,23 @@ for (;; pptr++)
     return -1;
     }
 
-  /* Add the item length to the branchlength, and save it for use if the next
-  thing is a quantifier. */
-
-  branchlength += itemlength;
-  lastitemlength = itemlength;
-
-  /* Ensure that the length does not overflow the limit. */
+  /* Add the item length to the branchlength, checking for integer overflow and
+  for the branch length exceeding the limit. */
 
-  if (branchlength > LOOKBEHIND_MAX)
+  if (INT_MAX - branchlength < (int)itemlength ||
+      (branchlength += itemlength) > LOOKBEHIND_MAX)
     {
     *errcodeptr = ERR87;
     return -1;
     }
+
+  /* Save this item length for use if the next item is a quantifier. */
+
+  lastitemlength = itemlength;
   }
 
 EXIT:
 *pptrptr = pptr;
-if (branchlength > cb->max_lookbehind) cb->max_lookbehind = branchlength;
 return branchlength;
 
 PARSED_SKIP_FAILED:
@@ -8918,6 +9426,11 @@ branches. An error occurs if any branch does not have a fixed length that is
 less than the maximum (65535). On exit, the pointer must be left on the final
 ket.
 
+The function also maintains the max_lookbehind value. Any lookbehind branch
+that contains a nested lookbehind may actually look further back than the
+length of the branch. The additional amount is passed back from
+get_branchlength() as an "extra" value.
+
 Arguments:
   pptrptr     pointer to pointer in the parsed pattern
   errcodeptr  pointer to error code
@@ -8951,6 +9464,7 @@ do
     if (cb->erroroffset == PCRE2_UNSET) cb->erroroffset = offset;
     return FALSE;
     }
+  if (branchlength > cb->max_lookbehind) cb->max_lookbehind = branchlength;
   *bptr |= branchlength;  /* branchlength never more than 65535 */
   bptr = *pptrptr;
   }
@@ -8971,20 +9485,30 @@ set_lookbehind_lengths() for each one. At the start, the errorcode is zero and
 the error offset is marked unset. The enables the functions above not to
 override settings from deeper nestings.
 
-Arguments cb      points to the compile block
-Returns:          0 on success, or an errorcode (cb->erroroffset will be set)
+This function is called recursively from get_branchlength() for lookaheads in
+order to process any lookbehinds that they may contain. It stops when it hits a
+non-nested closing parenthesis in this case, returning a pointer to it.
+
+Arguments
+  pptr      points to where to start (start of pattern or start of lookahead)
+  retptr    if not NULL, return the ket pointer here
+  recurses  chain of recurse_check to catch mutual recursion
+  cb        points to the compile block
+
+Returns:    0 on success, or an errorcode (cb->erroroffset will be set)
 */
 
 static int
-check_lookbehinds(compile_block *cb)
+check_lookbehinds(uint32_t *pptr, uint32_t **retptr,
+  parsed_recurse_check *recurses, compile_block *cb)
 {
-uint32_t *pptr;
 int errorcode = 0;
 int loopcount = 0;
+int nestlevel = 0;
 
 cb->erroroffset = PCRE2_UNSET;
 
-for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++)
+for (; *pptr != META_END; pptr++)
   {
   if (*pptr < META_END) continue;  /* Literal */
 
@@ -8998,14 +9522,31 @@ for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++)
       pptr += 1;
     break;
 
+    case META_KET:
+    if (--nestlevel < 0)
+      {
+      if (retptr != NULL) *retptr = pptr;
+      return 0;
+      }
+    break;
+
+    case META_ATOMIC:
+    case META_CAPTURE:
+    case META_COND_ASSERT:
+    case META_LOOKAHEAD:
+    case META_LOOKAHEADNOT:
+    case META_LOOKAHEAD_NA:
+    case META_NOCAPTURE:
+    case META_SCRIPT_RUN:
+    nestlevel++;
+    break;
+
     case META_ACCEPT:
     case META_ALT:
     case META_ASTERISK:
     case META_ASTERISK_PLUS:
     case META_ASTERISK_QUERY:
-    case META_ATOMIC:
     case META_BACKREF:
-    case META_CAPTURE:
     case META_CIRCUMFLEX:
     case META_CLASS:
     case META_CLASS_EMPTY:
@@ -9013,14 +9554,9 @@ for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++)
     case META_CLASS_END:
     case META_CLASS_NOT:
     case META_COMMIT:
-    case META_COND_ASSERT:
     case META_DOLLAR:
     case META_DOT:
     case META_FAIL:
-    case META_KET:
-    case META_LOOKAHEAD:
-    case META_LOOKAHEADNOT:
-    case META_NOCAPTURE:
     case META_PLUS:
     case META_PLUS_PLUS:
     case META_PLUS_QUERY:
@@ -9039,13 +9575,22 @@ for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++)
     break;
 
     case META_BACKREF_BYNAME:
+    case META_RECURSE_BYNAME:
+    pptr += 1 + SIZEOFFSET;
+    break;
+
     case META_COND_DEFINE:
     case META_COND_NAME:
     case META_COND_NUMBER:
     case META_COND_RNAME:
     case META_COND_RNUMBER:
-    case META_RECURSE_BYNAME:
     pptr += 1 + SIZEOFFSET;
+    nestlevel++;
+    break;
+
+    case META_COND_VERSION:
+    pptr += 3;
+    nestlevel++;
     break;
 
     case META_CALLOUT_STRING:
@@ -9066,7 +9611,6 @@ for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++)
     break;
 
     case META_CALLOUT_NUMBER:
-    case META_COND_VERSION:
     pptr += 3;
     break;
 
@@ -9080,7 +9624,8 @@ for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++)
 
     case META_LOOKBEHIND:
     case META_LOOKBEHINDNOT:
-    if (!set_lookbehind_lengths(&pptr, &errorcode, &loopcount, NULL, cb))
+    case META_LOOKBEHIND_NA:
+    if (!set_lookbehind_lengths(&pptr, &errorcode, &loopcount, recurses, cb))
       return errorcode;
     break;
     }
@@ -9182,6 +9727,10 @@ if (pattern == NULL)
 if (ccontext == NULL)
   ccontext = (pcre2_compile_context *)(&PRIV(default_compile_context));
 
+/* PCRE2_MATCH_INVALID_UTF implies UTF */
+
+if ((options & PCRE2_MATCH_INVALID_UTF) != 0) options |= PCRE2_UTF;
+
 /* Check that all undefined public option bits are zero. */
 
 if ((options & ~PUBLIC_COMPILE_OPTIONS) != 0 ||
@@ -9360,7 +9909,7 @@ if ((options & PCRE2_LITERAL) == 0)
 
 ptr += skipatstart;
 
-/* Can't support UTF or UCP unless PCRE2 has been compiled with UTF support. */
+/* Can't support UTF or UCP if PCRE2 was built without Unicode support. */
 
 #ifndef SUPPORT_UNICODE
 if ((cb.external_options & (PCRE2_UTF|PCRE2_UCP)) != 0)
@@ -9530,7 +10079,7 @@ lengths. */
 
 if (has_lookbehind)
   {
-  errorcode = check_lookbehinds(&cb);
+  errorcode = check_lookbehinds(cb.parsed_pattern, NULL, NULL, &cb);
   if (errorcode != 0) goto HAD_CB_ERROR;
   }
 
@@ -9678,8 +10227,9 @@ re->max_lookbehind = cb.max_lookbehind;
 
 if (cb.had_accept)
   {
-  reqcu = 0;              /* Must disable after (*ACCEPT) */
+  reqcu = 0;                     /* Must disable after (*ACCEPT) */
   reqcuflags = REQ_NONE;
+  re->flags |= PCRE2_HASACCEPT;  /* Disables minimum length */
   }
 
 /* Fill in the final opcode and check for disastrous overflow. If no overflow,
@@ -9800,6 +10350,8 @@ unit. */
 
 if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
   {
+  int minminlength = 0;  /* For minimal minlength from first/required CU */
+
   /* If we do not have a first code unit, see if there is one that is asserted
   (these are not saved during the compile because they can cause conflicts with
   actual literals that follow). */
@@ -9807,12 +10359,14 @@ if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
   if (firstcuflags < 0)
     firstcu = find_firstassertedcu(codestart, &firstcuflags, 0);
 
-  /* Save the data for a first code unit. */
+  /* Save the data for a first code unit. The existence of one means the
+  minimum length must be at least 1. */
 
   if (firstcuflags >= 0)
     {
     re->first_codeunit = firstcu;
     re->flags |= PCRE2_FIRSTSET;
+    minminlength++;
 
     /* Handle caseless first code units. */
 
@@ -9846,39 +10400,72 @@ if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
            is_startline(codestart, 0, &cb, 0, FALSE))
     re->flags |= PCRE2_STARTLINE;
 
-  /* Handle the "required code unit", if one is set. In the case of an anchored
-  pattern, do this only if it follows a variable length item in the pattern. */
+  /* Handle the "required code unit", if one is set. In the UTF case we can
+  increment the minimum minimum length only if we are sure this really is a
+  different character and not a non-starting code unit of the first character,
+  because the minimum length count is in characters, not code units. */
 
-  if (reqcuflags >= 0 &&
-       ((re->overall_options & PCRE2_ANCHORED) == 0 ||
-        (reqcuflags & REQ_VARY) != 0))
+  if (reqcuflags >= 0)
     {
-    re->last_codeunit = reqcu;
-    re->flags |= PCRE2_LASTSET;
+#if PCRE2_CODE_UNIT_WIDTH == 16
+    if ((re->overall_options & PCRE2_UTF) == 0 ||   /* Not UTF */
+        firstcuflags < 0 ||                         /* First not set */
+        (firstcu & 0xf800) != 0xd800 ||             /* First not surrogate */
+        (reqcu & 0xfc00) != 0xdc00)                 /* Req not low surrogate */
+#elif PCRE2_CODE_UNIT_WIDTH == 8
+    if ((re->overall_options & PCRE2_UTF) == 0 ||   /* Not UTF */
+        firstcuflags < 0 ||                         /* First not set */
+        (firstcu & 0x80) == 0 ||                    /* First is ASCII */
+        (reqcu & 0x80) == 0)                        /* Req is ASCII */
+#endif
+      {
+      minminlength++;
+      }
 
-    /* Handle caseless required code units as for first code units (above). */
+    /* In the case of an anchored pattern, set up the value only if it follows
+    a variable length item in the pattern. */
 
-    if ((reqcuflags & REQ_CASELESS) != 0)
+    if ((re->overall_options & PCRE2_ANCHORED) == 0 ||
+        (reqcuflags & REQ_VARY) != 0)
       {
-      if (reqcu < 128 || (!utf && reqcu < 255))
+      re->last_codeunit = reqcu;
+      re->flags |= PCRE2_LASTSET;
+
+      /* Handle caseless required code units as for first code units (above). */
+
+      if ((reqcuflags & REQ_CASELESS) != 0)
         {
-        if (cb.fcc[reqcu] != reqcu) re->flags |= PCRE2_LASTCASELESS;
-        }
+        if (reqcu < 128 || (!utf && reqcu < 255))
+          {
+          if (cb.fcc[reqcu] != reqcu) re->flags |= PCRE2_LASTCASELESS;
+          }
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 8
-      else if (reqcu <= MAX_UTF_CODE_POINT && UCD_OTHERCASE(reqcu) != reqcu)
-        re->flags |= PCRE2_LASTCASELESS;
+        else if (reqcu <= MAX_UTF_CODE_POINT && UCD_OTHERCASE(reqcu) != reqcu)
+          re->flags |= PCRE2_LASTCASELESS;
 #endif
+        }
       }
     }
 
-  /* Finally, study the compiled pattern to set up information such as a bitmap
-  of starting code units and a minimum matching length. */
+  /* Study the compiled pattern to set up information such as a bitmap of
+  starting code units and a minimum matching length. */
 
   if (PRIV(study)(re) != 0)
     {
     errorcode = ERR31;
     goto HAD_CB_ERROR;
     }
+
+  /* If study() set a bitmap of starting code units, it implies a minimum
+  length of at least one. */
+
+  if ((re->flags & PCRE2_FIRSTMAPSET) != 0 && minminlength == 0)
+    minminlength = 1;
+
+  /* If the minimum length set (or not set) by study() is less than the minimum
+  implied by required code units, override it. */
+
+  if (re->minlength < minminlength) re->minlength = minminlength;
   }   /* End of start-of-match optimizations. */
 
 /* Control ends up here in all cases. When running under valgrind, make a
index 2c14df00805bf044c2b9593a82e3bc87c755dc92..f904a494a018bbbc7f54ec7b52e8f9aa99d56587 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) 2016-2017 University of Cambridge
+          New API code Copyright (c) 2016-2018 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -163,11 +163,13 @@ when no context is supplied to a match function. */
 const pcre2_match_context PRIV(default_match_context) = {
   { default_malloc, default_free, NULL },
 #ifdef SUPPORT_JIT
-  NULL,
-  NULL,
+  NULL,          /* JIT callback */
+  NULL,          /* JIT callback data */
 #endif
-  NULL,
-  NULL,
+  NULL,          /* Callout function */
+  NULL,          /* Callout data */
+  NULL,          /* Substitute callout function */
+  NULL,          /* Substitute callout data */
   PCRE2_UNSET,   /* Offset limit */
   HEAP_LIMIT,
   MATCH_LIMIT,
@@ -321,7 +323,7 @@ data. */
 
 PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
 pcre2_set_character_tables(pcre2_compile_context *ccontext,
-  const unsigned char *tables)
+  const uint8_t *tables)
 {
 ccontext->tables = tables;
 return 0;
@@ -403,6 +405,16 @@ mcontext->callout_data = callout_data;
 return 0;
 }
 
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_substitute_callout(pcre2_match_context *mcontext,
+  int (*substitute_callout)(pcre2_substitute_callout_block *, void *),
+    void *substitute_callout_data)
+{
+mcontext->substitute_callout = substitute_callout;
+mcontext->substitute_callout_data = substitute_callout_data;
+return 0;
+}
+
 PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
 pcre2_set_heap_limit(pcre2_match_context *mcontext, uint32_t limit)
 {
index 1dd5c337dc3c37511a7050d0c188a00bf046a1fe..d45b6fee9744b2073c23810991db46796188e0d6 100644 (file)
@@ -276,7 +276,7 @@ while (plength > 0)
     break;
 
     case CHAR_BACKSLASH:
-    if (plength <= 0) return PCRE2_ERROR_END_BACKSLASH;
+    if (plength == 0) return PCRE2_ERROR_END_BACKSLASH;
     if (extended) nextisliteral = TRUE; else
       {
       if (*posix < 127 && strchr(posix_meta_escapes, *posix) != NULL)
index 9b43237da750ec34c5abe1c88264239661a20c1c..7d8ffe8a3ec35d61442dec0b981a4d95eb10de99 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -85,7 +85,8 @@ in others, so I abandoned this code. */
 #define PUBLIC_DFA_MATCH_OPTIONS \
   (PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
    PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \
-   PCRE2_PARTIAL_SOFT|PCRE2_DFA_SHORTEST|PCRE2_DFA_RESTART)
+   PCRE2_PARTIAL_SOFT|PCRE2_DFA_SHORTEST|PCRE2_DFA_RESTART| \
+   PCRE2_COPY_MATCHED_SUBJECT)
 
 
 /*************************************************
@@ -172,7 +173,10 @@ static const uint8_t coptable[] = {
   0,                             /* Assert not                             */
   0,                             /* Assert behind                          */
   0,                             /* Assert behind not                      */
+  0,                             /* NA assert                              */
+  0,                             /* NA assert behind                       */
   0,                             /* ONCE                                   */
+  0,                             /* SCRIPT_RUN                             */
   0, 0, 0, 0, 0,                 /* BRA, BRAPOS, CBRA, CBRAPOS, COND       */
   0, 0, 0, 0, 0,                 /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND  */
   0, 0,                          /* CREF, DNCREF                           */
@@ -246,7 +250,10 @@ static const uint8_t poptable[] = {
   0,                             /* Assert not                             */
   0,                             /* Assert behind                          */
   0,                             /* Assert behind not                      */
+  0,                             /* NA assert                              */
+  0,                             /* NA assert behind                       */
   0,                             /* ONCE                                   */
+  0,                             /* SCRIPT_RUN                             */
   0, 0, 0, 0, 0,                 /* BRA, BRAPOS, CBRA, CBRAPOS, COND       */
   0, 0, 0, 0, 0,                 /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND  */
   0, 0,                          /* CREF, DNCREF                           */
@@ -316,8 +323,8 @@ finding the minimum heap requirement for a match. */
 
 typedef struct RWS_anchor {
   struct RWS_anchor *next;
-  unsigned int size;  /* Number of ints */
-  unsigned int free;  /* Number of ints */
+  uint32_t size;  /* Number of ints */
+  uint32_t free;  /* Number of ints */
 } RWS_anchor;
 
 #define RWS_ANCHOR_SIZE (sizeof(RWS_anchor)/sizeof(int))
@@ -413,20 +420,24 @@ if (rws->next != NULL)
   new = rws->next;
   }
 
-/* All sizes are in units of sizeof(int), except for mb->heaplimit, which is in
-kibibytes. */
+/* Sizes in the RWS_anchor blocks are in units of sizeof(int), but
+mb->heap_limit and mb->heap_used are in kibibytes. Play carefully, to avoid
+overflow. */
 
 else
   {
-  unsigned int newsize = rws->size * 2;
-  unsigned int heapleft = (unsigned int)
-    (((1024/sizeof(int))*mb->heap_limit - mb->heap_used));
-  if (newsize > heapleft) newsize = heapleft;
+  uint32_t newsize = (rws->size >= UINT32_MAX/2)? UINT32_MAX/2 : rws->size * 2;
+  uint32_t newsizeK = newsize/(1024/sizeof(int));
+
+  if (newsizeK + mb->heap_used > mb->heap_limit)
+    newsizeK = (uint32_t)(mb->heap_limit - mb->heap_used);
+  newsize = newsizeK*(1024/sizeof(int));
+
   if (newsize < RWS_RSIZE + ovecsize + RWS_ANCHOR_SIZE)
     return PCRE2_ERROR_HEAPLIMIT;
   new = mb->memctl.malloc(newsize*sizeof(int), mb->memctl.memory_data);
   if (new == NULL) return PCRE2_ERROR_NOMEMORY;
-  mb->heap_used += newsize;
+  mb->heap_used += newsizeK;
   new->next = NULL;
   new->size = newsize;
   rws->next = new;
@@ -955,7 +966,7 @@ for (;;)
       if (ptr >= end_subject)
         {
         if ((mb->moptions & PCRE2_PARTIAL_HARD) != 0)
-          could_continue = TRUE;
+          return PCRE2_ERROR_PARTIAL;
         else { ADD_ACTIVE(state_offset + 1, 0); }
         }
       break;
@@ -1004,10 +1015,12 @@ for (;;)
 
       /*-----------------------------------------------------------------*/
       case OP_EODN:
-      if (clen == 0 && (mb->moptions & PCRE2_PARTIAL_HARD) != 0)
-        could_continue = TRUE;
-      else if (clen == 0 || (IS_NEWLINE(ptr) && ptr == end_subject - mb->nllen))
-        { ADD_ACTIVE(state_offset + 1, 0); }
+      if (clen == 0 || (IS_NEWLINE(ptr) && ptr == end_subject - mb->nllen))
+        {
+        if ((mb->moptions & PCRE2_PARTIAL_HARD) != 0)
+          return PCRE2_ERROR_PARTIAL;
+        ADD_ACTIVE(state_offset + 1, 0);
+        }
       break;
 
       /*-----------------------------------------------------------------*/
@@ -2560,7 +2573,7 @@ for (;;)
           if (clen > 0)
             {
             isinclass = (c > 255)? (codevalue == OP_NCLASS) :
-              ((((uint8_t *)(code + 1))[c/8] & (1 << (c&7))) != 0);
+              ((((uint8_t *)(code + 1))[c/8] & (1u << (c&7))) != 0);
             }
           }
 
@@ -2753,7 +2766,7 @@ for (;;)
         /* There is also an always-true condition */
 
         else if (condcode == OP_TRUE)
-          { ADD_ACTIVE(state_offset + LINK_SIZE + 2 + IMM2_SIZE, 0); }
+          { ADD_ACTIVE(state_offset + LINK_SIZE + 2, 0); }
 
         /* The only supported version of OP_RREF is for the value RREF_ANY,
         which means "test if in any recursion". We can't test for specifically
@@ -3145,8 +3158,8 @@ for (;;)
 
   /* We have finished the processing at the current subject character. If no
   new states have been set for the next character, we have found all the
-  matches that we are going to find. If we are at the top level and partial
-  matching has been requested, check for appropriate conditions.
+  matches that we are going to find. If partial matching has been requested,
+  check for appropriate conditions.
 
   The "forced_ fail" variable counts the number of (*F) encountered for the
   character. If it is equal to the original active_count (saved in
@@ -3158,22 +3171,24 @@ for (;;)
 
   if (new_count <= 0)
     {
-    if (rlevel == 1 &&                               /* Top level, and */
-        could_continue &&                            /* Some could go on, and */
+    if (could_continue &&                            /* Some could go on, and */
         forced_fail != workspace[1] &&               /* Not all forced fail & */
         (                                            /* either... */
         (mb->moptions & PCRE2_PARTIAL_HARD) != 0      /* Hard partial */
         ||                                           /* or... */
         ((mb->moptions & PCRE2_PARTIAL_SOFT) != 0 &&  /* Soft partial and */
-         match_count < 0)                            /* no matches */
+         match_count < 0)                             /* no matches */
         ) &&                                         /* And... */
         (
-        partial_newline ||                           /* Either partial NL */
-          (                                          /* or ... */
-          ptr >= end_subject &&                /* End of subject and */
-          ptr > mb->start_used_ptr)            /* Inspected non-empty string */
+        partial_newline ||                   /* Either partial NL */
+          (                                  /* or ... */
+          ptr >= end_subject &&              /* End of subject and */
+            (                                  /* either */
+            ptr > mb->start_used_ptr ||        /* Inspected non-empty string */
+            mb->allowemptypartial              /* or pattern has lookbehind */
+            )                                  /* or could match empty */
           )
-        )
+        ))
       match_count = PCRE2_ERROR_PARTIAL;
     break;  /* Exit from loop along the subject string */
     }
@@ -3226,6 +3241,8 @@ pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
   pcre2_match_context *mcontext, int *workspace, PCRE2_SIZE wscount)
 {
 int rc;
+int was_zero_terminated = 0;
+
 const pcre2_real_code *re = (const pcre2_real_code *)code;
 
 PCRE2_SPTR start_match;
@@ -3237,6 +3254,11 @@ BOOL utf, anchored, startline, firstline;
 BOOL has_first_cu = FALSE;
 BOOL has_req_cu = FALSE;
 
+#if PCRE2_CODE_UNIT_WIDTH == 8
+BOOL memchr_not_found_first_cu = FALSE;
+BOOL memchr_not_found_first_cu2 = FALSE;
+#endif
+
 PCRE2_UCHAR first_cu = 0;
 PCRE2_UCHAR first_cu2 = 0;
 PCRE2_UCHAR req_cu = 0;
@@ -3265,7 +3287,11 @@ rws->free = RWS_BASE_SIZE - RWS_ANCHOR_SIZE;
 /* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated
 subject string. */
 
-if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
+if (length == PCRE2_ZERO_TERMINATED)
+  {
+  length = PRIV(strlen)(subject);
+  was_zero_terminated = 1;
+  }
 
 /* Plausibility checks */
 
@@ -3282,6 +3308,11 @@ if ((options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0 &&
    ((re->overall_options | options) & PCRE2_ENDANCHORED) != 0)
   return PCRE2_ERROR_BADOPTION;
 
+/* Invalid UTF support is not available for DFA matching. */
+
+if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) != 0)
+  return PCRE2_ERROR_DFA_UINVALID_UTF;
+
 /* Check that the first field in the block is the magic number. If it is not,
 return with PCRE2_ERROR_BADMAGIC. */
 
@@ -3391,6 +3422,8 @@ mb->tables = re->tables;
 mb->start_subject = subject;
 mb->end_subject = end_subject;
 mb->start_offset = start_offset;
+mb->allowemptypartial = (re->max_lookbehind > 0) ||
+  (re->flags & PCRE2_MATCH_EMPTY) != 0;
 mb->moptions = options;
 mb->poptions = re->overall_options;
 mb->match_call_count = 0;
@@ -3518,10 +3551,20 @@ if ((re->flags & PCRE2_LASTSET) != 0)
     }
   }
 
+/* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT,
+free the memory that was obtained. */
+
+if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0)
+  {
+  match_data->memctl.free((void *)match_data->subject,
+    match_data->memctl.memory_data);
+  match_data->flags &= ~PCRE2_MD_COPIED_SUBJECT;
+  }
+
 /* Fill in fields that are always returned in the match data. */
 
 match_data->code = re;
-match_data->subject = subject;
+match_data->subject = NULL;  /* Default for no match */
 match_data->mark = NULL;
 match_data->matchedby = PCRE2_MATCHEDBY_DFA_INTERPRETER;
 
@@ -3586,7 +3629,7 @@ for (;;)
 #if PCRE2_CODE_UNIT_WIDTH != 8
             if (c > 255) c = 255;
 #endif
-            ok = (start_bits[c/8] & (1 << (c&7))) != 0;
+            ok = (start_bits[c/8] & (1u << (c&7))) != 0;
             }
           }
         if (!ok) break;
@@ -3596,7 +3639,10 @@ for (;;)
     /* Not anchored. Advance to a unique first code unit if there is one. In
     8-bit mode, the use of memchr() gives a big speed up, even though we have
     to call it twice in caseless mode, in order to find the earliest occurrence
-    of the character in either of its cases. */
+    of the character in either of its cases. If a call to memchr() that
+    searches the rest of the subject fails to find one case, remember that in
+    order not to keep on repeating the search. This can make a huge difference
+    when the strings are very long and only one case is present. */
 
     else
       {
@@ -3610,11 +3656,29 @@ for (;;)
                 (smc = UCHAR21TEST(start_match)) != first_cu &&
                   smc != first_cu2)
             start_match++;
+
 #else  /* 8-bit code units */
-          PCRE2_SPTR pp1 =
-            memchr(start_match, first_cu, end_subject-start_match);
-          PCRE2_SPTR pp2 =
-            memchr(start_match, first_cu2, end_subject-start_match);
+          PCRE2_SPTR pp1 = NULL;
+          PCRE2_SPTR pp2 = NULL;
+          PCRE2_SIZE cu2size = end_subject - start_match;
+
+          if (!memchr_not_found_first_cu)
+            {
+            pp1 = memchr(start_match, first_cu, end_subject - start_match);
+            if (pp1 == NULL) memchr_not_found_first_cu = TRUE;
+              else cu2size = pp1 - start_match;
+            }
+
+          /* If pp1 is not NULL, we have arranged to search only as far as pp1,
+          to see if the other case is earlier, so we can set "not found" only
+          when both searches have returned NULL. */
+
+          if (!memchr_not_found_first_cu2)
+            {
+            pp2 = memchr(start_match, first_cu2, cu2size);
+            memchr_not_found_first_cu2 = (pp2 == NULL && pp1 == NULL);
+            }
+
           if (pp1 == NULL)
             start_match = (pp2 == NULL)? end_subject : pp2;
           else
@@ -3630,7 +3694,7 @@ for (;;)
           while (start_match < end_subject && UCHAR21TEST(start_match) !=
                  first_cu)
             start_match++;
-#else
+#else  /* 8-bit code units */
           start_match = memchr(start_match, first_cu, end_subject - start_match);
           if (start_match == NULL) start_match = end_subject;
 #endif
@@ -3697,7 +3761,7 @@ for (;;)
 #if PCRE2_CODE_UNIT_WIDTH != 8
           if (c > 255) c = 255;
 #endif
-          if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
+          if ((start_bits[c/8] & (1u << (c&7))) != 0) break;
           start_match++;
           }
 
@@ -3717,6 +3781,8 @@ for (;;)
 
     if ((mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) == 0)
       {
+      PCRE2_SPTR p;
+
       /* The minimum matching length is a lower bound; no actual string of that
       length may actually match the pattern. Although the value is, strictly,
       in characters, we treat it as code units to avoid spending too much time
@@ -3730,37 +3796,63 @@ for (;;)
       point. This optimization can save a huge amount of backtracking in
       patterns with nested unlimited repeats that aren't going to match.
       Writing separate code for cased/caseless versions makes it go faster, as
-      does using an autoincrement and backing off on a match.
+      does using an autoincrement and backing off on a match. As in the case of
+      the first code unit, using memchr() in the 8-bit library gives a big
+      speed up. Unlike the first_cu check above, we do not need to call
+      memchr() twice in the caseless case because we only need to check for the
+      presence of the character in either case, not find the first occurrence.
+
+      The search can be skipped if the code unit was found later than the
+      current starting point in a previous iteration of the bumpalong loop.
 
       HOWEVER: when the subject string is very, very long, searching to its end
       can take a long time, and give bad performance on quite ordinary
       patterns. This showed up when somebody was matching something like
       /^\d+C/ on a 32-megabyte string... so we don't do this when the string is
-      sufficiently long. */
+      sufficiently long, but it's worth searching a lot more for unanchored
+      patterns. */
 
-      if (has_req_cu && end_subject - start_match < REQ_CU_MAX)
+      p = start_match + (has_first_cu? 1:0);
+      if (has_req_cu && p > req_cu_ptr)
         {
-        PCRE2_SPTR p = start_match + (has_first_cu? 1:0);
-
-        /* We don't need to repeat the search if we haven't yet reached the
-        place we found it at last time. */
+        PCRE2_SIZE check_length = end_subject - start_match;
 
-        if (p > req_cu_ptr)
+        if (check_length < REQ_CU_MAX ||
+              (!anchored && check_length < REQ_CU_MAX * 1000))
           {
-          if (req_cu != req_cu2)
+          if (req_cu != req_cu2)  /* Caseless */
             {
+#if PCRE2_CODE_UNIT_WIDTH != 8
             while (p < end_subject)
               {
               uint32_t pp = UCHAR21INCTEST(p);
               if (pp == req_cu || pp == req_cu2) { p--; break; }
               }
+#else  /* 8-bit code units */
+            PCRE2_SPTR pp = p;
+            p = memchr(pp, req_cu, end_subject - pp);
+            if (p == NULL)
+              {
+              p = memchr(pp, req_cu2, end_subject - pp);
+              if (p == NULL) p = end_subject;
+              }
+#endif /* PCRE2_CODE_UNIT_WIDTH != 8 */
             }
+
+          /* The caseful case */
+
           else
             {
+#if PCRE2_CODE_UNIT_WIDTH != 8
             while (p < end_subject)
               {
               if (UCHAR21INCTEST(p) == req_cu) { p--; break; }
               }
+
+#else  /* 8-bit code units */
+            p = memchr(p, req_cu, end_subject - p);
+            if (p == NULL) p = end_subject;
+#endif
             }
 
           /* If we can't find the required code unit, break the matching loop,
@@ -3816,6 +3908,20 @@ for (;;)
     match_data->rightchar = (PCRE2_SIZE)( mb->last_used_ptr - subject);
     match_data->startchar = (PCRE2_SIZE)(start_match - subject);
     match_data->rc = rc;
+
+    if (rc >= 0 &&(options & PCRE2_COPY_MATCHED_SUBJECT) != 0)
+      {
+      length = CU2BYTES(length + was_zero_terminated);
+      match_data->subject = match_data->memctl.malloc(length,
+        match_data->memctl.memory_data);
+      if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY;
+      memcpy((void *)match_data->subject, subject, length);
+      match_data->flags |= PCRE2_MD_COPIED_SUBJECT;
+      }
+    else
+      {
+      if (rc >= 0 || rc == PCRE2_ERROR_PARTIAL) match_data->subject = subject;
+      }
     goto EXIT;
     }
 
index 4b3b3f1bc0d247a74cdff06d23022473ff2fc95c..c61648cb7f466377c507c480b93c83a4009eb07e 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -71,7 +71,7 @@ static const unsigned char compile_error_texts[] =
   /* 5 */
   "number too big in {} quantifier\0"
   "missing terminating ] for character class\0"
-  "invalid escape sequence in character class\0"
+  "escape sequence is invalid in character class\0"
   "range out of order in character class\0"
   "quantifier does not follow a repeatable item\0"
   /* 10 */
@@ -95,7 +95,7 @@ static const unsigned char compile_error_texts[] =
   /* 25 */
   "lookbehind assertion is not fixed length\0"
   "a relative value of zero is not allowed\0"
-  "conditional group contains more than two branches\0"
+  "conditional subpattern contains more than two branches\0"
   "assertion expected after (?( or (?(?C)\0"
   "digit expected after (?+ or (?-\0"
   /* 30 */
@@ -113,21 +113,21 @@ static const unsigned char compile_error_texts[] =
   /* 40 */
   "invalid escape sequence in (*VERB) name\0"
   "unrecognized character after (?P\0"
-  "syntax error in subpattern name (missing terminator)\0"
+  "syntax error in subpattern name (missing terminator?)\0"
   "two named subpatterns have the same name (PCRE2_DUPNAMES not set)\0"
-  "group name must start with a non-digit\0"
+  "subpattern name must start with a non-digit\0"
   /* 45 */
   "this version of PCRE2 does not have support for \\P, \\p, or \\X\0"
   "malformed \\P or \\p sequence\0"
   "unknown property name after \\P or \\p\0"
-  "subpattern name is too long (maximum " XSTRING(MAX_NAME_SIZE) " characters)\0"
+  "subpattern name is too long (maximum " XSTRING(MAX_NAME_SIZE) " code units)\0"
   "too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0"
   /* 50 */
   "invalid range in character class\0"
   "octal value is greater than \\377 in 8-bit non-UTF-8 mode\0"
   "internal error: overran compiling workspace\0"
   "internal error: previously-checked referenced subpattern not found\0"
-  "DEFINE group contains more than one branch\0"
+  "DEFINE subpattern contains more than one branch\0"
   /* 55 */
   "missing opening brace after \\o\0"
   "internal error: unknown newline setting\0"
@@ -137,7 +137,7 @@ static const unsigned char compile_error_texts[] =
   "obsolete error (should not occur)\0"  /* Was the above */
   /* 60 */
   "(*VERB) not recognized or malformed\0"
-  "group number is too big\0"
+  "subpattern number is too big\0"
   "subpattern name expected\0"
   "internal error: parsed pattern overflow\0"
   "non-octal character in \\o{} (closing brace missing?)\0"
@@ -181,6 +181,11 @@ static const unsigned char compile_error_texts[] =
   "invalid option bits with PCRE2_LITERAL\0"
   "\\N{U+dddd} is supported only in Unicode (UTF) mode\0"
   "invalid hyphen in option setting\0"
+  /* 95 */
+  "(*alpha_assertion) not recognized\0"
+  "script runs require Unicode support, which this version of PCRE2 does not have\0"
+  "too many capturing groups (maximum 65535)\0"
+  "atomic assertion expected after (?( or (?(?C)\0"
   ;
 
 /* Match-time and UTF error texts are in the same format. */
@@ -265,6 +270,7 @@ static const unsigned char match_error_texts[] =
   "invalid syntax\0"
   /* 65 */
   "internal error - duplicate substitution match\0"
+  "PCRE2_MATCH_INVALID_UTF is not supported for DFA matching\0"
   ;
 
 
index 237211abf7f9752a6757d78bd8275f64fecc5fef..5a719e9cb4f3527a0d498cf70ea69bd3e6620e9c 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -100,7 +100,7 @@ while (eptr < end_subject)
   int len = 1;
   if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); }
   rgb = UCD_GRAPHBREAK(c);
-  if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
+  if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break;
 
   /* Not breaking between Regional Indicators is allowed only if there
   are an even number of preceding RIs. */
index 8750f2f17468364633de3a2af3d86c69ea234fe3..fe8ffe5c80db0547541ce6901f34b1d6cec77fde 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -148,16 +148,7 @@ pcre2_match() because of the way it backtracks. */
 /* When checking for integer overflow in pcre2_compile(), we need to handle
 large integers. If a 64-bit integer type is available, we can use that.
 Otherwise we have to cast to double, which of course requires floating point
-arithmetic. Handle this by defining a macro for the appropriate type. If
-stdint.h is available, include it; it may define INT64_MAX. Systems that do not
-have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set
-by "configure". */
-
-#if defined HAVE_STDINT_H
-#include <stdint.h>
-#elif defined HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
+arithmetic. Handle this by defining a macro for the appropriate type. */
 
 #if defined INT64_MAX || defined int64_t
 #define INT64_OR_DOUBLE int64_t
@@ -526,6 +517,7 @@ bytes in a code unit in that mode. */
 #define PCRE2_HASBKPORX     0x00100000  /* contains \P, \p, or \X */
 #define PCRE2_DUPCAPUSED    0x00200000  /* contains (?| */
 #define PCRE2_HASBKC        0x00400000  /* contains \C */
+#define PCRE2_HASACCEPT     0x00800000  /* contains (*ACCEPT) */
 
 #define PCRE2_MODE_MASK     (PCRE2_MODE8 | PCRE2_MODE16 | PCRE2_MODE32)
 
@@ -535,18 +527,23 @@ enum { PCRE2_MATCHEDBY_INTERPRETER,     /* pcre2_match() */
        PCRE2_MATCHEDBY_DFA_INTERPRETER, /* pcre2_dfa_match() */
        PCRE2_MATCHEDBY_JIT };           /* pcre2_jit_match() */
 
+/* Values for the flags field in a match data block. */
+
+#define PCRE2_MD_COPIED_SUBJECT  0x01u
+
 /* Magic number to provide a small check against being handed junk. */
 
 #define MAGIC_NUMBER  0x50435245UL   /* 'PCRE' */
 
 /* The maximum remaining length of subject we are prepared to search for a
-req_unit match. In 8-bit mode, memchr() is used and is much faster than the
-search loop that has to be used in 16-bit and 32-bit modes. */
+req_unit match from an anchored pattern. In 8-bit mode, memchr() is used and is
+much faster than the search loop that has to be used in 16-bit and 32-bit
+modes. */
 
 #if PCRE2_CODE_UNIT_WIDTH == 8
-#define REQ_CU_MAX 2000
+#define REQ_CU_MAX       5000
 #else
-#define REQ_CU_MAX 1000
+#define REQ_CU_MAX       2000
 #endif
 
 /* Offsets for the bitmap tables in the cbits set of tables. Each table
@@ -569,11 +566,11 @@ these tables. */
 without checking pcre2_jit_compile.c, which has an assertion to ensure that
 ctype_word has the value 16. */
 
-#define ctype_space   0x01
-#define ctype_letter  0x02
-#define ctype_digit   0x04
-#define ctype_xdigit  0x08    /* not actually used any more */
-#define ctype_word    0x10    /* alphanumeric or '_' */
+#define ctype_space    0x01
+#define ctype_letter   0x02
+#define ctype_lcletter 0x04
+#define ctype_digit    0x08
+#define ctype_word     0x10    /* alphanumeric or '_' */
 
 /* Offsets of the various tables from the base tables pointer, and
 total length of the tables. */
@@ -874,34 +871,52 @@ a positive value. */
 #define STR_RIGHT_CURLY_BRACKET     "}"
 #define STR_TILDE                   "~"
 
-#define STRING_ACCEPT0              "ACCEPT\0"
-#define STRING_COMMIT0              "COMMIT\0"
-#define STRING_F0                   "F\0"
-#define STRING_FAIL0                "FAIL\0"
-#define STRING_MARK0                "MARK\0"
-#define STRING_PRUNE0               "PRUNE\0"
-#define STRING_SKIP0                "SKIP\0"
-#define STRING_THEN                 "THEN"
-
-#define STRING_alpha0               "alpha\0"
-#define STRING_lower0               "lower\0"
-#define STRING_upper0               "upper\0"
-#define STRING_alnum0               "alnum\0"
-#define STRING_ascii0               "ascii\0"
-#define STRING_blank0               "blank\0"
-#define STRING_cntrl0               "cntrl\0"
-#define STRING_digit0               "digit\0"
-#define STRING_graph0               "graph\0"
-#define STRING_print0               "print\0"
-#define STRING_punct0               "punct\0"
-#define STRING_space0               "space\0"
-#define STRING_word0                "word\0"
-#define STRING_xdigit               "xdigit"
-
-#define STRING_DEFINE               "DEFINE"
-#define STRING_VERSION              "VERSION"
-#define STRING_WEIRD_STARTWORD      "[:<:]]"
-#define STRING_WEIRD_ENDWORD        "[:>:]]"
+#define STRING_ACCEPT0               "ACCEPT\0"
+#define STRING_COMMIT0               "COMMIT\0"
+#define STRING_F0                    "F\0"
+#define STRING_FAIL0                 "FAIL\0"
+#define STRING_MARK0                 "MARK\0"
+#define STRING_PRUNE0                "PRUNE\0"
+#define STRING_SKIP0                 "SKIP\0"
+#define STRING_THEN                  "THEN"
+
+#define STRING_atomic0               "atomic\0"
+#define STRING_pla0                  "pla\0"
+#define STRING_plb0                  "plb\0"
+#define STRING_napla0                "napla\0"
+#define STRING_naplb0                "naplb\0"
+#define STRING_nla0                  "nla\0"
+#define STRING_nlb0                  "nlb\0"
+#define STRING_sr0                   "sr\0"
+#define STRING_asr0                  "asr\0"
+#define STRING_positive_lookahead0   "positive_lookahead\0"
+#define STRING_positive_lookbehind0  "positive_lookbehind\0"
+#define STRING_non_atomic_positive_lookahead0   "non_atomic_positive_lookahead\0"
+#define STRING_non_atomic_positive_lookbehind0  "non_atomic_positive_lookbehind\0"
+#define STRING_negative_lookahead0   "negative_lookahead\0"
+#define STRING_negative_lookbehind0  "negative_lookbehind\0"
+#define STRING_script_run0           "script_run\0"
+#define STRING_atomic_script_run     "atomic_script_run"
+
+#define STRING_alpha0                "alpha\0"
+#define STRING_lower0                "lower\0"
+#define STRING_upper0                "upper\0"
+#define STRING_alnum0                "alnum\0"
+#define STRING_ascii0                "ascii\0"
+#define STRING_blank0                "blank\0"
+#define STRING_cntrl0                "cntrl\0"
+#define STRING_digit0                "digit\0"
+#define STRING_graph0                "graph\0"
+#define STRING_print0                "print\0"
+#define STRING_punct0                "punct\0"
+#define STRING_space0                "space\0"
+#define STRING_word0                 "word\0"
+#define STRING_xdigit                "xdigit"
+
+#define STRING_DEFINE                "DEFINE"
+#define STRING_VERSION               "VERSION"
+#define STRING_WEIRD_STARTWORD       "[:<:]]"
+#define STRING_WEIRD_ENDWORD         "[:>:]]"
 
 #define STRING_CR_RIGHTPAR                "CR)"
 #define STRING_LF_RIGHTPAR                "LF)"
@@ -1150,34 +1165,52 @@ only. */
 #define STR_RIGHT_CURLY_BRACKET     "\175"
 #define STR_TILDE                   "\176"
 
-#define STRING_ACCEPT0              STR_A STR_C STR_C STR_E STR_P STR_T "\0"
-#define STRING_COMMIT0              STR_C STR_O STR_M STR_M STR_I STR_T "\0"
-#define STRING_F0                   STR_F "\0"
-#define STRING_FAIL0                STR_F STR_A STR_I STR_L "\0"
-#define STRING_MARK0                STR_M STR_A STR_R STR_K "\0"
-#define STRING_PRUNE0               STR_P STR_R STR_U STR_N STR_E "\0"
-#define STRING_SKIP0                STR_S STR_K STR_I STR_P "\0"
-#define STRING_THEN                 STR_T STR_H STR_E STR_N
-
-#define STRING_alpha0               STR_a STR_l STR_p STR_h STR_a "\0"
-#define STRING_lower0               STR_l STR_o STR_w STR_e STR_r "\0"
-#define STRING_upper0               STR_u STR_p STR_p STR_e STR_r "\0"
-#define STRING_alnum0               STR_a STR_l STR_n STR_u STR_m "\0"
-#define STRING_ascii0               STR_a STR_s STR_c STR_i STR_i "\0"
-#define STRING_blank0               STR_b STR_l STR_a STR_n STR_k "\0"
-#define STRING_cntrl0               STR_c STR_n STR_t STR_r STR_l "\0"
-#define STRING_digit0               STR_d STR_i STR_g STR_i STR_t "\0"
-#define STRING_graph0               STR_g STR_r STR_a STR_p STR_h "\0"
-#define STRING_print0               STR_p STR_r STR_i STR_n STR_t "\0"
-#define STRING_punct0               STR_p STR_u STR_n STR_c STR_t "\0"
-#define STRING_space0               STR_s STR_p STR_a STR_c STR_e "\0"
-#define STRING_word0                STR_w STR_o STR_r STR_d       "\0"
-#define STRING_xdigit               STR_x STR_d STR_i STR_g STR_i STR_t
-
-#define STRING_DEFINE               STR_D STR_E STR_F STR_I STR_N STR_E
-#define STRING_VERSION              STR_V STR_E STR_R STR_S STR_I STR_O STR_N
-#define STRING_WEIRD_STARTWORD      STR_LEFT_SQUARE_BRACKET STR_COLON STR_LESS_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
-#define STRING_WEIRD_ENDWORD        STR_LEFT_SQUARE_BRACKET STR_COLON STR_GREATER_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
+#define STRING_ACCEPT0               STR_A STR_C STR_C STR_E STR_P STR_T "\0"
+#define STRING_COMMIT0               STR_C STR_O STR_M STR_M STR_I STR_T "\0"
+#define STRING_F0                    STR_F "\0"
+#define STRING_FAIL0                 STR_F STR_A STR_I STR_L "\0"
+#define STRING_MARK0                 STR_M STR_A STR_R STR_K "\0"
+#define STRING_PRUNE0                STR_P STR_R STR_U STR_N STR_E "\0"
+#define STRING_SKIP0                 STR_S STR_K STR_I STR_P "\0"
+#define STRING_THEN                  STR_T STR_H STR_E STR_N
+
+#define STRING_atomic0               STR_a STR_t STR_o STR_m STR_i STR_c "\0"
+#define STRING_pla0                  STR_p STR_l STR_a "\0"
+#define STRING_plb0                  STR_p STR_l STR_b "\0"
+#define STRING_napla0                STR_n STR_a STR_p STR_l STR_a "\0"
+#define STRING_naplb0                STR_n STR_a STR_p STR_l STR_b "\0"
+#define STRING_nla0                  STR_n STR_l STR_a "\0"
+#define STRING_nlb0                  STR_n STR_l STR_b "\0"
+#define STRING_sr0                   STR_s STR_r "\0"
+#define STRING_asr0                  STR_a STR_s STR_r "\0"
+#define STRING_positive_lookahead0   STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0"
+#define STRING_positive_lookbehind0  STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0"
+#define STRING_non_atomic_positive_lookahead0   STR_n STR_o STR_n STR_UNDERSCORE STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0"
+#define STRING_non_atomic_positive_lookbehind0  STR_n STR_o STR_n STR_UNDERSCORE STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0"
+#define STRING_negative_lookahead0   STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0"
+#define STRING_negative_lookbehind0  STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0"
+#define STRING_script_run0           STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n "\0"
+#define STRING_atomic_script_run     STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n
+
+#define STRING_alpha0                STR_a STR_l STR_p STR_h STR_a "\0"
+#define STRING_lower0                STR_l STR_o STR_w STR_e STR_r "\0"
+#define STRING_upper0                STR_u STR_p STR_p STR_e STR_r "\0"
+#define STRING_alnum0                STR_a STR_l STR_n STR_u STR_m "\0"
+#define STRING_ascii0                STR_a STR_s STR_c STR_i STR_i "\0"
+#define STRING_blank0                STR_b STR_l STR_a STR_n STR_k "\0"
+#define STRING_cntrl0                STR_c STR_n STR_t STR_r STR_l "\0"
+#define STRING_digit0                STR_d STR_i STR_g STR_i STR_t "\0"
+#define STRING_graph0                STR_g STR_r STR_a STR_p STR_h "\0"
+#define STRING_print0                STR_p STR_r STR_i STR_n STR_t "\0"
+#define STRING_punct0                STR_p STR_u STR_n STR_c STR_t "\0"
+#define STRING_space0                STR_s STR_p STR_a STR_c STR_e "\0"
+#define STRING_word0                 STR_w STR_o STR_r STR_d       "\0"
+#define STRING_xdigit                STR_x STR_d STR_i STR_g STR_i STR_t
+
+#define STRING_DEFINE                STR_D STR_E STR_F STR_I STR_N STR_E
+#define STRING_VERSION               STR_V STR_E STR_R STR_S STR_I STR_O STR_N
+#define STRING_WEIRD_STARTWORD       STR_LEFT_SQUARE_BRACKET STR_COLON STR_LESS_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
+#define STRING_WEIRD_ENDWORD         STR_LEFT_SQUARE_BRACKET STR_COLON STR_GREATER_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
 
 #define STRING_CR_RIGHTPAR                STR_C STR_R STR_RIGHT_PARENTHESIS
 #define STRING_LF_RIGHTPAR                STR_L STR_F STR_RIGHT_PARENTHESIS
@@ -1278,7 +1311,7 @@ enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s,
 Starting from 1 (i.e. after OP_END), the values up to OP_EOD must correspond in
 order to the list of escapes immediately above. Furthermore, values up to
 OP_DOLLM must not be changed without adjusting the table called autoposstab in
-pcre2_auto_possess.c
+pcre2_auto_possess.c.
 
 Whenever this list is updated, the two macro definitions that follow must be
 updated to match. The possessification table called "opcode_possessify" in
@@ -1476,79 +1509,81 @@ enum {
   OP_KETRMIN,        /* 123 order. They are for groups the repeat for ever. */
   OP_KETRPOS,        /* 124 Possessive unlimited repeat. */
 
-  /* The assertions must come before BRA, CBRA, ONCE, and COND, and the four
-  asserts must remain in order. */
+  /* The assertions must come before BRA, CBRA, ONCE, and COND. */
 
   OP_REVERSE,        /* 125 Move pointer back - used in lookbehind assertions */
   OP_ASSERT,         /* 126 Positive lookahead */
   OP_ASSERT_NOT,     /* 127 Negative lookahead */
   OP_ASSERTBACK,     /* 128 Positive lookbehind */
   OP_ASSERTBACK_NOT, /* 129 Negative lookbehind */
-
-  /* ONCE, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately after the
-  assertions, with ONCE first, as there's a test for >= ONCE for a subpattern
-  that isn't an assertion. The POS versions must immediately follow the non-POS
-  versions in each case. */
-
-  OP_ONCE,           /* 130 Atomic group, contains captures */
-  OP_BRA,            /* 131 Start of non-capturing bracket */
-  OP_BRAPOS,         /* 132 Ditto, with unlimited, possessive repeat */
-  OP_CBRA,           /* 133 Start of capturing bracket */
-  OP_CBRAPOS,        /* 134 Ditto, with unlimited, possessive repeat */
-  OP_COND,           /* 135 Conditional group */
+  OP_ASSERT_NA,      /* 130 Positive non-atomic lookahead */
+  OP_ASSERTBACK_NA,  /* 131 Positive non-atomic lookbehind */
+
+  /* ONCE, SCRIPT_RUN, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come
+  immediately after the assertions, with ONCE first, as there's a test for >=
+  ONCE for a subpattern that isn't an assertion. The POS versions must
+  immediately follow the non-POS versions in each case. */
+
+  OP_ONCE,           /* 132 Atomic group, contains captures */
+  OP_SCRIPT_RUN,     /* 133 Non-capture, but check characters' scripts */
+  OP_BRA,            /* 134 Start of non-capturing bracket */
+  OP_BRAPOS,         /* 135 Ditto, with unlimited, possessive repeat */
+  OP_CBRA,           /* 136 Start of capturing bracket */
+  OP_CBRAPOS,        /* 137 Ditto, with unlimited, possessive repeat */
+  OP_COND,           /* 138 Conditional group */
 
   /* These five must follow the previous five, in the same order. There's a
   check for >= SBRA to distinguish the two sets. */
 
-  OP_SBRA,           /* 136 Start of non-capturing bracket, check empty  */
-  OP_SBRAPOS,        /* 137 Ditto, with unlimited, possessive repeat */
-  OP_SCBRA,          /* 138 Start of capturing bracket, check empty */
-  OP_SCBRAPOS,       /* 139 Ditto, with unlimited, possessive repeat */
-  OP_SCOND,          /* 140 Conditional group, check empty */
+  OP_SBRA,           /* 139 Start of non-capturing bracket, check empty  */
+  OP_SBRAPOS,        /* 149 Ditto, with unlimited, possessive repeat */
+  OP_SCBRA,          /* 141 Start of capturing bracket, check empty */
+  OP_SCBRAPOS,       /* 142 Ditto, with unlimited, possessive repeat */
+  OP_SCOND,          /* 143 Conditional group, check empty */
 
   /* The next two pairs must (respectively) be kept together. */
 
-  OP_CREF,           /* 141 Used to hold a capture number as condition */
-  OP_DNCREF,         /* 142 Used to point to duplicate names as a condition */
-  OP_RREF,           /* 143 Used to hold a recursion number as condition */
-  OP_DNRREF,         /* 144 Used to point to duplicate names as a condition */
-  OP_FALSE,          /* 145 Always false (used by DEFINE and VERSION) */
-  OP_TRUE,           /* 146 Always true (used by VERSION) */
+  OP_CREF,           /* 144 Used to hold a capture number as condition */
+  OP_DNCREF,         /* 145 Used to point to duplicate names as a condition */
+  OP_RREF,           /* 146 Used to hold a recursion number as condition */
+  OP_DNRREF,         /* 147 Used to point to duplicate names as a condition */
+  OP_FALSE,          /* 148 Always false (used by DEFINE and VERSION) */
+  OP_TRUE,           /* 149 Always true (used by VERSION) */
 
-  OP_BRAZERO,        /* 147 These two must remain together and in this */
-  OP_BRAMINZERO,     /* 148 order. */
-  OP_BRAPOSZERO,     /* 149 */
+  OP_BRAZERO,        /* 150 These two must remain together and in this */
+  OP_BRAMINZERO,     /* 151 order. */
+  OP_BRAPOSZERO,     /* 152 */
 
   /* These are backtracking control verbs */
 
-  OP_MARK,           /* 150 always has an argument */
-  OP_PRUNE,          /* 151 */
-  OP_PRUNE_ARG,      /* 152 same, but with argument */
-  OP_SKIP,           /* 153 */
-  OP_SKIP_ARG,       /* 154 same, but with argument */
-  OP_THEN,           /* 155 */
-  OP_THEN_ARG,       /* 156 same, but with argument */
-  OP_COMMIT,         /* 157 */
-  OP_COMMIT_ARG,     /* 158 same, but with argument */
+  OP_MARK,           /* 153 always has an argument */
+  OP_PRUNE,          /* 154 */
+  OP_PRUNE_ARG,      /* 155 same, but with argument */
+  OP_SKIP,           /* 156 */
+  OP_SKIP_ARG,       /* 157 same, but with argument */
+  OP_THEN,           /* 158 */
+  OP_THEN_ARG,       /* 159 same, but with argument */
+  OP_COMMIT,         /* 160 */
+  OP_COMMIT_ARG,     /* 161 same, but with argument */
 
   /* These are forced failure and success verbs. FAIL and ACCEPT do accept an
   argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL)
   without the need for a special opcode. */
 
-  OP_FAIL,           /* 159 */
-  OP_ACCEPT,         /* 160 */
-  OP_ASSERT_ACCEPT,  /* 161 Used inside assertions */
-  OP_CLOSE,          /* 162 Used before OP_ACCEPT to close open captures */
+  OP_FAIL,           /* 162 */
+  OP_ACCEPT,         /* 163 */
+  OP_ASSERT_ACCEPT,  /* 164 Used inside assertions */
+  OP_CLOSE,          /* 165 Used before OP_ACCEPT to close open captures */
 
   /* This is used to skip a subpattern with a {0} quantifier */
 
-  OP_SKIPZERO,       /* 163 */
+  OP_SKIPZERO,       /* 166 */
 
   /* This is used to identify a DEFINE group during compilation so that it can
   be checked for having only one branch. It is changed to OP_FALSE before
   compilation finishes. */
 
-  OP_DEFINE,         /* 164 */
+  OP_DEFINE,         /* 167 */
 
   /* This is not an opcode, but is used to check that tables indexed by opcode
   are the correct length, in order to catch updating errors - there have been
@@ -1561,7 +1596,7 @@ enum {
 /* *** NOTE NOTE NOTE *** Whenever the list above is updated, the two macro
 definitions that follow must also be updated to match. There are also tables
 called "opcode_possessify" in pcre2_compile.c and "coptable" and "poptable" in
-pcre2_dfa_exec.c that must be updated. */
+pcre2_dfa_match.c that must be updated. */
 
 
 /* This macro defines textual names for all the opcodes. These are used only
@@ -1594,8 +1629,11 @@ some cases doesn't actually use these names at all). */
   "class", "nclass", "xclass", "Ref", "Refi", "DnRef", "DnRefi",  \
   "Recurse", "Callout", "CalloutStr",                             \
   "Alt", "Ket", "KetRmax", "KetRmin", "KetRpos",                  \
-  "Reverse", "Assert", "Assert not", "AssertB", "AssertB not",    \
+  "Reverse", "Assert", "Assert not",                              \
+  "Assert back", "Assert back not",                               \
+  "Non-atomic assert", "Non-atomic assert back",                  \
   "Once",                                                         \
+  "Script run",                                                   \
   "Bra", "BraPos", "CBra", "CBraPos",                             \
   "Cond",                                                         \
   "SBra", "SBraPos", "SCBra", "SCBraPos",                         \
@@ -1678,7 +1716,10 @@ in UTF-8 mode. The code that uses this table must know about such things. */
   1+LINK_SIZE,                   /* Assert not                             */ \
   1+LINK_SIZE,                   /* Assert behind                          */ \
   1+LINK_SIZE,                   /* Assert behind not                      */ \
+  1+LINK_SIZE,                   /* NA Assert                              */ \
+  1+LINK_SIZE,                   /* NA Assert behind                       */ \
   1+LINK_SIZE,                   /* ONCE                                   */ \
+  1+LINK_SIZE,                   /* SCRIPT_RUN                             */ \
   1+LINK_SIZE,                   /* BRA                                    */ \
   1+LINK_SIZE,                   /* BRAPOS                                 */ \
   1+LINK_SIZE+IMM2_SIZE,         /* CBRA                                   */ \
@@ -1747,6 +1788,8 @@ typedef struct {
   uint8_t gbprop;     /* ucp_gbControl, etc. (grapheme break property) */
   uint8_t caseset;    /* offset to multichar other cases or zero */
   int32_t other_case; /* offset to other case, or zero if none */
+  int16_t scriptx;    /* script extension value */
+  int16_t dummy;      /* spare - to round to multiple of 4 bytes */
 } ucd_record;
 
 /* UCD access macros */
@@ -1769,6 +1812,7 @@ typedef struct {
 #define UCD_GRAPHBREAK(ch)  GET_UCD(ch)->gbprop
 #define UCD_CASESET(ch)     GET_UCD(ch)->caseset
 #define UCD_OTHERCASE(ch)   ((uint32_t)((int)ch + (int)(GET_UCD(ch)->other_case)))
+#define UCD_SCRIPTX(ch)     GET_UCD(ch)->scriptx
 
 /* Header for serialized pcre2 codes. */
 
@@ -1826,6 +1870,8 @@ extern const uint8_t          PRIV(utf8_table4)[];
 #define _pcre2_hspace_list             PCRE2_SUFFIX(_pcre2_hspace_list_)
 #define _pcre2_vspace_list             PCRE2_SUFFIX(_pcre2_vspace_list_)
 #define _pcre2_ucd_caseless_sets       PCRE2_SUFFIX(_pcre2_ucd_caseless_sets_)
+#define _pcre2_ucd_digit_sets          PCRE2_SUFFIX(_pcre2_ucd_digit_sets_)
+#define _pcre2_ucd_script_sets         PCRE2_SUFFIX(_pcre2_ucd_script_sets_)
 #define _pcre2_ucd_records             PCRE2_SUFFIX(_pcre2_ucd_records_)
 #define _pcre2_ucd_stage1              PCRE2_SUFFIX(_pcre2_ucd_stage1_)
 #define _pcre2_ucd_stage2              PCRE2_SUFFIX(_pcre2_ucd_stage2_)
@@ -1847,6 +1893,8 @@ extern const uint8_t                   PRIV(default_tables)[];
 extern const uint32_t                  PRIV(hspace_list)[];
 extern const uint32_t                  PRIV(vspace_list)[];
 extern const uint32_t                  PRIV(ucd_caseless_sets)[];
+extern const uint32_t                  PRIV(ucd_digit_sets)[];
+extern const uint8_t                   PRIV(ucd_script_sets)[];
 extern const ucd_record                PRIV(ucd_records)[];
 #if PCRE2_CODE_UNIT_WIDTH == 32
 extern const ucd_record                PRIV(dummy_ucd_record)[];
@@ -1894,6 +1942,7 @@ is available. */
 #define _pcre2_jit_get_target        PCRE2_SUFFIX(_pcre2_jit_get_target_)
 #define _pcre2_memctl_malloc         PCRE2_SUFFIX(_pcre2_memctl_malloc_)
 #define _pcre2_ord2utf               PCRE2_SUFFIX(_pcre2_ord2utf_)
+#define _pcre2_script_run            PCRE2_SUFFIX(_pcre2_script_run_)
 #define _pcre2_strcmp                PCRE2_SUFFIX(_pcre2_strcmp_)
 #define _pcre2_strcmp_c8             PCRE2_SUFFIX(_pcre2_strcmp_c8_)
 #define _pcre2_strcpy_c8             PCRE2_SUFFIX(_pcre2_strcpy_c8_)
@@ -1908,7 +1957,7 @@ 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 *);
+                      int *, uint32_t, uint32_t, BOOL, compile_block *);
 extern PCRE2_SPTR   _pcre2_extuni(uint32_t, PCRE2_SPTR, PCRE2_SPTR, PCRE2_SPTR,
                       BOOL, int *);
 extern PCRE2_SPTR   _pcre2_find_bracket(PCRE2_SPTR, BOOL, int);
@@ -1920,6 +1969,7 @@ extern size_t       _pcre2_jit_get_size(void *);
 const char *        _pcre2_jit_get_target(void);
 extern void *       _pcre2_memctl_malloc(size_t, pcre2_memctl *);
 extern unsigned int _pcre2_ord2utf(uint32_t, PCRE2_UCHAR *);
+extern BOOL         _pcre2_script_run(PCRE2_SPTR, PCRE2_SPTR, BOOL);
 extern int          _pcre2_strcmp(PCRE2_SPTR, PCRE2_SPTR);
 extern int          _pcre2_strcmp_c8(PCRE2_SPTR, const char *);
 extern PCRE2_SIZE   _pcre2_strcpy_c8(PCRE2_UCHAR *, const char *);
index 62626d0a8a74efe2e5b20f971455ec7c45d38106..ea3b3ec6987638ec8fc75faab57795585bfceee1 100644 (file)
@@ -205,19 +205,19 @@ whether its argument, which is assumed to be one code unit, is less than 256.
 The CHMAX_255 macro does not assume one code unit. The maximum length of a MARK
 name must fit in one code unit; currently it is set to 255 or 65535. The
 TABLE_GET macro is used to access elements of tables containing exactly 256
-items. When code points can be greater than 255, a check is needed before
-accessing these tables. */
+items. Its argument is a code unit. When code points can be greater than 255, a
+check is needed before accessing these tables. */
 
 #if PCRE2_CODE_UNIT_WIDTH == 8
 #define MAX_255(c) TRUE
 #define MAX_MARK ((1u << 8) - 1)
+#define TABLE_GET(c, table, default) ((table)[c])
 #ifdef SUPPORT_UNICODE
 #define SUPPORT_WIDE_CHARS
 #define CHMAX_255(c) ((c) <= 255u)
 #else
 #define CHMAX_255(c) TRUE
 #endif  /* SUPPORT_UNICODE */
-#define TABLE_GET(c, table, default) ((table)[c])
 
 #else  /* Code units are 16 or 32 bits */
 #define CHMAX_255(c) ((c) <= 255u)
@@ -228,7 +228,6 @@ accessing these tables. */
 #endif
 
 
-
 /* ----------------- Character-handling macros ----------------- */
 
 /* There is a proposed future special "UTF-21" mode, in which only the lowest
@@ -585,6 +584,8 @@ typedef struct pcre2_real_match_context {
 #endif
   int    (*callout)(pcre2_callout_block *, void *);
   void    *callout_data;
+  int    (*substitute_callout)(pcre2_substitute_callout_block *, void *);
+  void    *substitute_callout_data;
   PCRE2_SIZE offset_limit;
   uint32_t heap_limit;
   uint32_t match_limit;
@@ -656,7 +657,8 @@ typedef struct pcre2_real_match_data {
   PCRE2_SIZE       leftchar;      /* Offset to leftmost code unit */
   PCRE2_SIZE       rightchar;     /* Offset to rightmost code unit */
   PCRE2_SIZE       startchar;     /* Offset to starting code unit */
-  uint16_t         matchedby;     /* Type of match (normal, JIT, DFA) */
+  uint8_t          matchedby;     /* Type of match (normal, JIT, DFA) */
+  uint8_t          flags;         /* Various flags */
   uint16_t         oveccount;     /* Number of pairs */
   int              rc;            /* The return code from the match */
   PCRE2_SIZE       ovector[131072]; /* Must be last in the structure */
@@ -851,6 +853,7 @@ typedef struct match_block {
   uint32_t match_call_count;      /* Number of times a new frame is created */
   BOOL hitend;                    /* Hit the end of the subject at some point */
   BOOL hasthen;                   /* Pattern contains (*THEN) */
+  BOOL allowemptypartial;         /* Allow empty hard partial */
   const uint8_t *lcc;             /* Points to lower casing table */
   const uint8_t *fcc;             /* Points to case-flipping table */
   const uint8_t *ctypes;          /* Points to table of type maps */
@@ -863,6 +866,7 @@ typedef struct match_block {
   PCRE2_SPTR name_table;          /* Table of group names */
   PCRE2_SPTR start_code;          /* For use when recursing */
   PCRE2_SPTR start_subject;       /* Start of the subject string */
+  PCRE2_SPTR check_subject;       /* Where UTF-checked from */
   PCRE2_SPTR end_subject;         /* End of the subject string */
   PCRE2_SPTR end_match_ptr;       /* Subject position at end match */
   PCRE2_SPTR start_used_ptr;      /* Earliest consulted character */
@@ -905,6 +909,7 @@ typedef struct dfa_match_block {
   uint32_t poptions;              /* Pattern options */
   uint32_t nltype;                /* Newline type */
   uint32_t nllen;                 /* Newline string length */
+  BOOL allowemptypartial;         /* Allow empty hard partial */
   PCRE2_UCHAR nl[4];              /* Newline string when fixed */
   uint16_t bsr_convention;        /* \R interpretation */
   pcre2_callout_block *cb;        /* Points to a callout block */
index 32e985b7938582536c79b5f0803edab141fe8be5..f564127c2ae2407cfcd0bb2f083992ed3de53a84 100644 (file)
@@ -6,8 +6,9 @@
 and semantics are as close as possible to those of the Perl 5 language.
 
                        Written by Philip Hazel
+                    This module by Zoltan Herczeg
      Original API code Copyright (c) 1997-2012 University of Cambridge
-          New API code Copyright (c) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -212,12 +213,6 @@ typedef struct stub_list {
   struct stub_list *next;
 } stub_list;
 
-typedef struct label_addr_list {
-  struct sljit_label *label;
-  sljit_uw *update_addr;
-  struct label_addr_list *next;
-} label_addr_list;
-
 enum frame_types {
   no_frame = -1,
   no_stack = -2
@@ -271,6 +266,8 @@ typedef struct bracket_backtrack {
     assert_backtrack *assert;
     /* For OP_ONCE. Less than 0 if not needed. */
     int framesize;
+    /* For brackets with >3 alternatives. */
+    struct sljit_put_label *matching_put_label;
   } u;
   /* Points to our private memory word on the stack. */
   int private_data_ptr;
@@ -416,6 +413,8 @@ typedef struct compiler_common {
   sljit_sw lcc;
   /* Mode can be PCRE2_JIT_COMPLETE and others. */
   int mode;
+  /* TRUE, when empty match is accepted for partial matching. */
+  BOOL allow_empty_partial;
   /* TRUE, when minlength is greater than 0. */
   BOOL might_be_empty;
   /* \K is found in the pattern. */
@@ -454,7 +453,6 @@ typedef struct compiler_common {
   struct sljit_label *accept_label;
   struct sljit_label *ff_newline_shortcut;
   stub_list *stubs;
-  label_addr_list *label_addrs;
   recurse_entry *entries;
   recurse_entry *currententry;
   jump_list *partialmatch;
@@ -477,12 +475,22 @@ typedef struct compiler_common {
   BOOL alt_circumflex;
 #ifdef SUPPORT_UNICODE
   BOOL utf;
+  BOOL invalid_utf;
   BOOL use_ucp;
+  /* Points to saving area for iref. */
+  sljit_s32 iref_ptr;
   jump_list *getucd;
+  jump_list *getucdtype;
 #if PCRE2_CODE_UNIT_WIDTH == 8
   jump_list *utfreadchar;
-  jump_list *utfreadchar16;
   jump_list *utfreadtype8;
+  jump_list *utfpeakcharback;
+#endif
+#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16
+  jump_list *utfreadchar_invalid;
+  jump_list *utfreadnewline_invalid;
+  jump_list *utfmoveback_invalid;
+  jump_list *utfpeakcharback_invalid;
 #endif
 #endif /* SUPPORT_UNICODE */
 } compiler_common;
@@ -553,6 +561,12 @@ typedef struct compare_context {
 #define ARGUMENTS     SLJIT_S4
 #define RETURN_ADDR   SLJIT_R4
 
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
+#define HAS_VIRTUAL_REGISTERS 1
+#else
+#define HAS_VIRTUAL_REGISTERS 0
+#endif
+
 /* Local space layout. */
 /* These two locals can be used by the current opcode. */
 #define LOCALS0          (0 * sizeof(sljit_sw))
@@ -616,7 +630,196 @@ the start pointers when the end of the capturing group has not yet reached. */
 
 #define READ_CHAR_MAX 0x7fffffff
 
-#define INVALID_UTF_CHAR 888
+#define INVALID_UTF_CHAR -1
+#define UNASSIGNED_UTF_CHAR 888
+
+#if defined SUPPORT_UNICODE
+#if PCRE2_CODE_UNIT_WIDTH == 8
+
+#define GETCHARINC_INVALID(c, ptr, end, invalid_action) \
+  { \
+  if (ptr[0] <= 0x7f) \
+    c = *ptr++; \
+  else if (ptr + 1 < end && ptr[1] >= 0x80 && ptr[1] < 0xc0) \
+    { \
+    c = ptr[1] - 0x80; \
+    \
+    if (ptr[0] >= 0xc2 && ptr[0] <= 0xdf) \
+      { \
+      c |= (ptr[0] - 0xc0) << 6; \
+      ptr += 2; \
+      } \
+    else if (ptr + 2 < end && ptr[2] >= 0x80 && ptr[2] < 0xc0) \
+      { \
+      c = c << 6 | (ptr[2] - 0x80); \
+      \
+      if (ptr[0] >= 0xe0 && ptr[0] <= 0xef) \
+        { \
+        c |= (ptr[0] - 0xe0) << 12; \
+        ptr += 3; \
+        \
+        if (c < 0x800 || (c >= 0xd800 && c < 0xe000)) \
+          { \
+          invalid_action; \
+          } \
+        } \
+      else if (ptr + 3 < end && ptr[3] >= 0x80 && ptr[3] < 0xc0) \
+        { \
+        c = c << 6 | (ptr[3] - 0x80); \
+        \
+        if (ptr[0] >= 0xf0 && ptr[0] <= 0xf4) \
+          { \
+          c |= (ptr[0] - 0xf0) << 18; \
+          ptr += 4; \
+          \
+          if (c >= 0x110000 || c < 0x10000) \
+            { \
+            invalid_action; \
+            } \
+          } \
+        else \
+          { \
+          invalid_action; \
+          } \
+        } \
+      else \
+        { \
+        invalid_action; \
+        } \
+      } \
+    else \
+      { \
+      invalid_action; \
+      } \
+    } \
+  else \
+    { \
+    invalid_action; \
+    } \
+  }
+
+#define GETCHARBACK_INVALID(c, ptr, start, invalid_action) \
+  { \
+  c = ptr[-1]; \
+  if (c <= 0x7f) \
+    ptr--; \
+  else if (ptr - 1 > start && ptr[-1] >= 0x80 && ptr[-1] < 0xc0) \
+    { \
+    c -= 0x80; \
+    \
+    if (ptr[-2] >= 0xc2 && ptr[-2] <= 0xdf) \
+      { \
+      c |= (ptr[-2] - 0xc0) << 6; \
+      ptr -= 2; \
+      } \
+    else if (ptr - 2 > start && ptr[-2] >= 0x80 && ptr[-2] < 0xc0) \
+      { \
+      c = c << 6 | (ptr[-2] - 0x80); \
+      \
+      if (ptr[-3] >= 0xe0 && ptr[-3] <= 0xef) \
+        { \
+        c |= (ptr[-3] - 0xe0) << 12; \
+        ptr -= 3; \
+        \
+        if (c < 0x800 || (c >= 0xd800 && c < 0xe000)) \
+          { \
+          invalid_action; \
+          } \
+        } \
+      else if (ptr - 3 > start && ptr[-3] >= 0x80 && ptr[-3] < 0xc0) \
+        { \
+        c = c << 6 | (ptr[-3] - 0x80); \
+        \
+        if (ptr[-4] >= 0xf0 && ptr[-4] <= 0xf4) \
+          { \
+          c |= (ptr[-4] - 0xf0) << 18; \
+          ptr -= 4; \
+          \
+          if (c >= 0x110000 || c < 0x10000) \
+            { \
+            invalid_action; \
+            } \
+          } \
+        else \
+          { \
+          invalid_action; \
+          } \
+        } \
+      else \
+        { \
+        invalid_action; \
+        } \
+      } \
+    else \
+      { \
+      invalid_action; \
+      } \
+    } \
+  else \
+    { \
+    invalid_action; \
+    } \
+  }
+
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+
+#define GETCHARINC_INVALID(c, ptr, end, invalid_action) \
+  { \
+  if (ptr[0] < 0xd800 || ptr[0] >= 0xe000) \
+    c = *ptr++; \
+  else if (ptr[0] < 0xdc00 && ptr + 1 < end && ptr[1] >= 0xdc00 && ptr[1] < 0xe000) \
+    { \
+    c = (((ptr[0] - 0xd800) << 10) | (ptr[1] - 0xdc00)) + 0x10000; \
+    ptr += 2; \
+    } \
+  else \
+    { \
+    invalid_action; \
+    } \
+  }
+
+#define GETCHARBACK_INVALID(c, ptr, start, invalid_action) \
+  { \
+  c = ptr[-1]; \
+  if (c < 0xd800 || c >= 0xe000) \
+    ptr--; \
+  else if (c >= 0xdc00 && ptr - 1 > start && ptr[-2] >= 0xd800 && ptr[-2] < 0xdc00) \
+    { \
+    c = (((ptr[-2] - 0xd800) << 10) | (c - 0xdc00)) + 0x10000; \
+    ptr -= 2; \
+    } \
+  else \
+    { \
+    invalid_action; \
+    } \
+  }
+
+
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+
+#define GETCHARINC_INVALID(c, ptr, end, invalid_action) \
+  { \
+  if (ptr[0] < 0xd800 || (ptr[0] >= 0xe000 && ptr[0] < 0x110000)) \
+    c = *ptr++; \
+  else \
+    { \
+    invalid_action; \
+    } \
+  }
+
+#define GETCHARBACK_INVALID(c, ptr, start, invalid_action) \
+  { \
+  c = ptr[-1]; \
+  if (ptr[-1] < 0xd800 || (ptr[-1] >= 0xe000 && ptr[-1] < 0x110000)) \
+    ptr--; \
+  else \
+    { \
+    invalid_action; \
+    } \
+  }
+
+#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */
+#endif /* SUPPORT_UNICODE */
 
 static PCRE2_SPTR bracketend(PCRE2_SPTR cc)
 {
@@ -716,6 +919,7 @@ switch(*cc)
   case OP_ASSERTBACK:
   case OP_ASSERTBACK_NOT:
   case OP_ONCE:
+  case OP_SCRIPT_RUN:
   case OP_BRA:
   case OP_BRAPOS:
   case OP_CBRA:
@@ -846,8 +1050,8 @@ switch(*cc)
   return cc + 1 + 2 + cc[1];
 
   default:
-  /* All opcodes are supported now! */
-  SLJIT_UNREACHABLE();
+  /* Unsupported opcodes: OP_ASSERT_NA and OP_ASSERTBACK_NA */
+  /* SLJIT_UNREACHABLE(); */
   return NULL;
   }
 }
@@ -869,8 +1073,16 @@ while (cc < ccend)
     cc += 1;
     break;
 
-    case OP_REF:
     case OP_REFI:
+#ifdef SUPPORT_UNICODE
+    if (common->iref_ptr == 0)
+      {
+      common->iref_ptr = common->ovector_start;
+      common->ovector_start += 3 * sizeof(sljit_sw);
+      }
+#endif /* SUPPORT_UNICODE */
+    /* Fall through. */
+    case OP_REF:
     common->optimized_cbracket[GET2(cc, 1)] = 0;
     cc += 1 + IMM2_SIZE;
     break;
@@ -1375,6 +1587,7 @@ while (cc < ccend)
     case OP_ASSERTBACK:
     case OP_ASSERTBACK_NOT:
     case OP_ONCE:
+    case OP_SCRIPT_RUN:
     case OP_BRAPOS:
     case OP_SBRA:
     case OP_SBRAPOS:
@@ -1951,6 +2164,7 @@ while (cc < ccend)
     case OP_ASSERTBACK:
     case OP_ASSERTBACK_NOT:
     case OP_ONCE:
+    case OP_SCRIPT_RUN:
     case OP_BRAPOS:
     case OP_SBRA:
     case OP_SBRAPOS:
@@ -2174,14 +2388,14 @@ if (base_reg != TMP2)
 else
   {
   status.saved_tmp_regs[1] = RETURN_ADDR;
-  if (sljit_get_register_index (RETURN_ADDR) == -1)
+  if (HAS_VIRTUAL_REGISTERS)
     status.tmp_regs[1] = STR_PTR;
   else
     status.tmp_regs[1] = RETURN_ADDR;
   }
 
 status.saved_tmp_regs[2] = TMP3;
-if (sljit_get_register_index (TMP3) == -1)
+if (HAS_VIRTUAL_REGISTERS)
   status.tmp_regs[2] = STR_END;
 else
   status.tmp_regs[2] = TMP3;
@@ -2274,6 +2488,7 @@ while (cc < ccend)
     case OP_ASSERTBACK:
     case OP_ASSERTBACK_NOT:
     case OP_ONCE:
+    case OP_SCRIPT_RUN:
     case OP_BRAPOS:
     case OP_SBRA:
     case OP_SBRAPOS:
@@ -2631,20 +2846,6 @@ while (list_item)
 common->stubs = NULL;
 }
 
-static void add_label_addr(compiler_common *common, sljit_uw *update_addr)
-{
-DEFINE_COMPILER;
-label_addr_list *label_addr;
-
-label_addr = sljit_alloc_memory(compiler, sizeof(label_addr_list));
-if (label_addr == NULL)
-  return;
-label_addr->label = LABEL();
-label_addr->update_addr = update_addr;
-label_addr->next = common->label_addrs;
-common->label_addrs = label_addr;
-}
-
 static SLJIT_INLINE void count_match(compiler_common *common)
 {
 DEFINE_COMPILER;
@@ -2787,12 +2988,18 @@ else
     }
   }
 
-OP1(SLJIT_MOV, STACK_TOP, 0, ARGUMENTS, 0);
+if (!HAS_VIRTUAL_REGISTERS)
+  OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, stack));
+else
+  OP1(SLJIT_MOV, STACK_TOP, 0, ARGUMENTS, 0);
+
 if (common->mark_ptr != 0)
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0);
 if (common->control_head_ptr != 0)
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0);
-OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(STACK_TOP), SLJIT_OFFSETOF(jit_arguments, stack));
+if (HAS_VIRTUAL_REGISTERS)
+  OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(STACK_TOP), SLJIT_OFFSETOF(jit_arguments, stack));
+
 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr);
 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(STACK_TOP), SLJIT_OFFSETOF(struct sljit_stack, end));
 }
@@ -2831,21 +3038,36 @@ BOOL has_pre;
 OP1(SLJIT_MOV, SLJIT_S2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(1));
 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(1), STR_PTR, 0);
 
-OP1(SLJIT_MOV, SLJIT_R0, 0, ARGUMENTS, 0);
-OP1(SLJIT_MOV, SLJIT_S0, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr);
-if (common->mark_ptr != 0)
-  OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr);
-OP1(SLJIT_MOV_U32, SLJIT_R1, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, oveccount));
-OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, startchar_ptr), SLJIT_S0, 0);
-if (common->mark_ptr != 0)
-  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, mark_ptr), SLJIT_R2, 0);
-OP2(SLJIT_ADD, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, match_data),
-  SLJIT_IMM, SLJIT_OFFSETOF(pcre2_match_data, ovector) - sizeof(PCRE2_SIZE));
+if (HAS_VIRTUAL_REGISTERS)
+  {
+  OP1(SLJIT_MOV, SLJIT_R0, 0, ARGUMENTS, 0);
+  OP1(SLJIT_MOV, SLJIT_S0, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr);
+  if (common->mark_ptr != 0)
+    OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr);
+  OP1(SLJIT_MOV_U32, SLJIT_R1, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, oveccount));
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, startchar_ptr), SLJIT_S0, 0);
+  if (common->mark_ptr != 0)
+    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, mark_ptr), SLJIT_R2, 0);
+  OP2(SLJIT_ADD, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, match_data),
+    SLJIT_IMM, SLJIT_OFFSETOF(pcre2_match_data, ovector) - sizeof(PCRE2_SIZE));
+  }
+else
+  {
+  OP1(SLJIT_MOV, SLJIT_S0, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr);
+  OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, match_data));
+  if (common->mark_ptr != 0)
+    OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr);
+  OP1(SLJIT_MOV_U32, SLJIT_R1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, oveccount));
+  OP1(SLJIT_MOV, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, startchar_ptr), SLJIT_S0, 0);
+  if (common->mark_ptr != 0)
+    OP1(SLJIT_MOV, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, mark_ptr), SLJIT_R0, 0);
+  OP2(SLJIT_ADD, SLJIT_R2, 0, SLJIT_R2, 0, SLJIT_IMM, SLJIT_OFFSETOF(pcre2_match_data, ovector) - sizeof(PCRE2_SIZE));
+  }
 
 has_pre = sljit_emit_mem(compiler, SLJIT_MOV | SLJIT_MEM_SUPP | SLJIT_MEM_PRE, SLJIT_S1, SLJIT_MEM1(SLJIT_S0), sizeof(sljit_sw)) == SLJIT_SUCCESS;
 
 GET_LOCAL_BASE(SLJIT_S0, 0, OVECTOR_START - (has_pre ? sizeof(sljit_sw) : 0));
-OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, begin));
+OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(HAS_VIRTUAL_REGISTERS ? SLJIT_R0 : ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin));
 
 loop = LABEL();
 
@@ -2907,20 +3129,22 @@ static SLJIT_INLINE void return_with_partial_match(compiler_common *common, stru
 {
 DEFINE_COMPILER;
 sljit_s32 mov_opcode;
+sljit_s32 arguments_reg = !HAS_VIRTUAL_REGISTERS ? ARGUMENTS : SLJIT_R1;
 
 SLJIT_COMPILE_ASSERT(STR_END == SLJIT_S0, str_end_must_be_saved_reg0);
 SLJIT_ASSERT(common->start_used_ptr != 0 && common->start_ptr != 0
   && (common->mode == PCRE2_JIT_PARTIAL_SOFT ? common->hit_start != 0 : common->hit_start == 0));
 
-OP1(SLJIT_MOV, SLJIT_R1, 0, ARGUMENTS, 0);
+if (arguments_reg != ARGUMENTS)
+  OP1(SLJIT_MOV, arguments_reg, 0, ARGUMENTS, 0);
 OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP),
   common->mode == PCRE2_JIT_PARTIAL_SOFT ? common->hit_start : common->start_ptr);
 OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_PARTIAL);
 
 /* Store match begin and end. */
-OP1(SLJIT_MOV, SLJIT_S1, 0, SLJIT_MEM1(SLJIT_R1), SLJIT_OFFSETOF(jit_arguments, begin));
-OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_R1), SLJIT_OFFSETOF(jit_arguments, startchar_ptr), SLJIT_R2, 0);
-OP1(SLJIT_MOV, SLJIT_R1, 0, SLJIT_MEM1(SLJIT_R1), SLJIT_OFFSETOF(jit_arguments, match_data));
+OP1(SLJIT_MOV, SLJIT_S1, 0, SLJIT_MEM1(arguments_reg), SLJIT_OFFSETOF(jit_arguments, begin));
+OP1(SLJIT_MOV, SLJIT_MEM1(arguments_reg), SLJIT_OFFSETOF(jit_arguments, startchar_ptr), SLJIT_R2, 0);
+OP1(SLJIT_MOV, SLJIT_R1, 0, SLJIT_MEM1(arguments_reg), SLJIT_OFFSETOF(jit_arguments, match_data));
 
 mov_opcode = (sizeof(PCRE2_SIZE) == 4) ? SLJIT_MOV_U32 : SLJIT_MOV;
 
@@ -3059,13 +3283,13 @@ return (0 << 8) | bit;
 #ifdef SUPPORT_UNICODE
 if (common->utf && c > 65535)
   {
-  if (bit >= (1 << 10))
+  if (bit >= (1u << 10))
     bit >>= 10;
   else
     return (bit < 256) ? ((2 << 8) | bit) : ((3 << 8) | (bit >> 8));
   }
 #endif /* SUPPORT_UNICODE */
-return (bit < 256) ? ((0 << 8) | bit) : ((1 << 8) | (bit >> 8));
+return (bit < 256) ? ((0u << 8) | bit) : ((1u << 8) | (bit >> 8));
 
 #endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */
 }
@@ -3081,7 +3305,7 @@ SLJIT_ASSERT(!force || common->mode != PCRE2_JIT_COMPLETE);
 if (common->mode == PCRE2_JIT_COMPLETE)
   return;
 
-if (!force)
+if (!force && !common->allow_empty_partial)
   jump = CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0);
 else if (common->mode == PCRE2_JIT_PARTIAL_SOFT)
   jump = CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1);
@@ -3143,7 +3367,11 @@ if (common->mode == PCRE2_JIT_COMPLETE)
 
 /* Partial matching mode. */
 jump = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0);
-add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0));
+if (!common->allow_empty_partial)
+  add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0));
+else if (common->mode == PCRE2_JIT_PARTIAL_SOFT)
+  add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1));
+
 if (common->mode == PCRE2_JIT_PARTIAL_SOFT)
   {
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0);
@@ -3159,95 +3387,194 @@ else
 JUMPHERE(jump);
 }
 
-static void peek_char(compiler_common *common, sljit_u32 max)
+static void process_partial_match(compiler_common *common)
+{
+DEFINE_COMPILER;
+struct sljit_jump *jump;
+
+/* Partial matching mode. */
+if (common->mode == PCRE2_JIT_PARTIAL_SOFT)
+  {
+  jump = CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0);
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0);
+  JUMPHERE(jump);
+  }
+else if (common->mode == PCRE2_JIT_PARTIAL_HARD)
+  {
+  if (common->partialmatchlabel != NULL)
+    CMPTO(SLJIT_LESS, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0, common->partialmatchlabel);
+  else
+    add_jump(compiler, &common->partialmatch, CMP(SLJIT_LESS, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0));
+  }
+}
+
+static void detect_partial_match_to(compiler_common *common, struct sljit_label *label)
+{
+DEFINE_COMPILER;
+
+CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, label);
+process_partial_match(common);
+}
+
+static void peek_char(compiler_common *common, sljit_u32 max, sljit_s32 dst, sljit_sw dstw, jump_list **backtracks)
 {
 /* Reads the character into TMP1, keeps STR_PTR.
-Does not check STR_END. TMP2 Destroyed. */
+Does not check STR_END. TMP2, dst, RETURN_ADDR Destroyed. */
 DEFINE_COMPILER;
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
 struct sljit_jump *jump;
-#endif
+#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */
 
 SLJIT_UNUSED_ARG(max);
+SLJIT_UNUSED_ARG(dst);
+SLJIT_UNUSED_ARG(dstw);
+SLJIT_UNUSED_ARG(backtracks);
 
-OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+
+#ifdef SUPPORT_UNICODE
+#if PCRE2_CODE_UNIT_WIDTH == 8
 if (common->utf)
   {
   if (max < 128) return;
 
-  jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
+  jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x80);
+  OP1(SLJIT_MOV, dst, dstw, STR_PTR, 0);
   OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-  add_jump(compiler, &common->utfreadchar, JUMP(SLJIT_FAST_CALL));
-  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+  add_jump(compiler, common->invalid_utf ? &common->utfreadchar_invalid : &common->utfreadchar, JUMP(SLJIT_FAST_CALL));
+  OP1(SLJIT_MOV, STR_PTR, 0, dst, dstw);
+  if (backtracks && common->invalid_utf)
+    add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
   JUMPHERE(jump);
   }
-#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16
+#elif PCRE2_CODE_UNIT_WIDTH == 16
 if (common->utf)
   {
   if (max < 0xd800) return;
 
   OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
-  jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800 - 1);
-  /* TMP2 contains the high surrogate. */
-  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
-  OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x40);
-  OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10);
-  OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3ff);
-  OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
-  JUMPHERE(jump);
-  }
-#endif
-}
 
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
-
-static BOOL is_char7_bitset(const sljit_u8 *bitset, BOOL nclass)
-{
-/* Tells whether the character codes below 128 are enough
-to determine a match. */
-const sljit_u8 value = nclass ? 0xff : 0;
-const sljit_u8 *end = bitset + 32;
+  if (common->invalid_utf)
+    {
+    jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800);
+    OP1(SLJIT_MOV, dst, dstw, STR_PTR, 0);
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL));
+    OP1(SLJIT_MOV, STR_PTR, 0, dst, dstw);
+    if (backtracks && common->invalid_utf)
+      add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
+    }
+  else
+    {
+    /* TMP2 contains the high surrogate. */
+    jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800);
+    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1));
+    OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10);
+    OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000 - 0xdc00);
+    OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+    }
 
-bitset += 16;
-do
+  JUMPHERE(jump);
+  }
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+if (common->invalid_utf)
   {
-  if (*bitset++ != value)
-    return FALSE;
+  if (max < 0xd800) return;
+
+  if (backtracks != NULL)
+    {
+    OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+    add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x110000));
+    add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800));
+    }
+  else
+    {
+    OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+    OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x110000);
+    CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR);
+    OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800);
+    CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, INVALID_UTF_CHAR);
+    }
   }
-while (bitset < end);
-return TRUE;
+#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */
+#endif /* SUPPORT_UNICODE */
 }
 
-static void read_char7_type(compiler_common *common, BOOL full_read)
+static void peek_char_back(compiler_common *common, sljit_u32 max, jump_list **backtracks)
 {
-/* Reads the precise character type of a character into TMP1, if the character
-is less than 128. Otherwise it returns with zero. Does not check STR_END. The
-full_read argument tells whether characters above max are accepted or not. */
+/* Reads one character back without moving STR_PTR. TMP2 must
+contain the start of the subject buffer. Affects TMP1, TMP2, and RETURN_ADDR. */
 DEFINE_COMPILER;
-struct sljit_jump *jump;
 
-SLJIT_ASSERT(common->utf);
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_jump *jump;
+#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */
 
-OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), 0);
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+SLJIT_UNUSED_ARG(max);
+SLJIT_UNUSED_ARG(backtracks);
 
-OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes);
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
 
-if (full_read)
+#ifdef SUPPORT_UNICODE
+#if PCRE2_CODE_UNIT_WIDTH == 8
+if (common->utf)
   {
-  jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xc0);
-  OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(utf8_table4) - 0xc0);
-  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+  if (max < 128) return;
+
+  jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x80);
+  if (common->invalid_utf)
+    {
+    add_jump(compiler, &common->utfpeakcharback_invalid, JUMP(SLJIT_FAST_CALL));
+    if (backtracks != NULL)
+      add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
+    }
+  else
+    add_jump(compiler, &common->utfpeakcharback, JUMP(SLJIT_FAST_CALL));
   JUMPHERE(jump);
   }
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+if (common->utf)
+  {
+  if (max < 0xd800) return;
+
+  if (common->invalid_utf)
+    {
+    jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800);
+    add_jump(compiler, &common->utfpeakcharback_invalid, JUMP(SLJIT_FAST_CALL));
+    if (backtracks != NULL)
+      add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
+    }
+  else
+    {
+    OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xdc00);
+    jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xdc00);
+    /* TMP2 contains the low surrogate. */
+    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
+    OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x10000);
+    OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+    OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 10);
+    OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+    }
+    JUMPHERE(jump);
+  }
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+if (common->invalid_utf)
+  {
+  OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+  add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x110000));
+  add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800));
+  }
+#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */
+#endif /* SUPPORT_UNICODE */
 }
 
-#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */
+#define READ_CHAR_UPDATE_STR_PTR 0x1
+#define READ_CHAR_UTF8_NEWLINE 0x2
+#define READ_CHAR_NEWLINE (READ_CHAR_UPDATE_STR_PTR | READ_CHAR_UTF8_NEWLINE)
+#define READ_CHAR_VALID_UTF 0x4
 
-static void read_char_range(compiler_common *common, sljit_u32 min, sljit_u32 max, BOOL update_str_ptr)
+static void read_char(compiler_common *common, sljit_u32 min, sljit_u32 max,
+  jump_list **backtracks, sljit_u32 options)
 {
 /* Reads the precise value of a character into TMP1, if the character is
 between min and max (c >= min && c <= max). Otherwise it returns with a value
@@ -3260,24 +3587,41 @@ struct sljit_jump *jump;
 struct sljit_jump *jump2;
 #endif
 
-SLJIT_UNUSED_ARG(update_str_ptr);
 SLJIT_UNUSED_ARG(min);
 SLJIT_UNUSED_ARG(max);
+SLJIT_UNUSED_ARG(backtracks);
+SLJIT_UNUSED_ARG(options);
 SLJIT_ASSERT(min <= max);
 
 OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
 OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
 
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
+#ifdef SUPPORT_UNICODE
+#if PCRE2_CODE_UNIT_WIDTH == 8
 if (common->utf)
   {
-  if (max < 128 && !update_str_ptr) return;
+  if (max < 128 && !(options & READ_CHAR_UPDATE_STR_PTR)) return;
+
+  if (common->invalid_utf && !(options & READ_CHAR_VALID_UTF))
+    {
+    jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x80);
+
+    if (options & READ_CHAR_UTF8_NEWLINE)
+      add_jump(compiler, &common->utfreadnewline_invalid, JUMP(SLJIT_FAST_CALL));
+    else
+      add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL));
+
+    if (backtracks != NULL)
+      add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
+    JUMPHERE(jump);
+    return;
+    }
 
   jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
   if (min >= 0x10000)
     {
     OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xf0);
-    if (update_str_ptr)
+    if (options & READ_CHAR_UPDATE_STR_PTR)
       OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0);
     OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
     jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0x7);
@@ -3289,19 +3633,19 @@ if (common->utf)
     OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
     OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
     OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(2));
-    if (!update_str_ptr)
+    if (!(options & READ_CHAR_UPDATE_STR_PTR))
       OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3));
     OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
     OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
     OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
     JUMPHERE(jump2);
-    if (update_str_ptr)
+    if (options & READ_CHAR_UPDATE_STR_PTR)
       OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, RETURN_ADDR, 0);
     }
   else if (min >= 0x800 && max <= 0xffff)
     {
     OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xe0);
-    if (update_str_ptr)
+    if (options & READ_CHAR_UPDATE_STR_PTR)
       OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0);
     OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
     jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xf);
@@ -3309,17 +3653,19 @@ if (common->utf)
     OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f);
     OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
     OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1));
-    if (!update_str_ptr)
+    if (!(options & READ_CHAR_UPDATE_STR_PTR))
       OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
     OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
     OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
     OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
     JUMPHERE(jump2);
-    if (update_str_ptr)
+    if (options & READ_CHAR_UPDATE_STR_PTR)
       OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, RETURN_ADDR, 0);
     }
   else if (max >= 0x800)
-    add_jump(compiler, (max < 0x10000) ? &common->utfreadchar16 : &common->utfreadchar, JUMP(SLJIT_FAST_CALL));
+    {
+    add_jump(compiler, &common->utfreadchar, JUMP(SLJIT_FAST_CALL));
+    }
   else if (max < 128)
     {
     OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0);
@@ -3328,7 +3674,7 @@ if (common->utf)
   else
     {
     OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
-    if (!update_str_ptr)
+    if (!(options & READ_CHAR_UPDATE_STR_PTR))
       OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
     else
       OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0);
@@ -3336,54 +3682,151 @@ if (common->utf)
     OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
     OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
     OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
-    if (update_str_ptr)
+    if (options & READ_CHAR_UPDATE_STR_PTR)
       OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, RETURN_ADDR, 0);
     }
   JUMPHERE(jump);
   }
-#endif
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16
+#elif PCRE2_CODE_UNIT_WIDTH == 16
 if (common->utf)
   {
+  if (max < 0xd800 && !(options & READ_CHAR_UPDATE_STR_PTR)) return;
+
+  if (common->invalid_utf && !(options & READ_CHAR_VALID_UTF))
+    {
+    OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+    jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800);
+
+    if (options & READ_CHAR_UTF8_NEWLINE)
+      add_jump(compiler, &common->utfreadnewline_invalid, JUMP(SLJIT_FAST_CALL));
+    else
+      add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL));
+
+    if (backtracks != NULL)
+      add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
+    JUMPHERE(jump);
+    return;
+    }
+
   if (max >= 0x10000)
     {
     OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
-    jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800 - 1);
+    jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800);
     /* TMP2 contains the high surrogate. */
     OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
-    OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x40);
     OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10);
     OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-    OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3ff);
-    OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+    OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000 - 0xdc00);
+    OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
     JUMPHERE(jump);
     return;
     }
 
-  if (max < 0xd800 && !update_str_ptr) return;
-
   /* Skip low surrogate if necessary. */
   OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
-  jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800 - 1);
-  if (update_str_ptr)
-    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-  if (max >= 0xd800)
-    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0x10000);
-  JUMPHERE(jump);
+
+  if (sljit_has_cpu_feature(SLJIT_HAS_CMOV) && !HAS_VIRTUAL_REGISTERS)
+    {
+    if (options & READ_CHAR_UPDATE_STR_PTR)
+      OP2(SLJIT_ADD, RETURN_ADDR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x400);
+    if (options & READ_CHAR_UPDATE_STR_PTR)
+      CMOV(SLJIT_LESS, STR_PTR, RETURN_ADDR, 0);
+    if (max >= 0xd800)
+      CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, 0x10000);
+    }
+  else
+    {
+    jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400);
+    if (options & READ_CHAR_UPDATE_STR_PTR)
+      OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    if (max >= 0xd800)
+      OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0x10000);
+    JUMPHERE(jump);
+    }
   }
-#endif
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+if (common->invalid_utf)
+  {
+  if (backtracks != NULL)
+    {
+    OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+    add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x110000));
+    add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800));
+    }
+  else
+    {
+    OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+    OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x110000);
+    CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR);
+    OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800);
+    CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, INVALID_UTF_CHAR);
+    }
+  }
+#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */
+#endif /* SUPPORT_UNICODE */
 }
 
-static SLJIT_INLINE void read_char(compiler_common *common)
-{
-read_char_range(common, 0, READ_CHAR_MAX, TRUE);
-}
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
 
-static void read_char8_type(compiler_common *common, BOOL update_str_ptr)
+static BOOL is_char7_bitset(const sljit_u8 *bitset, BOOL nclass)
 {
-/* Reads the character type into TMP1, updates STR_PTR. Does not check STR_END. */
-DEFINE_COMPILER;
+/* Tells whether the character codes below 128 are enough
+to determine a match. */
+const sljit_u8 value = nclass ? 0xff : 0;
+const sljit_u8 *end = bitset + 32;
+
+bitset += 16;
+do
+  {
+  if (*bitset++ != value)
+    return FALSE;
+  }
+while (bitset < end);
+return TRUE;
+}
+
+static void read_char7_type(compiler_common *common, jump_list **backtracks, BOOL negated)
+{
+/* Reads the precise character type of a character into TMP1, if the character
+is less than 128. Otherwise it returns with zero. Does not check STR_END. The
+full_read argument tells whether characters above max are accepted or not. */
+DEFINE_COMPILER;
+struct sljit_jump *jump;
+
+SLJIT_ASSERT(common->utf);
+
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), 0);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+/* All values > 127 are zero in ctypes. */
+OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes);
+
+if (negated)
+  {
+  jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x80);
+
+  if (common->invalid_utf)
+    {
+    add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL));
+    add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
+    }
+  else
+    {
+    OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(utf8_table4) - 0xc0);
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+    }
+  JUMPHERE(jump);
+  }
+}
+
+#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */
+
+static void read_char8_type(compiler_common *common, jump_list **backtracks, BOOL negated)
+{
+/* Reads the character type into TMP1, updates STR_PTR. Does not check STR_END. */
+DEFINE_COMPILER;
 #if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
 struct sljit_jump *jump;
 #endif
@@ -3391,7 +3834,8 @@ struct sljit_jump *jump;
 struct sljit_jump *jump2;
 #endif
 
-SLJIT_UNUSED_ARG(update_str_ptr);
+SLJIT_UNUSED_ARG(backtracks);
+SLJIT_UNUSED_ARG(negated);
 
 OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), 0);
 OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
@@ -3399,18 +3843,38 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
 if (common->utf)
   {
-  /* This can be an extra read in some situations, but hopefully
-  it is needed in most cases. */
+  /* The result of this read may be unused, but saves an "else" part. */
   OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes);
-  jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0xc0);
-  if (!update_str_ptr)
+  jump = CMP(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x80);
+
+  if (!negated)
     {
+    if (common->invalid_utf)
+      add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
     OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
     OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-    OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
+    OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2);
+    if (common->invalid_utf)
+      add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe0 - 0xc2));
+
     OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6);
-    OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f);
-    OP2(SLJIT_OR, TMP2, 0, TMP2, 0, TMP1, 0);
+    OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
+    OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80);
+    if (common->invalid_utf)
+      add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40));
+
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
+    jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 255);
+    OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes);
+    JUMPHERE(jump2);
+    }
+  else if (common->invalid_utf)
+    {
+    add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL));
+    OP1(SLJIT_MOV, TMP2, 0, TMP1, 0);
+    add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
+
     OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
     jump2 = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 255);
     OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes);
@@ -3418,43 +3882,98 @@ if (common->utf)
     }
   else
     add_jump(compiler, &common->utfreadtype8, JUMP(SLJIT_FAST_CALL));
+
   JUMPHERE(jump);
   return;
   }
 #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */
 
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 32
+if (common->invalid_utf && negated)
+  add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x110000));
+#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 32 */
+
 #if PCRE2_CODE_UNIT_WIDTH != 8
 /* The ctypes array contains only 256 values. */
 OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
 jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 255);
-#endif
+#endif /* PCRE2_CODE_UNIT_WIDTH != 8 */
 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes);
 #if PCRE2_CODE_UNIT_WIDTH != 8
 JUMPHERE(jump);
-#endif
+#endif /* PCRE2_CODE_UNIT_WIDTH != 8 */
 
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16
-if (common->utf && update_str_ptr)
+if (common->utf && negated)
   {
   /* Skip low surrogate if necessary. */
+  if (!common->invalid_utf)
+    {
+    OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xd800);
+
+    if (sljit_has_cpu_feature(SLJIT_HAS_CMOV) && !HAS_VIRTUAL_REGISTERS)
+      {
+      OP2(SLJIT_ADD, RETURN_ADDR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+      OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x400);
+      CMOV(SLJIT_LESS, STR_PTR, RETURN_ADDR, 0);
+      }
+    else
+      {
+      jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400);
+      OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+      JUMPHERE(jump);
+      }
+    return;
+    }
+
   OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xd800);
-  jump = CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, 0xdc00 - 0xd800 - 1);
+  jump = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0xe000 - 0xd800);
+  add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400));
+  add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+  OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
   OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+  OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xdc00);
+  add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400));
+
   JUMPHERE(jump);
+  return;
   }
 #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 16 */
 }
 
-static void skip_char_back(compiler_common *common)
+static void move_back(compiler_common *common, jump_list **backtracks, BOOL must_be_valid)
 {
-/* Goes one character back. Affects STR_PTR and TMP1. Does not check begin. */
+/* Goes one character back. Affects STR_PTR and TMP1. If must_be_valid is TRUE,
+TMP2 is not used. Otherwise TMP2 must contain the start of the subject buffer,
+and it is destroyed. Does not modify STR_PTR for invalid character sequences. */
 DEFINE_COMPILER;
+
+SLJIT_UNUSED_ARG(backtracks);
+SLJIT_UNUSED_ARG(must_be_valid);
+
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_jump *jump;
+#endif
+
+#ifdef SUPPORT_UNICODE
 #if PCRE2_CODE_UNIT_WIDTH == 8
 struct sljit_label *label;
 
 if (common->utf)
   {
+  if (!must_be_valid && common->invalid_utf)
+    {
+    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -IN_UCHARS(1));
+    OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x80);
+    add_jump(compiler, &common->utfmoveback_invalid, JUMP(SLJIT_FAST_CALL));
+    if (backtracks != NULL)
+      add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0));
+    JUMPHERE(jump);
+    return;
+    }
+
   label = LABEL();
   OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -IN_UCHARS(1));
   OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
@@ -3467,16 +3986,45 @@ if (common->utf)
   {
   OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -IN_UCHARS(1));
   OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+  if (!must_be_valid && common->invalid_utf)
+    {
+    OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+    jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xe000 - 0xd800);
+    add_jump(compiler, &common->utfmoveback_invalid, JUMP(SLJIT_FAST_CALL));
+    if (backtracks != NULL)
+      add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0));
+    JUMPHERE(jump);
+    return;
+    }
+
   /* Skip low surrogate if necessary. */
   OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
   OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xdc00);
   OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
-  OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
+  OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT);
   OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
   return;
   }
-#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */
-#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+if (common->invalid_utf && !must_be_valid)
+  {
+  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -IN_UCHARS(1));
+  if (backtracks != NULL)
+    {
+    add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x110000));
+    OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    return;
+    }
+
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x110000);
+  OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_LESS);
+  OP2(SLJIT_SHL,  TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT);
+  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+  return;
+  }
+#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */
+#endif /* SUPPORT_UNICODE */
 OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
 }
 
@@ -3519,13 +4067,12 @@ else
 static void do_utfreadchar(compiler_common *common)
 {
 /* Fast decoding a UTF-8 character. TMP1 contains the first byte
-of the character (>= 0xc0). Return char value in TMP1, length in TMP2. */
+of the character (>= 0xc0). Return char value in TMP1. */
 DEFINE_COMPILER;
 struct sljit_jump *jump;
 
 sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
 OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
-OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f);
 OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
 OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
 OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
@@ -3534,13 +4081,12 @@ OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
 OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
 jump = JUMP(SLJIT_NOT_ZERO);
 /* Two byte sequence. */
+OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3000);
 OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, IN_UCHARS(2));
 sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
 
 JUMPHERE(jump);
 OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1));
-OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x800);
 OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
 OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
 OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
@@ -3548,55 +4094,18 @@ OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
 OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x10000);
 jump = JUMP(SLJIT_NOT_ZERO);
 /* Three byte sequence. */
+OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0000);
 OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, IN_UCHARS(3));
 sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
 
 /* Four byte sequence. */
 JUMPHERE(jump);
 OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(2));
-OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000);
-OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
+OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xf0000);
 OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3));
-OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
-OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, IN_UCHARS(4));
-sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
-}
-
-static void do_utfreadchar16(compiler_common *common)
-{
-/* Fast decoding a UTF-8 character. TMP1 contains the first byte
-of the character (>= 0xc0). Return value in TMP1. */
-DEFINE_COMPILER;
-struct sljit_jump *jump;
-
-sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
-OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
-OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x3f);
-OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
-OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
-OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
-
-/* Searching for the first zero. */
-OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
-jump = JUMP(SLJIT_NOT_ZERO);
-/* Two byte sequence. */
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
-
-JUMPHERE(jump);
-OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x400);
-OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_NOT_ZERO);
-/* This code runs only in 8 bit mode. No need to shift the value. */
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
-OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1));
-OP2(SLJIT_XOR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x800);
 OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
 OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x3f);
 OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
-/* Three byte sequence. */
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
 sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
 }
 
@@ -3636,129 +4145,821 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
 sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
 }
 
-#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
-
-/* UCD_BLOCK_SIZE must be 128 (see the assert below). */
-#define UCD_BLOCK_MASK 127
-#define UCD_BLOCK_SHIFT 7
-
-static void do_getucd(compiler_common *common)
+static void do_utfreadchar_invalid(compiler_common *common)
 {
-/* Search the UCD record for the character comes in TMP1.
-Returns chartype in TMP1 and UCD offset in TMP2. */
+/* Slow decoding a UTF-8 character. TMP1 contains the first byte
+of the character (>= 0xc0). Return char value in TMP1. STR_PTR is
+undefined for invalid characters. */
 DEFINE_COMPILER;
-#if PCRE2_CODE_UNIT_WIDTH == 32
+sljit_s32 i;
+sljit_s32 has_cmov = sljit_has_cpu_feature(SLJIT_HAS_CMOV);
 struct sljit_jump *jump;
-#endif
+struct sljit_jump *buffer_end_close;
+struct sljit_label *three_byte_entry;
+struct sljit_label *exit_invalid_label;
+struct sljit_jump *exit_invalid[11];
 
-#if defined SLJIT_DEBUG && SLJIT_DEBUG
-/* dummy_ucd_record */
-const ucd_record *record = GET_UCD(INVALID_UTF_CHAR);
-SLJIT_ASSERT(record->script == ucp_Common && record->chartype == ucp_Cn && record->gbprop == ucp_gbOther);
-SLJIT_ASSERT(record->caseset == 0 && record->other_case == 0);
-#endif
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
 
-SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 8);
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc2);
 
-sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+/* Usually more than 3 characters remained in the subject buffer. */
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3));
 
-#if PCRE2_CODE_UNIT_WIDTH == 32
-if (!common->utf)
-  {
-  jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1);
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
-  JUMPHERE(jump);
-  }
-#endif
+/* Not a valid start of a multi-byte sequence, no more bytes read. */
+exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xf5 - 0xc2);
 
-OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
-OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
-OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1));
-OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK);
-OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
-OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2));
-OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1);
-OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype));
-OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3);
-sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
-}
+buffer_end_close = CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0);
 
-#endif /* SUPPORT_UNICODE */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-3));
+OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
+/* If TMP2 is in 0x80-0xbf range, TMP1 is also increased by (0x2 << 6). */
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80);
+exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40);
 
-static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common)
-{
-DEFINE_COMPILER;
-struct sljit_label *mainloop;
-struct sljit_label *newlinelabel = NULL;
-struct sljit_jump *start;
-struct sljit_jump *end = NULL;
-struct sljit_jump *end2 = NULL;
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-struct sljit_jump *singlechar;
-#endif
-jump_list *newline = NULL;
-sljit_u32 overall_options = common->re->overall_options;
-BOOL hascrorlf = (common->re->flags & PCRE2_HASCRORLF) != 0;
-BOOL newlinecheck = FALSE;
-BOOL readuchar = FALSE;
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
+jump = JUMP(SLJIT_NOT_ZERO);
 
-if (!(hascrorlf || (overall_options & PCRE2_FIRSTLINE) != 0)
-    && (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF || common->newline > 255))
-  newlinecheck = TRUE;
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
 
-SLJIT_ASSERT(common->abort_label == NULL);
+JUMPHERE(jump);
 
-if ((overall_options & PCRE2_FIRSTLINE) != 0)
+/* Three-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
+OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+if (has_cmov)
   {
-  /* Search for the end of the first line. */
-  SLJIT_ASSERT(common->match_end_ptr != 0);
-  OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0);
+  OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x40);
+  CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, 0x20000);
+  exit_invalid[2] = NULL;
+  }
+else
+  exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40);
 
-  if (common->nltype == NLTYPE_FIXED && common->newline > 255)
-    {
-    mainloop = LABEL();
-    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-    end = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
-    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
-    OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
-    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->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->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->match_end_ptr, STR_PTR, 0);
-    set_jumps(newline, LABEL());
-    }
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x10000);
+jump = JUMP(SLJIT_NOT_ZERO);
 
-  OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0);
+three_byte_entry = LABEL();
+
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x2d800);
+if (has_cmov)
+  {
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
+  CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, INVALID_UTF_CHAR - 0xd800);
+  exit_invalid[3] = NULL;
   }
-else if ((overall_options & PCRE2_USE_OFFSET_LIMIT) != 0)
+else
+  exit_invalid[3] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x800);
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+if (has_cmov)
   {
-  /* Check whether offset limit is set and valid. */
-  SLJIT_ASSERT(common->match_end_ptr != 0);
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
+  CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, INVALID_UTF_CHAR);
+  exit_invalid[4] = NULL;
+  }
+else
+  exit_invalid[4] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x800);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(jump);
+
+/* Four-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
+OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+if (has_cmov)
+  {
+  OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x40);
+  CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, 0);
+  exit_invalid[5] = NULL;
+  }
+else
+  exit_invalid[5] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40);
+
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc10000);
+if (has_cmov)
+  {
+  OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x100000);
+  CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR - 0x10000);
+  exit_invalid[6] = NULL;
+  }
+else
+  exit_invalid[6] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x100000);
+
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(buffer_end_close);
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
+exit_invalid[7] = CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0);
+
+/* Two-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
+OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
+/* If TMP2 is in 0x80-0xbf range, TMP1 is also increased by (0x2 << 6). */
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80);
+exit_invalid[8] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40);
+
+OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
+jump = JUMP(SLJIT_NOT_ZERO);
+
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+/* Three-byte sequence. */
+JUMPHERE(jump);
+exit_invalid[9] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+if (has_cmov)
+  {
+  OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x40);
+  CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR);
+  exit_invalid[10] = NULL;
+  }
+else
+  exit_invalid[10] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40);
+
+/* One will be substracted from STR_PTR later. */
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
+
+/* Four byte sequences are not possible. */
+CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x30000, three_byte_entry);
+
+exit_invalid_label = LABEL();
+for (i = 0; i < 11; i++)
+  sljit_set_label(exit_invalid[i], exit_invalid_label);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+static void do_utfreadnewline_invalid(compiler_common *common)
+{
+/* Slow decoding a UTF-8 character, specialized for newlines.
+TMP1 contains the first byte of the character (>= 0xc0). Return
+char value in TMP1. */
+DEFINE_COMPILER;
+struct sljit_label *loop;
+struct sljit_label *skip_start;
+struct sljit_label *three_byte_exit;
+struct sljit_jump *jump[5];
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+if (common->nltype != NLTYPE_ANY)
+  {
+  SLJIT_ASSERT(common->nltype != NLTYPE_FIXED || common->newline < 128);
+
+  /* All newlines are ascii, just skip intermediate octets. */
+  jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+  loop = LABEL();
+  OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+  OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc0);
+  CMPTO(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0x80, loop);
+  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+  JUMPHERE(jump[0]);
+
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+  sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+  return;
+  }
+
+jump[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+jump[1] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xc2);
+jump[2] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, 0xe2);
+
+skip_start = LABEL();
+OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc0);
+jump[3] = CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0x80);
+
+/* Skip intermediate octets. */
+loop = LABEL();
+jump[4] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc0);
+CMPTO(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0x80, loop);
+
+JUMPHERE(jump[3]);
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+three_byte_exit = LABEL();
+JUMPHERE(jump[0]);
+JUMPHERE(jump[4]);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+/* Two byte long newline: 0x85. */
+JUMPHERE(jump[1]);
+CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0x85, skip_start);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0x85);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+/* Three byte long newlines: 0x2028 and 0x2029. */
+JUMPHERE(jump[2]);
+CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, 0x80, skip_start);
+CMPTO(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0, three_byte_exit);
+
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+OP2(SLJIT_SUB, TMP1, 0, TMP2, 0, SLJIT_IMM, 0x80);
+CMPTO(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x40, skip_start);
+
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 0x2000);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+static void do_utfmoveback_invalid(compiler_common *common)
+{
+/* Goes one character back. */
+DEFINE_COMPILER;
+sljit_s32 i;
+struct sljit_jump *jump;
+struct sljit_jump *buffer_start_close;
+struct sljit_label *exit_ok_label;
+struct sljit_label *exit_invalid_label;
+struct sljit_jump *exit_invalid[7];
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3));
+exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xc0);
+
+/* Two-byte sequence. */
+buffer_start_close = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(2));
+
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
+jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x20);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+/* Three-byte sequence. */
+JUMPHERE(jump);
+exit_invalid[1] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, -0x40);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(1));
+
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0);
+jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x10);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+/* Four-byte sequence. */
+JUMPHERE(jump);
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0 - 0x80);
+exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x40);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xf0);
+exit_invalid[3] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x05);
+
+exit_ok_label = LABEL();
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+/* Two-byte sequence. */
+JUMPHERE(buffer_start_close);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
+
+exit_invalid[4] = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
+CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x20, exit_ok_label);
+
+/* Three-byte sequence. */
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+exit_invalid[5] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, -0x40);
+exit_invalid[6] = CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0);
+CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x10, exit_ok_label);
+
+/* Four-byte sequences are not possible. */
+
+exit_invalid_label = LABEL();
+sljit_set_label(exit_invalid[5], exit_invalid_label);
+sljit_set_label(exit_invalid[6], exit_invalid_label);
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(3));
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(exit_invalid[4]);
+/* -2 + 4 = 2 */
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
+
+exit_invalid_label = LABEL();
+for (i = 0; i < 4; i++)
+  sljit_set_label(exit_invalid[i], exit_invalid_label);
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(4));
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+static void do_utfpeakcharback(compiler_common *common)
+{
+/* Peak a character back. Does not modify STR_PTR. */
+DEFINE_COMPILER;
+struct sljit_jump *jump[2];
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xc0);
+jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x20);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-3));
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0);
+jump[1] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x10);
+
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-4));
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xe0 - 0x80);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf0);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+JUMPHERE(jump[1]);
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
+OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+JUMPHERE(jump[0]);
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
+OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 6);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x80);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+static void do_utfpeakcharback_invalid(compiler_common *common)
+{
+/* Peak a character back. Does not modify STR_PTR. */
+DEFINE_COMPILER;
+sljit_s32 i;
+sljit_s32 has_cmov = sljit_has_cpu_feature(SLJIT_HAS_CMOV);
+struct sljit_jump *jump[2];
+struct sljit_label *two_byte_entry;
+struct sljit_label *three_byte_entry;
+struct sljit_label *exit_invalid_label;
+struct sljit_jump *exit_invalid[8];
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(3));
+exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xc0);
+jump[0] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, STR_PTR, 0);
+
+/* Two-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2);
+jump[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x1e);
+
+two_byte_entry = LABEL();
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6);
+/* If TMP1 is in 0x80-0xbf range, TMP1 is also increased by (0x2 << 6). */
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(jump[1]);
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2 - 0x80);
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80);
+exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+/* Three-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-3));
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xe0);
+jump[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x10);
+
+three_byte_entry = LABEL();
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 12);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+if (has_cmov)
+  {
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
+  CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, -0xd800);
+  exit_invalid[2] = NULL;
+  }
+else
+  exit_invalid[2] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x800);
+
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+if (has_cmov)
+  {
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x800);
+  CMOV(SLJIT_LESS, TMP1, SLJIT_IMM, INVALID_UTF_CHAR);
+  exit_invalid[3] = NULL;
+  }
+else
+  exit_invalid[3] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x800);
+
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(jump[1]);
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xe0 - 0x80);
+exit_invalid[4] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 12);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+/* Four-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-4));
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf0);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 18);
+/* ADD is used instead of OR because of the SUB 0x10000 above. */
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+
+if (has_cmov)
+  {
+  OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x100000);
+  CMOV(SLJIT_GREATER_EQUAL, TMP1, SLJIT_IMM, INVALID_UTF_CHAR - 0x10000);
+  exit_invalid[5] = NULL;
+  }
+else
+  exit_invalid[5] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x100000);
+
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(jump[0]);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1));
+jump[0] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, STR_PTR, 0);
+
+/* Two-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2);
+CMPTO(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x1e, two_byte_entry);
+
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2 - 0x80);
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80);
+exit_invalid[6] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x40);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 6);
+OP2(SLJIT_OR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+/* Three-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-3));
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xe0);
+CMPTO(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x10, three_byte_entry);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(jump[0]);
+exit_invalid[7] = CMP(SLJIT_GREATER, TMP2, 0, STR_PTR, 0);
+
+/* Two-byte sequence. */
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xc2);
+CMPTO(SLJIT_LESS, TMP2, 0, SLJIT_IMM, 0x1e, two_byte_entry);
+
+exit_invalid_label = LABEL();
+for (i = 0; i < 8; i++)
+  sljit_set_label(exit_invalid[i], exit_invalid_label);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
 
-  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);
+
+static void do_utfreadchar_invalid(compiler_common *common)
+{
+/* Slow decoding a UTF-16 character. TMP1 contains the first half
+of the character (>= 0xd800). Return char value in TMP1. STR_PTR is
+undefined for invalid characters. */
+DEFINE_COMPILER;
+struct sljit_jump *exit_invalid[3];
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+/* TMP2 contains the high surrogate. */
+exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00);
+exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xdc00);
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, 0x10000);
+exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x400);
+
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(exit_invalid[0]);
+JUMPHERE(exit_invalid[1]);
+JUMPHERE(exit_invalid[2]);
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+static void do_utfreadnewline_invalid(compiler_common *common)
+{
+/* Slow decoding a UTF-16 character, specialized for newlines.
+TMP1 contains the first half of the character (>= 0xd800). Return
+char value in TMP1. */
+
+DEFINE_COMPILER;
+struct sljit_jump *exit_invalid[2];
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+/* TMP2 contains the high surrogate. */
+exit_invalid[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xdc00);
+
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xdc00);
+OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, 0x400);
+OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS);
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0x10000);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCHAR_SHIFT);
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(exit_invalid[0]);
+JUMPHERE(exit_invalid[1]);
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+static void do_utfmoveback_invalid(compiler_common *common)
+{
+/* Goes one character back. */
+DEFINE_COMPILER;
+struct sljit_jump *exit_invalid[3];
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+exit_invalid[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x400);
+exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, STR_PTR, 0);
+
+OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
+OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0x400);
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 1);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(exit_invalid[0]);
+JUMPHERE(exit_invalid[1]);
+JUMPHERE(exit_invalid[2]);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+static void do_utfpeakcharback_invalid(compiler_common *common)
+{
+/* Peak a character back. Does not modify STR_PTR. */
+DEFINE_COMPILER;
+struct sljit_jump *jump;
+struct sljit_jump *exit_invalid[3];
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+jump = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xe000);
+OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, IN_UCHARS(1));
+exit_invalid[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xdc00);
+exit_invalid[1] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, STR_PTR, 0);
+
+OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x10000 - 0xdc00);
+OP2(SLJIT_SUB, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xd800);
+exit_invalid[2] = CMP(SLJIT_GREATER_EQUAL, TMP2, 0, SLJIT_IMM, 0x400);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 10);
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+
+JUMPHERE(jump);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+
+JUMPHERE(exit_invalid[0]);
+JUMPHERE(exit_invalid[1]);
+JUMPHERE(exit_invalid[2]);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+#endif /* PCRE2_CODE_UNIT_WIDTH == 16 */
+
+/* UCD_BLOCK_SIZE must be 128 (see the assert below). */
+#define UCD_BLOCK_MASK 127
+#define UCD_BLOCK_SHIFT 7
+
+static void do_getucd(compiler_common *common)
+{
+/* Search the UCD record for the character comes in TMP1.
+Returns chartype in TMP1 and UCD offset in TMP2. */
+DEFINE_COMPILER;
+#if PCRE2_CODE_UNIT_WIDTH == 32
+struct sljit_jump *jump;
+#endif
+
+#if defined SLJIT_DEBUG && SLJIT_DEBUG
+/* dummy_ucd_record */
+const ucd_record *record = GET_UCD(UNASSIGNED_UTF_CHAR);
+SLJIT_ASSERT(record->script == ucp_Unknown && record->chartype == ucp_Cn && record->gbprop == ucp_gbOther);
+SLJIT_ASSERT(record->caseset == 0 && record->other_case == 0);
+#endif
+
+SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 12);
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+#if PCRE2_CODE_UNIT_WIDTH == 32
+if (!common->utf)
+  {
+  jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1);
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR);
+  JUMPHERE(jump);
+  }
 #endif
-  OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin));
+
+OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
+OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1));
+OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2));
+OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1);
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+static void do_getucdtype(compiler_common *common)
+{
+/* Search the UCD record for the character comes in TMP1.
+Returns chartype in TMP1 and UCD offset in TMP2. */
+DEFINE_COMPILER;
+#if PCRE2_CODE_UNIT_WIDTH == 32
+struct sljit_jump *jump;
+#endif
+
+#if defined SLJIT_DEBUG && SLJIT_DEBUG
+/* dummy_ucd_record */
+const ucd_record *record = GET_UCD(UNASSIGNED_UTF_CHAR);
+SLJIT_ASSERT(record->script == ucp_Unknown && record->chartype == ucp_Cn && record->gbprop == ucp_gbOther);
+SLJIT_ASSERT(record->caseset == 0 && record->other_case == 0);
+#endif
+
+SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 12);
+
+sljit_emit_fast_enter(compiler, RETURN_ADDR, 0);
+
+#if PCRE2_CODE_UNIT_WIDTH == 32
+if (!common->utf)
+  {
+  jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1);
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR);
+  JUMPHERE(jump);
+  }
+#endif
+
+OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
+OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1));
+OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK);
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2));
+OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1);
+
+/* TMP2 is multiplied by 12. Same as (TMP2 << 2) + ((TMP2 << 2) << 1). */
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype));
+OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2);
+OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
+OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 1);
+
+sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
+}
+
+#endif /* SUPPORT_UNICODE */
+
+static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common)
+{
+DEFINE_COMPILER;
+struct sljit_label *mainloop;
+struct sljit_label *newlinelabel = NULL;
+struct sljit_jump *start;
+struct sljit_jump *end = NULL;
+struct sljit_jump *end2 = NULL;
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_label *loop;
+struct sljit_jump *jump;
+#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */
+jump_list *newline = NULL;
+sljit_u32 overall_options = common->re->overall_options;
+BOOL hascrorlf = (common->re->flags & PCRE2_HASCRORLF) != 0;
+BOOL newlinecheck = FALSE;
+BOOL readuchar = FALSE;
+
+if (!(hascrorlf || (overall_options & PCRE2_FIRSTLINE) != 0)
+    && (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF || common->newline > 255))
+  newlinecheck = TRUE;
+
+SLJIT_ASSERT(common->abort_label == NULL);
+
+if ((overall_options & PCRE2_FIRSTLINE) != 0)
+  {
+  /* Search for the end of the first line. */
+  SLJIT_ASSERT(common->match_end_ptr != 0);
+  OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0);
+
+  if (common->nltype == NLTYPE_FIXED && common->newline > 255)
+    {
+    mainloop = LABEL();
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    end = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
+    OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+    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->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->match_end_ptr, STR_PTR, 0);
+    read_char(common, common->nlmin, common->nlmax, NULL, READ_CHAR_NEWLINE);
+    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->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);
+
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, offset_limit));
+    }
+  else
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), 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);
+  if (HAS_VIRTUAL_REGISTERS)
+    OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
+  else
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin));
+
+#if PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
+  OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT);
+#endif /* PCRE2_CODE_UNIT_WIDTH == [16|32] */
+  if (HAS_VIRTUAL_REGISTERS)
+    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);
@@ -3781,7 +4982,7 @@ if (newlinecheck)
   OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
 #if PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
   OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT);
-#endif
+#endif /* PCRE2_CODE_UNIT_WIDTH == [16|32] */
   OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
   end2 = JUMP(SLJIT_JUMP);
   }
@@ -3789,9 +4990,9 @@ if (newlinecheck)
 mainloop = LABEL();
 
 /* Increasing the STR_PTR here requires one less jump in the most common case. */
-#ifdef SUPPORT_UNICODE
-if (common->utf) readuchar = TRUE;
-#endif
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf && !common->invalid_utf) readuchar = TRUE;
+#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */
 if (newlinecheck) readuchar = TRUE;
 
 if (readuchar)
@@ -3803,23 +5004,55 @@ if (newlinecheck)
 OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
 #if PCRE2_CODE_UNIT_WIDTH == 8
-if (common->utf)
+if (common->invalid_utf)
   {
-  singlechar = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
+  /* Skip continuation code units. */
+  loop = LABEL();
+  jump = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+  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, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x80);
+  CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x40, loop);
+  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+  JUMPHERE(jump);
+  }
+else if (common->utf)
+  {
+  jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
   OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0);
   OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-  JUMPHERE(singlechar);
+  JUMPHERE(jump);
   }
 #elif PCRE2_CODE_UNIT_WIDTH == 16
-if (common->utf)
+if (common->invalid_utf)
   {
-  singlechar = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xd800);
-  OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xfc00);
-  OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xd800);
-  OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
-  OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
-  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-  JUMPHERE(singlechar);
+  /* Skip continuation code units. */
+  loop = LABEL();
+  jump = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+  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, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xdc00);
+  CMPTO(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0x400, loop);
+  OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+  JUMPHERE(jump);
+  }
+else if (common->utf)
+  {
+  OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, 0xd800);
+
+  if (sljit_has_cpu_feature(SLJIT_HAS_CMOV))
+    {
+    OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x400);
+    CMOV(SLJIT_LESS, STR_PTR, TMP2, 0);
+    }
+  else
+    {
+    OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x400);
+    OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_LESS);
+    OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, UCHAR_SHIFT);
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+    }
   }
 #endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */
 #endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */
@@ -4265,720 +5498,77 @@ while (TRUE)
     cc = cc_save;
     }
 
-  repeat = 1;
-  if (last)
-    return consumed;
-  }
-}
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-static void jumpto_if_not_utf_char_start(struct sljit_compiler *compiler, sljit_s32 reg, struct sljit_label *label)
-{
-#if PCRE2_CODE_UNIT_WIDTH == 8
-OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xc0);
-CMPTO(SLJIT_EQUAL, reg, 0, SLJIT_IMM, 0x80, label);
-#elif PCRE2_CODE_UNIT_WIDTH == 16
-OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xfc00);
-CMPTO(SLJIT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00, label);
-#else
-#error "Unknown code width"
-#endif
-}
-#endif
-
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND)
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-static struct sljit_jump *jump_if_utf_char_start(struct sljit_compiler *compiler, sljit_s32 reg)
-{
-#if PCRE2_CODE_UNIT_WIDTH == 8
-OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xc0);
-return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0x80);
-#elif PCRE2_CODE_UNIT_WIDTH == 16
-OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xfc00);
-return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00);
-#else
-#error "Unknown code width"
-#endif
-}
-#endif
-
-static sljit_s32 character_to_int32(PCRE2_UCHAR chr)
-{
-sljit_s32 value = (sljit_s32)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 void load_from_mem_sse2(struct sljit_compiler *compiler, sljit_s32 dst_xmm_reg, sljit_s32 src_general_reg)
-{
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
-sljit_u8 instruction[5];
-#else
-sljit_u8 instruction[4];
-#endif
-
-SLJIT_ASSERT(dst_xmm_reg < 8);
-
-/* MOVDQA xmm1, xmm2/m128 */
-#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
-if (src_general_reg < 8)
-  {
-  instruction[0] = 0x66;
-  instruction[1] = 0x0f;
-  instruction[2] = 0x6f;
-  instruction[3] = (dst_xmm_reg << 3) | src_general_reg;
-  sljit_emit_op_custom(compiler, instruction, 4);
-  }
-else
-  {
-  instruction[0] = 0x66;
-  instruction[1] = 0x41;
-  instruction[2] = 0x0f;
-  instruction[3] = 0x6f;
-  instruction[4] = (dst_xmm_reg << 3) | (src_general_reg & 0x7);
-  sljit_emit_op_custom(compiler, instruction, 4);
-  }
-#else
-instruction[0] = 0x66;
-instruction[1] = 0x0f;
-instruction[2] = 0x6f;
-instruction[3] = (dst_xmm_reg << 3) | src_general_reg;
-sljit_emit_op_custom(compiler, instruction, 4);
-#endif
-}
-
-static void fast_forward_char_pair_sse2_compare(struct sljit_compiler *compiler, PCRE2_UCHAR char1, PCRE2_UCHAR char2,
-  sljit_u32 bit, sljit_s32 dst_ind, sljit_s32 cmp1_ind, sljit_s32 cmp2_ind, sljit_s32 tmp_ind)
-{
-sljit_u8 instruction[4];
-instruction[0] = 0x66;
-instruction[1] = 0x0f;
-
-if (char1 == char2 || bit != 0)
-  {
-  if (bit != 0)
-    {
-    /* POR xmm1, xmm2/m128 */
-    /* instruction[0] = 0x66; */
-    /* instruction[1] = 0x0f; */
-    instruction[2] = 0xeb;
-    instruction[3] = 0xc0 | (dst_ind << 3) | cmp2_ind;
-    sljit_emit_op_custom(compiler, instruction, 4);
-    }
-
-  /* PCMPEQB/W/D xmm1, xmm2/m128 */
-  /* instruction[0] = 0x66; */
-  /* instruction[1] = 0x0f; */
-  instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
-  instruction[3] = 0xc0 | (dst_ind << 3) | cmp1_ind;
-  sljit_emit_op_custom(compiler, instruction, 4);
-  }
-else
-  {
-  /* MOVDQA xmm1, xmm2/m128 */
-  /* instruction[0] = 0x66; */
-  /* instruction[1] = 0x0f; */
-  instruction[2] = 0x6f;
-  instruction[3] = 0xc0 | (tmp_ind << 3) | dst_ind;
-  sljit_emit_op_custom(compiler, instruction, 4);
-
-  /* PCMPEQB/W/D xmm1, xmm2/m128 */
-  /* instruction[0] = 0x66; */
-  /* instruction[1] = 0x0f; */
-  instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
-  instruction[3] = 0xc0 | (dst_ind << 3) | cmp1_ind;
-  sljit_emit_op_custom(compiler, instruction, 4);
-
-  instruction[3] = 0xc0 | (tmp_ind << 3) | cmp2_ind;
-  sljit_emit_op_custom(compiler, instruction, 4);
-
-  /* POR xmm1, xmm2/m128 */
-  /* instruction[0] = 0x66; */
-  /* instruction[1] = 0x0f; */
-  instruction[2] = 0xeb;
-  instruction[3] = 0xc0 | (dst_ind << 3) | tmp_ind;
-  sljit_emit_op_custom(compiler, instruction, 4);
-  }
-}
-
-static void fast_forward_first_char2_sse2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset)
-{
-DEFINE_COMPILER;
-struct sljit_label *start;
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-struct sljit_label *restart;
-#endif
-struct sljit_jump *quit;
-struct sljit_jump *partial_quit[2];
-sljit_u8 instruction[8];
-sljit_s32 tmp1_ind = sljit_get_register_index(TMP1);
-sljit_s32 str_ptr_ind = sljit_get_register_index(STR_PTR);
-sljit_s32 data_ind = 0;
-sljit_s32 tmp_ind = 1;
-sljit_s32 cmp1_ind = 2;
-sljit_s32 cmp2_ind = 3;
-sljit_u32 bit = 0;
-
-SLJIT_UNUSED_ARG(offset);
-
-if (char1 != char2)
-  {
-  bit = char1 ^ char2;
-  if (!is_powerof2(bit))
-    bit = 0;
-  }
-
-partial_quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
-if (common->mode == PCRE2_JIT_COMPLETE)
-  add_jump(compiler, &common->failed_match, partial_quit[0]);
-
-/* First part (unaligned start) */
-
-OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1 | bit));
-
-SLJIT_ASSERT(tmp1_ind < 8);
-
-/* MOVD xmm, r/m32 */
-instruction[0] = 0x66;
-instruction[1] = 0x0f;
-instruction[2] = 0x6e;
-instruction[3] = 0xc0 | (cmp1_ind << 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 | (cmp2_ind << 3) | tmp1_ind;
-  sljit_emit_op_custom(compiler, instruction, 4);
-  }
-
-OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
-
-/* PSHUFD xmm1, xmm2/m128, imm8 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x70;
-instruction[3] = 0xc0 | (cmp1_ind << 3) | 2;
-instruction[4] = 0;
-sljit_emit_op_custom(compiler, instruction, 5);
-
-if (char1 != char2)
-  {
-  /* PSHUFD xmm1, xmm2/m128, imm8 */
-  instruction[3] = 0xc0 | (cmp2_ind << 3) | 3;
-  sljit_emit_op_custom(compiler, instruction, 5);
-  }
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-restart = LABEL();
-#endif
-OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf);
-OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf);
-
-load_from_mem_sse2(compiler, data_ind, str_ptr_ind);
-fast_forward_char_pair_sse2_compare(compiler, char1, char2, bit, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
-
-/* PMOVMSKB reg, xmm */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0xd7;
-instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
-OP2(SLJIT_LSHR, 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);
-sljit_set_current_flags(compiler, SLJIT_SET_Z);
-
-quit = JUMP(SLJIT_NOT_ZERO);
-
-OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
-
-start = LABEL();
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
-
-partial_quit[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
-if (common->mode == PCRE2_JIT_COMPLETE)
-  add_jump(compiler, &common->failed_match, partial_quit[1]);
-
-/* Second part (aligned) */
-
-load_from_mem_sse2(compiler, 0, str_ptr_ind);
-fast_forward_char_pair_sse2_compare(compiler, char1, char2, bit, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
-
-/* PMOVMSKB reg, xmm */
-instruction[0] = 0x66;
-instruction[1] = 0x0f;
-instruction[2] = 0xd7;
-instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-/* 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);
-sljit_set_current_flags(compiler, SLJIT_SET_Z);
-
-JUMPTO(SLJIT_ZERO, start);
-
-JUMPHERE(quit);
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-
-if (common->mode != PCRE2_JIT_COMPLETE)
-  {
-  JUMPHERE(partial_quit[0]);
-  JUMPHERE(partial_quit[1]);
-  OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0);
-  CMOV(SLJIT_GREATER, STR_PTR, STR_END, 0);
-  }
-else
-  add_jump(compiler, &common->failed_match, 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));
-
-  quit = jump_if_utf_char_start(compiler, TMP1);
-
-  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-  add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
-  OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
-  JUMPTO(SLJIT_JUMP, restart);
-
-  JUMPHERE(quit);
-  }
-#endif
-}
-
-#ifndef _WIN64
-
-static SLJIT_INLINE sljit_u32 max_fast_forward_char_pair_sse2_offset(void)
-{
-#if PCRE2_CODE_UNIT_WIDTH == 8
-return 15;
-#elif PCRE2_CODE_UNIT_WIDTH == 16
-return 7;
-#elif PCRE2_CODE_UNIT_WIDTH == 32
-return 3;
-#else
-#error "Unsupported unit width"
-#endif
-}
-
-static void fast_forward_char_pair_sse2(compiler_common *common, sljit_s32 offs1,
-  PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b)
-{
-DEFINE_COMPILER;
-sljit_u32 bit1 = 0;
-sljit_u32 bit2 = 0;
-sljit_u32 diff = IN_UCHARS(offs1 - offs2);
-sljit_s32 tmp1_ind = sljit_get_register_index(TMP1);
-sljit_s32 tmp2_ind = sljit_get_register_index(TMP2);
-sljit_s32 str_ptr_ind = sljit_get_register_index(STR_PTR);
-sljit_s32 data1_ind = 0;
-sljit_s32 data2_ind = 1;
-sljit_s32 tmp_ind = 2;
-sljit_s32 cmp1a_ind = 3;
-sljit_s32 cmp1b_ind = 4;
-sljit_s32 cmp2a_ind = 5;
-sljit_s32 cmp2b_ind = 6;
-struct sljit_label *start;
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-struct sljit_label *restart;
-#endif
-struct sljit_jump *jump[2];
-
-sljit_u8 instruction[8];
-
-SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2);
-SLJIT_ASSERT(diff <= IN_UCHARS(max_fast_forward_char_pair_sse2_offset()));
-SLJIT_ASSERT(tmp1_ind < 8 && tmp2_ind == 1);
-
-/* Initialize. */
-if (common->match_end_ptr != 0)
-  {
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
-  OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
-  OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(offs1 + 1));
-
-  OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, STR_END, 0);
-  CMOV(SLJIT_LESS, STR_END, TMP1, 0);
-  }
-
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1));
-add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
-
-/* MOVD xmm, r/m32 */
-instruction[0] = 0x66;
-instruction[1] = 0x0f;
-instruction[2] = 0x6e;
-
-if (char1a == char1b)
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a));
-else
-  {
-  bit1 = char1a ^ char1b;
-  if (is_powerof2(bit1))
-    {
-    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a | bit1));
-    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit1));
-    }
-  else
-    {
-    bit1 = 0;
-    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a));
-    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char1b));
-    }
-  }
-
-instruction[3] = 0xc0 | (cmp1a_ind << 3) | tmp1_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-if (char1a != char1b)
-  {
-  instruction[3] = 0xc0 | (cmp1b_ind << 3) | tmp2_ind;
-  sljit_emit_op_custom(compiler, instruction, 4);
-  }
-
-if (char2a == char2b)
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a));
-else
-  {
-  bit2 = char2a ^ char2b;
-  if (is_powerof2(bit2))
-    {
-    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a | bit2));
-    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit2));
-    }
-  else
-    {
-    bit2 = 0;
-    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a));
-    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char2b));
-    }
-  }
-
-instruction[3] = 0xc0 | (cmp2a_ind << 3) | tmp1_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-if (char2a != char2b)
-  {
-  instruction[3] = 0xc0 | (cmp2b_ind << 3) | tmp2_ind;
-  sljit_emit_op_custom(compiler, instruction, 4);
-  }
-
-/* PSHUFD xmm1, xmm2/m128, imm8 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x70;
-instruction[4] = 0;
-
-instruction[3] = 0xc0 | (cmp1a_ind << 3) | cmp1a_ind;
-sljit_emit_op_custom(compiler, instruction, 5);
-
-if (char1a != char1b)
-  {
-  instruction[3] = 0xc0 | (cmp1b_ind << 3) | cmp1b_ind;
-  sljit_emit_op_custom(compiler, instruction, 5);
-  }
-
-instruction[3] = 0xc0 | (cmp2a_ind << 3) | cmp2a_ind;
-sljit_emit_op_custom(compiler, instruction, 5);
-
-if (char2a != char2b)
-  {
-  instruction[3] = 0xc0 | (cmp2b_ind << 3) | cmp2b_ind;
-  sljit_emit_op_custom(compiler, instruction, 5);
-  }
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-restart = LABEL();
-#endif
-
-OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1 - offs2));
-OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
-OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf);
-OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, ~0xf);
-
-load_from_mem_sse2(compiler, data1_ind, str_ptr_ind);
-
-jump[0] = CMP(SLJIT_EQUAL, STR_PTR, 0, TMP1, 0);
-
-load_from_mem_sse2(compiler, data2_ind, tmp1_ind);
-
-/* MOVDQA xmm1, xmm2/m128 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x6f;
-instruction[3] = 0xc0 | (tmp_ind << 3) | data1_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-/* PSLLDQ xmm1, xmm2/m128, imm8 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x73;
-instruction[3] = 0xc0 | (7 << 3) | tmp_ind;
-instruction[4] = diff;
-sljit_emit_op_custom(compiler, instruction, 5);
-
-/* PSRLDQ xmm1, xmm2/m128, imm8 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-/* instruction[2] = 0x73; */
-instruction[3] = 0xc0 | (3 << 3) | data2_ind;
-instruction[4] = 16 - diff;
-sljit_emit_op_custom(compiler, instruction, 5);
-
-/* POR xmm1, xmm2/m128 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0xeb;
-instruction[3] = 0xc0 | (data2_ind << 3) | tmp_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-jump[1] = JUMP(SLJIT_JUMP);
-
-JUMPHERE(jump[0]);
-
-/* MOVDQA xmm1, xmm2/m128 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x6f;
-instruction[3] = 0xc0 | (data2_ind << 3) | data1_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-/* PSLLDQ xmm1, xmm2/m128, imm8 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x73;
-instruction[3] = 0xc0 | (7 << 3) | data2_ind;
-instruction[4] = diff;
-sljit_emit_op_custom(compiler, instruction, 5);
-
-JUMPHERE(jump[1]);
-
-OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf);
-
-fast_forward_char_pair_sse2_compare(compiler, char2a, char2b, bit2, data2_ind, cmp2a_ind, cmp2b_ind, tmp_ind);
-fast_forward_char_pair_sse2_compare(compiler, char1a, char1b, bit1, data1_ind, cmp1a_ind, cmp1b_ind, tmp_ind);
-
-/* PAND xmm1, xmm2/m128 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0xdb;
-instruction[3] = 0xc0 | (data1_ind << 3) | data2_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-/* PMOVMSKB reg, xmm */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0xd7;
-instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-/* Ignore matches before the first STR_PTR. */
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
-OP2(SLJIT_LSHR, 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);
-sljit_set_current_flags(compiler, SLJIT_SET_Z);
-
-jump[0] = JUMP(SLJIT_NOT_ZERO);
-
-OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
-
-/* Main loop. */
-instruction[0] = 0x66;
-instruction[1] = 0x0f;
-
-start = LABEL();
-
-load_from_mem_sse2(compiler, data2_ind, str_ptr_ind);
-
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
-add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
-
-load_from_mem_sse2(compiler, data1_ind, str_ptr_ind);
-
-/* PSRLDQ xmm1, xmm2/m128, imm8 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x73;
-instruction[3] = 0xc0 | (3 << 3) | data2_ind;
-instruction[4] = 16 - diff;
-sljit_emit_op_custom(compiler, instruction, 5);
-
-/* MOVDQA xmm1, xmm2/m128 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x6f;
-instruction[3] = 0xc0 | (tmp_ind << 3) | data1_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-/* PSLLDQ xmm1, xmm2/m128, imm8 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0x73;
-instruction[3] = 0xc0 | (7 << 3) | tmp_ind;
-instruction[4] = diff;
-sljit_emit_op_custom(compiler, instruction, 5);
-
-/* POR xmm1, xmm2/m128 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0xeb;
-instruction[3] = 0xc0 | (data2_ind << 3) | tmp_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-fast_forward_char_pair_sse2_compare(compiler, char1a, char1b, bit1, data1_ind, cmp1a_ind, cmp1b_ind, tmp_ind);
-fast_forward_char_pair_sse2_compare(compiler, char2a, char2b, bit2, data2_ind, cmp2a_ind, cmp2b_ind, tmp_ind);
-
-/* PAND xmm1, xmm2/m128 */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0xdb;
-instruction[3] = 0xc0 | (data1_ind << 3) | data2_ind;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-/* PMOVMSKB reg, xmm */
-/* instruction[0] = 0x66; */
-/* instruction[1] = 0x0f; */
-instruction[2] = 0xd7;
-instruction[3] = 0xc0 | (tmp1_ind << 3) | 0;
-sljit_emit_op_custom(compiler, instruction, 4);
-
-/* 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);
-sljit_set_current_flags(compiler, SLJIT_SET_Z);
-
-JUMPTO(SLJIT_ZERO, start);
-
-JUMPHERE(jump[0]);
-
-OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-
-add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
-
-if (common->match_end_ptr != 0)
-  OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
-
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-if (common->utf)
-  {
-  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offs1));
-
-  jump[0] = jump_if_utf_char_start(compiler, TMP1);
-
-  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-  CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, restart);
-
-  add_jump(compiler, &common->failed_match, JUMP(SLJIT_JUMP));
-
-  JUMPHERE(jump[0]);
-  }
-#endif
-
-OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1));
-
-if (common->match_end_ptr != 0)
-  OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
+  repeat = 1;
+  if (last)
+    return consumed;
+  }
 }
 
-static BOOL check_fast_forward_char_pair_sse2(compiler_common *common, fast_forward_char_data *chars, int max)
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+static void jumpto_if_not_utf_char_start(struct sljit_compiler *compiler, sljit_s32 reg, struct sljit_label *label)
 {
-sljit_s32 i, j, priority, count;
-sljit_u32 priorities;
-PCRE2_UCHAR a1, a2, b1, b2;
-
-priorities = 0;
-
-count = 0;
-for (i = 0; i < max; i++)
-  {
-  if (chars[i].last_count > 2)
-    {
-    SLJIT_ASSERT(chars[i].last_count <= 7);
+#if PCRE2_CODE_UNIT_WIDTH == 8
+OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xc0);
+CMPTO(SLJIT_EQUAL, reg, 0, SLJIT_IMM, 0x80, label);
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xfc00);
+CMPTO(SLJIT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00, label);
+#else
+#error "Unknown code width"
+#endif
+}
+#endif
 
-    priorities |= (1 << chars[i].last_count);
-    count++;
-    }
-  }
+#include "pcre2_jit_simd_inc.h"
 
-if (count < 2)
-  return FALSE;
+#ifdef JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD
 
-for (priority = 7; priority > 2; priority--)
-  {
-  if ((priorities & (1 << priority)) == 0)
-    continue;
+static BOOL check_fast_forward_char_pair_simd(compiler_common *common, fast_forward_char_data *chars, int max)
+{
+  sljit_s32 i, j, max_i = 0, max_j = 0;
+  sljit_u32 max_pri = 0;
+  PCRE2_UCHAR a1, a2, a_pri, b1, b2, b_pri;
 
   for (i = max - 1; i >= 1; i--)
-    if (chars[i].last_count >= priority)
+    {
+    if (chars[i].last_count > 2)
       {
-      SLJIT_ASSERT(chars[i].count <= 2 && chars[i].count >= 1);
-
       a1 = chars[i].chars[0];
       a2 = chars[i].chars[1];
+      a_pri = chars[i].last_count;
 
-      j = i - max_fast_forward_char_pair_sse2_offset();
+      j = i - max_fast_forward_char_pair_offset();
       if (j < 0)
         j = 0;
 
       while (j < i)
         {
-        if (chars[j].last_count >= priority)
+        b_pri = chars[j].last_count;
+        if (b_pri > 2 && a_pri + b_pri >= max_pri)
           {
           b1 = chars[j].chars[0];
           b2 = chars[j].chars[1];
 
           if (a1 != b1 && a1 != b2 && a2 != b1 && a2 != b2)
             {
-            fast_forward_char_pair_sse2(common, i, a1, a2, j, b1, b2);
-            return TRUE;
+            max_pri = a_pri + b_pri;
+            max_i = i;
+            max_j = j;
             }
           }
         j++;
         }
       }
-  }
-
-return FALSE;
-}
+    }
 
-#endif
+if (max_pri == 0)
+  return FALSE;
 
-#undef SSE2_COMPARE_TYPE_INDEX
+fast_forward_char_pair_simd(common, max_i, chars[max_i].chars[0], chars[max_i].chars[1], max_j, chars[max_j].chars[0], chars[max_j].chars[1]);
+return TRUE;
+}
 
-#endif
+#endif /* JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD */
 
 static void fast_forward_first_char2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset)
 {
@@ -5006,13 +5596,11 @@ if (has_match_end)
   CMOV(SLJIT_GREATER, STR_END, TMP1, 0);
   }
 
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND)
+#ifdef JIT_HAS_FAST_FORWARD_CHAR_SIMD
 
-/* SSE2 accelerated first character search. */
-
-if (sljit_has_cpu_feature(SLJIT_HAS_SSE2))
+if (JIT_HAS_FAST_FORWARD_CHAR_SIMD)
   {
-  fast_forward_first_char2_sse2(common, char1, char2, offset);
+  fast_forward_char_simd(common, char1, char2, offset);
 
   if (offset > 0)
     OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offset));
@@ -5119,8 +5707,8 @@ for (i = 0; i < max; i++)
     chars[i].last_count = (chars[i].count == 255) ? 0 : 1;
   }
 
-#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND) && !(defined _WIN64)
-if (check_fast_forward_char_pair_sse2(common, chars, max))
+#ifdef JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD
+if (JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD && check_fast_forward_char_pair_simd(common, chars, max))
   return TRUE;
 #endif
 
@@ -5205,18 +5793,21 @@ if (common->match_end_ptr != 0)
   {
   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));
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max));
+  add_jump(compiler, &common->failed_match, JUMP(SLJIT_LESS));
   OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_END, 0, TMP1, 0);
   CMOV(SLJIT_GREATER, STR_END, TMP1, 0);
   }
 else
-  OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max));
+  {
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, STR_END, 0, STR_END, 0, SLJIT_IMM, IN_UCHARS(max));
+  add_jump(compiler, &common->failed_match, JUMP(SLJIT_LESS));
+  }
 
 SLJIT_ASSERT(range_right >= 0);
 
-#if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
-OP1(SLJIT_MOV, RETURN_ADDR, 0, SLJIT_IMM, (sljit_sw)update_table);
-#endif
+if (!HAS_VIRTUAL_REGISTERS)
+  OP1(SLJIT_MOV, RETURN_ADDR, 0, SLJIT_IMM, (sljit_sw)update_table);
 
 start = LABEL();
 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0));
@@ -5227,11 +5818,11 @@ OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(range_right));
 OP1(SLJIT_MOV_U8, 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_U8, TMP1, 0, SLJIT_MEM2(RETURN_ADDR, TMP1), 0);
-#else
-OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)update_table);
-#endif
+if (!HAS_VIRTUAL_REGISTERS)
+  OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(RETURN_ADDR, TMP1), 0);
+else
+  OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)update_table);
+
 OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0, start);
 
@@ -5325,9 +5916,17 @@ if (common->match_end_ptr != 0)
 if (common->nltype == NLTYPE_FIXED && common->newline > 255)
   {
   lastchar = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
-  OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
-  OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
+    }
+  else
+    {
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, str));
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin));
+    }
   firstchar = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0);
 
   OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(2));
@@ -5355,15 +5954,22 @@ if (common->nltype == NLTYPE_FIXED && common->newline > 255)
   return;
   }
 
-OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
+if (HAS_VIRTUAL_REGISTERS)
+  {
+  OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+  OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
+  }
+else
+  OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, str));
+
+/* Example: match /^/ to \r\n from offset 1. */
 firstchar = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0);
-skip_char_back(common);
+move_back(common, NULL, FALSE);
 
 loop = LABEL();
 common->ff_newline_shortcut = loop;
 
-read_char_range(common, common->nlmin, common->nlmax, TRUE);
+read_char(common, common->nlmin, common->nlmax, NULL, READ_CHAR_NEWLINE);
 lastchar = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF)
   foundcr = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR);
@@ -5437,7 +6043,7 @@ if (!optimize_class(common, start_bits, (start_bits[31] & 0x80) != 0, FALSE, &ma
   OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
   OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
   OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)start_bits);
-  if (sljit_get_register_index(TMP3) >= 0)
+  if (!HAS_VIRTUAL_REGISTERS)
     {
     OP2(SLJIT_SHL, TMP3, 0, SLJIT_IMM, 1, TMP2, 0);
     OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, TMP3, 0);
@@ -5544,7 +6150,7 @@ OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), -sizeof(sljit_sw));
 jump = CMP(SLJIT_SIG_LESS_EQUAL, TMP2, 0, SLJIT_IMM, 0);
 
 OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
-if (sljit_get_register_index (TMP3) < 0)
+if (HAS_VIRTUAL_REGISTERS)
   {
   OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
   OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), sizeof(sljit_sw), SLJIT_MEM1(STACK_TOP), -(3 * sizeof(sljit_sw)));
@@ -5569,7 +6175,7 @@ sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
 JUMPHERE(jump);
 OP1(SLJIT_NEG, TMP2, 0, TMP2, 0);
 OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
-if (sljit_get_register_index (TMP3) < 0)
+if (HAS_VIRTUAL_REGISTERS)
   {
   OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
   OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2 * sizeof(sljit_sw));
@@ -5588,21 +6194,49 @@ static void check_wordboundary(compiler_common *common)
 DEFINE_COMPILER;
 struct sljit_jump *skipread;
 jump_list *skipread_list = NULL;
+#ifdef SUPPORT_UNICODE
+struct sljit_label *valid_utf;
+jump_list *invalid_utf1 = NULL;
+#endif /* SUPPORT_UNICODE */
+jump_list *invalid_utf2 = NULL;
 #if PCRE2_CODE_UNIT_WIDTH != 8 || defined SUPPORT_UNICODE
 struct sljit_jump *jump;
-#endif
+#endif /* PCRE2_CODE_UNIT_WIDTH != 8 || SUPPORT_UNICODE */
 
 SLJIT_COMPILE_ASSERT(ctype_word == 0x10, ctype_word_must_be_16);
 
 sljit_emit_fast_enter(compiler, SLJIT_MEM1(SLJIT_SP), LOCALS0);
-/* Get type of the previous char, and put it to LOCALS1. */
+/* Get type of the previous char, and put it to TMP3. */
 OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
-OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
-OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, SLJIT_IMM, 0);
-skipread = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP1, 0);
-skip_char_back(common);
-check_start_used_ptr(common);
-read_char(common);
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
+OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 0);
+skipread = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0);
+
+#ifdef SUPPORT_UNICODE
+if (common->invalid_utf)
+  {
+  peek_char_back(common, READ_CHAR_MAX, &invalid_utf1);
+
+  if (common->mode != PCRE2_JIT_COMPLETE)
+    {
+    OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
+    move_back(common, NULL, TRUE);
+    check_start_used_ptr(common);
+    OP1(SLJIT_MOV, STR_PTR, 0, TMP2, 0);
+    }
+  }
+else
+#endif /* SUPPORT_UNICODE */
+  {
+  if (common->mode == PCRE2_JIT_COMPLETE)
+    peek_char_back(common, READ_CHAR_MAX, NULL);
+  else
+    {
+    move_back(common, NULL, TRUE);
+    check_start_used_ptr(common);
+    read_char(common, 0, READ_CHAR_MAX, NULL, READ_CHAR_UPDATE_STR_PTR);
+    }
+  }
 
 /* Testing char type. */
 #ifdef SUPPORT_UNICODE
@@ -5610,7 +6244,7 @@ if (common->use_ucp)
   {
   OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 1);
   jump = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_UNDERSCORE);
-  add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));
+  add_jump(compiler, &common->getucdtype, JUMP(SLJIT_FAST_CALL));
   OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Ll);
   OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
   OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
@@ -5618,23 +6252,22 @@ if (common->use_ucp)
   OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_No - ucp_Nd);
   OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
   JUMPHERE(jump);
-  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP2, 0);
+  OP1(SLJIT_MOV, TMP3, 0, TMP2, 0);
   }
 else
-#endif
+#endif /* SUPPORT_UNICODE */
   {
 #if PCRE2_CODE_UNIT_WIDTH != 8
   jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
 #elif defined SUPPORT_UNICODE
-  /* Here LOCALS1 has already been zeroed. */
+  /* Here TMP3 has already been zeroed. */
   jump = NULL;
   if (common->utf)
     jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
 #endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
   OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes);
   OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 4 /* ctype_word */);
-  OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
-  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP1, 0);
+  OP2(SLJIT_AND, TMP3, 0, TMP1, 0, SLJIT_IMM, 1);
 #if PCRE2_CODE_UNIT_WIDTH != 8
   JUMPHERE(jump);
 #elif defined SUPPORT_UNICODE
@@ -5646,15 +6279,18 @@ JUMPHERE(skipread);
 
 OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 0);
 check_str_end(common, &skipread_list);
-peek_char(common, READ_CHAR_MAX);
+peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, &invalid_utf2);
 
 /* Testing char type. This is a code duplication. */
 #ifdef SUPPORT_UNICODE
+
+valid_utf = LABEL();
+
 if (common->use_ucp)
   {
   OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 1);
   jump = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_UNDERSCORE);
-  add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));
+  add_jump(compiler, &common->getucdtype, JUMP(SLJIT_FAST_CALL));
   OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Ll);
   OP2(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
   OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
@@ -5664,7 +6300,7 @@ if (common->use_ucp)
   JUMPHERE(jump);
   }
 else
-#endif
+#endif /* SUPPORT_UNICODE */
   {
 #if PCRE2_CODE_UNIT_WIDTH != 8
   /* TMP2 may be destroyed by peek_char. */
@@ -5688,8 +6324,28 @@ else
   }
 set_jumps(skipread_list, LABEL());
 
-OP2(SLJIT_XOR | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1);
-sljit_emit_fast_return(compiler, SLJIT_MEM1(SLJIT_SP), LOCALS0);
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
+OP2(SLJIT_XOR | SLJIT_SET_Z, TMP2, 0, TMP2, 0, TMP3, 0);
+sljit_emit_fast_return(compiler, TMP1, 0);
+
+#ifdef SUPPORT_UNICODE
+if (common->invalid_utf)
+  {
+  set_jumps(invalid_utf1, LABEL());
+
+  peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, NULL);
+  CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR, valid_utf);
+
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
+  OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, -1);
+  sljit_emit_fast_return(compiler, TMP1, 0);
+
+  set_jumps(invalid_utf2, LABEL());
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
+  OP1(SLJIT_MOV, TMP2, 0, TMP3, 0);
+  sljit_emit_fast_return(compiler, TMP1, 0);
+  }
+#endif /* SUPPORT_UNICODE */
 }
 
 static BOOL optimize_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert, jump_list **backtracks)
@@ -5856,9 +6512,6 @@ int i, j, k, len, c;
 if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV))
   return FALSE;
 
-if (invert)
-  nclass = !nclass;
-
 len = 0;
 
 for (i = 0; i < 32; i++)
@@ -5940,6 +6593,9 @@ if (j != 0)
       }
   }
 
+if (invert)
+  nclass = !nclass;
+
 type = nclass ? SLJIT_NOT_EQUAL : SLJIT_EQUAL;
 add_jump(compiler, backtracks, CMP(type, TMP2, 0, SLJIT_IMM, 0));
 return TRUE;
@@ -6055,7 +6711,7 @@ struct sljit_label *label;
 int char1_reg;
 int char2_reg;
 
-if (sljit_get_register_index(TMP3) < 0)
+if (HAS_VIRTUAL_REGISTERS)
   {
   char1_reg = STR_END;
   char2_reg = STACK_TOP;
@@ -6137,7 +6793,7 @@ int char2_reg;
 int lcc_table;
 int opt_type = 0;
 
-if (sljit_get_register_index(TMP3) < 0)
+if (HAS_VIRTUAL_REGISTERS)
   {
   char2_reg = STACK_TOP;
   lcc_table = STACK_LIMIT;
@@ -6225,37 +6881,6 @@ OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1);
 sljit_emit_fast_return(compiler, TMP1, 0);
 }
 
-#if defined SUPPORT_UNICODE
-
-static PCRE2_SPTR SLJIT_FUNC do_utf_caselesscmp(PCRE2_SPTR src1, PCRE2_SPTR src2, PCRE2_SPTR end1, PCRE2_SPTR end2)
-{
-/* This function would be ineffective to do in JIT level. */
-sljit_u32 c1, c2;
-const ucd_record *ur;
-const sljit_u32 *pp;
-
-while (src1 < end1)
-  {
-  if (src2 >= end2)
-    return (PCRE2_SPTR)1;
-  GETCHARINC(c1, src1);
-  GETCHARINC(c2, src2);
-  ur = GET_UCD(c2);
-  if (c1 != c2 && c1 != c2 + ur->other_case)
-    {
-    pp = PRIV(ucd_caseless_sets) + ur->caseset;
-    for (;;)
-      {
-      if (c1 < *pp) return NULL;
-      if (c1 == *pp++) break;
-      }
-    }
-  }
-return src2;
-}
-
-#endif /* SUPPORT_UNICODE */
-
 static PCRE2_SPTR byte_sequence_compare(compiler_common *common, BOOL caseless, PCRE2_SPTR cc,
     compare_context *context, jump_list **backtracks)
 {
@@ -6297,7 +6922,7 @@ if (context->sourcereg == -1)
     OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length);
   else
 #endif
-    OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length);
+    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), -context->length);
 #elif PCRE2_CODE_UNIT_WIDTH == 16
 #if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED
   if (context->length >= 4)
@@ -6444,7 +7069,7 @@ PCRE2_SPTR ccbegin;
 int compares, invertcmp, numberofcmps;
 #if defined SUPPORT_UNICODE && (PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16)
 BOOL utf = common->utf;
-#endif
+#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == [8|16] */
 
 #ifdef SUPPORT_UNICODE
 BOOL needstype = FALSE, needsscript = FALSE, needschar = FALSE;
@@ -6452,7 +7077,7 @@ BOOL charsaved = FALSE;
 int typereg = TMP1;
 const sljit_u32 *other_cases;
 sljit_uw typeoffset;
-#endif
+#endif /* SUPPORT_UNICODE */
 
 /* Scanning the necessary info. */
 cc++;
@@ -6476,7 +7101,7 @@ while (*cc != XCL_END)
     if (c < min) min = c;
 #ifdef SUPPORT_UNICODE
     needschar = TRUE;
-#endif
+#endif /* SUPPORT_UNICODE */
     }
   else if (*cc == XCL_RANGE)
     {
@@ -6487,7 +7112,7 @@ while (*cc != XCL_END)
     if (c > max) max = c;
 #ifdef SUPPORT_UNICODE
     needschar = TRUE;
-#endif
+#endif /* SUPPORT_UNICODE */
     }
 #ifdef SUPPORT_UNICODE
   else
@@ -6555,13 +7180,16 @@ while (*cc != XCL_END)
       }
     cc += 2;
     }
-#endif
+#endif /* SUPPORT_UNICODE */
   }
 SLJIT_ASSERT(compares > 0);
 
 /* We are not necessary in utf mode even in 8 bit mode. */
 cc = ccbegin;
-read_char_range(common, min, max, (cc[-1] & XCL_NOT) != 0);
+if ((cc[-1] & XCL_NOT) != 0)
+  read_char(common, min, max, backtracks, READ_CHAR_UPDATE_STR_PTR);
+else
+  read_char(common, min, max, NULL, 0);
 
 if ((cc[-1] & XCL_HASPROP) == 0)
   {
@@ -6594,13 +7222,13 @@ else if ((cc[-1] & XCL_MAP) != 0)
   OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0);
 #ifdef SUPPORT_UNICODE
   charsaved = TRUE;
-#endif
+#endif /* SUPPORT_UNICODE */
   if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list))
     {
 #if PCRE2_CODE_UNIT_WIDTH == 8
     jump = NULL;
     if (common->utf)
-#endif
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
       jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
 
     OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
@@ -6612,7 +7240,7 @@ else if ((cc[-1] & XCL_MAP) != 0)
 
 #if PCRE2_CODE_UNIT_WIDTH == 8
     if (common->utf)
-#endif
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
       JUMPHERE(jump);
     }
 
@@ -6630,10 +7258,10 @@ if (needstype || needsscript)
   if (!common->utf)
     {
     jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1);
-    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR);
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR);
     JUMPHERE(jump);
     }
-#endif
+#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */
 
   OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
   OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
@@ -6647,8 +7275,16 @@ if (needstype || needsscript)
   /* Before anything else, we deal with scripts. */
   if (needsscript)
     {
+// PH hacking
+      OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2);
+      OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3);
+      OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
+
     OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script));
-    OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3);
+
+      OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 0);
+
+    // OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3);
 
     ccbegin = cc;
 
@@ -6686,33 +7322,47 @@ if (needstype || needsscript)
     }
 
   if (needschar)
-    {
     OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0);
-    }
 
   if (needstype)
     {
     if (!needschar)
       {
+// PH hacking
+  OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2);
+  OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3);
+  OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
+  OP2(SLJIT_ADD, TMP1, 0, TMP2, 0, TMP1, 0);
+
       OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype));
-      OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3);
+
+  OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 0);
+
+//      OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3);
       }
     else
       {
+// PH hacking
+  OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2);
+
       OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3);
+
+  OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
+  OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0);
+
       OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype));
       typereg = RETURN_ADDR;
       }
     }
   }
-#endif
+#endif /* SUPPORT_UNICODE */
 
 /* Generating code. */
 charoffset = 0;
 numberofcmps = 0;
 #ifdef SUPPORT_UNICODE
 typeoffset = 0;
-#endif
+#endif /* SUPPORT_UNICODE */
 
 while (*cc != XCL_END)
   {
@@ -6979,7 +7629,7 @@ while (*cc != XCL_END)
       }
     cc += 2;
     }
-#endif
+#endif /* SUPPORT_UNICODE */
 
   if (jump != NULL)
     add_jump(compiler, compares > 0 ? list : backtracks, jump);
@@ -7006,20 +7656,37 @@ struct sljit_label *label;
 switch(type)
   {
   case OP_SOD:
-  OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
+    }
+  else
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin));
   add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, TMP1, 0));
   return cc;
 
   case OP_SOM:
-  OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
+    }
+  else
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, str));
   add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, TMP1, 0));
   return cc;
 
   case OP_NOT_WORD_BOUNDARY:
   case OP_WORD_BOUNDARY:
   add_jump(compiler, &common->wordboundary, JUMP(SLJIT_FAST_CALL));
+#ifdef SUPPORT_UNICODE
+  if (common->invalid_utf)
+    {
+    add_jump(compiler, backtracks, CMP((type == OP_NOT_WORD_BOUNDARY) ? SLJIT_NOT_EQUAL : SLJIT_SIG_LESS_EQUAL, TMP2, 0, SLJIT_IMM, 0));
+    return cc;
+    }
+#endif /* SUPPORT_UNICODE */
   sljit_set_current_flags(compiler, SLJIT_SET_Z);
   add_jump(compiler, backtracks, JUMP(type == OP_NOT_WORD_BOUNDARY ? SLJIT_NOT_ZERO : SLJIT_ZERO));
   return cc;
@@ -7078,29 +7745,36 @@ switch(type)
       }
     else
       {
-      OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, STR_PTR, 0);
-      read_char_range(common, common->nlmin, common->nlmax, TRUE);
+      OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0);
+      read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR);
       add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0));
       add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL));
       sljit_set_current_flags(compiler, SLJIT_SET_Z);
       add_jump(compiler, backtracks, JUMP(SLJIT_ZERO));
-      OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1);
+      OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0);
       }
     JUMPHERE(jump[2]);
     JUMPHERE(jump[3]);
     }
   JUMPHERE(jump[0]);
-  check_partial(common, FALSE);
+  if (common->mode != PCRE2_JIT_COMPLETE)
+    check_partial(common, TRUE);
   return cc;
 
   case OP_EOD:
   add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0));
-  check_partial(common, FALSE);
+  if (common->mode != PCRE2_JIT_COMPLETE)
+    check_partial(common, TRUE);
   return cc;
 
   case OP_DOLL:
-  OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
-  OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
+    OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
+    }
+  else
+    OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
   add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
 
   if (!common->endonly)
@@ -7114,8 +7788,13 @@ switch(type)
 
   case OP_DOLLM:
   jump[1] = CMP(SLJIT_LESS, STR_PTR, 0, STR_END, 0);
-  OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
-  OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
+    OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
+    }
+  else
+    OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTEOL);
   add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
   check_partial(common, FALSE);
   jump[0] = JUMP(SLJIT_JUMP);
@@ -7143,25 +7822,45 @@ switch(type)
     }
   else
     {
-    peek_char(common, common->nlmax);
+    peek_char(common, common->nlmax, TMP3, 0, NULL);
     check_newlinechar(common, common->nltype, backtracks, FALSE);
     }
   JUMPHERE(jump[0]);
   return cc;
 
   case OP_CIRC:
-  OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin));
-  add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0));
-  OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
-  add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin));
+    add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0));
+    OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
+    add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
+    }
+  else
+    {
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin));
+    add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0));
+    OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
+    add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
+    }
   return cc;
 
   case OP_CIRCM:
-  OP1(SLJIT_MOV, TMP2, 0, ARGUMENTS, 0);
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, begin));
-  jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP1, 0);
-  OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
+  /* TMP2 might be used by peek_char_back. */
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
+    jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP2, 0);
+    OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
+    }
+  else
+    {
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin));
+    jump[1] = CMP(SLJIT_GREATER, STR_PTR, 0, TMP2, 0);
+    OP2(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_UNUSED, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options), SLJIT_IMM, PCRE2_NOTBOL);
+    }
   add_jump(compiler, backtracks, JUMP(SLJIT_NOT_ZERO32));
   jump[0] = JUMP(SLJIT_JUMP);
   JUMPHERE(jump[1]);
@@ -7171,8 +7870,8 @@ switch(type)
 
   if (common->nltype == NLTYPE_FIXED && common->newline > 255)
     {
-    OP2(SLJIT_SUB, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
-    add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP2, 0, TMP1, 0));
+    OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(2));
+    add_jump(compiler, backtracks, CMP(SLJIT_LESS, TMP1, 0, TMP2, 0));
     OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
     OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
     add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff));
@@ -7180,8 +7879,7 @@ switch(type)
     }
   else
     {
-    skip_char_back(common);
-    read_char_range(common, common->nlmin, common->nlmax, TRUE);
+    peek_char_back(common, common->nlmax, backtracks);
     check_newlinechar(common, common->nltype, backtracks, FALSE);
     }
   JUMPHERE(jump[0]);
@@ -7191,55 +7889,134 @@ switch(type)
   length = GET(cc, 0);
   if (length == 0)
     return cc + LINK_SIZE;
-  OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+  if (HAS_VIRTUAL_REGISTERS)
+    {
+    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
+    }
+  else
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, begin));
 #ifdef SUPPORT_UNICODE
   if (common->utf)
     {
-    OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
-    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length);
+    OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, length);
     label = LABEL();
-    add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP3, 0));
-    skip_char_back(common);
-    OP2(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
+    add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, TMP2, 0));
+    move_back(common, backtracks, FALSE);
+    OP2(SLJIT_SUB | SLJIT_SET_Z, TMP3, 0, TMP3, 0, SLJIT_IMM, 1);
     JUMPTO(SLJIT_NOT_ZERO, label);
     }
   else
 #endif
     {
-    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
     OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length));
-    add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, TMP1, 0));
+    add_jump(compiler, backtracks, CMP(SLJIT_LESS, STR_PTR, 0, TMP2, 0));
+    }
+  check_start_used_ptr(common);
+  return cc + LINK_SIZE;
+  }
+SLJIT_UNREACHABLE();
+return cc;
+}
+
+#ifdef SUPPORT_UNICODE
+
+#if PCRE2_CODE_UNIT_WIDTH != 32
+
+static PCRE2_SPTR SLJIT_FUNC do_extuni_utf(jit_arguments *args, PCRE2_SPTR cc)
+{
+PCRE2_SPTR start_subject = args->begin;
+PCRE2_SPTR end_subject = args->end;
+int lgb, rgb, ricount;
+PCRE2_SPTR prevcc, endcc, bptr;
+BOOL first = TRUE;
+uint32_t c;
+
+prevcc = cc;
+endcc = NULL;
+do
+  {
+  GETCHARINC(c, cc);
+  rgb = UCD_GRAPHBREAK(c);
+
+  if (first)
+    {
+    lgb = rgb;
+    endcc = cc;
+    first = FALSE;
+    continue;
+    }
+
+  if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0)
+    break;
+
+  /* Not breaking between Regional Indicators is allowed only if there
+  are an even number of preceding RIs. */
+
+  if (lgb == ucp_gbRegionalIndicator && rgb == ucp_gbRegionalIndicator)
+    {
+    ricount = 0;
+    bptr = prevcc;
+
+    /* bptr is pointing to the left-hand character */
+    while (bptr > start_subject)
+      {
+      bptr--;
+      BACKCHAR(bptr);
+      GETCHAR(c, bptr);
+
+      if (UCD_GRAPHBREAK(c) != ucp_gbRegionalIndicator)
+        break;
+
+      ricount++;
+      }
+
+    if ((ricount & 1) != 0) break;  /* Grapheme break required */
     }
-  check_start_used_ptr(common);
-  return cc + LINK_SIZE;
+
+  /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this
+  allows any number of them before a following Extended_Pictographic. */
+
+  if ((rgb != ucp_gbExtend && rgb != ucp_gbZWJ) ||
+       lgb != ucp_gbExtended_Pictographic)
+    lgb = rgb;
+
+  prevcc = endcc;
+  endcc = cc;
   }
-SLJIT_UNREACHABLE();
-return cc;
-}
+while (cc < end_subject);
 
-#ifdef SUPPORT_UNICODE
+return endcc;
+}
 
-#if PCRE2_CODE_UNIT_WIDTH != 32
+#endif /* PCRE2_CODE_UNIT_WIDTH != 32 */
 
-static PCRE2_SPTR SLJIT_FUNC do_extuni_utf(jit_arguments *args, PCRE2_SPTR cc)
+static PCRE2_SPTR SLJIT_FUNC do_extuni_utf_invalid(jit_arguments *args, PCRE2_SPTR cc)
 {
 PCRE2_SPTR start_subject = args->begin;
 PCRE2_SPTR end_subject = args->end;
-int lgb, rgb, len, ricount;
-PCRE2_SPTR prevcc, bptr;
+int lgb, rgb, ricount;
+PCRE2_SPTR prevcc, endcc, bptr;
+BOOL first = TRUE;
 uint32_t c;
 
 prevcc = cc;
-GETCHARINC(c, cc);
-lgb = UCD_GRAPHBREAK(c);
-
-while (cc < end_subject)
+endcc = NULL;
+do
   {
-  len = 1;
-  GETCHARLEN(c, cc, len);
+  GETCHARINC_INVALID(c, cc, end_subject, break);
   rgb = UCD_GRAPHBREAK(c);
 
-  if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
+  if (first)
+    {
+    lgb = rgb;
+    endcc = cc;
+    first = FALSE;
+    continue;
+    }
+
+  if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0)
+    break;
 
   /* Not breaking between Regional Indicators is allowed only if there
   are an even number of preceding RIs. */
@@ -7252,16 +8029,16 @@ while (cc < end_subject)
     /* bptr is pointing to the left-hand character */
     while (bptr > start_subject)
       {
-      bptr--;
-      BACKCHAR(bptr);
-      GETCHAR(c, bptr);
+      GETCHARBACK_INVALID(c, bptr, start_subject, break);
 
-      if (UCD_GRAPHBREAK(c) != ucp_gbRegionalIndicator) break;
+      if (UCD_GRAPHBREAK(c) != ucp_gbRegionalIndicator)
+        break;
 
       ricount++;
       }
 
-    if ((ricount & 1) != 0) break;  /* Grapheme break required */
+    if ((ricount & 1) != 0)
+      break;  /* Grapheme break required */
     }
 
   /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this
@@ -7271,15 +8048,14 @@ while (cc < end_subject)
        lgb != ucp_gbExtended_Pictographic)
     lgb = rgb;
 
-  prevcc = cc;
-  cc += len;
+  prevcc = endcc;
+  endcc = cc;
   }
+while (cc < end_subject);
 
-return cc;
+return endcc;
 }
 
-#endif
-
 static PCRE2_SPTR SLJIT_FUNC do_extuni_no_utf(jit_arguments *args, PCRE2_SPTR cc)
 {
 PCRE2_SPTR start_subject = args->begin;
@@ -7288,15 +8064,27 @@ int lgb, rgb, ricount;
 PCRE2_SPTR bptr;
 uint32_t c;
 
-GETCHARINC(c, cc);
+/* Patch by PH */
+/* GETCHARINC(c, cc); */
+c = *cc++;
+
+#if PCRE2_CODE_UNIT_WIDTH == 32
+if (c >= 0x110000)
+  return NULL;
+#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */
 lgb = UCD_GRAPHBREAK(c);
 
 while (cc < end_subject)
   {
   c = *cc;
+#if PCRE2_CODE_UNIT_WIDTH == 32
+  if (c >= 0x110000)
+    break;
+#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */
   rgb = UCD_GRAPHBREAK(c);
 
-  if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
+  if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0)
+    break;
 
   /* Not breaking between Regional Indicators is allowed only if there
   are an even number of preceding RIs. */
@@ -7311,13 +8099,18 @@ while (cc < end_subject)
       {
       bptr--;
       c = *bptr;
+#if PCRE2_CODE_UNIT_WIDTH == 32
+      if (c >= 0x110000)
+        break;
+#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */
 
       if (UCD_GRAPHBREAK(c) != ucp_gbRegionalIndicator) break;
 
       ricount++;
       }
 
-    if ((ricount & 1) != 0) break;  /* Grapheme break required */
+    if ((ricount & 1) != 0)
+      break;  /* Grapheme break required */
     }
 
   /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this
@@ -7333,7 +8126,7 @@ while (cc < end_subject)
 return cc;
 }
 
-#endif
+#endif /* SUPPORT_UNICODE */
 
 static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtracks, BOOL check_str_ptr)
 {
@@ -7356,10 +8149,10 @@ switch(type)
     detect_partial_match(common, backtracks);
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
   if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_digit, FALSE))
-    read_char7_type(common, type == OP_NOT_DIGIT);
+    read_char7_type(common, backtracks, type == OP_NOT_DIGIT);
   else
 #endif
-    read_char8_type(common, type == OP_NOT_DIGIT);
+    read_char8_type(common, backtracks, type == OP_NOT_DIGIT);
     /* Flip the starting bit in the negative case. */
   OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_digit);
   add_jump(compiler, backtracks, JUMP(type == OP_DIGIT ? SLJIT_ZERO : SLJIT_NOT_ZERO));
@@ -7371,10 +8164,10 @@ switch(type)
     detect_partial_match(common, backtracks);
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
   if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_space, FALSE))
-    read_char7_type(common, type == OP_NOT_WHITESPACE);
+    read_char7_type(common, backtracks, type == OP_NOT_WHITESPACE);
   else
 #endif
-    read_char8_type(common, type == OP_NOT_WHITESPACE);
+    read_char8_type(common, backtracks, type == OP_NOT_WHITESPACE);
   OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_space);
   add_jump(compiler, backtracks, JUMP(type == OP_WHITESPACE ? SLJIT_ZERO : SLJIT_NOT_ZERO));
   return cc;
@@ -7385,10 +8178,10 @@ switch(type)
     detect_partial_match(common, backtracks);
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
   if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_word, FALSE))
-    read_char7_type(common, type == OP_NOT_WORDCHAR);
+    read_char7_type(common, backtracks, type == OP_NOT_WORDCHAR);
   else
 #endif
-    read_char8_type(common, type == OP_NOT_WORDCHAR);
+    read_char8_type(common, backtracks, type == OP_NOT_WORDCHAR);
   OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, ctype_word);
   add_jump(compiler, backtracks, JUMP(type == OP_WORDCHAR ? SLJIT_ZERO : SLJIT_NOT_ZERO));
   return cc;
@@ -7396,7 +8189,7 @@ switch(type)
   case OP_ANY:
   if (check_str_ptr)
     detect_partial_match(common, backtracks);
-  read_char_range(common, common->nlmin, common->nlmax, TRUE);
+  read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR);
   if (common->nltype == NLTYPE_FIXED && common->newline > 255)
     {
     jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff);
@@ -7418,12 +8211,18 @@ switch(type)
   case OP_ALLANY:
   if (check_str_ptr)
     detect_partial_match(common, backtracks);
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+#ifdef SUPPORT_UNICODE
   if (common->utf)
     {
+    if (common->invalid_utf)
+      {
+      read_char(common, 0, READ_CHAR_MAX, backtracks, READ_CHAR_UPDATE_STR_PTR);
+      return cc;
+      }
+
+#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16
     OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
     OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16
 #if PCRE2_CODE_UNIT_WIDTH == 8
     jump[0] = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
     OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(utf8_table4) - 0xc0);
@@ -7435,12 +8234,12 @@ switch(type)
     OP_FLAGS(SLJIT_MOV, TMP1, 0, SLJIT_EQUAL);
     OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
     OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
-#endif
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
     JUMPHERE(jump[0]);
-#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */
     return cc;
+#endif /* PCRE2_CODE_UNIT_WIDTH == [8|16] */
     }
-#endif
+#endif /* SUPPORT_UNICODE */
   OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
   return cc;
 
@@ -7467,7 +8266,7 @@ switch(type)
   case OP_ANYNL:
   if (check_str_ptr)
     detect_partial_match(common, backtracks);
-  read_char_range(common, common->bsr_nlmin, common->bsr_nlmax, FALSE);
+  read_char(common, common->bsr_nlmin, common->bsr_nlmax, NULL, 0);
   jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, CHAR_CR);
   /* We don't need to handle soft partial matching case. */
   end_list = NULL;
@@ -7490,7 +8289,12 @@ switch(type)
   case OP_HSPACE:
   if (check_str_ptr)
     detect_partial_match(common, backtracks);
-  read_char_range(common, 0x9, 0x3000, type == OP_NOT_HSPACE);
+
+  if (type == OP_NOT_HSPACE)
+    read_char(common, 0x9, 0x3000, backtracks, READ_CHAR_UPDATE_STR_PTR);
+  else
+    read_char(common, 0x9, 0x3000, NULL, 0);
+
   add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL));
   sljit_set_current_flags(compiler, SLJIT_SET_Z);
   add_jump(compiler, backtracks, JUMP(type == OP_NOT_HSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO));
@@ -7500,7 +8304,12 @@ switch(type)
   case OP_VSPACE:
   if (check_str_ptr)
     detect_partial_match(common, backtracks);
-  read_char_range(common, 0xa, 0x2029, type == OP_NOT_VSPACE);
+
+  if (type == OP_NOT_VSPACE)
+    read_char(common, 0xa, 0x2029, backtracks, READ_CHAR_UPDATE_STR_PTR);
+  else
+    read_char(common, 0xa, 0x2029, NULL, 0);
+
   add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL));
   sljit_set_current_flags(compiler, SLJIT_SET_Z);
   add_jump(compiler, backtracks, JUMP(type == OP_NOT_VSPACE ? SLJIT_NOT_ZERO : SLJIT_ZERO));
@@ -7516,9 +8325,14 @@ switch(type)
 
 #if PCRE2_CODE_UNIT_WIDTH != 32
   sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM,
-      common->utf ? SLJIT_FUNC_OFFSET(do_extuni_utf) : SLJIT_FUNC_OFFSET(do_extuni_no_utf));
+    common->utf ? (common->invalid_utf ? SLJIT_FUNC_OFFSET(do_extuni_utf_invalid) : SLJIT_FUNC_OFFSET(do_extuni_utf)) : SLJIT_FUNC_OFFSET(do_extuni_no_utf));
+  if (common->invalid_utf)
+    add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0));
 #else
-  sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(do_extuni_no_utf));
+  sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM,
+    common->invalid_utf ? SLJIT_FUNC_OFFSET(do_extuni_utf_invalid) : SLJIT_FUNC_OFFSET(do_extuni_no_utf));
+  if (!common->utf || common->invalid_utf)
+    add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0));
 #endif
 
   OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0);
@@ -7539,11 +8353,15 @@ switch(type)
 #ifdef SUPPORT_UNICODE
   if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc);
 #endif
-  if (common->mode == PCRE2_JIT_COMPLETE && check_str_ptr
-      && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0))
+
+  if (check_str_ptr && common->mode != PCRE2_JIT_COMPLETE)
+    detect_partial_match(common, backtracks);
+
+  if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0)
     {
     OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length));
-    add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0));
+    if (length > 1 || (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE))
+      add_jump(compiler, backtracks, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0));
 
     context.length = IN_UCHARS(length);
     context.sourcereg = -1;
@@ -7553,8 +8371,6 @@ switch(type)
     return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks);
     }
 
-  if (check_str_ptr)
-    detect_partial_match(common, backtracks);
 #ifdef SUPPORT_UNICODE
   if (common->utf)
     {
@@ -7564,24 +8380,28 @@ switch(type)
 #endif
     c = *cc;
 
-  if (type == OP_CHAR || !char_has_othercase(common, cc))
+  SLJIT_ASSERT(type == OP_CHARI && char_has_othercase(common, cc));
+
+  if (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE)
+    add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+  oc = char_othercase(common, c);
+  read_char(common, c < oc ? c : oc, c > oc ? c : oc, NULL, 0);
+
+  SLJIT_ASSERT(!is_powerof2(c ^ oc));
+
+  if (sljit_has_cpu_feature(SLJIT_HAS_CMOV))
     {
-    read_char_range(common, c, c, FALSE);
+    OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, oc);
+    CMOV(SLJIT_EQUAL, TMP1, SLJIT_IMM, c);
     add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, c));
-    return cc + length;
     }
-  oc = char_othercase(common, c);
-  read_char_range(common, c < oc ? c : oc, c > oc ? c : oc, FALSE);
-  bit = c ^ oc;
-  if (is_powerof2(bit))
+  else
     {
-    OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, bit);
-    add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, c | bit));
-    return cc + length;
+    jump[0] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c);
+    add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, oc));
+    JUMPHERE(jump[0]);
     }
-  jump[0] = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c);
-  add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, oc));
-  JUMPHERE(jump[0]);
   return cc + length;
 
   case OP_NOT:
@@ -7595,7 +8415,7 @@ switch(type)
     {
 #if PCRE2_CODE_UNIT_WIDTH == 8
     c = *cc;
-    if (c < 128)
+    if (c < 128 && !common->invalid_utf)
       {
       OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
       if (type == OP_NOT || !char_has_othercase(common, cc))
@@ -7626,13 +8446,13 @@ switch(type)
 
   if (type == OP_NOT || !char_has_othercase(common, cc))
     {
-    read_char_range(common, c, c, TRUE);
+    read_char(common, c, c, backtracks, READ_CHAR_UPDATE_STR_PTR);
     add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, c));
     }
   else
     {
     oc = char_othercase(common, c);
-    read_char_range(common, c < oc ? c : oc, c > oc ? c : oc, TRUE);
+    read_char(common, c < oc ? c : oc, c > oc ? c : oc, backtracks, READ_CHAR_UPDATE_STR_PTR);
     bit = c ^ oc;
     if (is_powerof2(bit))
       {
@@ -7654,9 +8474,15 @@ switch(type)
 
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
   bit = (common->utf && is_char7_bitset((const sljit_u8 *)cc, type == OP_NCLASS)) ? 127 : 255;
-  read_char_range(common, 0, bit, type == OP_NCLASS);
+  if (type == OP_NCLASS)
+    read_char(common, 0, bit, backtracks, READ_CHAR_UPDATE_STR_PTR);
+  else
+    read_char(common, 0, bit, NULL, 0);
 #else
-  read_char_range(common, 0, 255, type == OP_NCLASS);
+  if (type == OP_NCLASS)
+    read_char(common, 0, 255, backtracks, READ_CHAR_UPDATE_STR_PTR);
+  else
+    read_char(common, 0, 255, NULL, 0);
 #endif
 
   if (optimize_class(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks))
@@ -7843,6 +8669,14 @@ int offset = 0;
 struct sljit_jump *jump = NULL;
 struct sljit_jump *partial;
 struct sljit_jump *nopartial;
+#if defined SUPPORT_UNICODE
+struct sljit_label *loop;
+struct sljit_label *caseless_loop;
+jump_list *no_match = NULL;
+int source_reg = COUNT_MATCH;
+int source_end_reg = ARGUMENTS;
+int char1_reg = STACK_LIMIT;
+#endif /* SUPPORT_UNICODE */
 
 if (ref)
   {
@@ -7858,34 +8692,96 @@ else
 #if defined SUPPORT_UNICODE
 if (common->utf && *cc == OP_REFI)
   {
-  SLJIT_ASSERT(TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1);
+  SLJIT_ASSERT(common->iref_ptr != 0);
+
   if (ref)
-    OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1));
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(offset + 1));
   else
-    OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw));
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP2), sizeof(sljit_sw));
 
-  if (withchecks)
-    jump = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_R2, 0);
-  /* No free saved registers so save data on stack. */
+  if (withchecks && emptyfail)
+    add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, TMP2, 0));
 
-  OP1(SLJIT_MOV, SLJIT_R3, 0, STR_END, 0);
-  sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW) | SLJIT_ARG3(SW) | SLJIT_ARG4(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(do_utf_caselesscmp));
-  OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0);
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr, source_reg, 0);
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw), source_end_reg, 0);
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2, char1_reg, 0);
+
+  OP1(SLJIT_MOV, source_reg, 0, TMP1, 0);
+  OP1(SLJIT_MOV, source_end_reg, 0, TMP2, 0);
+
+  loop = LABEL();
+  jump = CMP(SLJIT_GREATER_EQUAL, source_reg, 0, source_end_reg, 0);
+  partial = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+
+  /* Read original character. It must be a valid UTF character. */
+  OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0);
+  OP1(SLJIT_MOV, STR_PTR, 0, source_reg, 0);
+
+  read_char(common, 0, READ_CHAR_MAX, NULL, READ_CHAR_UPDATE_STR_PTR | READ_CHAR_VALID_UTF);
+
+  OP1(SLJIT_MOV, source_reg, 0, STR_PTR, 0);
+  OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0);
+  OP1(SLJIT_MOV, char1_reg, 0, TMP1, 0);
+
+  /* Read second character. */
+  read_char(common, 0, READ_CHAR_MAX, &no_match, READ_CHAR_UPDATE_STR_PTR);
+
+  CMPTO(SLJIT_EQUAL, TMP1, 0, char1_reg, 0, loop);
 
+// PH hacking
+  OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);
+
+  add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));
+
+    OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2);
+
+  OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3);
+
+    OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
+
+  OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_records));
+
+  OP1(SLJIT_MOV_S32, TMP1, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(ucd_record, other_case));
+  OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(ucd_record, caseset));
+  OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP3, 0);
+  CMPTO(SLJIT_EQUAL, TMP1, 0, char1_reg, 0, loop);
+
+  add_jump(compiler, &no_match, CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0));
+  OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2);
+  OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_caseless_sets));
+
+  caseless_loop = LABEL();
+  OP1(SLJIT_MOV_U32, TMP1, 0, SLJIT_MEM1(TMP2), 0);
+  OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, sizeof(uint32_t));
+  OP2(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, char1_reg, 0);
+  JUMPTO(SLJIT_EQUAL, loop);
+  JUMPTO(SLJIT_LESS, caseless_loop);
+
+  set_jumps(no_match, LABEL());
   if (common->mode == PCRE2_JIT_COMPLETE)
-    add_jump(compiler, backtracks, CMP(SLJIT_LESS_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 1));
-  else
-    {
-    OP2(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_LESS, SLJIT_UNUSED, 0, SLJIT_RETURN_REG, 0, SLJIT_IMM, 1);
+    JUMPHERE(partial);
 
-    add_jump(compiler, backtracks, JUMP(SLJIT_LESS));
+  OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr);
+  OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw));
+  OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2);
+  add_jump(compiler, backtracks, JUMP(SLJIT_JUMP));
+
+  if (common->mode != PCRE2_JIT_COMPLETE)
+    {
+    JUMPHERE(partial);
+    OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr);
+    OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw));
+    OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2);
 
-    nopartial = JUMP(SLJIT_NOT_EQUAL);
-    OP1(SLJIT_MOV, STR_PTR, 0, STR_END, 0);
     check_partial(common, FALSE);
     add_jump(compiler, backtracks, JUMP(SLJIT_JUMP));
-    JUMPHERE(nopartial);
     }
+
+  JUMPHERE(jump);
+  OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr);
+  OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw));
+  OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2);
+  return;
   }
 else
 #endif /* SUPPORT_UNICODE */
@@ -8862,6 +9758,42 @@ if (common->optimized_cbracket[offset >> 1] == 0)
 return stacksize;
 }
 
+static PCRE2_SPTR SLJIT_FUNC do_script_run(PCRE2_SPTR ptr, PCRE2_SPTR endptr)
+{
+  if (PRIV(script_run)(ptr, endptr, FALSE))
+    return endptr;
+  return NULL;
+}
+
+#ifdef SUPPORT_UNICODE
+
+static PCRE2_SPTR SLJIT_FUNC do_script_run_utf(PCRE2_SPTR ptr, PCRE2_SPTR endptr)
+{
+  if (PRIV(script_run)(ptr, endptr, TRUE))
+    return endptr;
+  return NULL;
+}
+
+#endif /* SUPPORT_UNICODE */
+
+static SLJIT_INLINE void match_script_run_common(compiler_common *common, int private_data_ptr, backtrack_common *parent)
+{
+DEFINE_COMPILER;
+
+SLJIT_ASSERT(TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1);
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
+#ifdef SUPPORT_UNICODE
+sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM,
+  common->utf ? SLJIT_FUNC_OFFSET(do_script_run_utf) : SLJIT_FUNC_OFFSET(do_script_run));
+#else
+sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(do_script_run));
+#endif
+
+OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0);
+add_jump(compiler, parent->top != NULL ? &parent->top->nextbacktracks : &parent->topbacktracks, CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0));
+}
+
 /*
   Handling bracketed expressions is probably the most complex part.
 
@@ -8997,7 +9929,7 @@ if (opcode == OP_CBRA || opcode == OP_SCBRA)
   BACKTRACK_AS(bracket_backtrack)->private_data_ptr = private_data_ptr;
   matchingpath += IMM2_SIZE;
   }
-else if (opcode == OP_ONCE || opcode == OP_SBRA || opcode == OP_SCOND)
+else if (opcode == OP_ONCE || opcode == OP_SCRIPT_RUN || opcode == OP_SBRA || opcode == OP_SCOND)
   {
   /* Other brackets simply allocate the next entry. */
   private_data_ptr = PRIVATE_DATA(ccbegin);
@@ -9036,35 +9968,32 @@ if (bra == OP_BRAMINZERO)
     free_stack(common, 1);
     braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0);
     }
-  else
+  else if (opcode == OP_ONCE || opcode >= OP_SBRA)
     {
-    if (opcode == OP_ONCE || opcode >= OP_SBRA)
+    jump = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0);
+    OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(1));
+    /* Nothing stored during the first run. */
+    skip = JUMP(SLJIT_JUMP);
+    JUMPHERE(jump);
+    /* Checking zero-length iteration. */
+    if (opcode != OP_ONCE || BACKTRACK_AS(bracket_backtrack)->u.framesize < 0)
       {
-      jump = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0);
-      OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(1));
-      /* Nothing stored during the first run. */
-      skip = JUMP(SLJIT_JUMP);
-      JUMPHERE(jump);
-      /* Checking zero-length iteration. */
-      if (opcode != OP_ONCE || BACKTRACK_AS(bracket_backtrack)->u.framesize < 0)
-        {
-        /* When we come from outside, private_data_ptr contains the previous STR_PTR. */
-        braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
-        }
-      else
-        {
-        /* Except when the whole stack frame must be saved. */
-        OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
-        braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(TMP1), STACK(-BACKTRACK_AS(bracket_backtrack)->u.framesize - 2));
-        }
-      JUMPHERE(skip);
+      /* When we come from outside, private_data_ptr contains the previous STR_PTR. */
+      braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
       }
     else
       {
-      jump = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0);
-      OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(1));
-      JUMPHERE(jump);
+      /* Except when the whole stack frame must be saved. */
+      OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
+      braminzero = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(TMP1), STACK(-BACKTRACK_AS(bracket_backtrack)->u.framesize - 2));
       }
+    JUMPHERE(skip);
+    }
+  else
+    {
+    jump = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, 0);
+    OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(STACK_TOP), STACK(1));
+    JUMPHERE(jump);
     }
   }
 
@@ -9081,7 +10010,7 @@ if (ket == OP_KETRMIN)
 if (ket == OP_KETRMAX)
   {
   rmax_label = LABEL();
-  if (has_alternatives && opcode != OP_ONCE && opcode < OP_SBRA && repeat_type == 0)
+  if (has_alternatives && opcode >= OP_BRA && opcode < OP_SBRA && repeat_type == 0)
     BACKTRACK_AS(bracket_backtrack)->alternative_matchingpath = rmax_label;
   }
 
@@ -9185,7 +10114,7 @@ else if (opcode == OP_CBRA || opcode == OP_SCBRA)
     OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), TMP2, 0);
     }
   }
-else if (opcode == OP_SBRA || opcode == OP_SCOND)
+else if (opcode == OP_SCRIPT_RUN || opcode == OP_SBRA || opcode == OP_SCOND)
   {
   /* Saving the previous value. */
   OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), private_data_ptr);
@@ -9314,6 +10243,9 @@ if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
 if (opcode == OP_ONCE)
   match_once_common(common, ket, BACKTRACK_AS(bracket_backtrack)->u.framesize, private_data_ptr, has_alternatives, needs_control_head);
 
+if (opcode == OP_SCRIPT_RUN)
+  match_script_run_common(common, private_data_ptr, backtrack);
+
 stacksize = 0;
 if (repeat_type == OP_MINUPTO)
   {
@@ -9356,10 +10288,23 @@ if (ket != OP_KET || bra != OP_BRA)
 if (offset != 0)
   stacksize = match_capture_common(common, stacksize, offset, private_data_ptr);
 
+/* Skip and count the other alternatives. */
+i = 1;
+while (*cc == OP_ALT)
+  {
+  cc += GET(cc, 1);
+  i++;
+  }
+
 if (has_alternatives)
   {
   if (opcode != OP_ONCE)
-    OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), SLJIT_IMM, 0);
+    {
+    if (i <= 3)
+      OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), SLJIT_IMM, 0);
+    else
+      BACKTRACK_AS(bracket_backtrack)->u.matching_put_label = sljit_emit_put_label(compiler, SLJIT_MEM1(STACK_TOP), STACK(stacksize));
+    }
   if (ket != OP_KETRMAX)
     BACKTRACK_AS(bracket_backtrack)->alternative_matchingpath = LABEL();
   }
@@ -9383,13 +10328,15 @@ if (ket == OP_KETRMAX)
     if (opcode != OP_ONCE)
       free_stack(common, 1);
     }
-  else if (opcode == OP_ONCE || opcode >= OP_SBRA)
+  else if (opcode < OP_BRA || opcode >= OP_SBRA)
     {
     if (has_alternatives)
       BACKTRACK_AS(bracket_backtrack)->alternative_matchingpath = LABEL();
+
     /* Checking zero-length iteration. */
     if (opcode != OP_ONCE)
       {
+      /* This case includes opcodes such as OP_SCRIPT_RUN. */
       CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), private_data_ptr, STR_PTR, 0, rmax_label);
       /* Drop STR_PTR for greedy plus quantifier. */
       if (bra != OP_BRAZERO)
@@ -9446,9 +10393,6 @@ if (bra == OP_BRAMINZERO)
 if ((ket != OP_KET && bra != OP_BRAMINZERO) || bra == OP_BRAZERO)
   count_match(common);
 
-/* Skip the other alternatives. */
-while (*cc == OP_ALT)
-  cc += GET(cc, 1);
 cc += 1 + LINK_SIZE;
 
 if (opcode == OP_ONCE)
@@ -9456,7 +10400,7 @@ if (opcode == OP_ONCE)
   /* We temporarily encode the needs_control_head in the lowest bit.
      Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns
      the same value for small signed numbers (including negative numbers). */
-  BACKTRACK_AS(bracket_backtrack)->u.framesize = (BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0);
+  BACKTRACK_AS(bracket_backtrack)->u.framesize = (int)((unsigned)BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0);
   }
 return cc + repeat_length;
 }
@@ -9951,7 +10895,7 @@ if (exact > 1)
 #ifdef SUPPORT_UNICODE
       && !common->utf
 #endif
-      )
+      && type != OP_ANYNL && type != OP_EXTUNI)
     {
     OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact));
     add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0));
@@ -10007,174 +10951,232 @@ switch(opcode)
     JUMPTO(SLJIT_JUMP, label);
     if (jump != NULL)
       JUMPHERE(jump);
+    BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL();
+    break;
     }
-  else
+#ifdef SUPPORT_UNICODE
+  else if (type == OP_ALLANY && !common->invalid_utf)
+#else
+  else if (type == OP_ALLANY)
+#endif
     {
-    charpos_enabled = FALSE;
-    charpos_char = 0;
-    charpos_othercasebit = 0;
-
-    if ((type != OP_CHAR && type != OP_CHARI) && (*end == OP_CHAR || *end == OP_CHARI))
+    if (opcode == OP_STAR)
       {
-      charpos_enabled = TRUE;
+      if (private_data_ptr == 0)
+        allocate_stack(common, 2);
+
+      OP1(SLJIT_MOV, base, offset0, STR_END, 0);
+      OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
+
+      OP1(SLJIT_MOV, STR_PTR, 0, STR_END, 0);
+      process_partial_match(common);
+
+      if (fast_str_ptr != 0)
+        OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_END, 0);
+      BACKTRACK_AS(char_iterator_backtrack)->matchingpath = LABEL();
+      break;
+      }
 #ifdef SUPPORT_UNICODE
-      charpos_enabled = !common->utf || !HAS_EXTRALEN(end[1]);
+    else if (!common->utf)
+#else
+    else
 #endif
-      if (charpos_enabled && *end == OP_CHARI && char_has_othercase(common, end + 1))
+      {
+      if (private_data_ptr == 0)
+        allocate_stack(common, 2);
+
+      OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
+      OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(max));
+
+      if (common->mode == PCRE2_JIT_COMPLETE)
         {
-        charpos_othercasebit = char_get_othercase_bit(common, end + 1);
-        if (charpos_othercasebit == 0)
-          charpos_enabled = FALSE;
+        OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0);
+        CMOV(SLJIT_GREATER, STR_PTR, STR_END, 0);
         }
-
-      if (charpos_enabled)
+      else
         {
-        charpos_char = end[1];
-        /* Consumpe the OP_CHAR opcode. */
-        end += 2;
+        jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, STR_END, 0);
+        process_partial_match(common);
+        JUMPHERE(jump);
+        }
+
+      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();
+      break;
+      }
+    }
+
+  charpos_enabled = FALSE;
+  charpos_char = 0;
+  charpos_othercasebit = 0;
+
+  if ((type != OP_CHAR && type != OP_CHARI) && (*end == OP_CHAR || *end == OP_CHARI))
+    {
+#ifdef SUPPORT_UNICODE
+    charpos_enabled = !common->utf || !HAS_EXTRALEN(end[1]);
+#else
+    charpos_enabled = TRUE;
+#endif
+    if (charpos_enabled && *end == OP_CHARI && char_has_othercase(common, end + 1))
+      {
+      charpos_othercasebit = char_get_othercase_bit(common, end + 1);
+      if (charpos_othercasebit == 0)
+        charpos_enabled = FALSE;
+      }
+
+    if (charpos_enabled)
+      {
+      charpos_char = end[1];
+      /* Consumpe the OP_CHAR opcode. */
+      end += 2;
 #if PCRE2_CODE_UNIT_WIDTH == 8
-        SLJIT_ASSERT((charpos_othercasebit >> 8) == 0);
+      SLJIT_ASSERT((charpos_othercasebit >> 8) == 0);
 #elif PCRE2_CODE_UNIT_WIDTH == 16 || PCRE2_CODE_UNIT_WIDTH == 32
-        SLJIT_ASSERT((charpos_othercasebit >> 9) == 0);
-        if ((charpos_othercasebit & 0x100) != 0)
-          charpos_othercasebit = (charpos_othercasebit & 0xff) << 8;
+      SLJIT_ASSERT((charpos_othercasebit >> 9) == 0);
+      if ((charpos_othercasebit & 0x100) != 0)
+        charpos_othercasebit = (charpos_othercasebit & 0xff) << 8;
 #endif
-        if (charpos_othercasebit != 0)
-          charpos_char |= charpos_othercasebit;
+      if (charpos_othercasebit != 0)
+        charpos_char |= charpos_othercasebit;
+
+      BACKTRACK_AS(char_iterator_backtrack)->u.charpos.enabled = TRUE;
+      BACKTRACK_AS(char_iterator_backtrack)->u.charpos.chr = charpos_char;
+      BACKTRACK_AS(char_iterator_backtrack)->u.charpos.othercasebit = charpos_othercasebit;
+      }
+    }
+
+  if (charpos_enabled)
+    {
+    if (opcode == OP_UPTO)
+      OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max + 1);
+
+    /* Search the first instance of charpos_char. */
+    jump = JUMP(SLJIT_JUMP);
+    label = LABEL();
+    if (opcode == OP_UPTO)
+      {
+      OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+      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);
 
-        BACKTRACK_AS(char_iterator_backtrack)->u.charpos.enabled = TRUE;
-        BACKTRACK_AS(char_iterator_backtrack)->u.charpos.chr = charpos_char;
-        BACKTRACK_AS(char_iterator_backtrack)->u.charpos.othercasebit = charpos_othercasebit;
-        }
-      }
+    detect_partial_match(common, &backtrack->topbacktracks);
+    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
+    if (charpos_othercasebit != 0)
+      OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit);
+    CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char, label);
 
-    if (charpos_enabled)
+    if (private_data_ptr == 0)
+      allocate_stack(common, 2);
+    OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
+    OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
+    if (opcode == OP_UPTO)
       {
-      if (opcode == OP_UPTO)
-        OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max + 1);
-
-      /* Search the first instance of charpos_char. */
-      jump = JUMP(SLJIT_JUMP);
-      label = LABEL();
-      if (opcode == OP_UPTO)
-        {
-        OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
-        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);
+      OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+      add_jump(compiler, &no_match, JUMP(SLJIT_ZERO));
+      }
 
-      detect_partial_match(common, &backtrack->topbacktracks);
-      OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(0));
-      if (charpos_othercasebit != 0)
-        OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit);
+    /* 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)
+      OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit);
+    if (opcode == OP_STAR)
+      {
       CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char, label);
-
-      if (private_data_ptr == 0)
-        allocate_stack(common, 2);
       OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
-      OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
-      if (opcode == OP_UPTO)
-        {
-        OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
-        add_jump(compiler, &no_match, JUMP(SLJIT_ZERO));
-        }
-
-      /* 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)
-        OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, charpos_othercasebit);
-      if (opcode == OP_STAR)
-        {
-        CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char, label);
-        OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
-        }
-      else
-        {
-        jump = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char);
-        OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
-        JUMPHERE(jump);
-        }
-
-      if (opcode == OP_UPTO)
-        {
-        OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
-        JUMPTO(SLJIT_NOT_ZERO, label);
-        }
-      else
-        JUMPTO(SLJIT_JUMP, label);
-
-      set_jumps(no_match, LABEL());
-      OP1(SLJIT_MOV, STR_PTR, 0, base, offset0);
-      OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+      }
+    else
+      {
+      jump = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, charpos_char);
       OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
+      JUMPHERE(jump);
       }
-#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
-    else if (common->utf)
+
+    if (opcode == OP_UPTO)
       {
-      if (private_data_ptr == 0)
-        allocate_stack(common, 2);
+      OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+      JUMPTO(SLJIT_NOT_ZERO, label);
+      }
+    else
+      JUMPTO(SLJIT_JUMP, label);
 
-      OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
-      OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
+    set_jumps(no_match, LABEL());
+    OP1(SLJIT_MOV, STR_PTR, 0, base, offset0);
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+    OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
+    }
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+  else if (common->utf)
+    {
+    if (private_data_ptr == 0)
+      allocate_stack(common, 2);
 
-      if (opcode == OP_UPTO)
-        OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max);
+    OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
+    OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
 
-      label = LABEL();
-      compile_char1_matchingpath(common, type, cc, &no_match, TRUE);
-      OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
+    if (opcode == OP_UPTO)
+      OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max);
 
-      if (opcode == OP_UPTO)
-        {
-        OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
-        JUMPTO(SLJIT_NOT_ZERO, label);
-        }
-      else
-        JUMPTO(SLJIT_JUMP, label);
+    detect_partial_match(common, &no_match);
+    label = LABEL();
+    compile_char1_matchingpath(common, type, cc, &no_match, FALSE);
+    OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
 
-      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
+    if (opcode == OP_UPTO)
       {
-      if (private_data_ptr == 0)
-        allocate_stack(common, 2);
+      OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+      add_jump(compiler, &no_match, JUMP(SLJIT_ZERO));
+      }
 
-      OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
-      if (opcode == OP_UPTO)
-        OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max);
+    detect_partial_match_to(common, label);
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
 
-      label = LABEL();
-      detect_partial_match(common, &no_match);
-      compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE);
-      if (opcode == OP_UPTO)
-        {
-        OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
-        JUMPTO(SLJIT_NOT_ZERO, label);
-        OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
-        }
-      else
-        JUMPTO(SLJIT_JUMP, label);
+    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
+    {
+    if (private_data_ptr == 0)
+      allocate_stack(common, 2);
 
-      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());
-      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);
+    OP1(SLJIT_MOV, base, offset1, STR_PTR, 0);
+    if (opcode == OP_UPTO)
+      OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max);
+
+    detect_partial_match(common, &no_match);
+    label = LABEL();
+    compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE);
+    if (opcode == OP_UPTO)
+      {
+      OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
+      add_jump(compiler, &no_match, JUMP(SLJIT_ZERO));
       }
+
+    detect_partial_match_to(common, label);
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
+    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());
+    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();
   break;
 
@@ -10211,25 +11213,47 @@ switch(opcode)
   break;
 
   case OP_POSSTAR:
+#if defined SUPPORT_UNICODE
+  if (type == OP_ALLANY && !common->invalid_utf)
+#else
+  if (type == OP_ALLANY)
+#endif
+    {
+    OP1(SLJIT_MOV, STR_PTR, 0, STR_END, 0);
+    process_partial_match(common);
+    if (fast_str_ptr != 0)
+      OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_END, 0);
+    break;
+    }
+
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
   if (common->utf)
     {
     OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0);
+    detect_partial_match(common, &no_match);
     label = LABEL();
-    compile_char1_matchingpath(common, type, cc, &no_match, TRUE);
+    compile_char1_matchingpath(common, type, cc, &no_match, FALSE);
     OP1(SLJIT_MOV, tmp_base, tmp_offset, STR_PTR, 0);
-    JUMPTO(SLJIT_JUMP, label);
+    detect_partial_match_to(common, 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);
+      {
+      if (tmp_base == TMP3)
+        OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, TMP3, 0);
+      else
+        OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
+      }
     break;
     }
 #endif
-  label = LABEL();
   detect_partial_match(common, &no_match);
+  label = LABEL();
   compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE);
-  JUMPTO(SLJIT_JUMP, label);
+  detect_partial_match_to(common, label);
+  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
   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());
@@ -10244,23 +11268,52 @@ switch(opcode)
     {
     OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, STR_PTR, 0);
     OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max);
+
+    detect_partial_match(common, &no_match);
     label = LABEL();
-    compile_char1_matchingpath(common, type, cc, &no_match, TRUE);
+    compile_char1_matchingpath(common, type, cc, &no_match, FALSE);
     OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1, STR_PTR, 0);
     OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
-    JUMPTO(SLJIT_NOT_ZERO, label);
+    add_jump(compiler, &no_match, JUMP(SLJIT_ZERO));
+    detect_partial_match_to(common, label);
+
     set_jumps(no_match, LABEL());
     OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), POSSESSIVE1);
     break;
     }
 #endif
+
+  if (type == OP_ALLANY)
+    {
+    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(max));
+
+    if (common->mode == PCRE2_JIT_COMPLETE)
+      {
+      OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0);
+      CMOV(SLJIT_GREATER, STR_PTR, STR_END, 0);
+      }
+    else
+      {
+      jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, STR_END, 0);
+      process_partial_match(common);
+      JUMPHERE(jump);
+      }
+
+    if (fast_str_ptr != 0)
+      OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), fast_str_ptr, STR_PTR, 0);
+    break;
+    }
+
   OP1(SLJIT_MOV, tmp_base, tmp_offset, SLJIT_IMM, max);
-  label = LABEL();
+
   detect_partial_match(common, &no_match);
+  label = LABEL();
   compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE);
   OP2(SLJIT_SUB | SLJIT_SET_Z, tmp_base, tmp_offset, tmp_base, tmp_offset, SLJIT_IMM, 1);
-  JUMPTO(SLJIT_NOT_ZERO, label);
+  add_jump(compiler, &no_match, JUMP(SLJIT_ZERO));
+  detect_partial_match_to(common, label);
   OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+
   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());
@@ -10314,8 +11367,15 @@ if (common->accept_label == NULL)
   add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0)));
 else
   CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), common->accept_label);
-OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
-OP1(SLJIT_MOV_U32, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options));
+
+if (HAS_VIRTUAL_REGISTERS)
+  {
+  OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+  OP1(SLJIT_MOV_U32, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options));
+  }
+else
+  OP1(SLJIT_MOV_U32, TMP2, 0, SLJIT_MEM1(ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, options));
+
 OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY);
 add_jump(compiler, &backtrack->topbacktracks, JUMP(SLJIT_NOT_ZERO));
 OP2(SLJIT_AND | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY_ATSTART);
@@ -10323,7 +11383,8 @@ if (common->accept_label == NULL)
   add_jump(compiler, &common->accept, JUMP(SLJIT_ZERO));
 else
   JUMPTO(SLJIT_ZERO, common->accept_label);
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
+
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(HAS_VIRTUAL_REGISTERS ? TMP1 : ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, str));
 if (common->accept_label == NULL)
   add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0));
 else
@@ -10373,10 +11434,11 @@ if (opcode == OP_SKIP)
 
 if (opcode == OP_COMMIT_ARG || opcode == OP_PRUNE_ARG || opcode == OP_THEN_ARG)
   {
-  OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+  if (HAS_VIRTUAL_REGISTERS)
+    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
   OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)(cc + 2));
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0);
-  OP1(SLJIT_MOV, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, mark_ptr), TMP2, 0);
+  OP1(SLJIT_MOV, SLJIT_MEM1(HAS_VIRTUAL_REGISTERS ? TMP1 : ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, mark_ptr), TMP2, 0);
   }
 
 return ccend;
@@ -10634,6 +11696,7 @@ while (cc < ccend)
     break;
 
     case OP_ONCE:
+    case OP_SCRIPT_RUN:
     case OP_BRA:
     case OP_CBRA:
     case OP_COND:
@@ -10666,11 +11729,12 @@ while (cc < ccend)
     SLJIT_ASSERT(common->mark_ptr != 0);
     OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr);
     allocate_stack(common, common->has_skip_arg ? 5 : 1);
-    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
+    if (HAS_VIRTUAL_REGISTERS)
+      OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
     OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0), TMP2, 0);
     OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)(cc + 2));
     OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0);
-    OP1(SLJIT_MOV, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, mark_ptr), TMP2, 0);
+    OP1(SLJIT_MOV, SLJIT_MEM1(HAS_VIRTUAL_REGISTERS ? TMP1 : ARGUMENTS), SLJIT_OFFSETOF(jit_arguments, mark_ptr), TMP2, 0);
     if (common->has_skip_arg)
       {
       OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr);
@@ -10787,14 +11851,14 @@ switch(opcode)
       if (CURRENT_AS(char_iterator_backtrack)->u.charpos.othercasebit != 0)
         OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->u.charpos.othercasebit);
       CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, CURRENT_AS(char_iterator_backtrack)->u.charpos.chr, CURRENT_AS(char_iterator_backtrack)->matchingpath);
-      skip_char_back(common);
+      move_back(common, NULL, TRUE);
       CMPTO(SLJIT_GREATER, STR_PTR, 0, TMP2, 0, label);
       }
     else
       {
       OP1(SLJIT_MOV, STR_PTR, 0, base, offset0);
       jump = CMP(SLJIT_LESS_EQUAL, STR_PTR, 0, base, offset1);
-      skip_char_back(common);
+      move_back(common, NULL, TRUE);
       OP1(SLJIT_MOV, base, offset0, STR_PTR, 0);
       JUMPTO(SLJIT_JUMP, CURRENT_AS(char_iterator_backtrack)->matchingpath);
       }
@@ -10997,16 +12061,15 @@ PCRE2_SPTR ccprev;
 PCRE2_UCHAR bra = OP_BRA;
 PCRE2_UCHAR ket;
 assert_backtrack *assert;
-sljit_uw *next_update_addr = NULL;
 BOOL has_alternatives;
 BOOL needs_control_head = FALSE;
 struct sljit_jump *brazero = NULL;
-struct sljit_jump *alt1 = NULL;
-struct sljit_jump *alt2 = NULL;
+struct sljit_jump *next_alt = NULL;
 struct sljit_jump *once = NULL;
 struct sljit_jump *cond = NULL;
 struct sljit_label *rmin_label = NULL;
 struct sljit_label *exact_label = NULL;
+struct sljit_put_label *put_label = NULL;
 
 if (*cc == OP_BRAZERO || *cc == OP_BRAMINZERO)
   {
@@ -11155,7 +12218,7 @@ else if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND)
     free_stack(common, 1);
 
     alt_max = 2;
-    alt1 = CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, sizeof(sljit_uw));
+    next_alt = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0);
     }
   }
 else if (has_alternatives)
@@ -11163,21 +12226,15 @@ else if (has_alternatives)
   OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0));
   free_stack(common, 1);
 
-  if (alt_max > 4)
+  if (alt_max > 3)
     {
-    /* Table jump if alt_max is greater than 4. */
-    next_update_addr = allocate_read_only_data(common, alt_max * sizeof(sljit_uw));
-    if (SLJIT_UNLIKELY(next_update_addr == NULL))
-      return;
-    sljit_emit_ijump(compiler, SLJIT_JUMP, SLJIT_MEM1(TMP1), (sljit_sw)next_update_addr);
-    add_label_addr(common, next_update_addr++);
+    sljit_emit_ijump(compiler, SLJIT_JUMP, TMP1, 0);
+
+    SLJIT_ASSERT(CURRENT_AS(bracket_backtrack)->u.matching_put_label);
+    sljit_set_put_label(CURRENT_AS(bracket_backtrack)->u.matching_put_label, LABEL());
     }
   else
-    {
-    if (alt_max == 4)
-      alt2 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 2 * sizeof(sljit_uw));
-    alt1 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, sizeof(sljit_uw));
-    }
+    next_alt = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0);
   }
 
 COMPILE_BACKTRACKINGPATH(current->top);
@@ -11214,7 +12271,7 @@ if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND))
 
 if (has_alternatives)
   {
-  alt_count = sizeof(sljit_uw);
+  alt_count = 1;
   do
     {
     current->top = NULL;
@@ -11240,6 +12297,9 @@ if (has_alternatives)
       compile_matchingpath(common, ccprev, cc, current);
       if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
         return;
+
+      if (opcode == OP_SCRIPT_RUN)
+        match_script_run_common(common, private_data_ptr, current);
       }
 
     /* Instructions after the current alternative is successfully matched. */
@@ -11290,7 +12350,12 @@ if (has_alternatives)
       stacksize = match_capture_common(common, stacksize, offset, private_data_ptr);
 
     if (opcode != OP_ONCE)
-      OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), SLJIT_IMM, alt_count);
+      {
+      if (alt_max <= 3)
+        OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(stacksize), SLJIT_IMM, alt_count);
+      else
+        put_label = sljit_emit_put_label(compiler, SLJIT_MEM1(STACK_TOP), STACK(stacksize));
+      }
 
     if (offset != 0 && ket == OP_KETRMAX && common->optimized_cbracket[offset >> 1] != 0)
       {
@@ -11303,24 +12368,18 @@ if (has_alternatives)
 
     if (opcode != OP_ONCE)
       {
-      if (alt_max > 4)
-        add_label_addr(common, next_update_addr++);
-      else
+      if (alt_max <= 3)
         {
-        if (alt_count != 2 * sizeof(sljit_uw))
-          {
-          JUMPHERE(alt1);
-          if (alt_max == 3 && alt_count == sizeof(sljit_uw))
-            alt2 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 2 * sizeof(sljit_uw));
-          }
-        else
+        JUMPHERE(next_alt);
+        alt_count++;
+        if (alt_count < alt_max)
           {
-          JUMPHERE(alt2);
-          if (alt_max == 4)
-            alt1 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 3 * sizeof(sljit_uw));
+          SLJIT_ASSERT(alt_count == 2 && alt_max == 3);
+          next_alt = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 1);
           }
         }
-      alt_count += sizeof(sljit_uw);
+      else
+        sljit_set_put_label(put_label, LABEL());
       }
 
     COMPILE_BACKTRACKINGPATH(current->top);
@@ -11368,7 +12427,7 @@ if (offset != 0)
     OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, TMP1, 0);
     }
   }
-else if (opcode == OP_SBRA || opcode == OP_SCOND)
+else if (opcode == OP_SCRIPT_RUN || opcode == OP_SBRA || opcode == OP_SCOND)
   {
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), private_data_ptr, SLJIT_MEM1(STACK_TOP), STACK(0));
   free_stack(common, 1);
@@ -11717,6 +12776,7 @@ while (current)
     break;
 
     case OP_ONCE:
+    case OP_SCRIPT_RUN:
     case OP_BRA:
     case OP_CBRA:
     case OP_COND:
@@ -11809,11 +12869,10 @@ int private_data_size = get_recurse_data_length(common, ccbegin, ccend, &needs_c
 int alt_count, alt_max, local_size;
 backtrack_common altbacktrack;
 jump_list *match = NULL;
-sljit_uw *next_update_addr = NULL;
-struct sljit_jump *alt1 = NULL;
-struct sljit_jump *alt2 = NULL;
+struct sljit_jump *next_alt = NULL;
 struct sljit_jump *accept_exit = NULL;
 struct sljit_label *quit;
+struct sljit_put_label *put_label;
 
 /* Recurse captures then. */
 common->then_trap = NULL;
@@ -11874,7 +12933,12 @@ while (1)
   OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr);
 
   if (alt_max > 1 || has_accept)
-    OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, alt_count);
+    {
+    if (alt_max > 3)
+      put_label = sljit_emit_put_label(compiler, SLJIT_MEM1(STACK_TOP), STACK(1));
+    else
+      OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, alt_count);
+    }
 
   add_jump(compiler, &match, JUMP(SLJIT_JUMP));
 
@@ -11888,7 +12952,7 @@ while (1)
     sljit_emit_fast_enter(compiler, TMP1, 0);
 
     if (has_accept)
-      accept_exit = CMP(SLJIT_EQUAL, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, alt_max * sizeof (sljit_sw));
+      accept_exit = CMP(SLJIT_EQUAL, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, -1);
 
     OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(STACK_TOP), STACK(0));
     /* Save return address. */
@@ -11901,44 +12965,30 @@ while (1)
       OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(1));
       free_stack(common, 2);
 
-      if (alt_max > 4)
+      if (alt_max > 3)
         {
-          /* Table jump if alt_max is greater than 4. */
-          next_update_addr = allocate_read_only_data(common, alt_max * sizeof(sljit_uw));
-          if (SLJIT_UNLIKELY(next_update_addr == NULL))
-            return;
-          sljit_emit_ijump(compiler, SLJIT_JUMP, SLJIT_MEM1(TMP1), (sljit_sw)next_update_addr);
-          add_label_addr(common, next_update_addr++);
+        sljit_emit_ijump(compiler, SLJIT_JUMP, TMP1, 0);
+        sljit_set_put_label(put_label, LABEL());
         }
       else
-        {
-        if (alt_max == 4)
-          alt2 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 2 * sizeof(sljit_uw));
-        alt1 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, sizeof(sljit_uw));
-        }
+        next_alt = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0);
       }
     else
       free_stack(common, has_accept ? 2 : 1);
     }
-  else if (alt_max > 4)
-    add_label_addr(common, next_update_addr++);
+  else if (alt_max > 3)
+    sljit_set_put_label(put_label, LABEL());
   else
     {
-    if (alt_count != 2 * sizeof(sljit_uw))
+    JUMPHERE(next_alt);
+    if (alt_count + 1 < alt_max)
       {
-      JUMPHERE(alt1);
-      if (alt_max == 3 && alt_count == sizeof(sljit_uw))
-        alt2 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 2 * sizeof(sljit_uw));
-      }
-    else
-      {
-      JUMPHERE(alt2);
-      if (alt_max == 4)
-        alt1 = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 3 * sizeof(sljit_uw));
+      SLJIT_ASSERT(alt_count == 1 && alt_max == 3);
+      next_alt = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 1);
       }
     }
 
-  alt_count += sizeof(sljit_uw);
+  alt_count++;
 
   compile_backtrackingpath(common, altbacktrack.top);
   if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
@@ -11999,7 +13049,7 @@ if (common->accept != NULL)
   OP1(SLJIT_MOV, TMP2, 0, STACK_TOP, 0);
 
   allocate_stack(common, 2);
-  OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, alt_count);
+  OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), SLJIT_IMM, -1);
   }
 
 set_jumps(match, LABEL());
@@ -12016,6 +13066,9 @@ sljit_emit_fast_return(compiler, TMP2, 0);
 #undef COMPILE_BACKTRACKINGPATH
 #undef CURRENT_AS
 
+#define PUBLIC_JIT_COMPILE_CONFIGURATION_OPTIONS \
+  (PCRE2_JIT_INVALID_UTF)
+
 static int jit_compile(pcre2_code *code, sljit_u32 mode)
 {
 pcre2_real_code *re = (pcre2_real_code *)code;
@@ -12031,7 +13084,6 @@ executable_functions *functions;
 void *executable_func;
 sljit_uw executable_size;
 sljit_uw total_length;
-label_addr_list *label_addr;
 struct sljit_label *mainloop_label = NULL;
 struct sljit_label *continue_match_label;
 struct sljit_label *empty_match_found_label = NULL;
@@ -12046,18 +13098,32 @@ struct sljit_jump *end_anchor_failed = NULL;
 
 SLJIT_ASSERT(tables);
 
+#if HAS_VIRTUAL_REGISTERS == 1
+SLJIT_ASSERT(sljit_get_register_index(TMP3) < 0 && sljit_get_register_index(ARGUMENTS) < 0 && sljit_get_register_index(RETURN_ADDR) < 0);
+#elif HAS_VIRTUAL_REGISTERS == 0
+SLJIT_ASSERT(sljit_get_register_index(TMP3) >= 0 && sljit_get_register_index(ARGUMENTS) >= 0 && sljit_get_register_index(RETURN_ADDR) >= 0);
+#else
+#error "Invalid value for HAS_VIRTUAL_REGISTERS"
+#endif
+
 memset(&rootbacktrack, 0, sizeof(backtrack_common));
 memset(common, 0, sizeof(compiler_common));
 common->re = re;
 common->name_table = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code));
 rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size;
 
+#ifdef SUPPORT_UNICODE
+common->invalid_utf = (mode & PCRE2_JIT_INVALID_UTF) != 0;
+#endif /* SUPPORT_UNICODE */
+mode &= ~PUBLIC_JIT_COMPILE_CONFIGURATION_OPTIONS;
+
 common->start = rootbacktrack.cc;
 common->read_only_data_head = NULL;
 common->fcc = tables + fcc_offset;
 common->lcc = (sljit_sw)(tables + lcc_offset);
 common->mode = mode;
 common->might_be_empty = re->minlength == 0;
+common->allow_empty_partial = (re->max_lookbehind > 0) || (re->flags & PCRE2_MATCH_EMPTY) != 0;
 common->nltype = NLTYPE_FIXED;
 switch(re->newline_convention)
   {
@@ -12066,6 +13132,7 @@ switch(re->newline_convention)
   case PCRE2_NEWLINE_CRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; break;
   case PCRE2_NEWLINE_ANY: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY; break;
   case PCRE2_NEWLINE_ANYCRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANYCRLF; break;
+  case PCRE2_NEWLINE_NUL: common->newline = CHAR_NUL; break;
   default: return PCRE2_ERROR_INTERNAL;
   }
 common->nlmax = READ_CHAR_MAX;
@@ -12117,6 +13184,8 @@ if (common->utf)
     common->bsr_nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL;
   common->bsr_nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL;
   }
+else
+  common->invalid_utf = FALSE;
 #endif /* SUPPORT_UNICODE */
 ccend = bracketend(common->start);
 
@@ -12321,7 +13390,7 @@ if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
   sljit_free_compiler(compiler);
   SLJIT_FREE(common->optimized_cbracket, allocator_data);
   SLJIT_FREE(common->private_data_ptrs, allocator_data);
-  PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data);
+  PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
   return PCRE2_ERROR_NOMEMORY;
   }
 
@@ -12375,7 +13444,7 @@ if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
   sljit_free_compiler(compiler);
   SLJIT_FREE(common->optimized_cbracket, allocator_data);
   SLJIT_FREE(common->private_data_ptrs, allocator_data);
-  PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data);
+  PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
   return PCRE2_ERROR_NOMEMORY;
   }
 
@@ -12464,7 +13533,7 @@ while (common->currententry != NULL)
     sljit_free_compiler(compiler);
     SLJIT_FREE(common->optimized_cbracket, allocator_data);
     SLJIT_FREE(common->private_data_ptrs, allocator_data);
-    PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data);
+    PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
     return PCRE2_ERROR_NOMEMORY;
     }
   flush_stubs(common);
@@ -12557,22 +13626,49 @@ if (common->utfreadchar != NULL)
   set_jumps(common->utfreadchar, LABEL());
   do_utfreadchar(common);
   }
-if (common->utfreadchar16 != NULL)
-  {
-  set_jumps(common->utfreadchar16, LABEL());
-  do_utfreadchar16(common);
-  }
 if (common->utfreadtype8 != NULL)
   {
   set_jumps(common->utfreadtype8, LABEL());
   do_utfreadtype8(common);
   }
+if (common->utfpeakcharback != NULL)
+  {
+  set_jumps(common->utfpeakcharback, LABEL());
+  do_utfpeakcharback(common);
+  }
 #endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
+#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16
+if (common->utfreadchar_invalid != NULL)
+  {
+  set_jumps(common->utfreadchar_invalid, LABEL());
+  do_utfreadchar_invalid(common);
+  }
+if (common->utfreadnewline_invalid != NULL)
+  {
+  set_jumps(common->utfreadnewline_invalid, LABEL());
+  do_utfreadnewline_invalid(common);
+  }
+if (common->utfmoveback_invalid)
+  {
+  set_jumps(common->utfmoveback_invalid, LABEL());
+  do_utfmoveback_invalid(common);
+  }
+if (common->utfpeakcharback_invalid)
+  {
+  set_jumps(common->utfpeakcharback_invalid, LABEL());
+  do_utfpeakcharback_invalid(common);
+  }
+#endif /* PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16 */
 if (common->getucd != NULL)
   {
   set_jumps(common->getucd, LABEL());
   do_getucd(common);
   }
+if (common->getucdtype != NULL)
+  {
+  set_jumps(common->getucdtype, LABEL());
+  do_getucdtype(common);
+  }
 #endif /* SUPPORT_UNICODE */
 
 SLJIT_FREE(common->optimized_cbracket, allocator_data);
@@ -12580,16 +13676,11 @@ SLJIT_FREE(common->private_data_ptrs, allocator_data);
 
 executable_func = sljit_generate_code(compiler);
 executable_size = sljit_get_generated_code_size(compiler);
-label_addr = common->label_addrs;
-while (label_addr != NULL)
-  {
-  *label_addr->update_addr = sljit_get_label_addr(label_addr->label);
-  label_addr = label_addr->next;
-  }
 sljit_free_compiler(compiler);
+
 if (executable_func == NULL)
   {
-  PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data);
+  PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
   return PCRE2_ERROR_NOMEMORY;
   }
 
@@ -12604,7 +13695,7 @@ else
     /* This case is highly unlikely since we just recently
     freed a lot of memory. Not impossible though. */
     sljit_free_code(executable_func);
-    PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data);
+    PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
     return PCRE2_ERROR_NOMEMORY;
     }
   memset(functions, 0, sizeof(executable_functions));
@@ -12644,22 +13735,17 @@ Returns:        0: success or (*NOJIT) was used
 */
 
 #define PUBLIC_JIT_COMPILE_OPTIONS \
-  (PCRE2_JIT_COMPLETE|PCRE2_JIT_PARTIAL_SOFT|PCRE2_JIT_PARTIAL_HARD)
+  (PCRE2_JIT_COMPLETE|PCRE2_JIT_PARTIAL_SOFT|PCRE2_JIT_PARTIAL_HARD|PCRE2_JIT_INVALID_UTF)
 
 PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
 pcre2_jit_compile(pcre2_code *code, uint32_t options)
 {
-#ifndef SUPPORT_JIT
-
-(void)code;
-(void)options;
-return PCRE2_ERROR_JIT_BADOPTION;
-
-#else  /* SUPPORT_JIT */
-
 pcre2_real_code *re = (pcre2_real_code *)code;
-executable_functions *functions;
-int result;
+
+#ifdef SUPPORT_JIT
+executable_functions *functions = (executable_functions *)re->executable_jit;
+static int executable_allocator_is_working = 0;
+#endif
 
 if (code == NULL)
   return PCRE2_ERROR_NULL;
@@ -12667,27 +13753,98 @@ if (code == NULL)
 if ((options & ~PUBLIC_JIT_COMPILE_OPTIONS) != 0)
   return PCRE2_ERROR_JIT_BADOPTION;
 
+/* Support for invalid UTF was first introduced in JIT, with the option
+PCRE2_JIT_INVALID_UTF. Later, support was added to the interpreter, and the
+compile-time option PCRE2_MATCH_INVALID_UTF was created. This is now the
+preferred feature, with the earlier option deprecated. However, for backward
+compatibility, if the earlier option is set, it forces the new option so that
+if JIT matching falls back to the interpreter, there is still support for
+invalid UTF. However, if this function has already been successfully called
+without PCRE2_JIT_INVALID_UTF and without PCRE2_MATCH_INVALID_UTF (meaning that
+non-invalid-supporting JIT code was compiled), give an error.
+
+If in the future support for PCRE2_JIT_INVALID_UTF is withdrawn, the following
+actions are needed:
+
+  1. Remove the definition from pcre2.h.in and from the list in
+     PUBLIC_JIT_COMPILE_OPTIONS above.
+
+  2. Replace PCRE2_JIT_INVALID_UTF with a local flag in this module.
+
+  3. Replace PCRE2_JIT_INVALID_UTF in pcre2_jit_test.c.
+
+  4. Delete the following short block of code. The setting of "re" and
+     "functions" can be moved into the JIT-only block below, but if that is
+     done, (void)re and (void)functions will be needed in the non-JIT case, to
+     avoid compiler warnings.
+*/
+
+if ((options & PCRE2_JIT_INVALID_UTF) != 0)
+  {
+  if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) == 0)
+    {
+#ifdef SUPPORT_JIT
+    if (functions != NULL) return PCRE2_ERROR_JIT_BADOPTION;
+#endif
+    re->overall_options |= PCRE2_MATCH_INVALID_UTF;
+    }
+  }
+
+/* The above tests are run with and without JIT support. This means that
+PCRE2_JIT_INVALID_UTF propagates back into the regex options (ensuring
+interpreter support) even in the absence of JIT. But now, if there is no JIT
+support, give an error return. */
+
+#ifndef SUPPORT_JIT
+return PCRE2_ERROR_JIT_BADOPTION;
+#else  /* SUPPORT_JIT */
+
+/* There is JIT support. Do the necessary. */
+
 if ((re->flags & PCRE2_NOJIT) != 0) return 0;
 
-functions = (executable_functions *)re->executable_jit;
+if (executable_allocator_is_working == 0)
+  {
+  /* Checks whether the executable allocator is working. This check
+     might run multiple times in multi-threaded environments, but the
+     result should not be affected by it. */
+  void *ptr = SLJIT_MALLOC_EXEC(32);
+
+  executable_allocator_is_working = -1;
+
+  if (ptr != NULL)
+    {
+    SLJIT_FREE_EXEC(((sljit_u8*)(ptr)) + SLJIT_EXEC_OFFSET(ptr));
+    executable_allocator_is_working = 1;
+    }
+  }
+
+if (executable_allocator_is_working < 0)
+  return PCRE2_ERROR_NOMEMORY;
+
+if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) != 0)
+  options |= PCRE2_JIT_INVALID_UTF;
 
 if ((options & PCRE2_JIT_COMPLETE) != 0 && (functions == NULL
     || functions->executable_funcs[0] == NULL)) {
-  result = jit_compile(code, PCRE2_JIT_COMPLETE);
+  uint32_t excluded_options = (PCRE2_JIT_PARTIAL_SOFT | PCRE2_JIT_PARTIAL_HARD);
+  int result = jit_compile(code, options & ~excluded_options);
   if (result != 0)
     return result;
   }
 
 if ((options & PCRE2_JIT_PARTIAL_SOFT) != 0 && (functions == NULL
     || functions->executable_funcs[1] == NULL)) {
-  result = jit_compile(code, PCRE2_JIT_PARTIAL_SOFT);
+  uint32_t excluded_options = (PCRE2_JIT_COMPLETE | PCRE2_JIT_PARTIAL_HARD);
+  int result = jit_compile(code, options & ~excluded_options);
   if (result != 0)
     return result;
   }
 
 if ((options & PCRE2_JIT_PARTIAL_HARD) != 0 && (functions == NULL
     || functions->executable_funcs[2] == NULL)) {
-  result = jit_compile(code, PCRE2_JIT_PARTIAL_HARD);
+  uint32_t excluded_options = (PCRE2_JIT_COMPLETE | PCRE2_JIT_PARTIAL_SOFT);
+  int result = jit_compile(code, options & ~excluded_options);
   if (result != 0)
     return result;
   }
index 5a66545bae34ceb3943fc9184808205d3a10abe6..7e13b8cfeedca308078d0d31c795ba6385f85b87 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) 2016 University of Cambridge
+          New API code Copyright (c) 2016-2018 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -74,7 +74,6 @@ Arguments:
   options         option bits
   match_data      points to a match_data block
   mcontext        points to a match context
-  jit_stack       points to a JIT stack
 
 Returns:          > 0 => success; value is the number of ovector pairs filled
                   = 0 => success, but ovector is not big enough
@@ -152,8 +151,6 @@ else
   jit_stack = NULL;
   }
 
-/* JIT only need two offsets for each ovector entry. Hence
-   the last 1/3 of the ovector will never be touched. */
 
 max_oveccount = functions->top_bracket;
 if (oveccount > max_oveccount)
@@ -173,7 +170,7 @@ else
 if (rc > (int)oveccount)
   rc = 0;
 match_data->code = re;
-match_data->subject = subject;
+match_data->subject = (rc >= 0 || rc == PCRE2_ERROR_PARTIAL)? subject : NULL;
 match_data->rc = rc;
 match_data->startchar = arguments.startchar_ptr - subject;
 match_data->leftchar = 0;
diff --git a/src/pcre2_jit_neon_inc.h b/src/pcre2_jit_neon_inc.h
new file mode 100644 (file)
index 0000000..55b1f32
--- /dev/null
@@ -0,0 +1,321 @@
+/*************************************************
+*      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
+            This module by Zoltan Herczeg and Sebastian Pop
+     Original API code Copyright (c) 1997-2012 University of Cambridge
+          New API code Copyright (c) 2016-2019 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.
+-----------------------------------------------------------------------------
+*/
+
+# if defined(FFCS)
+#  if defined(FF_UTF)
+#   define FF_FUN ffcs_utf
+#  else
+#   define FF_FUN ffcs
+#  endif
+
+# elif defined(FFCS_2)
+#  if defined(FF_UTF)
+#   define FF_FUN ffcs_2_utf
+#  else
+#   define FF_FUN ffcs_2
+#  endif
+
+# elif defined(FFCS_MASK)
+#  if defined(FF_UTF)
+#   define FF_FUN ffcs_mask_utf
+#  else
+#   define FF_FUN ffcs_mask
+#  endif
+
+# elif defined(FFCPS_0)
+#  if defined (FF_UTF)
+#   define FF_FUN ffcps_0_utf
+#  else
+#   define FF_FUN ffcps_0
+#  endif
+
+# elif defined (FFCPS_1)
+#  if defined (FF_UTF)
+#   define FF_FUN ffcps_1_utf
+#  else
+#   define FF_FUN ffcps_1
+#  endif
+
+# elif defined (FFCPS_DEFAULT)
+#  if defined (FF_UTF)
+#   define FF_FUN ffcps_default_utf
+#  else
+#   define FF_FUN ffcps_default
+#  endif
+# endif
+
+static sljit_u8* SLJIT_FUNC FF_FUN(sljit_u8 *str_end, sljit_u8 *str_ptr, sljit_uw offs1, sljit_uw offs2, sljit_uw chars)
+#undef FF_FUN
+{
+quad_word qw;
+int_char ic;
+ic.x = chars;
+
+#if defined(FFCS)
+sljit_u8 c1 = ic.c.c1;
+vect_t vc1 = VDUPQ(c1);
+
+#elif defined(FFCS_2)
+sljit_u8 c1 = ic.c.c1;
+vect_t vc1 = VDUPQ(c1);
+sljit_u8 c2 = ic.c.c2;
+vect_t vc2 = VDUPQ(c2);
+
+#elif defined(FFCS_MASK)
+sljit_u8 c1 = ic.c.c1;
+vect_t vc1 = VDUPQ(c1);
+sljit_u8 mask = ic.c.c2;
+vect_t vmask = VDUPQ(mask);
+#endif
+
+#if defined(FFCPS)
+compare_type compare1_type = compare_match1;
+compare_type compare2_type = compare_match1;
+vect_t cmp1a, cmp1b, cmp2a, cmp2b;
+const sljit_u32 diff = IN_UCHARS(offs1 - offs2);
+PCRE2_UCHAR char1a = ic.c.c1;
+PCRE2_UCHAR char2a = ic.c.c3;
+
+# ifdef FFCPS_CHAR1A2A
+cmp1a = VDUPQ(char1a);
+cmp2a = VDUPQ(char2a);
+# else
+PCRE2_UCHAR char1b = ic.c.c2;
+PCRE2_UCHAR char2b = ic.c.c4;
+if (char1a == char1b)
+  cmp1a = VDUPQ(char1a);
+else
+  {
+  sljit_u32 bit1 = char1a ^ char1b;
+  if (is_powerof2(bit1))
+    {
+    compare1_type = compare_match1i;
+    cmp1a = VDUPQ(char1a | bit1);
+    cmp1b = VDUPQ(bit1);
+    }
+  else
+    {
+    compare1_type = compare_match2;
+    cmp1a = VDUPQ(char1a);
+    cmp1b = VDUPQ(char1b);
+    }
+  }
+
+if (char2a == char2b)
+  cmp2a = VDUPQ(char2a);
+else
+  {
+  sljit_u32 bit2 = char2a ^ char2b;
+  if (is_powerof2(bit2))
+    {
+    compare2_type = compare_match1i;
+    cmp2a = VDUPQ(char2a | bit2);
+    cmp2b = VDUPQ(bit2);
+    }
+  else
+    {
+    compare2_type = compare_match2;
+    cmp2a = VDUPQ(char2a);
+    cmp2b = VDUPQ(char2b);
+    }
+  }
+# endif
+
+str_ptr += IN_UCHARS(offs1);
+#endif
+
+#if PCRE2_CODE_UNIT_WIDTH != 8
+vect_t char_mask = VDUPQ(0xff);
+#endif
+
+#if defined(FF_UTF)
+restart:;
+#endif
+
+#if defined(FFCPS)
+sljit_u8 *p1 = str_ptr - diff;
+#endif
+sljit_s32 align_offset = ((uint64_t)str_ptr & 0xf);
+str_ptr = (sljit_u8 *) ((uint64_t)str_ptr & ~0xf);
+vect_t data = VLD1Q(str_ptr);
+#if PCRE2_CODE_UNIT_WIDTH != 8
+data = VANDQ(data, char_mask);
+#endif
+#if defined(FFCS)
+vect_t eq = VCEQQ(data, vc1);
+
+#elif defined(FFCS_2)
+vect_t eq1 = VCEQQ(data, vc1);
+vect_t eq2 = VCEQQ(data, vc2);
+vect_t eq = VORRQ(eq1, eq2);    
+
+#elif defined(FFCS_MASK)
+vect_t eq = VORRQ(data, vmask);
+eq = VCEQQ(eq, vc1);
+
+#elif defined(FFCPS)
+# if defined(FFCPS_DIFF1)
+vect_t prev_data = data;
+# endif
+
+vect_t data2;
+if (p1 < str_ptr)
+  {
+  data2 = VLD1Q(str_ptr - diff);
+#if PCRE2_CODE_UNIT_WIDTH != 8
+  data2 = VANDQ(data2, char_mask);
+#endif
+  }
+else
+  data2 = shift_left_n_lanes(data, offs1 - offs2);
+data = fast_forward_char_pair_compare(compare1_type, data, cmp1a, cmp1b);
+data2 = fast_forward_char_pair_compare(compare2_type, data2, cmp2a, cmp2b);
+vect_t eq = VANDQ(data, data2);
+#endif
+
+VST1Q(qw.mem, eq);
+/* Ignore matches before the first STR_PTR. */
+if (align_offset < 8)
+  {
+  qw.dw[0] >>= align_offset * 8;
+  if (qw.dw[0])
+    {
+    str_ptr += align_offset + __builtin_ctzll(qw.dw[0]) / 8;
+    goto match;
+    }
+  if (qw.dw[1])
+    {
+    str_ptr += 8 + __builtin_ctzll(qw.dw[1]) / 8;
+    goto match;
+    }
+  }
+else
+  {
+  qw.dw[1] >>= (align_offset - 8) * 8;
+  if (qw.dw[1])
+    {
+    str_ptr += align_offset + __builtin_ctzll(qw.dw[1]) / 8;
+    goto match;
+    }
+  }
+str_ptr += 16;
+
+while (str_ptr < str_end)
+  {
+  vect_t orig_data = VLD1Q(str_ptr);
+#if PCRE2_CODE_UNIT_WIDTH != 8
+  orig_data = VANDQ(orig_data, char_mask);
+#endif
+  data = orig_data;
+
+#if defined(FFCS)
+  eq = VCEQQ(data, vc1);
+
+#elif defined(FFCS_2)
+  eq1 = VCEQQ(data, vc1);
+  eq2 = VCEQQ(data, vc2);
+  eq = VORRQ(eq1, eq2);    
+
+#elif defined(FFCS_MASK)
+  eq = VORRQ(data, vmask);
+  eq = VCEQQ(eq, vc1);
+#endif
+
+#if defined(FFCPS)
+# if defined (FFCPS_DIFF1)
+  data2 = VEXTQ(prev_data, data, VECTOR_FACTOR - 1);
+# else
+  data2 = VLD1Q(str_ptr - diff);
+#  if PCRE2_CODE_UNIT_WIDTH != 8
+  data2 = VANDQ(data2, char_mask);
+#  endif
+# endif
+
+# ifdef FFCPS_CHAR1A2A
+  data = VCEQQ(data, cmp1a);
+  data2 = VCEQQ(data2, cmp2a);
+# else
+  data = fast_forward_char_pair_compare(compare1_type, data, cmp1a, cmp1b);
+  data2 = fast_forward_char_pair_compare(compare2_type, data2, cmp2a, cmp2b);
+# endif
+
+  eq = VANDQ(data, data2);
+#endif
+
+  VST1Q(qw.mem, eq);
+  if (qw.dw[0])
+    str_ptr += __builtin_ctzll(qw.dw[0]) / 8;
+  else if (qw.dw[1])
+    str_ptr += 8 + __builtin_ctzll(qw.dw[1]) / 8;
+  else {
+    str_ptr += 16;
+#if defined (FFCPS_DIFF1)
+    prev_data = orig_data;
+#endif
+    continue;
+  }
+
+match:;
+  if (str_ptr >= str_end)
+    /* Failed match. */
+    return NULL;
+
+#if defined(FF_UTF)
+  if (utf_continue(str_ptr + IN_UCHARS(-offs1)))
+    {
+    /* Not a match. */
+    str_ptr += IN_UCHARS(1);
+    goto restart;
+    }
+#endif
+
+  /* Match. */
+#if defined (FFCPS)
+  str_ptr -= IN_UCHARS(offs1);
+#endif
+  return str_ptr;
+  }
+
+/* Failed match. */
+return NULL;
+}
diff --git a/src/pcre2_jit_simd_inc.h b/src/pcre2_jit_simd_inc.h
new file mode 100644 (file)
index 0000000..f7d56b2
--- /dev/null
@@ -0,0 +1,993 @@
+/*************************************************
+*      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
+                    This module by Zoltan Herczeg
+     Original API code Copyright (c) 1997-2012 University of Cambridge
+          New API code Copyright (c) 2016-2019 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.
+-----------------------------------------------------------------------------
+*/
+
+#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND)
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+static struct sljit_jump *jump_if_utf_char_start(struct sljit_compiler *compiler, sljit_s32 reg)
+{
+#if PCRE2_CODE_UNIT_WIDTH == 8
+OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xc0);
+return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0x80);
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+OP2(SLJIT_AND, reg, 0, reg, 0, SLJIT_IMM, 0xfc00);
+return CMP(SLJIT_NOT_EQUAL, reg, 0, SLJIT_IMM, 0xdc00);
+#else
+#error "Unknown code width"
+#endif
+}
+#endif
+
+static sljit_s32 character_to_int32(PCRE2_UCHAR chr)
+{
+sljit_u32 value = chr;
+#if PCRE2_CODE_UNIT_WIDTH == 8
+#define SSE2_COMPARE_TYPE_INDEX 0
+return (sljit_s32)((value << 24) | (value << 16) | (value << 8) | value);
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+#define SSE2_COMPARE_TYPE_INDEX 1
+return (sljit_s32)((value << 16) | value);
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+#define SSE2_COMPARE_TYPE_INDEX 2
+return (sljit_s32)(value);
+#else
+#error "Unsupported unit width"
+#endif
+}
+
+static void load_from_mem_sse2(struct sljit_compiler *compiler, sljit_s32 dst_xmm_reg, sljit_s32 src_general_reg, sljit_s8 offset)
+{
+sljit_u8 instruction[5];
+
+SLJIT_ASSERT(dst_xmm_reg < 8);
+SLJIT_ASSERT(src_general_reg < 8);
+
+/* MOVDQA xmm1, xmm2/m128 */
+instruction[0] = ((sljit_u8)offset & 0xf) == 0 ? 0x66 : 0xf3;
+instruction[1] = 0x0f;
+instruction[2] = 0x6f;
+
+if (offset == 0)
+  {
+  instruction[3] = (dst_xmm_reg << 3) | src_general_reg;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  return;
+  }
+
+instruction[3] = 0x40 | (dst_xmm_reg << 3) | src_general_reg;
+instruction[4] = (sljit_u8)offset;
+sljit_emit_op_custom(compiler, instruction, 5);
+}
+
+typedef enum {
+    sse2_compare_match1,
+    sse2_compare_match1i,
+    sse2_compare_match2,
+} sse2_compare_type;
+
+static void fast_forward_char_pair_sse2_compare(struct sljit_compiler *compiler, sse2_compare_type compare_type,
+  int step, sljit_s32 dst_ind, sljit_s32 cmp1_ind, sljit_s32 cmp2_ind, sljit_s32 tmp_ind)
+{
+sljit_u8 instruction[4];
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+
+SLJIT_ASSERT(step >= 0 && step <= 3);
+
+if (compare_type != sse2_compare_match2)
+  {
+  if (step == 0)
+    {
+    if (compare_type == sse2_compare_match1i)
+      {
+      /* POR xmm1, xmm2/m128 */
+      /* instruction[0] = 0x66; */
+      /* instruction[1] = 0x0f; */
+      instruction[2] = 0xeb;
+      instruction[3] = 0xc0 | (dst_ind << 3) | cmp2_ind;
+      sljit_emit_op_custom(compiler, instruction, 4);
+      }
+    return;
+    }
+
+  if (step != 2)
+    return;
+
+  /* PCMPEQB/W/D xmm1, xmm2/m128 */
+  /* instruction[0] = 0x66; */
+  /* instruction[1] = 0x0f; */
+  instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
+  instruction[3] = 0xc0 | (dst_ind << 3) | cmp1_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  return;
+  }
+
+switch (step)
+  {
+  case 0:
+  /* MOVDQA xmm1, xmm2/m128 */
+  /* instruction[0] = 0x66; */
+  /* instruction[1] = 0x0f; */
+  instruction[2] = 0x6f;
+  instruction[3] = 0xc0 | (tmp_ind << 3) | dst_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  return;
+
+  case 1:
+  /* PCMPEQB/W/D xmm1, xmm2/m128 */
+  /* instruction[0] = 0x66; */
+  /* instruction[1] = 0x0f; */
+  instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
+  instruction[3] = 0xc0 | (dst_ind << 3) | cmp1_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  return;
+
+  case 2:
+  /* PCMPEQB/W/D xmm1, xmm2/m128 */
+  /* instruction[0] = 0x66; */
+  /* instruction[1] = 0x0f; */
+  instruction[2] = 0x74 + SSE2_COMPARE_TYPE_INDEX;
+  instruction[3] = 0xc0 | (tmp_ind << 3) | cmp2_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  return;
+
+  case 3:
+  /* POR xmm1, xmm2/m128 */
+  /* instruction[0] = 0x66; */
+  /* instruction[1] = 0x0f; */
+  instruction[2] = 0xeb;
+  instruction[3] = 0xc0 | (dst_ind << 3) | tmp_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  return;
+  }
+}
+
+#define JIT_HAS_FAST_FORWARD_CHAR_SIMD (sljit_has_cpu_feature(SLJIT_HAS_SSE2))
+
+static void fast_forward_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset)
+{
+DEFINE_COMPILER;
+struct sljit_label *start;
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_label *restart;
+#endif
+struct sljit_jump *quit;
+struct sljit_jump *partial_quit[2];
+sse2_compare_type compare_type = sse2_compare_match1;
+sljit_u8 instruction[8];
+sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1);
+sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR);
+sljit_s32 data_ind = 0;
+sljit_s32 tmp_ind = 1;
+sljit_s32 cmp1_ind = 2;
+sljit_s32 cmp2_ind = 3;
+sljit_u32 bit = 0;
+int i;
+
+SLJIT_UNUSED_ARG(offset);
+
+if (char1 != char2)
+  {
+  bit = char1 ^ char2;
+  compare_type = sse2_compare_match1i;
+
+  if (!is_powerof2(bit))
+    {
+    bit = 0;
+    compare_type = sse2_compare_match2;
+    }
+  }
+
+partial_quit[0] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+  add_jump(compiler, &common->failed_match, partial_quit[0]);
+
+/* First part (unaligned start) */
+
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1 | bit));
+
+SLJIT_ASSERT(tmp1_reg_ind < 8);
+
+/* MOVD xmm, r/m32 */
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+instruction[2] = 0x6e;
+instruction[3] = 0xc0 | (cmp1_ind << 3) | tmp1_reg_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 | (cmp2_ind << 3) | tmp1_reg_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
+
+/* PSHUFD xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x70;
+instruction[3] = 0xc0 | (cmp1_ind << 3) | cmp1_ind;
+instruction[4] = 0;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+if (char1 != char2)
+  {
+  /* PSHUFD xmm1, xmm2/m128, imm8 */
+  instruction[3] = 0xc0 | (cmp2_ind << 3) | cmp2_ind;
+  sljit_emit_op_custom(compiler, instruction, 5);
+  }
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+restart = LABEL();
+#endif
+OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf);
+OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf);
+
+load_from_mem_sse2(compiler, data_ind, str_ptr_reg_ind, 0);
+for (i = 0; i < 4; i++)
+  fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+/* PMOVMSKB reg, xmm */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xd7;
+instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | data_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+quit = CMP(SLJIT_NOT_ZERO, TMP1, 0, SLJIT_IMM, 0);
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+
+/* Second part (aligned) */
+start = LABEL();
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
+
+partial_quit[1] = CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+  add_jump(compiler, &common->failed_match, partial_quit[1]);
+
+load_from_mem_sse2(compiler, data_ind, str_ptr_reg_ind, 0);
+for (i = 0; i < 4; i++)
+  fast_forward_char_pair_sse2_compare(compiler, compare_type, i, data_ind, cmp1_ind, cmp2_ind, tmp_ind);
+
+/* PMOVMSKB reg, xmm */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xd7;
+instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | data_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+CMPTO(SLJIT_ZERO, TMP1, 0, SLJIT_IMM, 0, start);
+
+JUMPHERE(quit);
+
+/* BSF r32, r/m32 */
+instruction[0] = 0x0f;
+instruction[1] = 0xbc;
+instruction[2] = 0xc0 | (tmp1_reg_ind << 3) | tmp1_reg_ind;
+sljit_emit_op_custom(compiler, instruction, 3);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+
+if (common->mode != PCRE2_JIT_COMPLETE)
+  {
+  JUMPHERE(partial_quit[0]);
+  JUMPHERE(partial_quit[1]);
+  OP2(SLJIT_SUB | SLJIT_SET_GREATER, SLJIT_UNUSED, 0, STR_PTR, 0, STR_END, 0);
+  CMOV(SLJIT_GREATER, STR_PTR, STR_END, 0);
+  }
+else
+  add_jump(compiler, &common->failed_match, 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));
+
+  quit = jump_if_utf_char_start(compiler, TMP1);
+
+  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+  add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+  OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
+  JUMPTO(SLJIT_JUMP, restart);
+
+  JUMPHERE(quit);
+  }
+#endif
+}
+
+#ifndef _WIN64
+
+static SLJIT_INLINE sljit_u32 max_fast_forward_char_pair_offset(void)
+{
+#if PCRE2_CODE_UNIT_WIDTH == 8
+return 15;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+return 7;
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+return 3;
+#else
+#error "Unsupported unit width"
+#endif
+}
+
+#define JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD (sljit_has_cpu_feature(SLJIT_HAS_SSE2))
+
+static void fast_forward_char_pair_simd(compiler_common *common, sljit_s32 offs1,
+  PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b)
+{
+DEFINE_COMPILER;
+sse2_compare_type compare1_type = sse2_compare_match1;
+sse2_compare_type compare2_type = sse2_compare_match1;
+sljit_u32 bit1 = 0;
+sljit_u32 bit2 = 0;
+sljit_u32 diff = IN_UCHARS(offs1 - offs2);
+sljit_s32 tmp1_reg_ind = sljit_get_register_index(TMP1);
+sljit_s32 tmp2_reg_ind = sljit_get_register_index(TMP2);
+sljit_s32 str_ptr_reg_ind = sljit_get_register_index(STR_PTR);
+sljit_s32 data1_ind = 0;
+sljit_s32 data2_ind = 1;
+sljit_s32 tmp1_ind = 2;
+sljit_s32 tmp2_ind = 3;
+sljit_s32 cmp1a_ind = 4;
+sljit_s32 cmp1b_ind = 5;
+sljit_s32 cmp2a_ind = 6;
+sljit_s32 cmp2b_ind = 7;
+struct sljit_label *start;
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+struct sljit_label *restart;
+#endif
+struct sljit_jump *jump[2];
+sljit_u8 instruction[8];
+int i;
+
+SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2);
+SLJIT_ASSERT(diff <= IN_UCHARS(max_fast_forward_char_pair_offset()));
+SLJIT_ASSERT(tmp1_reg_ind < 8 && tmp2_reg_ind == 1);
+
+/* Initialize. */
+if (common->match_end_ptr != 0)
+  {
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+  OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
+  OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, IN_UCHARS(offs1 + 1));
+
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, TMP1, 0, STR_END, 0);
+  CMOV(SLJIT_LESS, STR_END, TMP1, 0);
+  }
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1));
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+/* MOVD xmm, r/m32 */
+instruction[0] = 0x66;
+instruction[1] = 0x0f;
+instruction[2] = 0x6e;
+
+if (char1a == char1b)
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a));
+else
+  {
+  bit1 = char1a ^ char1b;
+  if (is_powerof2(bit1))
+    {
+    compare1_type = sse2_compare_match1i;
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a | bit1));
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit1));
+    }
+  else
+    {
+    compare1_type = sse2_compare_match2;
+    bit1 = 0;
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char1a));
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char1b));
+    }
+  }
+
+instruction[3] = 0xc0 | (cmp1a_ind << 3) | tmp1_reg_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (char1a != char1b)
+  {
+  instruction[3] = 0xc0 | (cmp1b_ind << 3) | tmp2_reg_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+if (char2a == char2b)
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a));
+else
+  {
+  bit2 = char2a ^ char2b;
+  if (is_powerof2(bit2))
+    {
+    compare2_type = sse2_compare_match1i;
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a | bit2));
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(bit2));
+    }
+  else
+    {
+    compare2_type = sse2_compare_match2;
+    bit2 = 0;
+    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, character_to_int32(char2a));
+    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, character_to_int32(char2b));
+    }
+  }
+
+instruction[3] = 0xc0 | (cmp2a_ind << 3) | tmp1_reg_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+if (char2a != char2b)
+  {
+  instruction[3] = 0xc0 | (cmp2b_ind << 3) | tmp2_reg_ind;
+  sljit_emit_op_custom(compiler, instruction, 4);
+  }
+
+/* PSHUFD xmm1, xmm2/m128, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x70;
+instruction[4] = 0;
+
+instruction[3] = 0xc0 | (cmp1a_ind << 3) | cmp1a_ind;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+if (char1a != char1b)
+  {
+  instruction[3] = 0xc0 | (cmp1b_ind << 3) | cmp1b_ind;
+  sljit_emit_op_custom(compiler, instruction, 5);
+  }
+
+instruction[3] = 0xc0 | (cmp2a_ind << 3) | cmp2a_ind;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+if (char2a != char2b)
+  {
+  instruction[3] = 0xc0 | (cmp2b_ind << 3) | cmp2b_ind;
+  sljit_emit_op_custom(compiler, instruction, 5);
+  }
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+restart = LABEL();
+#endif
+
+OP2(SLJIT_SUB, TMP1, 0, STR_PTR, 0, SLJIT_IMM, diff);
+OP1(SLJIT_MOV, TMP2, 0, STR_PTR, 0);
+OP2(SLJIT_AND, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, ~0xf);
+
+load_from_mem_sse2(compiler, data1_ind, str_ptr_reg_ind, 0);
+
+jump[0] = CMP(SLJIT_GREATER_EQUAL, TMP1, 0, STR_PTR, 0);
+
+load_from_mem_sse2(compiler, data2_ind, str_ptr_reg_ind, -(sljit_s8)diff);
+jump[1] = JUMP(SLJIT_JUMP);
+
+JUMPHERE(jump[0]);
+
+/* MOVDQA xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x6f;
+instruction[3] = 0xc0 | (data2_ind << 3) | data1_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+/* PSLLDQ xmm1, imm8 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0x73;
+instruction[3] = 0xc0 | (7 << 3) | data2_ind;
+instruction[4] = diff;
+sljit_emit_op_custom(compiler, instruction, 5);
+
+JUMPHERE(jump[1]);
+
+OP2(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_IMM, 0xf);
+
+for (i = 0; i < 4; i++)
+  {
+  fast_forward_char_pair_sse2_compare(compiler, compare2_type, i, data2_ind, cmp2a_ind, cmp2b_ind, tmp2_ind);
+  fast_forward_char_pair_sse2_compare(compiler, compare1_type, i, data1_ind, cmp1a_ind, cmp1b_ind, tmp1_ind);
+  }
+
+/* PAND xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xdb;
+instruction[3] = 0xc0 | (data1_ind << 3) | data2_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+/* PMOVMSKB reg, xmm */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xd7;
+instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | 0;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+/* Ignore matches before the first STR_PTR. */
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, TMP2, 0);
+
+jump[0] = CMP(SLJIT_NOT_ZERO, TMP1, 0, SLJIT_IMM, 0);
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, TMP2, 0);
+
+/* Main loop. */
+start = LABEL();
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 16);
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+load_from_mem_sse2(compiler, data1_ind, str_ptr_reg_ind, 0);
+load_from_mem_sse2(compiler, data2_ind, str_ptr_reg_ind, -(sljit_s8)diff);
+
+for (i = 0; i < 4; i++)
+  {
+  fast_forward_char_pair_sse2_compare(compiler, compare1_type, i, data1_ind, cmp1a_ind, cmp1b_ind, tmp2_ind);
+  fast_forward_char_pair_sse2_compare(compiler, compare2_type, i, data2_ind, cmp2a_ind, cmp2b_ind, tmp1_ind);
+  }
+
+/* PAND xmm1, xmm2/m128 */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xdb;
+instruction[3] = 0xc0 | (data1_ind << 3) | data2_ind;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+/* PMOVMSKB reg, xmm */
+/* instruction[0] = 0x66; */
+/* instruction[1] = 0x0f; */
+instruction[2] = 0xd7;
+instruction[3] = 0xc0 | (tmp1_reg_ind << 3) | 0;
+sljit_emit_op_custom(compiler, instruction, 4);
+
+CMPTO(SLJIT_ZERO, TMP1, 0, SLJIT_IMM, 0, start);
+
+JUMPHERE(jump[0]);
+
+/* BSF r32, r/m32 */
+instruction[0] = 0x0f;
+instruction[1] = 0xbc;
+instruction[2] = 0xc0 | (tmp1_reg_ind << 3) | tmp1_reg_ind;
+sljit_emit_op_custom(compiler, instruction, 3);
+
+OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
+
+add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0));
+
+if (common->match_end_ptr != 0)
+  OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+if (common->utf)
+  {
+  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-offs1));
+
+  jump[0] = jump_if_utf_char_start(compiler, TMP1);
+
+  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
+  CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, restart);
+
+  add_jump(compiler, &common->failed_match, JUMP(SLJIT_JUMP));
+
+  JUMPHERE(jump[0]);
+  }
+#endif
+
+OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(offs1));
+
+if (common->match_end_ptr != 0)
+  OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
+}
+
+#endif /* !_WIN64 */
+
+#undef SSE2_COMPARE_TYPE_INDEX
+
+#endif /* SLJIT_CONFIG_X86 && !SUPPORT_VALGRIND */
+
+#if (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64 && (defined __ARM_NEON || defined __ARM_NEON__))
+
+#include <arm_neon.h>
+
+typedef union {
+  unsigned int x;
+  struct { unsigned char c1, c2, c3, c4; } c;
+} int_char;
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+static SLJIT_INLINE int utf_continue(sljit_u8 *s)
+{
+#if PCRE2_CODE_UNIT_WIDTH == 8
+return (*s & 0xc0) == 0x80;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+return (*s & 0xfc00) == 0xdc00;
+#else
+#error "Unknown code width"
+#endif
+}
+#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 */
+
+#if PCRE2_CODE_UNIT_WIDTH == 8
+# define VECTOR_FACTOR 16
+# define vect_t uint8x16_t
+# define VLD1Q(X) vld1q_u8((sljit_u8 *)(X))
+# define VCEQQ vceqq_u8
+# define VORRQ vorrq_u8
+# define VST1Q vst1q_u8
+# define VDUPQ vdupq_n_u8
+# define VEXTQ vextq_u8
+# define VANDQ vandq_u8
+typedef union {
+       uint8_t mem[16];
+       uint64_t dw[2];
+} quad_word;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+# define VECTOR_FACTOR 8
+# define vect_t uint16x8_t
+# define VLD1Q(X) vld1q_u16((sljit_u16 *)(X))
+# define VCEQQ vceqq_u16
+# define VORRQ vorrq_u16
+# define VST1Q vst1q_u16
+# define VDUPQ vdupq_n_u16
+# define VEXTQ vextq_u16
+# define VANDQ vandq_u16
+typedef union {
+       uint16_t mem[8];
+       uint64_t dw[2];
+} quad_word;
+#else
+# define VECTOR_FACTOR 4
+# define vect_t uint32x4_t
+# define VLD1Q(X) vld1q_u32((sljit_u32 *)(X))
+# define VCEQQ vceqq_u32
+# define VORRQ vorrq_u32
+# define VST1Q vst1q_u32
+# define VDUPQ vdupq_n_u32
+# define VEXTQ vextq_u32
+# define VANDQ vandq_u32
+typedef union {
+       uint32_t mem[4];
+       uint64_t dw[2];
+} quad_word;
+#endif
+
+#define FFCS
+#include "pcre2_jit_neon_inc.h"
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+# define FF_UTF
+# include "pcre2_jit_neon_inc.h"
+# undef FF_UTF
+#endif
+#undef FFCS
+
+#define FFCS_2
+#include "pcre2_jit_neon_inc.h"
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+# define FF_UTF
+# include "pcre2_jit_neon_inc.h"
+# undef FF_UTF
+#endif
+#undef FFCS_2
+
+#define FFCS_MASK
+#include "pcre2_jit_neon_inc.h"
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+# define FF_UTF
+# include "pcre2_jit_neon_inc.h"
+# undef FF_UTF
+#endif
+#undef FFCS_MASK
+
+#define JIT_HAS_FAST_FORWARD_CHAR_SIMD 1
+
+static void fast_forward_char_simd(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2, sljit_s32 offset)
+{
+DEFINE_COMPILER;
+int_char ic;
+struct sljit_jump *partial_quit;
+/* Save temporary registers. */
+OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STR_PTR, 0);
+OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, TMP3, 0);
+
+/* Prepare function arguments */
+OP1(SLJIT_MOV, SLJIT_R0, 0, STR_END, 0);
+OP1(SLJIT_MOV, SLJIT_R1, 0, STR_PTR, 0);
+OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_IMM, offset);
+
+if (char1 == char2)
+  {
+    ic.c.c1 = char1;
+    ic.c.c2 = char2;
+    OP1(SLJIT_MOV, SLJIT_R4, 0, SLJIT_IMM, ic.x);
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+  if (common->utf && offset > 0)
+    sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                     SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs_utf));
+  else
+    sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                     SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs));
+#else
+  sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                   SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs));
+#endif
+  }
+else
+  {
+  PCRE2_UCHAR mask = char1 ^ char2;
+  if (is_powerof2(mask))
+    {
+    ic.c.c1 = char1 | mask;
+    ic.c.c2 = mask;
+    OP1(SLJIT_MOV, SLJIT_R4, 0, SLJIT_IMM, ic.x);
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+    if (common->utf && offset > 0)
+      sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                       SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs_mask_utf));
+    else
+      sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                       SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs_mask));
+#else
+    sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                     SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs_mask));
+#endif
+    }
+  else
+    {
+      ic.c.c1 = char1;
+      ic.c.c2 = char2;
+      OP1(SLJIT_MOV, SLJIT_R4, 0, SLJIT_IMM, ic.x);
+
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+    if (common->utf && offset > 0)
+      sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                       SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs_2_utf));
+    else
+      sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                       SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs_2));
+#else
+    sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(UW) | SLJIT_ARG3(UW) | SLJIT_ARG4(UW),
+                     SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcs_2));
+#endif
+    }
+  }
+/* Restore registers. */
+OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
+OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1);
+
+/* Check return value. */
+partial_quit = CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0);
+if (common->mode == PCRE2_JIT_COMPLETE)
+  add_jump(compiler, &common->failed_match, partial_quit);
+
+/* Fast forward STR_PTR to the result of memchr. */
+OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0);
+
+if (common->mode != PCRE2_JIT_COMPLETE)
+  JUMPHERE(partial_quit);
+}
+
+typedef enum {
+  compare_match1,
+  compare_match1i,
+  compare_match2,
+} compare_type;
+
+static inline vect_t fast_forward_char_pair_compare(compare_type ctype, vect_t dst, vect_t cmp1, vect_t cmp2)
+{
+if (ctype == compare_match2)
+  {
+  vect_t tmp = dst;
+  dst = VCEQQ(dst, cmp1);
+  tmp = VCEQQ(tmp, cmp2);
+  dst = VORRQ(dst, tmp);
+  return dst;
+  }
+
+if (ctype == compare_match1i)
+  dst = VORRQ(dst, cmp2);
+dst = VCEQQ(dst, cmp1);
+return dst;
+}
+
+static SLJIT_INLINE sljit_u32 max_fast_forward_char_pair_offset(void)
+{
+#if PCRE2_CODE_UNIT_WIDTH == 8
+return 15;
+#elif PCRE2_CODE_UNIT_WIDTH == 16
+return 7;
+#elif PCRE2_CODE_UNIT_WIDTH == 32
+return 3;
+#else
+#error "Unsupported unit width"
+#endif
+}
+
+/* ARM doesn't have a shift left across lanes. */
+static SLJIT_INLINE vect_t shift_left_n_lanes(vect_t a, sljit_u8 n)
+{
+vect_t zero = VDUPQ(0);
+SLJIT_ASSERT(0 < n && n < VECTOR_FACTOR);
+/* VEXTQ takes an immediate as last argument. */
+#define C(X) case X: return VEXTQ(zero, a, VECTOR_FACTOR - X);
+switch (n)
+  {
+  C(1); C(2); C(3);
+#if PCRE2_CODE_UNIT_WIDTH != 32
+  C(4); C(5); C(6); C(7);
+# if PCRE2_CODE_UNIT_WIDTH != 16
+  C(8); C(9); C(10); C(11); C(12); C(13); C(14); C(15);
+# endif
+#endif
+  default:
+    /* Based on the ASSERT(0 < n && n < VECTOR_FACTOR) above, this won't
+       happen. The return is still here for compilers to not warn. */
+    return a;
+  }
+}
+
+#define FFCPS
+#define FFCPS_DIFF1
+#define FFCPS_CHAR1A2A
+
+#define FFCPS_0
+#include "pcre2_jit_neon_inc.h"
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+# define FF_UTF
+# include "pcre2_jit_neon_inc.h"
+# undef FF_UTF
+#endif
+#undef FFCPS_0
+
+#undef FFCPS_CHAR1A2A
+
+#define FFCPS_1
+#include "pcre2_jit_neon_inc.h"
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+# define FF_UTF
+# include "pcre2_jit_neon_inc.h"
+# undef FF_UTF
+#endif
+#undef FFCPS_1
+
+#undef FFCPS_DIFF1
+
+#define FFCPS_DEFAULT
+#include "pcre2_jit_neon_inc.h"
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+# define FF_UTF
+# include "pcre2_jit_neon_inc.h"
+# undef FF_UTF
+#endif
+#undef FFCPS
+
+#define JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD 1
+
+static void fast_forward_char_pair_simd(compiler_common *common, sljit_s32 offs1,
+  PCRE2_UCHAR char1a, PCRE2_UCHAR char1b, sljit_s32 offs2, PCRE2_UCHAR char2a, PCRE2_UCHAR char2b)
+{
+DEFINE_COMPILER;
+sljit_u32 diff = IN_UCHARS(offs1 - offs2);
+struct sljit_jump *partial_quit;
+int_char ic;
+SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2);
+SLJIT_ASSERT(diff <= IN_UCHARS(max_fast_forward_char_pair_offset()));
+SLJIT_ASSERT(compiler->scratches == 5);
+
+/* Save temporary register STR_PTR. */
+OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, STR_PTR, 0);
+
+/* Prepare arguments for the function call. */
+if (common->match_end_ptr == 0)
+   OP1(SLJIT_MOV, SLJIT_R0, 0, STR_END, 0);
+else
+  {
+  OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
+  OP2(SLJIT_ADD, SLJIT_R0, 0, SLJIT_R0, 0, SLJIT_IMM, IN_UCHARS(offs1 + 1));
+
+  OP2(SLJIT_SUB | SLJIT_SET_LESS, SLJIT_UNUSED, 0, STR_END, 0, SLJIT_R0, 0);
+  CMOV(SLJIT_LESS, SLJIT_R0, STR_END, 0);
+  }
+
+OP1(SLJIT_MOV, SLJIT_R1, 0, STR_PTR, 0); 
+OP1(SLJIT_MOV_S32, SLJIT_R2, 0, SLJIT_IMM, offs1);
+OP1(SLJIT_MOV_S32, SLJIT_R3, 0, SLJIT_IMM, offs2);
+ic.c.c1 = char1a;
+ic.c.c2 = char1b;
+ic.c.c3 = char2a;
+ic.c.c4 = char2b;
+OP1(SLJIT_MOV_U32, SLJIT_R4, 0, SLJIT_IMM, ic.x);
+
+if (diff == 1) {
+  if (char1a == char1b && char2a == char2b) {
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+    if (common->utf)
+      sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW) | SLJIT_ARG3(SW) | SLJIT_ARG4(SW),
+                       SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcps_0_utf));
+    else
+#endif
+      sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW) | SLJIT_ARG3(SW) | SLJIT_ARG4(SW),
+                       SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcps_0));
+  } else {
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+    if (common->utf)
+      sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW) | SLJIT_ARG3(SW) | SLJIT_ARG4(SW),
+                       SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcps_1_utf));
+    else
+#endif
+      sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW) | SLJIT_ARG3(SW) | SLJIT_ARG4(SW),
+                       SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcps_1));
+  }
+} else {
+#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
+  if (common->utf)
+    sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW) | SLJIT_ARG3(SW) | SLJIT_ARG4(SW),
+                     SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcps_default_utf));
+  else
+#endif
+    sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_RET(SW) | SLJIT_ARG1(SW) | SLJIT_ARG2(SW) | SLJIT_ARG3(SW) | SLJIT_ARG4(SW),
+                     SLJIT_IMM, SLJIT_FUNC_OFFSET(ffcps_default));
+}
+
+/* Restore STR_PTR register. */
+OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
+
+/* Check return value. */
+partial_quit = CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0);
+add_jump(compiler, &common->failed_match, partial_quit);
+
+/* Fast forward STR_PTR to the result of memchr. */
+OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0);
+
+JUMPHERE(partial_quit);
+}
+
+#endif /* SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64 */
index a28e9a0b183e123619eb9427268d4ea30a86b256..a9b3880dd075cf11042f5ee4327763a32780acd9 100644 (file)
@@ -93,6 +93,9 @@ POSSIBILITY OF SUCH DAMAGE.
 */
 
 static int regression_tests(void);
+static int invalid_utf8_regression_tests(void);
+static int invalid_utf16_regression_tests(void);
+static int invalid_utf32_regression_tests(void);
 
 int main(void)
 {
@@ -108,7 +111,10 @@ int main(void)
                printf("JIT must be enabled to run pcre_jit_test\n");
                return 1;
        }
-       return regression_tests();
+       return regression_tests()
+               | invalid_utf8_regression_tests()
+               | invalid_utf16_regression_tests()
+               | invalid_utf32_regression_tests();
 }
 
 /* --------------------------------------------------------------------------------------- */
@@ -184,12 +190,14 @@ static struct regression_test_case regression_test_cases[] = {
        { CM, A, 0, 0, "\\Ca", "CDA" },
        { M, A, 0, 0 | F_NOMATCH, "\\Cx", "cda" },
        { CM, A, 0, 0 | F_NOMATCH, "\\Cx", "CDA" },
-#endif
+#endif /* !NEVER_BACKSLASH_C */
        { CMUP, A, 0, 0, "\xf0\x90\x90\x80\xf0\x90\x90\xa8", "\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
        { 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" },
+       { PCRE2_AUTO_CALLOUT, A, 0, 0, "12345678901234567890123456789012345678901234567890123456789012345678901234567890",
+               "12345678901234567890123456789012345678901234567890123456789012345678901234567890" },
 
        /* Assertions. */
        { MU, A, 0, 0, "\\b[^A]", "A_B#" },
@@ -262,6 +270,9 @@ static struct regression_test_case regression_test_cases[] = {
        { MU, A, 0, 0, "\xc6\x82\xc6\x82|\xc7\x83\xc7\x83|\xc8\x84\xc8\x84", "\xf1\x83\x82\x82\xc8\x84\xc8\x84" },
        { U, A, 0, 0, "\xe1\x81\x80|\xe2\x82\x80|\xe4\x84\x80", "\xdf\xbf\xc2\x80\xe4\x84\x80" },
        { U, A, 0, 0, "(?:\xe1\x81\x80|\xe2\x82\x80|\xe4\x84\x80)#", "\xdf\xbf\xc2\x80#\xe4\x84\x80#" },
+       { CM, A, 0, 0, "ab|cd", "CD" },
+       { CM, A, 0, 0, "a1277|a1377|bX487", "bx487" },
+       { CM, A, 0, 0, "a1277|a1377|bx487", "bX487" },
 
        /* Greedy and non-greedy ? operators. */
        { MU, A, 0, 0, "(?:a)?a", "laab" },
@@ -374,6 +385,7 @@ static struct regression_test_case regression_test_cases[] = {
        { MU, A, 0, 0, "[^\\x{801}-\\x{fffe}]+", "\xe0\xa0\x81#\xc3\xa9\xf0\x90\x90\x80\xe0\xa0\x80\xef\xbf\xbf\xef\xbf\xbe" },
        { MU, A, 0, 0, "[\\x{10001}-\\x{10fffe}]+", "#\xc3\xa9\xe2\xb1\xa5\xf0\x90\x80\x80\xf0\x90\x80\x81\xf4\x8f\xbf\xbe\xf4\x8f\xbf\xbf" },
        { MU, A, 0, 0, "[^\\x{10001}-\\x{10fffe}]+", "\xf0\x90\x80\x81#\xc3\xa9\xe2\xb1\xa5\xf0\x90\x80\x80\xf4\x8f\xbf\xbf\xf4\x8f\xbf\xbe" },
+       { CMU, A, 0, 0 | F_NOMATCH, "^[\\x{0100}-\\x{017f}]", " " },
 
        /* Unicode properties. */
        { MUP, A, 0, 0, "[1-5\xc3\xa9\\w]", "\xc3\xa1_" },
@@ -858,6 +870,18 @@ static struct regression_test_case regression_test_cases[] = {
        { MU, A, 0, 0, "(a(*COMMIT)(?:b|bb)|c(*ACCEPT)d|dd){0}_(?1)+_", "_ax_ _cd_ _abbb_ _abcd_ _abbcdd_" },
        { MU, A, 0, 0, "((.)(?:.|(*COMMIT)\\2{3}(*ACCEPT).*|.*)){0}_(?1){0,4}_", "_aaaabbbbccccddd_ _aaaabbbbccccdddd_" },
 
+#ifdef SUPPORT_UNICODE
+       /* Script runs and iterations. */
+       { MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)*#", "!abcdefghijklmno!abcdefghijklmno!abcdef#" },
+       { MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)+#", "!abcdefghijklmno!abcdefghijklmno!abcdef#" },
+       { MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)*?#", "!abcdefghijklmno!abcdefghijklmno!abcdef#" },
+       { MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)+?#", "!abcdefghijklmno!abcdefghijklmno!abcdef#" },
+       { MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)*+#", "!abcdefghijklmno!abcdefghijklmno!abcdef#" },
+       { MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)++#", "!abcdefghijklmno!abcdefghijklmno!abcdef#" },
+       { MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)?#", "!ab!abc!ab!ab#" },
+       { MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)??#", "!ab!abc!ab!ab#" },
+#endif
+
        /* Deep recursion. */
        { MU, A, 0, 0, "((((?:(?:(?:\\w)+)?)*|(?>\\w)+?)+|(?>\\w)?\?)*)?\\s", "aaaaa+ " },
        { MU, A, 0, 0, "(?:((?:(?:(?:\\w*?)+)??|(?>\\w)?|\\w*+)*)+)+?\\s", "aa+ " },
@@ -1163,7 +1187,7 @@ static int regression_tests(void)
 #elif defined SUPPORT_PCRE2_32
        PCRE2_UCHAR32 cpu_info[128];
 #endif
-#if defined SUPPORT_UTF && ((defined(SUPPORT_PCRE2_8) + defined(SUPPORT_PCRE2_16) + defined(SUPPORT_PCRE2_32)) >= 2)
+#if defined SUPPORT_UNICODE && ((defined(SUPPORT_PCRE2_8) + defined(SUPPORT_PCRE2_16) + defined(SUPPORT_PCRE2_32)) >= 2)
        int return_value;
 #endif
 
@@ -1331,9 +1355,8 @@ static int regression_tests(void)
                                ovector8_2[i] = -2;
                }
                if (re8) {
-                        (void)pcre2_set_match_limit_8(mcontext8, 10000000);
                        return_value8[1] = pcre2_match_8(re8, (PCRE2_SPTR8)current->input, strlen(current->input),
-                               current->start_offset & OFFSET_MASK, current->match_options, mdata8_2, mcontext8);
+                               current->start_offset & OFFSET_MASK, current->match_options, mdata8_2, NULL);
 
                        if (pcre2_jit_compile_8(re8, jit_compile_mode)) {
                                printf("\n8 bit: JIT compiler does not support \"%s\"\n", current->pattern);
@@ -1376,9 +1399,8 @@ static int regression_tests(void)
                        else
                                length16 = copy_char8_to_char16((PCRE2_SPTR8)current->input, regtest_buf16, REGTEST_MAX_LENGTH16);
 
-                        (void)pcre2_set_match_limit_16(mcontext16, 10000000);
                        return_value16[1] = pcre2_match_16(re16, regtest_buf16, length16,
-                               current->start_offset & OFFSET_MASK, current->match_options, mdata16_2, mcontext16);
+                               current->start_offset & OFFSET_MASK, current->match_options, mdata16_2, NULL);
 
                        if (pcre2_jit_compile_16(re16, jit_compile_mode)) {
                                printf("\n16 bit: JIT compiler does not support \"%s\"\n", current->pattern);
@@ -1421,9 +1443,8 @@ static int regression_tests(void)
                        else
                                length32 = copy_char8_to_char32((PCRE2_SPTR8)current->input, regtest_buf32, REGTEST_MAX_LENGTH32);
 
-                        (void)pcre2_set_match_limit_32(mcontext32, 10000000);
                        return_value32[1] = pcre2_match_32(re32, regtest_buf32, length32,
-                               current->start_offset & OFFSET_MASK, current->match_options, mdata32_2, mcontext32);
+                               current->start_offset & OFFSET_MASK, current->match_options, mdata32_2, NULL);
 
                        if (pcre2_jit_compile_32(re32, jit_compile_mode)) {
                                printf("\n32 bit: JIT compiler does not support \"%s\"\n", current->pattern);
@@ -1451,7 +1472,7 @@ static int regression_tests(void)
 
                is_successful = 1;
                if (!(current->start_offset & F_DIFF)) {
-#if defined SUPPORT_UTF && ((defined(SUPPORT_PCRE2_8) + defined(SUPPORT_PCRE2_16) + defined(SUPPORT_PCRE2_32)) >= 2)
+#if defined SUPPORT_UNICODE && ((defined(SUPPORT_PCRE2_8) + defined(SUPPORT_PCRE2_16) + defined(SUPPORT_PCRE2_32)) >= 2)
                        if (!(current->start_offset & F_FORCECONV)) {
 
                                /* All results must be the same. */
@@ -1500,8 +1521,8 @@ static int regression_tests(void)
                                        is_successful = 0;
                                } else
 #endif
-                               if (return_value >= 0 || return_value == PCRE_ERROR_PARTIAL) {
-                                       if (return_value == PCRE_ERROR_PARTIAL) {
+                               if (return_value >= 0 || return_value == PCRE2_ERROR_PARTIAL) {
+                                       if (return_value == PCRE2_ERROR_PARTIAL) {
                                                return_value = 2;
                                        } else {
                                                return_value *= 2;
@@ -1516,20 +1537,20 @@ static int regression_tests(void)
                                        return_value32[0] = return_value;
 #endif
                                        /* Transform back the results. */
-                                       if (current->flags & PCRE_UTF8) {
+                                       if (current->compile_options & PCRE2_UTF) {
 #ifdef SUPPORT_PCRE2_16
                                                for (i = 0; i < return_value; ++i) {
-                                                       if (ovector16_1[i] >= 0)
+                                                       if (ovector16_1[i] != PCRE2_UNSET)
                                                                ovector16_1[i] = regtest_offsetmap16[ovector16_1[i]];
-                                                       if (ovector16_2[i] >= 0)
+                                                       if (ovector16_2[i] != PCRE2_UNSET)
                                                                ovector16_2[i] = regtest_offsetmap16[ovector16_2[i]];
                                                }
 #endif
 #ifdef SUPPORT_PCRE2_32
                                                for (i = 0; i < return_value; ++i) {
-                                                       if (ovector32_1[i] >= 0)
+                                                       if (ovector32_1[i] != PCRE2_UNSET)
                                                                ovector32_1[i] = regtest_offsetmap32[ovector32_1[i]];
-                                                       if (ovector32_2[i] >= 0)
+                                                       if (ovector32_2[i] != PCRE2_UNSET)
                                                                ovector32_2[i] = regtest_offsetmap32[ovector32_2[i]];
                                                }
 #endif
@@ -1539,7 +1560,7 @@ static int regression_tests(void)
 #if defined SUPPORT_PCRE2_8 && defined SUPPORT_PCRE2_16
                                                if (ovector8_1[i] != ovector8_2[i] || ovector8_1[i] != ovector16_1[i] || ovector8_1[i] != ovector16_2[i]) {
                                                        printf("\n8 and 16 bit: Ovector[%d] value differs(J8:%d,I8:%d,J16:%d,I16:%d): [%d] '%s' @ '%s' \n",
-                                                               i, ovector8_1[i], ovector8_2[i], ovector16_1[i], ovector16_2[i],
+                                                               i, (int)ovector8_1[i], (int)ovector8_2[i], (int)ovector16_1[i], (int)ovector16_2[i],
                                                                total, current->pattern, current->input);
                                                        is_successful = 0;
                                                }
@@ -1547,7 +1568,7 @@ static int regression_tests(void)
 #if defined SUPPORT_PCRE2_8 && defined SUPPORT_PCRE2_32
                                                if (ovector8_1[i] != ovector8_2[i] || ovector8_1[i] != ovector32_1[i] || ovector8_1[i] != ovector32_2[i]) {
                                                        printf("\n8 and 32 bit: Ovector[%d] value differs(J8:%d,I8:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n",
-                                                               i, ovector8_1[i], ovector8_2[i], ovector32_1[i], ovector32_2[i],
+                                                               i, (int)ovector8_1[i], (int)ovector8_2[i], (int)ovector32_1[i], (int)ovector32_2[i],
                                                                total, current->pattern, current->input);
                                                        is_successful = 0;
                                                }
@@ -1555,7 +1576,7 @@ static int regression_tests(void)
 #if defined SUPPORT_PCRE2_16 && defined SUPPORT_PCRE2_32
                                                if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector32_1[i] || ovector16_1[i] != ovector32_2[i]) {
                                                        printf("\n16 and 32 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n",
-                                                               i, ovector16_1[i], ovector16_2[i], ovector32_1[i], ovector32_2[i],
+                                                               i, (int)ovector16_1[i], (int)ovector16_2[i], (int)ovector32_1[i], (int)ovector32_2[i],
                                                                total, current->pattern, current->input);
                                                        is_successful = 0;
                                                }
@@ -1751,4 +1772,708 @@ static int regression_tests(void)
        }
 }
 
+#if defined SUPPORT_UNICODE
+
+static int check_invalid_utf_result(int pattern_index, const char *type, int result,
+       int match_start, int match_end, PCRE2_SIZE *ovector)
+{
+       if (match_start < 0) {
+               if (result != -1) {
+                       printf("Pattern[%d] %s result is not -1.\n", pattern_index, type);
+                       return 1;
+               }
+               return 0;
+       }
+
+       if (result <= 0) {
+               printf("Pattern[%d] %s result (%d) is not greater than 0.\n", pattern_index, type, result);
+               return 1;
+       }
+
+       if (ovector[0] != (PCRE2_SIZE)match_start) {
+               printf("Pattern[%d] %s ovector[0] is unexpected (%d instead of %d)\n",
+                       pattern_index, type, (int)ovector[0], match_start);
+               return 1;
+       }
+
+       if (ovector[1] != (PCRE2_SIZE)match_end) {
+               printf("Pattern[%d] %s ovector[1] is unexpected (%d instead of %d)\n",
+                       pattern_index, type, (int)ovector[1], match_end);
+               return 1;
+       }
+
+       return 0;
+}
+
+#endif /* SUPPORT_UNICODE */
+
+#if defined SUPPORT_UNICODE && defined SUPPORT_PCRE2_8
+
+#define UDA (PCRE2_UTF | PCRE2_DOTALL | PCRE2_ANCHORED)
+#define CI (PCRE2_JIT_COMPLETE | PCRE2_JIT_INVALID_UTF)
+#define CPI (PCRE2_JIT_COMPLETE | PCRE2_JIT_PARTIAL_SOFT | PCRE2_JIT_INVALID_UTF)
+
+struct invalid_utf8_regression_test_case {
+       int compile_options;
+       int jit_compile_options;
+       int start_offset;
+       int skip_left;
+       int skip_right;
+       int match_start;
+       int match_end;
+       const char *pattern[2];
+       const char *input;
+};
+
+static struct invalid_utf8_regression_test_case invalid_utf8_regression_test_cases[] = {
+       { UDA, CI, 0, 0, 0, 0, 4, { ".", NULL }, "\xf4\x8f\xbf\xbf" },
+       { UDA, CI, 0, 0, 0, 0, 4, { ".", NULL }, "\xf0\x90\x80\x80" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xf4\x90\x80\x80" },
+       { UDA, CI, 0, 0, 1, -1, -1, { ".", NULL }, "\xf4\x8f\xbf\xbf" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xf0\x90\x80\x7f" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xf0\x90\x80\xc0" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xf0\x8f\xbf\xbf" },
+       { UDA, CI, 0, 0, 0, 0, 3, { ".", NULL }, "\xef\xbf\xbf#" },
+       { UDA, CI, 0, 0, 0, 0, 3, { ".", NULL }, "\xef\xbf\xbf" },
+       { UDA, CI, 0, 0, 0, 0, 3, { ".", NULL }, "\xe0\xa0\x80#" },
+       { UDA, CI, 0, 0, 0, 0, 3, { ".", NULL }, "\xe0\xa0\x80" },
+       { UDA, CI, 0, 0, 2, -1, -1, { ".", NULL }, "\xef\xbf\xbf#" },
+       { UDA, CI, 0, 0, 1, -1, -1, { ".", NULL }, "\xef\xbf\xbf" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xef\xbf\x7f#" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xef\xbf\xc0" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xe0\x9f\xbf#" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xe0\x9f\xbf" },
+       { UDA, CI, 0, 0, 0, 0, 3, { ".", NULL }, "\xed\x9f\xbf#" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xed\xa0\x80#" },
+       { UDA, CI, 0, 0, 0, 0, 3, { ".", NULL }, "\xee\x80\x80#" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xed\xbf\xbf#" },
+       { UDA, CI, 0, 0, 0, 0, 2, { ".", NULL }, "\xdf\xbf##" },
+       { UDA, CI, 0, 0, 0, 0, 2, { ".", NULL }, "\xdf\xbf#" },
+       { UDA, CI, 0, 0, 0, 0, 2, { ".", NULL }, "\xdf\xbf" },
+       { UDA, CI, 0, 0, 0, 0, 2, { ".", NULL }, "\xc2\x80##" },
+       { UDA, CI, 0, 0, 0, 0, 2, { ".", NULL }, "\xc2\x80#" },
+       { UDA, CI, 0, 0, 0, 0, 2, { ".", NULL }, "\xc2\x80" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xe0\x80##" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xdf\xc0##" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xe0\x80" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xdf\xc0" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xc1\xbf##" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xc1\xbf" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\x80###" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\x80" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xf8###" },
+       { UDA, CI, 0, 0, 0, -1, -1, { ".", NULL }, "\xf8" },
+       { UDA, CI, 0, 0, 0, 0, 1, { ".", NULL }, "\x7f" },
+
+       { UDA, CPI, 4, 0, 0, 4, 4, { "\\B", NULL }, "\xf4\x8f\xbf\xbf#" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "\xf4\xa0\x80\x80\xf4\xa0\x80\x80" },
+       { UDA, CPI, 4, 1, 1, -1, -1, { "\\B", "\\b" }, "\xf4\x8f\xbf\xbf\xf4\x8f\xbf\xbf" },
+       { UDA, CPI, 4, 0, 0, 4, 4, { "\\B", NULL }, "#\xef\xbf\xbf#" },
+       { UDA, CPI, 4, 0, 0, 4, 4, { "\\B", NULL }, "#\xe0\xa0\x80#" },
+       { UDA, CPI, 4, 0, 0, 4, 4, { "\\B", NULL }, "\xf0\x90\x80\x80#" },
+       { UDA, CPI, 4, 0, 0, 4, 4, { "\\B", NULL }, "\xf3\xbf\xbf\xbf#" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "\xf0\x8f\xbf\xbf\xf0\x8f\xbf\xbf" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "\xf5\x80\x80\x80\xf5\x80\x80\x80" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "\xf4\x90\x80\x80\xf4\x90\x80\x80" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "\xf4\x8f\xbf\xff\xf4\x8f\xbf\xff" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "\xf4\x8f\xff\xbf\xf4\x8f\xff\xbf" },
+       { UDA, CPI, 4, 0, 1, -1, -1, { "\\B", "\\b" }, "\xef\x80\x80\x80\xef\x80\x80" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "\x80\x80\x80\x80\x80\x80\x80\x80" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "#\xe0\x9f\xbf\xe0\x9f\xbf#" },
+       { UDA, CPI, 4, 2, 2, -1, -1, { "\\B", "\\b" }, "#\xe0\xa0\x80\xe0\xa0\x80#" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "#\xf0\x80\x80\xf0\x80\x80#" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "#\xed\xa0\x80\xed\xa0\x80#" },
+       { UDA, CPI, 4, 0, 0, 4, 4, { "\\B", NULL }, "##\xdf\xbf#" },
+       { UDA, CPI, 4, 2, 0, 2, 2, { "\\B", NULL }, "##\xdf\xbf#" },
+       { UDA, CPI, 4, 0, 0, 4, 4, { "\\B", NULL }, "##\xc2\x80#" },
+       { UDA, CPI, 4, 2, 0, 2, 2, { "\\B", NULL }, "##\xc2\x80#" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "##\xc1\xbf\xc1\xbf##" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "##\xdf\xc0\xdf\xc0##" },
+       { UDA, CPI, 4, 0, 0, -1, -1, { "\\B", "\\b" }, "##\xe0\x80\xe0\x80##" },
+
+       { UDA, CPI, 3, 0, 0, 3, 3, { "\\B", NULL }, "\xef\xbf\xbf#" },
+       { UDA, CPI, 3, 0, 0, 3, 3, { "\\B", NULL }, "\xe0\xa0\x80#" },
+       { UDA, CPI, 3, 0, 0, -1, -1, { "\\B", "\\b" }, "\xe0\x9f\xbf\xe0\x9f\xbf" },
+       { UDA, CPI, 3, 1, 1, -1, -1, { "\\B", "\\b" }, "\xef\xbf\xbf\xef\xbf\xbf" },
+       { UDA, CPI, 3, 0, 1, -1, -1, { "\\B", "\\b" }, "\xdf\x80\x80\xdf\x80" },
+       { UDA, CPI, 3, 0, 0, -1, -1, { "\\B", "\\b" }, "\xef\xbf\xff\xef\xbf\xff" },
+       { UDA, CPI, 3, 0, 0, -1, -1, { "\\B", "\\b" }, "\xef\xff\xbf\xef\xff\xbf" },
+       { UDA, CPI, 3, 0, 0, -1, -1, { "\\B", "\\b" }, "\xed\xbf\xbf\xed\xbf\xbf" },
+
+       { UDA, CPI, 2, 0, 0, 2, 2, { "\\B", NULL }, "\xdf\xbf#" },
+       { UDA, CPI, 2, 0, 0, 2, 2, { "\\B", NULL }, "\xc2\x80#" },
+       { UDA, CPI, 2, 1, 1, -1, -1, { "\\B", "\\b" }, "\xdf\xbf\xdf\xbf" },
+       { UDA, CPI, 2, 0, 0, -1, -1, { "\\B", "\\b" }, "\xc1\xbf\xc1\xbf" },
+       { UDA, CPI, 2, 0, 0, -1, -1, { "\\B", "\\b" }, "\xe0\x80\xe0\x80" },
+       { UDA, CPI, 2, 0, 0, -1, -1, { "\\B", "\\b" }, "\xdf\xff\xdf\xff" },
+       { UDA, CPI, 2, 0, 0, -1, -1, { "\\B", "\\b" }, "\xff\xbf\xff\xbf" },
+
+       { UDA, CPI, 1, 0, 0, 1, 1, { "\\B", NULL }, "\x7f#" },
+       { UDA, CPI, 1, 0, 0, 1, 1, { "\\B", NULL }, "\x01#" },
+       { UDA, CPI, 1, 0, 0, -1, -1, { "\\B", "\\b" }, "\x80\x80" },
+       { UDA, CPI, 1, 0, 0, -1, -1, { "\\B", "\\b" }, "\xb0\xb0" },
+
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, 0, 2, { "(.)\\1", NULL }, "aA" },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, -1, -1, { "(.)\\1", NULL }, "a\xff" },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, 0, 4, { "(.)\\1", NULL }, "\xc3\xa1\xc3\x81" },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 1, -1, -1, { "(.)\\1", NULL }, "\xc3\xa1\xc3\x81" },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, -1, -1, { "(.)\\1", NULL }, "\xc2\x80\x80" },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, 0, 6, { "(.)\\1", NULL }, "\xe1\xbd\xb8\xe1\xbf\xb8" },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 1, -1, -1, { "(.)\\1", NULL }, "\xe1\xbd\xb8\xe1\xbf\xb8" },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, 0, 8, { "(.)\\1", NULL }, "\xf0\x90\x90\x80\xf0\x90\x90\xa8" },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 1, -1, -1, { "(.)\\1", NULL }, "\xf0\x90\x90\x80\xf0\x90\x90\xa8" },
+
+       { UDA, CPI, 0, 0, 0, 0, 1, { "\\X", NULL }, "A" },
+       { UDA, CPI, 0, 0, 0, -1, -1, { "\\X", NULL }, "\xff" },
+       { UDA, CPI, 0, 0, 0, 0, 2, { "\\X", NULL }, "\xc3\xa1" },
+       { UDA, CPI, 0, 0, 1, -1, -1, { "\\X", NULL }, "\xc3\xa1" },
+       { UDA, CPI, 0, 0, 0, -1, -1, { "\\X", NULL }, "\xc3\x7f" },
+       { UDA, CPI, 0, 0, 0, 0, 3, { "\\X", NULL }, "\xe1\xbd\xb8" },
+       { UDA, CPI, 0, 0, 1, -1, -1, { "\\X", NULL }, "\xe1\xbd\xb8" },
+       { UDA, CPI, 0, 0, 0, 0, 4, { "\\X", NULL }, "\xf0\x90\x90\x80" },
+       { UDA, CPI, 0, 0, 1, -1, -1, { "\\X", NULL }, "\xf0\x90\x90\x80" },
+
+       { UDA, CPI, 0, 0, 0, -1, -1, { "[^#]", NULL }, "#" },
+       { UDA, CPI, 0, 0, 0, 0, 4, { "[^#]", NULL }, "\xf4\x8f\xbf\xbf" },
+       { UDA, CPI, 0, 0, 0, -1, -1, { "[^#]", NULL }, "\xf4\x90\x80\x80" },
+       { UDA, CPI, 0, 0, 0, -1, -1, { "[^#]", NULL }, "\xc1\x80" },
+
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 2, 3, { "^\\W", NULL }, " \x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 14, 15, { "^\\W", NULL }, " \xc0\x8a#\xe0\x80\x8a#\xf0\x80\x80\x8a#\x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 3, 4, { "^\\W", NULL }, " \xf8\x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 3, 4, { "^\\W", NULL }, " \xc3\x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 3, 4, { "^\\W", NULL }, " \xf1\x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 4, 5, { "^\\W", NULL }, " \xf2\xbf\x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 5, 6, { "^\\W", NULL }, " \xf2\xbf\xbf\x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 3, 4, { "^\\W", NULL }, " \xef\x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 4, 5, { "^\\W", NULL }, " \xef\xbf\x0a#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 5, 6, { "^\\W", NULL }, " \x85#\xc2\x85#"},
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 7, 8, { "^\\W", NULL }, " \xe2\x80\xf8\xe2\x80\xa8#"},
+
+       { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, -1, -1, { "#", NULL }, "\xe2\x80\xf8\xe2\x80\xa8#"},
+       { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, 3, 4, { "#", NULL }, "\xe2\x80\xf8#\xe2\x80\xa8#"},
+       { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, -1, -1, { "#", NULL }, "abcd\xc2\x85#"},
+       { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, 1, 2, { "#", NULL }, "\x85#\xc2\x85#"},
+       { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, 5, 6, { "#", NULL }, "\xef,\x80,\xf8#\x0a"},
+       { PCRE2_UTF | PCRE2_FIRSTLINE, CI, 0, 0, 0, -1, -1, { "#", NULL }, "\xef,\x80,\xf8\x0a#"},
+
+       { PCRE2_UTF | PCRE2_NO_START_OPTIMIZE, CI, 0, 0, 0, 4, 8, { "#\xc7\x85#", NULL }, "\x80\x80#\xc7#\xc7\x85#" },
+       { PCRE2_UTF | PCRE2_NO_START_OPTIMIZE, CI, 0, 0, 0, 7, 11, { "#\xc7\x85#", NULL }, "\x80\x80#\xc7\x80\x80\x80#\xc7\x85#" },
+       { PCRE2_UTF, CI, 0, 0, 0, 4, 8, { "#\xc7\x85#", NULL }, "\x80\x80#\xc7#\xc7\x85#" },
+       { PCRE2_UTF, CI, 0, 0, 0, 7, 11, { "#\xc7\x85#", NULL }, "\x80\x80#\xc7\x80\x80\x80#\xc7\x85#" },
+
+       /* These two are not invalid UTF tests, but this infrastructure fits better for them. */
+       { 0, PCRE2_JIT_COMPLETE, 0, 0, 1, -1, -1, { "\\X{2}", NULL }, "\r\n\n" },
+       { 0, PCRE2_JIT_COMPLETE, 0, 0, 1, -1, -1, { "\\R{2}", NULL }, "\r\n\n" },
+
+       { 0, 0, 0, 0, 0, 0, 0, { NULL, NULL }, NULL }
+};
+
+#undef UDA
+#undef CI
+#undef CPI
+
+static int run_invalid_utf8_test(struct invalid_utf8_regression_test_case *current,
+       int pattern_index, int i, pcre2_compile_context_8 *ccontext, pcre2_match_data_8 *mdata)
+{
+       pcre2_code_8 *code;
+       int result, errorcode;
+       PCRE2_SIZE length, erroroffset;
+       PCRE2_SIZE *ovector = pcre2_get_ovector_pointer_8(mdata);
+
+       if (current->pattern[i] == NULL)
+               return 1;
+
+       code = pcre2_compile_8((PCRE2_UCHAR8*)current->pattern[i], PCRE2_ZERO_TERMINATED,
+               current->compile_options, &errorcode, &erroroffset, ccontext);
+
+       if (!code) {
+               printf("Pattern[%d:0] cannot be compiled. Error offset: %d\n", pattern_index, (int)erroroffset);
+               return 0;
+       }
+
+       if (pcre2_jit_compile_8(code, current->jit_compile_options) != 0) {
+               printf("Pattern[%d:0] cannot be compiled by the JIT compiler.\n", pattern_index);
+               pcre2_code_free_8(code);
+               return 0;
+       }
+
+       length = (PCRE2_SIZE)(strlen(current->input) - current->skip_left - current->skip_right);
+
+       if (current->jit_compile_options & PCRE2_JIT_COMPLETE) {
+               result = pcre2_jit_match_8(code, (PCRE2_UCHAR8*)(current->input + current->skip_left),
+                       length, current->start_offset - current->skip_left, 0, mdata, NULL);
+
+               if (check_invalid_utf_result(pattern_index, "match", result, current->match_start, current->match_end, ovector)) {
+                       pcre2_code_free_8(code);
+                       return 0;
+               }
+       }
+
+       if (current->jit_compile_options & PCRE2_JIT_PARTIAL_SOFT) {
+               result = pcre2_jit_match_8(code, (PCRE2_UCHAR8*)(current->input + current->skip_left),
+                       length, current->start_offset - current->skip_left, PCRE2_PARTIAL_SOFT, mdata, NULL);
+
+               if (check_invalid_utf_result(pattern_index, "partial match", result, current->match_start, current->match_end, ovector)) {
+                       pcre2_code_free_8(code);
+                       return 0;
+               }
+       }
+
+       pcre2_code_free_8(code);
+       return 1;
+}
+
+static int invalid_utf8_regression_tests(void)
+{
+       struct invalid_utf8_regression_test_case *current;
+       pcre2_compile_context_8 *ccontext;
+       pcre2_match_data_8 *mdata;
+       int total = 0, successful = 0;
+       int result;
+
+       printf("\nRunning invalid-utf8 JIT regression tests\n");
+
+       ccontext = pcre2_compile_context_create_8(NULL);
+       pcre2_set_newline_8(ccontext, PCRE2_NEWLINE_ANY);
+       mdata = pcre2_match_data_create_8(4, NULL);
+
+       for (current = invalid_utf8_regression_test_cases; current->pattern[0]; current++) {
+               /* printf("\nPattern: %s :\n", current->pattern); */
+               total++;
+
+               result = 1;
+               if (!run_invalid_utf8_test(current, total - 1, 0, ccontext, mdata))
+                       result = 0;
+               if (!run_invalid_utf8_test(current, total - 1, 1, ccontext, mdata))
+                       result = 0;
+
+               if (result) {
+                       successful++;
+               }
+
+               printf(".");
+               if ((total % 60) == 0)
+                       printf("\n");
+       }
+
+       if ((total % 60) != 0)
+               printf("\n");
+
+       pcre2_match_data_free_8(mdata);
+       pcre2_compile_context_free_8(ccontext);
+
+       if (total == successful) {
+               printf("\nAll invalid UTF8 JIT regression tests are successfully passed.\n");
+               return 0;
+       } else {
+               printf("\nInvalid UTF8 successful test ratio: %d%% (%d failed)\n", successful * 100 / total, total - successful);
+               return 1;
+       }
+}
+
+#else /* !SUPPORT_UNICODE || !SUPPORT_PCRE2_8 */
+
+static int invalid_utf8_regression_tests(void)
+{
+       return 0;
+}
+
+#endif /* SUPPORT_UNICODE && SUPPORT_PCRE2_8 */
+
+#if defined SUPPORT_UNICODE && defined SUPPORT_PCRE2_16
+
+#define UDA (PCRE2_UTF | PCRE2_DOTALL | PCRE2_ANCHORED)
+#define CI (PCRE2_JIT_COMPLETE | PCRE2_JIT_INVALID_UTF)
+#define CPI (PCRE2_JIT_COMPLETE | PCRE2_JIT_PARTIAL_SOFT | PCRE2_JIT_INVALID_UTF)
+
+struct invalid_utf16_regression_test_case {
+       int compile_options;
+       int jit_compile_options;
+       int start_offset;
+       int skip_left;
+       int skip_right;
+       int match_start;
+       int match_end;
+       const PCRE2_UCHAR16 *pattern[2];
+       const PCRE2_UCHAR16 *input;
+};
+
+static PCRE2_UCHAR16 allany16[] = { '.', 0 };
+static PCRE2_UCHAR16 non_word_boundary16[] = { '\\', 'B', 0 };
+static PCRE2_UCHAR16 word_boundary16[] = { '\\', 'b', 0 };
+static PCRE2_UCHAR16 backreference16[] = { '(', '.', ')', '\\', '1', 0 };
+static PCRE2_UCHAR16 grapheme16[] = { '\\', 'X', 0 };
+static PCRE2_UCHAR16 nothashmark16[] = { '[', '^', '#', ']', 0 };
+static PCRE2_UCHAR16 afternl16[] = { '^', '\\', 'W', 0 };
+static PCRE2_UCHAR16 generic16[] = { '#', 0xd800, 0xdc00, '#', 0 };
+static PCRE2_UCHAR16 test16_1[] = { 0xd7ff, 0xe000, 0xffff, 0x01, '#', 0 };
+static PCRE2_UCHAR16 test16_2[] = { 0xd800, 0xdc00, 0xd800, 0xdc00, 0 };
+static PCRE2_UCHAR16 test16_3[] = { 0xdbff, 0xdfff, 0xdbff, 0xdfff, 0 };
+static PCRE2_UCHAR16 test16_4[] = { 0xd800, 0xdbff, 0xd800, 0xdbff, 0 };
+static PCRE2_UCHAR16 test16_5[] = { '#', 0xd800, 0xdc00, '#', 0 };
+static PCRE2_UCHAR16 test16_6[] = { 'a', 'A', 0xdc28, 0 };
+static PCRE2_UCHAR16 test16_7[] = { 0xd801, 0xdc00, 0xd801, 0xdc28, 0 };
+static PCRE2_UCHAR16 test16_8[] = { '#', 0xd800, 0xdc00, 0 };
+static PCRE2_UCHAR16 test16_9[] = { ' ', 0x2028, '#', 0 };
+static PCRE2_UCHAR16 test16_10[] = { ' ', 0xdc00, 0xd800, 0x2028, '#', 0 };
+static PCRE2_UCHAR16 test16_11[] = { 0xdc00, 0xdc00, 0xd800, 0xdc00, 0xdc00, '#', 0xd800, 0xdc00, '#', 0 };
+static PCRE2_UCHAR16 test16_12[] = { '#', 0xd800, 0xdc00, 0xd800, '#', 0xd800, 0xdc00, 0xdc00, 0xdc00, '#', 0xd800, 0xdc00, '#', 0 };
+
+static struct invalid_utf16_regression_test_case invalid_utf16_regression_test_cases[] = {
+       { UDA, CI, 0, 0, 0, 0, 1, { allany16, NULL }, test16_1 },
+       { UDA, CI, 1, 0, 0, 1, 2, { allany16, NULL }, test16_1 },
+       { UDA, CI, 2, 0, 0, 2, 3, { allany16, NULL }, test16_1 },
+       { UDA, CI, 3, 0, 0, 3, 4, { allany16, NULL }, test16_1 },
+       { UDA, CI, 0, 0, 0, 0, 2, { allany16, NULL }, test16_2 },
+       { UDA, CI, 0, 0, 3, -1, -1, { allany16, NULL }, test16_2 },
+       { UDA, CI, 1, 0, 0, -1, -1, { allany16, NULL }, test16_2 },
+       { UDA, CI, 0, 0, 0, 0, 2, { allany16, NULL }, test16_3 },
+       { UDA, CI, 0, 0, 3, -1, -1, { allany16, NULL }, test16_3 },
+       { UDA, CI, 1, 0, 0, -1, -1, { allany16, NULL }, test16_3 },
+
+       { UDA, CPI, 1, 0, 0, 1, 1, { non_word_boundary16, NULL }, test16_1 },
+       { UDA, CPI, 2, 0, 0, 2, 2, { non_word_boundary16, NULL }, test16_1 },
+       { UDA, CPI, 3, 0, 0, 3, 3, { non_word_boundary16, NULL }, test16_1 },
+       { UDA, CPI, 4, 0, 0, 4, 4, { non_word_boundary16, NULL }, test16_1 },
+       { UDA, CPI, 2, 0, 0, 2, 2, { non_word_boundary16, NULL }, test16_2 },
+       { UDA, CPI, 2, 0, 0, 2, 2, { non_word_boundary16, NULL }, test16_3 },
+       { UDA, CPI, 2, 1, 1, -1, -1, { non_word_boundary16, word_boundary16 }, test16_2 },
+       { UDA, CPI, 2, 1, 1, -1, -1, { non_word_boundary16, word_boundary16 }, test16_3 },
+       { UDA, CPI, 2, 0, 0, -1, -1, { non_word_boundary16, word_boundary16 }, test16_4 },
+       { UDA, CPI, 2, 0, 0, -1, -1, { non_word_boundary16, word_boundary16 }, test16_5 },
+
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, 0, 2, { backreference16, NULL }, test16_6 },
+       { UDA | PCRE2_CASELESS, CPI, 1, 0, 0, -1, -1, { backreference16, NULL }, test16_6 },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, 0, 4, { backreference16, NULL }, test16_7 },
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 1, -1, -1, { backreference16, NULL }, test16_7 },
+
+       { UDA, CPI, 0, 0, 0, 0, 1, { grapheme16, NULL }, test16_6 },
+       { UDA, CPI, 1, 0, 0, 1, 2, { grapheme16, NULL }, test16_6 },
+       { UDA, CPI, 2, 0, 0, -1, -1, { grapheme16, NULL }, test16_6 },
+       { UDA, CPI, 0, 0, 0, 0, 2, { grapheme16, NULL }, test16_7 },
+       { UDA, CPI, 2, 0, 0, 2, 4, { grapheme16, NULL }, test16_7 },
+       { UDA, CPI, 1, 0, 0, -1, -1, { grapheme16, NULL }, test16_7 },
+
+       { UDA, CPI, 0, 0, 0, -1, -1, { nothashmark16, NULL }, test16_8 },
+       { UDA, CPI, 1, 0, 0, 1, 3, { nothashmark16, NULL }, test16_8 },
+       { UDA, CPI, 2, 0, 0, -1, -1, { nothashmark16, NULL }, test16_8 },
+
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 2, 3, { afternl16, NULL }, test16_9 },
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 4, 5, { afternl16, NULL }, test16_10 },
+
+       { PCRE2_UTF | PCRE2_NO_START_OPTIMIZE, CI, 0, 0, 0, 5, 9, { generic16, NULL }, test16_11 },
+       { PCRE2_UTF | PCRE2_NO_START_OPTIMIZE, CI, 0, 0, 0, 9, 13, { generic16, NULL }, test16_12 },
+       { PCRE2_UTF, CI, 0, 0, 0, 5, 9, { generic16, NULL }, test16_11 },
+       { PCRE2_UTF, CI, 0, 0, 0, 9, 13, { generic16, NULL }, test16_12 },
+
+       { 0, 0, 0, 0, 0, 0, 0, { NULL, NULL }, NULL }
+};
+
+#undef UDA
+#undef CI
+#undef CPI
+
+static int run_invalid_utf16_test(struct invalid_utf16_regression_test_case *current,
+       int pattern_index, int i, pcre2_compile_context_16 *ccontext, pcre2_match_data_16 *mdata)
+{
+       pcre2_code_16 *code;
+       int result, errorcode;
+       PCRE2_SIZE length, erroroffset;
+       const PCRE2_UCHAR16 *input;
+       PCRE2_SIZE *ovector = pcre2_get_ovector_pointer_16(mdata);
+
+       if (current->pattern[i] == NULL)
+               return 1;
+
+       code = pcre2_compile_16(current->pattern[i], PCRE2_ZERO_TERMINATED,
+               current->compile_options, &errorcode, &erroroffset, ccontext);
+
+       if (!code) {
+               printf("Pattern[%d:0] cannot be compiled. Error offset: %d\n", pattern_index, (int)erroroffset);
+               return 0;
+       }
+
+       if (pcre2_jit_compile_16(code, current->jit_compile_options) != 0) {
+               printf("Pattern[%d:0] cannot be compiled by the JIT compiler.\n", pattern_index);
+               pcre2_code_free_16(code);
+               return 0;
+       }
+
+       input = current->input;
+       length = 0;
+
+       while (*input++ != 0)
+               length++;
+
+       length -= current->skip_left + current->skip_right;
+
+       if (current->jit_compile_options & PCRE2_JIT_COMPLETE) {
+               result = pcre2_jit_match_16(code, (current->input + current->skip_left),
+                       length, current->start_offset - current->skip_left, 0, mdata, NULL);
+
+               if (check_invalid_utf_result(pattern_index, "match", result, current->match_start, current->match_end, ovector)) {
+                       pcre2_code_free_16(code);
+                       return 0;
+               }
+       }
+
+       if (current->jit_compile_options & PCRE2_JIT_PARTIAL_SOFT) {
+               result = pcre2_jit_match_16(code, (current->input + current->skip_left),
+                       length, current->start_offset - current->skip_left, PCRE2_PARTIAL_SOFT, mdata, NULL);
+
+               if (check_invalid_utf_result(pattern_index, "partial match", result, current->match_start, current->match_end, ovector)) {
+                       pcre2_code_free_16(code);
+                       return 0;
+               }
+       }
+
+       pcre2_code_free_16(code);
+       return 1;
+}
+
+static int invalid_utf16_regression_tests(void)
+{
+       struct invalid_utf16_regression_test_case *current;
+       pcre2_compile_context_16 *ccontext;
+       pcre2_match_data_16 *mdata;
+       int total = 0, successful = 0;
+       int result;
+
+       printf("\nRunning invalid-utf16 JIT regression tests\n");
+
+       ccontext = pcre2_compile_context_create_16(NULL);
+       pcre2_set_newline_16(ccontext, PCRE2_NEWLINE_ANY);
+       mdata = pcre2_match_data_create_16(4, NULL);
+
+       for (current = invalid_utf16_regression_test_cases; current->pattern[0]; current++) {
+               /* printf("\nPattern: %s :\n", current->pattern); */
+               total++;
+
+               result = 1;
+               if (!run_invalid_utf16_test(current, total - 1, 0, ccontext, mdata))
+                       result = 0;
+               if (!run_invalid_utf16_test(current, total - 1, 1, ccontext, mdata))
+                       result = 0;
+
+               if (result) {
+                       successful++;
+               }
+
+               printf(".");
+               if ((total % 60) == 0)
+                       printf("\n");
+       }
+
+       if ((total % 60) != 0)
+               printf("\n");
+
+       pcre2_match_data_free_16(mdata);
+       pcre2_compile_context_free_16(ccontext);
+
+       if (total == successful) {
+               printf("\nAll invalid UTF16 JIT regression tests are successfully passed.\n");
+               return 0;
+       } else {
+               printf("\nInvalid UTF16 successful test ratio: %d%% (%d failed)\n", successful * 100 / total, total - successful);
+               return 1;
+       }
+}
+
+#else /* !SUPPORT_UNICODE || !SUPPORT_PCRE2_16 */
+
+static int invalid_utf16_regression_tests(void)
+{
+       return 0;
+}
+
+#endif /* SUPPORT_UNICODE && SUPPORT_PCRE2_16 */
+
+#if defined SUPPORT_UNICODE && defined SUPPORT_PCRE2_32
+
+#define UDA (PCRE2_UTF | PCRE2_DOTALL | PCRE2_ANCHORED)
+#define CI (PCRE2_JIT_COMPLETE | PCRE2_JIT_INVALID_UTF)
+#define CPI (PCRE2_JIT_COMPLETE | PCRE2_JIT_PARTIAL_SOFT | PCRE2_JIT_INVALID_UTF)
+
+struct invalid_utf32_regression_test_case {
+       int compile_options;
+       int jit_compile_options;
+       int start_offset;
+       int skip_left;
+       int skip_right;
+       int match_start;
+       int match_end;
+       const PCRE2_UCHAR32 *pattern[2];
+       const PCRE2_UCHAR32 *input;
+};
+
+static PCRE2_UCHAR32 allany32[] = { '.', 0 };
+static PCRE2_UCHAR32 non_word_boundary32[] = { '\\', 'B', 0 };
+static PCRE2_UCHAR32 word_boundary32[] = { '\\', 'b', 0 };
+static PCRE2_UCHAR32 backreference32[] = { '(', '.', ')', '\\', '1', 0 };
+static PCRE2_UCHAR32 grapheme32[] = { '\\', 'X', 0 };
+static PCRE2_UCHAR32 nothashmark32[] = { '[', '^', '#', ']', 0 };
+static PCRE2_UCHAR32 afternl32[] = { '^', '\\', 'W', 0 };
+static PCRE2_UCHAR32 test32_1[] = { 0x10ffff, 0x10ffff, 0x110000, 0x110000, 0x10ffff, 0 };
+static PCRE2_UCHAR32 test32_2[] = { 0xd7ff, 0xe000, 0xd800, 0xdfff, 0xe000, 0xdfff, 0xd800, 0 };
+static PCRE2_UCHAR32 test32_3[] = { 'a', 'A', 0x110000, 0 };
+static PCRE2_UCHAR32 test32_4[] = { '#', 0x10ffff, 0x110000, 0 };
+static PCRE2_UCHAR32 test32_5[] = { ' ', 0x2028, '#', 0 };
+static PCRE2_UCHAR32 test32_6[] = { ' ', 0x110000, 0x2028, '#', 0 };
+
+static struct invalid_utf32_regression_test_case invalid_utf32_regression_test_cases[] = {
+       { UDA, CI, 0, 0, 0, 0, 1, { allany32, NULL }, test32_1 },
+       { UDA, CI, 2, 0, 0, -1, -1, { allany32, NULL }, test32_1 },
+       { UDA, CI, 0, 0, 0, 0, 1, { allany32, NULL }, test32_2 },
+       { UDA, CI, 1, 0, 0, 1, 2, { allany32, NULL }, test32_2 },
+       { UDA, CI, 2, 0, 0, -1, -1, { allany32, NULL }, test32_2 },
+       { UDA, CI, 3, 0, 0, -1, -1, { allany32, NULL }, test32_2 },
+
+       { UDA, CPI, 1, 0, 0, 1, 1, { non_word_boundary32, NULL }, test32_1 },
+       { UDA, CPI, 3, 0, 0, -1, -1, { non_word_boundary32, word_boundary32 }, test32_1 },
+       { UDA, CPI, 1, 0, 0, 1, 1, { non_word_boundary32, NULL }, test32_2 },
+       { UDA, CPI, 3, 0, 0, -1, -1, { non_word_boundary32, word_boundary32 }, test32_2 },
+       { UDA, CPI, 6, 0, 0, -1, -1, { non_word_boundary32, word_boundary32 }, test32_2 },
+
+       { UDA | PCRE2_CASELESS, CPI, 0, 0, 0, 0, 2, { backreference32, NULL }, test32_3 },
+       { UDA | PCRE2_CASELESS, CPI, 1, 0, 0, -1, -1, { backreference32, NULL }, test32_3 },
+
+       { UDA, CPI, 0, 0, 0, 0, 1, { grapheme32, NULL }, test32_1 },
+       { UDA, CPI, 2, 0, 0, -1, -1, { grapheme32, NULL }, test32_1 },
+       { UDA, CPI, 1, 0, 0, 1, 2, { grapheme32, NULL }, test32_2 },
+       { UDA, CPI, 2, 0, 0, -1, -1, { grapheme32, NULL }, test32_2 },
+       { UDA, CPI, 3, 0, 0, -1, -1, { grapheme32, NULL }, test32_2 },
+       { UDA, CPI, 4, 0, 0, 4, 5, { grapheme32, NULL }, test32_2 },
+
+       { UDA, CPI, 0, 0, 0, -1, -1, { nothashmark32, NULL }, test32_4 },
+       { UDA, CPI, 1, 0, 0, 1, 2, { nothashmark32, NULL }, test32_4 },
+       { UDA, CPI, 2, 0, 0, -1, -1, { nothashmark32, NULL }, test32_4 },
+       { UDA, CPI, 1, 0, 0, 1, 2, { nothashmark32, NULL }, test32_2 },
+       { UDA, CPI, 2, 0, 0, -1, -1, { nothashmark32, NULL }, test32_2 },
+
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 2, 3, { afternl32, NULL }, test32_5 },
+       { PCRE2_UTF | PCRE2_MULTILINE, CI, 1, 0, 0, 3, 4, { afternl32, NULL }, test32_6 },
+
+       { 0, 0, 0, 0, 0, 0, 0, { NULL, NULL }, NULL }
+};
+
+#undef UDA
+#undef CI
+#undef CPI
+
+static int run_invalid_utf32_test(struct invalid_utf32_regression_test_case *current,
+       int pattern_index, int i, pcre2_compile_context_32 *ccontext, pcre2_match_data_32 *mdata)
+{
+       pcre2_code_32 *code;
+       int result, errorcode;
+       PCRE2_SIZE length, erroroffset;
+       const PCRE2_UCHAR32 *input;
+       PCRE2_SIZE *ovector = pcre2_get_ovector_pointer_32(mdata);
+
+       if (current->pattern[i] == NULL)
+               return 1;
+
+       code = pcre2_compile_32(current->pattern[i], PCRE2_ZERO_TERMINATED,
+               current->compile_options, &errorcode, &erroroffset, ccontext);
+
+       if (!code) {
+               printf("Pattern[%d:0] cannot be compiled. Error offset: %d\n", pattern_index, (int)erroroffset);
+               return 0;
+       }
+
+       if (pcre2_jit_compile_32(code, current->jit_compile_options) != 0) {
+               printf("Pattern[%d:0] cannot be compiled by the JIT compiler.\n", pattern_index);
+               pcre2_code_free_32(code);
+               return 0;
+       }
+
+       input = current->input;
+       length = 0;
+
+       while (*input++ != 0)
+               length++;
+
+       length -= current->skip_left + current->skip_right;
+
+       if (current->jit_compile_options & PCRE2_JIT_COMPLETE) {
+               result = pcre2_jit_match_32(code, (current->input + current->skip_left),
+                       length, current->start_offset - current->skip_left, 0, mdata, NULL);
+
+               if (check_invalid_utf_result(pattern_index, "match", result, current->match_start, current->match_end, ovector)) {
+                       pcre2_code_free_32(code);
+                       return 0;
+               }
+       }
+
+       if (current->jit_compile_options & PCRE2_JIT_PARTIAL_SOFT) {
+               result = pcre2_jit_match_32(code, (current->input + current->skip_left),
+                       length, current->start_offset - current->skip_left, PCRE2_PARTIAL_SOFT, mdata, NULL);
+
+               if (check_invalid_utf_result(pattern_index, "partial match", result, current->match_start, current->match_end, ovector)) {
+                       pcre2_code_free_32(code);
+                       return 0;
+               }
+       }
+
+       pcre2_code_free_32(code);
+       return 1;
+}
+
+static int invalid_utf32_regression_tests(void)
+{
+       struct invalid_utf32_regression_test_case *current;
+       pcre2_compile_context_32 *ccontext;
+       pcre2_match_data_32 *mdata;
+       int total = 0, successful = 0;
+       int result;
+
+       printf("\nRunning invalid-utf32 JIT regression tests\n");
+
+       ccontext = pcre2_compile_context_create_32(NULL);
+       pcre2_set_newline_32(ccontext, PCRE2_NEWLINE_ANY);
+       mdata = pcre2_match_data_create_32(4, NULL);
+
+       for (current = invalid_utf32_regression_test_cases; current->pattern[0]; current++) {
+               /* printf("\nPattern: %s :\n", current->pattern); */
+               total++;
+
+               result = 1;
+               if (!run_invalid_utf32_test(current, total - 1, 0, ccontext, mdata))
+                       result = 0;
+               if (!run_invalid_utf32_test(current, total - 1, 1, ccontext, mdata))
+                       result = 0;
+
+               if (result) {
+                       successful++;
+               }
+
+               printf(".");
+               if ((total % 60) == 0)
+                       printf("\n");
+       }
+
+       if ((total % 60) != 0)
+               printf("\n");
+
+       pcre2_match_data_free_32(mdata);
+       pcre2_compile_context_free_32(ccontext);
+
+       if (total == successful) {
+               printf("\nAll invalid UTF32 JIT regression tests are successfully passed.\n");
+               return 0;
+       } else {
+               printf("\nInvalid UTF32 successful test ratio: %d%% (%d failed)\n", successful * 100 / total, total - successful);
+               return 1;
+       }
+}
+
+#else /* !SUPPORT_UNICODE || !SUPPORT_PCRE2_32 */
+
+static int invalid_utf32_regression_tests(void)
+{
+       return 0;
+}
+
+#endif /* SUPPORT_UNICODE && SUPPORT_PCRE2_32 */
+
 /* End of pcre2_jit_test.c */
index 537edba8c329047c88dde54c3a98ebc8a41044c6..8c93b4b57373ecfec2eeeb29c9a01a8a67cbe696 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -114,17 +114,17 @@ test for alnum specially. */
 memset(p, 0, cbit_length);
 for (i = 0; i < 256; i++)
   {
-  if (isdigit(i)) p[cbit_digit  + i/8] |= 1 << (i&7);
-  if (isupper(i)) p[cbit_upper  + i/8] |= 1 << (i&7);
-  if (islower(i)) p[cbit_lower  + i/8] |= 1 << (i&7);
-  if (isalnum(i)) p[cbit_word   + i/8] |= 1 << (i&7);
-  if (i == '_')   p[cbit_word   + i/8] |= 1 << (i&7);
-  if (isspace(i)) p[cbit_space  + i/8] |= 1 << (i&7);
-  if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7);
-  if (isgraph(i)) p[cbit_graph  + i/8] |= 1 << (i&7);
-  if (isprint(i)) p[cbit_print  + i/8] |= 1 << (i&7);
-  if (ispunct(i)) p[cbit_punct  + i/8] |= 1 << (i&7);
-  if (iscntrl(i)) p[cbit_cntrl  + i/8] |= 1 << (i&7);
+  if (isdigit(i)) p[cbit_digit  + i/8] |= 1u << (i&7);
+  if (isupper(i)) p[cbit_upper  + i/8] |= 1u << (i&7);
+  if (islower(i)) p[cbit_lower  + i/8] |= 1u << (i&7);
+  if (isalnum(i)) p[cbit_word   + i/8] |= 1u << (i&7);
+  if (i == '_')   p[cbit_word   + i/8] |= 1u << (i&7);
+  if (isspace(i)) p[cbit_space  + i/8] |= 1u << (i&7);
+  if (isxdigit(i))p[cbit_xdigit + i/8] |= 1u << (i&7);
+  if (isgraph(i)) p[cbit_graph  + i/8] |= 1u << (i&7);
+  if (isprint(i)) p[cbit_print  + i/8] |= 1u << (i&7);
+  if (ispunct(i)) p[cbit_punct  + i/8] |= 1u << (i&7);
+  if (iscntrl(i)) p[cbit_cntrl  + i/8] |= 1u << (i&7);
   }
 p += cbit_length;
 
@@ -138,8 +138,8 @@ for (i = 0; i < 256; i++)
   int x = 0;
   if (isspace(i)) x += ctype_space;
   if (isalpha(i)) x += ctype_letter;
+  if (islower(i)) x += ctype_lcletter;
   if (isdigit(i)) x += ctype_digit;
-  if (isxdigit(i)) x += ctype_xdigit;
   if (isalnum(i) || i == '_') x += ctype_word;
   *p++ = x;
   }
@@ -147,4 +147,15 @@ for (i = 0; i < 256; i++)
 return yield;
 }
 
+#ifndef DFTABLES
+PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
+pcre2_maketables_free(pcre2_general_context *gcontext, const uint8_t *tables)
+{
+  if (gcontext)
+    gcontext->memctl.free((void *)tables, gcontext->memctl.memory_data);
+  else
+    free((void *)tables);
+}
+#endif
+
 /* End of pcre2_maketables.c */
index 8741e1432d616327fcff80bb50002e0dfd9e4903..48e7b9dbb2c409ce3592297e315ac786acd91135 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-2018 University of Cambridge
+          New API code Copyright (c) 2015-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -69,11 +69,12 @@ information, and fields within it. */
 #define PUBLIC_MATCH_OPTIONS \
   (PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
    PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \
-   PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT)
+   PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT|PCRE2_COPY_MATCHED_SUBJECT)
 
 #define PUBLIC_JIT_MATCH_OPTIONS \
    (PCRE2_NO_UTF_CHECK|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY|\
-    PCRE2_NOTEMPTY_ATSTART|PCRE2_PARTIAL_SOFT|PCRE2_PARTIAL_HARD)
+    PCRE2_NOTEMPTY_ATSTART|PCRE2_PARTIAL_SOFT|PCRE2_PARTIAL_HARD|\
+    PCRE2_COPY_MATCHED_SUBJECT)
 
 /* Non-error returns from and within the match() function. Error returns are
 externally defined PCRE2_ERROR_xxx codes, which are all negative. */
@@ -414,8 +415,7 @@ if (caseless)
   else
 #endif
 
-    /* Not in UTF mode */
-
+  /* Not in UTF mode */
     {
     for (; length > 0; length--)
       {
@@ -490,27 +490,32 @@ heap is used for a larger vector.
 *************************************************/
 
 /* These macros pack up tests that are used for partial matching several times
-in the code. We set the "hit end" flag if the pointer is at the end of the
-subject and also past the earliest inspected character (i.e. something has been
-matched, even if not part of the actual matched string). For hard partial
-matching, we then return immediately. The second one is used when we already
-know we are past the end of the subject. */
+in the code. The second one is used when we already know we are past the end of
+the subject. We set the "hit end" flag if the pointer is at the end of the
+subject and either (a) the pointer is past the earliest inspected character
+(i.e. something has been matched, even if not part of the actual matched
+string), or (b) the pattern contains a lookbehind. These are the conditions for
+which adding more characters may allow the current match to continue.
+
+For hard partial matching, we immediately return a partial match. Otherwise,
+carrying on means that a complete match on the current subject will be sought.
+A partial match is returned only if no complete match can be found. */
 
 #define CHECK_PARTIAL()\
-  if (mb->partial != 0 && Feptr >= mb->end_subject && \
-      Feptr > mb->start_used_ptr) \
+  if (Feptr >= mb->end_subject) \
     { \
-    mb->hitend = TRUE; \
-    if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; \
+    SCHECK_PARTIAL(); \
     }
 
 #define SCHECK_PARTIAL()\
-  if (mb->partial != 0 && Feptr > mb->start_used_ptr) \
+  if (mb->partial != 0 && \
+      (Feptr > mb->start_used_ptr || mb->allowemptypartial)) \
     { \
     mb->hitend = TRUE; \
     if (mb->partial > 1) return PCRE2_ERROR_PARTIAL; \
     }
 
+
 /* These macros are used to implement backtracking. They simulate a recursive
 call to the match() function by means of a local vector of frames which
 remember the backtracking points. */
@@ -1848,7 +1853,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
             if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH);
             }
           else
-            if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
+            if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
           }
         }
       else
@@ -1870,7 +1875,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
             }
           else
 #endif
-          if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
+          if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
           }
         }
 
@@ -1902,7 +1907,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
               if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH);
               }
             else
-              if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
+              if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
             }
           }
         else
@@ -1927,7 +1932,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
               }
             else
 #endif
-            if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
+            if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
             }
           }
         /* Control never gets here */
@@ -1956,7 +1961,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
               if (Fop == OP_CLASS) break;
               }
             else
-              if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) break;
+              if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) break;
             Feptr += len;
             }
 
@@ -1993,7 +1998,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
               }
             else
 #endif
-            if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) break;
+            if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) break;
             Feptr++;
             }
 
@@ -4084,7 +4089,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
               GETCHAR(fc, fptr);
               }
             lgb = UCD_GRAPHBREAK(fc);
-            if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
+            if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break;
             Feptr = fptr;
             rgb = lgb;
             }
@@ -5014,6 +5019,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
     must record a backtracking point and also set up a chained frame. */
 
     case OP_ONCE:
+    case OP_SCRIPT_RUN:
     case OP_SBRA:
     Lframe_type = GF_NOCAPTURE | Fop;
 
@@ -5125,6 +5131,8 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
 
     case OP_ASSERT:
     case OP_ASSERTBACK:
+    case OP_ASSERT_NA:
+    case OP_ASSERTBACK_NA:
     Lframe_type = GF_NOCAPTURE | Fop;
     for (;;)
       {
@@ -5410,7 +5418,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
       {
       while (number-- > 0)
         {
-        if (Feptr <= mb->start_subject) RRETURN(MATCH_NOMATCH);
+        if (Feptr <= mb->check_subject) RRETURN(MATCH_NOMATCH);
         Feptr--;
         BACKCHAR(Feptr);
         }
@@ -5418,7 +5426,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
     else
 #endif
 
-    /* No UTF-8 support, or not in UTF-8 mode: count is byte count */
+    /* No UTF-8 support, or not in UTF-8 mode: count is code unit count */
 
       {
       if ((ptrdiff_t)number > Feptr - mb->start_subject) RRETURN(MATCH_NOMATCH);
@@ -5470,15 +5478,16 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
 
       /* If we are at the end of an assertion that is a condition, return a
       match, discarding any intermediate backtracking points. Copy back the
-      captures into the frame before N so that they are set on return. Doing
-      this for all assertions, both positive and negative, seems to match what
-      Perl does. */
+      mark setting and the captures into the frame before N so that they are
+      set on return. Doing this for all assertions, both positive and negative,
+      seems to match what Perl does. */
 
       if (GF_IDMASK(N->group_frame_type) == GF_CONDASSERT)
         {
         memcpy((char *)P + offsetof(heapframe, ovector), Fovector,
           Foffset_top * sizeof(PCRE2_SIZE));
         P->offset_top = Foffset_top;
+        P->mark = Fmark;
         Fback_frame = (char *)F - (char *)P;
         RRETURN(MATCH_MATCH);
         }
@@ -5494,10 +5503,20 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
       case OP_SCOND:
       break;
 
-      /* Positive assertions are like OP_ONCE, except that in addition the
+      /* Non-atomic positive assertions are like OP_BRA, except that the
       subject pointer must be put back to where it was at the start of the
       assertion. */
 
+      case OP_ASSERT_NA:
+      case OP_ASSERTBACK_NA:
+      if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
+      Feptr = P->eptr;
+      break;
+
+      /* Atomic positive assertions are like OP_ONCE, except that in addition
+      the subject pointer must be put back to where it was at the start of the
+      assertion. */
+
       case OP_ASSERT:
       case OP_ASSERTBACK:
       if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
@@ -5526,6 +5545,14 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
       case OP_ASSERTBACK_NOT:
       RRETURN(MATCH_MATCH);
 
+      /* At the end of a script run, apply the script-checking rules. This code
+      will never by exercised if Unicode support it not compiled, because in
+      that environment script runs cause an error at compile time. */
+
+      case OP_SCRIPT_RUN:
+      if (!PRIV(script_run)(P->eptr, Feptr, utf)) RRETURN(MATCH_NOMATCH);
+      break;
+
       /* Whole-pattern recursion is coded as a recurse into group 0, so it
       won't be picked up here. Instead, we catch it when the OP_END is reached.
       Other recursion is handled here. */
@@ -5630,7 +5657,11 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
 
     case OP_EOD:
     if (Feptr < mb->end_subject) RRETURN(MATCH_NOMATCH);
-    SCHECK_PARTIAL();
+    if (mb->partial != 0)
+      {
+      mb->hitend = TRUE;
+      if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
+      }
     Fecode++;
     break;
 
@@ -5655,7 +5686,11 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
 
     /* Either at end of string or \n before end. */
 
-    SCHECK_PARTIAL();
+    if (mb->partial != 0)
+      {
+      mb->hitend = TRUE;
+      if (mb->partial > 1) return PCRE2_ERROR_PARTIAL;
+      }
     Fecode++;
     break;
 
@@ -5733,7 +5768,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
 
     case OP_NOT_WORD_BOUNDARY:
     case OP_WORD_BOUNDARY:
-    if (Feptr == mb->start_subject) prev_is_word = FALSE; else
+    if (Feptr == mb->check_subject) prev_is_word = FALSE; else
       {
       PCRE2_SPTR lastptr = Feptr - 1;
 #ifdef SUPPORT_UNICODE
@@ -5936,6 +5971,7 @@ in rrc. */
 #define LBL(val) case val: goto L_RM##val;
 
 RETURN_SWITCH:
+if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
 if (Frdepth == 0) return rrc;                     /* Exit from the top level */
 F = (heapframe *)((char *)F - Fback_frame);       /* Backtrack */
 mb->cb->callout_flags |= PCRE2_CALLOUT_BACKTRACK; /* Note for callouts */
@@ -5989,9 +6025,9 @@ Arguments:
 
 Returns:          > 0 => success; value is the number of ovector pairs filled
                   = 0 => success, but ovector is not big enough
-                   -1 => failed to match (PCRE2_ERROR_NOMATCH)
-                   -2 => partial match (PCRE2_ERROR_PARTIAL)
-                 < -2 => some kind of unexpected problem
+                  = -1 => failed to match (PCRE2_ERROR_NOMATCH)
+                  = -2 => partial match (PCRE2_ERROR_PARTIAL)
+                  < -2 => some kind of unexpected problem
 */
 
 PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
@@ -6000,8 +6036,8 @@ pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
   pcre2_match_context *mcontext)
 {
 int rc;
+int was_zero_terminated = 0;
 const uint8_t *start_bits = NULL;
-
 const pcre2_real_code *re = (const pcre2_real_code *)code;
 
 BOOL anchored;
@@ -6011,6 +6047,11 @@ BOOL has_req_cu = FALSE;
 BOOL startline;
 BOOL utf;
 
+#if PCRE2_CODE_UNIT_WIDTH == 8
+BOOL memchr_not_found_first_cu = FALSE;
+BOOL memchr_not_found_first_cu2 = FALSE;
+#endif
+
 PCRE2_UCHAR first_cu = 0;
 PCRE2_UCHAR first_cu2 = 0;
 PCRE2_UCHAR req_cu = 0;
@@ -6018,10 +6059,23 @@ PCRE2_UCHAR req_cu2 = 0;
 
 PCRE2_SPTR bumpalong_limit;
 PCRE2_SPTR end_subject;
+PCRE2_SPTR true_end_subject;
 PCRE2_SPTR start_match = subject + start_offset;
 PCRE2_SPTR req_cu_ptr = start_match - 1;
-PCRE2_SPTR start_partial = NULL;
-PCRE2_SPTR match_partial = NULL;
+PCRE2_SPTR start_partial;
+PCRE2_SPTR match_partial;
+
+#ifdef SUPPORT_JIT
+BOOL use_jit;
+#endif
+
+#ifdef SUPPORT_UNICODE
+BOOL allow_invalid;
+uint32_t fragment_options = 0;
+#ifdef SUPPORT_JIT
+BOOL jit_checked_utf = FALSE;
+#endif
+#endif
 
 PCRE2_SIZE frame_size;
 
@@ -6043,8 +6097,12 @@ mb->stack_frames = (heapframe *)stack_frames_vector;
 /* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated
 subject string. */
 
-if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
-end_subject = subject + length;
+if (length == PCRE2_ZERO_TERMINATED)
+  {
+  length = PRIV(strlen)(subject);
+  was_zero_terminated = 1;
+  }
+true_end_subject = end_subject = subject + length;
 
 /* Plausibility checks */
 
@@ -6080,12 +6138,24 @@ options |= (re->flags & FF) / ((FF & (~FF+1)) / (OO & (~OO+1)));
 #undef FF
 #undef OO
 
-/* These two settings are used in the code for checking a UTF string that
-follows immediately afterwards. Other values in the mb block are used only
-during interpretive processing, not when the JIT support is in use, so they are
-set up later. */
+/* If the pattern was successfully studied with JIT support, we will 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. */
+
+#ifdef SUPPORT_JIT
+use_jit = (re->executable_jit != NULL &&
+          (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0);
+#endif
+
+/* Initialize UTF parameters. */
 
 utf = (re->overall_options & PCRE2_UTF) != 0;
+#ifdef SUPPORT_UNICODE
+allow_invalid = (re->overall_options & PCRE2_MATCH_INVALID_UTF) != 0;
+#endif
+
+/* Convert the partial matching flags into an integer. */
+
 mb->partial = ((options & PCRE2_PARTIAL_HARD) != 0)? 2 :
               ((options & PCRE2_PARTIAL_SOFT) != 0)? 1 : 0;
 
@@ -6096,85 +6166,269 @@ if (mb->partial != 0 &&
    ((re->overall_options | options) & PCRE2_ENDANCHORED) != 0)
   return PCRE2_ERROR_BADOPTION;
 
-/* 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. 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. */
+/* It is an error to set an offset limit without setting the flag at compile
+time. */
 
-#ifdef SUPPORT_UNICODE
-if (utf && (options & PCRE2_NO_UTF_CHECK) == 0)
+if (mcontext != NULL && mcontext->offset_limit != PCRE2_UNSET &&
+     (re->overall_options & PCRE2_USE_OFFSET_LIMIT) == 0)
+  return PCRE2_ERROR_BADOFFSETLIMIT;
+
+/* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT,
+free the memory that was obtained. Set the field to NULL for no match cases. */
+
+if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0)
   {
-  PCRE2_SPTR check_subject = start_match;  /* start_match includes offset */
+  match_data->memctl.free((void *)match_data->subject,
+    match_data->memctl.memory_data);
+  match_data->flags &= ~PCRE2_MD_COPIED_SUBJECT;
+  }
+match_data->subject = NULL;
+
+/* Zero the error offset in case the first code unit is invalid UTF. */
+
+match_data->startchar = 0;
+
+
+/* ============================= JIT matching ============================== */
 
-  if (start_offset > 0)
+/* Prepare for JIT matching. Check a UTF string for validity unless no check is
+requested or invalid UTF can be handled. We check only the portion of the
+subject that might be be inspected during matching - from the offset minus the
+maximum lookbehind 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_JIT
+if (use_jit)
+  {
+#ifdef SUPPORT_UNICODE
+  if (utf && (options & PCRE2_NO_UTF_CHECK) == 0 && !allow_invalid)
     {
 #if PCRE2_CODE_UNIT_WIDTH != 32
     unsigned int i;
+#endif
+
+    /* For 8-bit and 16-bit UTF, check that the first code unit is a valid
+    character start. */
+
+#if PCRE2_CODE_UNIT_WIDTH != 32
     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 (start_offset > 0) return PCRE2_ERROR_BADUTFOFFSET;
 #if PCRE2_CODE_UNIT_WIDTH == 8
-      (*check_subject & 0xc0) == 0x80)
+      return PCRE2_ERROR_UTF8_ERR20;  /* Isolated 0x80 byte */
+#else
+      return PCRE2_ERROR_UTF16_ERR3;  /* Isolated low surrogate */
+#endif
+      }
+#endif  /* WIDTH != 32 */
+
+    /* Move back by the maximum lookbehind, just in case it happens at the very
+    start of matching. */
+
+#if PCRE2_CODE_UNIT_WIDTH != 32
+    for (i = re->max_lookbehind; i > 0 && start_match > subject; i--)
+      {
+      start_match--;
+      while (start_match > subject &&
+#if PCRE2_CODE_UNIT_WIDTH == 8
+      (*start_match & 0xc0) == 0x80)
 #else  /* 16-bit */
-      (*check_subject & 0xfc00) == 0xdc00)
-#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
-        check_subject--;
+      (*start_match & 0xfc00) == 0xdc00)
+#endif
+        start_match--;
       }
-#else
+#else  /* PCRE2_CODE_UNIT_WIDTH != 32 */
+
     /* 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;
+      start_match -= re->max_lookbehind;
     else
-      check_subject = subject;
+      start_match = subject;
 #endif  /* PCRE2_CODE_UNIT_WIDTH != 32 */
+
+    /* Validate the relevant portion of the subject. Adjust the offset of an
+    invalid code point to be an absolute offset in the whole string. */
+
+    match_data->rc = PRIV(valid_utf)(start_match,
+      length - (start_match - subject), &(match_data->startchar));
+    if (match_data->rc != 0)
+      {
+      match_data->startchar += start_match - subject;
+      return match_data->rc;
+      }
+    jit_checked_utf = TRUE;
     }
+#endif  /* SUPPORT_UNICODE */
 
-  /* Validate the relevant portion of the subject. After an error, adjust the
-  offset to be an absolute offset in the whole string. */
+  /* If JIT returns BADOPTION, which means that the selected complete or
+  partial matching mode was not compiled, fall through to the interpreter. */
 
-  match_data->rc = PRIV(valid_utf)(check_subject,
-    length - (check_subject - subject), &(match_data->startchar));
-  if (match_data->rc != 0)
+  rc = pcre2_jit_match(code, subject, length, start_offset, options,
+    match_data, mcontext);
+  if (rc != PCRE2_ERROR_JIT_BADOPTION)
     {
-    match_data->startchar += check_subject - subject;
-    return match_data->rc;
+    if (rc >= 0 && (options & PCRE2_COPY_MATCHED_SUBJECT) != 0)
+      {
+      length = CU2BYTES(length + was_zero_terminated);
+      match_data->subject = match_data->memctl.malloc(length,
+        match_data->memctl.memory_data);
+      if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY;
+      memcpy((void *)match_data->subject, subject, length);
+      match_data->flags |= PCRE2_MD_COPIED_SUBJECT;
+      }
+    return rc;
     }
   }
-#endif  /* SUPPORT_UNICODE */
+#endif  /* SUPPORT_JIT */
 
-/* It is an error to set an offset limit without setting the flag at compile
-time. */
+/* ========================= End of JIT matching ========================== */
 
-if (mcontext != NULL && 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
-an unsupported option is set or if JIT returns BADOPTION (which means that the
-selected normal or partial matching mode was not compiled). */
+/* Proceed with non-JIT matching. The default is to allow lookbehinds to the
+start of the subject. A UTF check when there is a non-zero offset may change
+this. */
+
+mb->check_subject = subject;
+
+/* If a UTF subject string was not checked for validity in the JIT code above,
+check it here, and handle support for invalid UTF strings. The check above
+happens only when invalid UTF is not supported and PCRE2_NO_CHECK_UTF is unset.
+If we get here in those circumstances, it means the subject string is valid,
+but for some reason JIT matching was not successful. There is no need to check
+the subject again.
 
+We check only the portion of the subject that might be be inspected during
+matching - from the offset minus the maximum lookbehind 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.
+
+Note also that support for invalid UTF forces a check, overriding the setting
+of PCRE2_NO_CHECK_UTF. */
+
+#ifdef SUPPORT_UNICODE
+if (utf &&
 #ifdef SUPPORT_JIT
-if (re->executable_jit != NULL && (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0)
+    !jit_checked_utf &&
+#endif
+    ((options & PCRE2_NO_UTF_CHECK) == 0 || allow_invalid))
   {
-  rc = pcre2_jit_match(code, subject, length, start_offset, options,
-    match_data, mcontext);
-  if (rc != PCRE2_ERROR_JIT_BADOPTION) return rc;
-  }
+#if PCRE2_CODE_UNIT_WIDTH != 32
+  BOOL skipped_bad_start = FALSE;
+#endif
+
+  /* For 8-bit and 16-bit UTF, check that the first code unit is a valid
+  character start. If we are handling invalid UTF, just skip over such code
+  units. Otherwise, give an appropriate error. */
+
+#if PCRE2_CODE_UNIT_WIDTH != 32
+  if (allow_invalid)
+    {
+    while (start_match < end_subject && NOT_FIRSTCU(*start_match))
+      {
+      start_match++;
+      skipped_bad_start = TRUE;
+      }
+    }
+  else if (start_match < end_subject && NOT_FIRSTCU(*start_match))
+    {
+    if (start_offset > 0) return PCRE2_ERROR_BADUTFOFFSET;
+#if PCRE2_CODE_UNIT_WIDTH == 8
+    return PCRE2_ERROR_UTF8_ERR20;  /* Isolated 0x80 byte */
+#else
+    return PCRE2_ERROR_UTF16_ERR3;  /* Isolated low surrogate */
 #endif
+    }
+#endif  /* WIDTH != 32 */
+
+  /* The mb->check_subject field points to the start of UTF checking;
+  lookbehinds can go back no further than this. */
 
-/* Carry on with non-JIT matching. A NULL match context means "use a default
-context", but we take the memory control functions from the pattern. */
+  mb->check_subject = start_match;
+
+  /* Move back by the maximum lookbehind, just in case it happens at the very
+  start of matching, but don't do this if we skipped bad 8-bit or 16-bit code
+  units above. */
+
+#if PCRE2_CODE_UNIT_WIDTH != 32
+  if (!skipped_bad_start)
+    {
+    unsigned int i;
+    for (i = re->max_lookbehind; i > 0 && mb->check_subject > subject; i--)
+      {
+      mb->check_subject--;
+      while (mb->check_subject > subject &&
+#if PCRE2_CODE_UNIT_WIDTH == 8
+      (*mb->check_subject & 0xc0) == 0x80)
+#else  /* 16-bit */
+      (*mb->check_subject & 0xfc00) == 0xdc00)
+#endif
+        mb->check_subject--;
+      }
+    }
+#else  /* PCRE2_CODE_UNIT_WIDTH != 32 */
+
+  /* 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)
+    mb->check_subject -= re->max_lookbehind;
+  else
+    mb->check_subject = subject;
+#endif  /* PCRE2_CODE_UNIT_WIDTH != 32 */
+
+  /* Validate the relevant portion of the subject. There's a loop in case we
+  encounter bad UTF in the characters preceding start_match which we are
+  scanning because of a lookbehind. */
+
+  for (;;)
+    {
+    match_data->rc = PRIV(valid_utf)(mb->check_subject,
+      length - (mb->check_subject - subject), &(match_data->startchar));
+
+    if (match_data->rc == 0) break;   /* Valid UTF string */
+
+    /* Invalid UTF string. Adjust the offset to be an absolute offset in the
+    whole string. If we are handling invalid UTF strings, set end_subject to
+    stop before the bad code unit, and set the options to "not end of line".
+    Otherwise return the error. */
+
+    match_data->startchar += mb->check_subject - subject;
+    if (!allow_invalid || match_data->rc > 0) return match_data->rc;
+    end_subject = subject + match_data->startchar;
+
+    /* If the end precedes start_match, it means there is invalid UTF in the
+    extra code units we reversed over because of a lookbehind. Advance past the
+    first bad code unit, and then skip invalid character starting code units in
+    8-bit and 16-bit modes, and try again. */
+
+    if (end_subject < start_match)
+      {
+      mb->check_subject = end_subject + 1;
+#if PCRE2_CODE_UNIT_WIDTH != 32
+      while (mb->check_subject < start_match && NOT_FIRSTCU(*mb->check_subject))
+        mb->check_subject++;
+#endif
+      }
+
+    /* Otherwise, set the not end of line option, and do the match. */
+
+    else
+      {
+      fragment_options = PCRE2_NOTEOL;
+      break;
+      }
+    }
+  }
+#endif  /* SUPPORT_UNICODE */
+
+/* A NULL match context means "use a default context", but we take the memory
+control functions from the pattern. */
 
 if (mcontext == NULL)
   {
@@ -6186,8 +6440,8 @@ else mb->memctl = mcontext->memctl;
 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;
+bumpalong_limit = (mcontext->offset_limit == PCRE2_UNSET)?
+  true_end_subject : subject + mcontext->offset_limit;
 
 /* Initialize and set up the fixed fields in the callout block, with a pointer
 in the match block. */
@@ -6198,7 +6452,8 @@ cb.subject = subject;
 cb.subject_length = (PCRE2_SIZE)(end_subject - subject);
 cb.callout_flags = 0;
 
-/* Fill in the remaining fields in the match block. */
+/* Fill in the remaining fields in the match block, except for moptions, which
+gets set later. */
 
 mb->callout = mcontext->callout;
 mb->callout_data = mcontext->callout_data;
@@ -6207,13 +6462,11 @@ mb->start_subject = subject;
 mb->start_offset = start_offset;
 mb->end_subject = end_subject;
 mb->hasthen = (re->flags & PCRE2_HASTHEN) != 0;
-
-mb->moptions = options;                 /* Match options */
-mb->poptions = re->overall_options;     /* Pattern options */
-
+mb->allowemptypartial = (re->max_lookbehind > 0) ||
+    (re->flags & PCRE2_MATCH_EMPTY) != 0;
+mb->poptions = re->overall_options;          /* Pattern options */
 mb->ignore_skip_arg = 0;
-mb->mark = mb->nomatch_mark = NULL;     /* In case never set */
-mb->hitend = FALSE;
+mb->mark = mb->nomatch_mark = NULL;          /* In case never set */
 
 /* The name table is needed for finding all the numbers associated with a
 given name, for condition testing. The code follows the name table. */
@@ -6366,6 +6619,13 @@ if ((re->flags & PCRE2_LASTSET) != 0)
 /* Loop for handling unanchored repeated matching attempts; for anchored regexs
 the loop runs just once. */
 
+#ifdef SUPPORT_UNICODE
+FRAGMENT_RESTART:
+#endif
+
+start_partial = match_partial = NULL;
+mb->hitend = FALSE;
+
 for(;;)
   {
   PCRE2_SPTR new_start_match;
@@ -6421,7 +6681,7 @@ for(;;)
 #if PCRE2_CODE_UNIT_WIDTH != 8
             if (c > 255) c = 255;
 #endif
-            ok = (start_bits[c/8] & (1 << (c&7))) != 0;
+            ok = (start_bits[c/8] & (1u << (c&7))) != 0;
             }
           }
         if (!ok)
@@ -6435,7 +6695,10 @@ for(;;)
     /* Not anchored. Advance to a unique first code unit if there is one. In
     8-bit mode, the use of memchr() gives a big speed up, even though we have
     to call it twice in caseless mode, in order to find the earliest occurrence
-    of the character in either of its cases. */
+    of the character in either of its cases. If a call to memchr() that
+    searches the rest of the subject fails to find one case, remember that in
+    order not to keep on repeating the search. This can make a huge difference
+    when the strings are very long and only one case is present. */
 
     else
       {
@@ -6449,11 +6712,29 @@ for(;;)
                 (smc = UCHAR21TEST(start_match)) != first_cu &&
                   smc != first_cu2)
             start_match++;
+
 #else  /* 8-bit code units */
-          PCRE2_SPTR pp1 =
-            memchr(start_match, first_cu, end_subject-start_match);
-          PCRE2_SPTR pp2 =
-            memchr(start_match, first_cu2, end_subject-start_match);
+          PCRE2_SPTR pp1 = NULL;
+          PCRE2_SPTR pp2 = NULL;
+          PCRE2_SIZE cu2size = end_subject - start_match;
+
+          if (!memchr_not_found_first_cu)
+            {
+            pp1 = memchr(start_match, first_cu, end_subject - start_match);
+            if (pp1 == NULL) memchr_not_found_first_cu = TRUE;
+              else cu2size = pp1 - start_match;
+            }
+
+          /* If pp1 is not NULL, we have arranged to search only as far as pp1,
+          to see if the other case is earlier, so we can set "not found" only
+          when both searches have returned NULL. */
+
+          if (!memchr_not_found_first_cu2)
+            {
+            pp2 = memchr(start_match, first_cu2, cu2size);
+            memchr_not_found_first_cu2 = (pp2 == NULL && pp1 == NULL);
+            }
+
           if (pp1 == NULL)
             start_match = (pp2 == NULL)? end_subject : pp2;
           else
@@ -6485,7 +6766,7 @@ for(;;)
         we also let the cycle run, because the matching string is legitimately
         allowed to start with the first code unit of a newline. */
 
-        if (!mb->partial && start_match >= mb->end_subject)
+        if (mb->partial == 0 && start_match >= mb->end_subject)
           {
           rc = MATCH_NOMATCH;
           break;
@@ -6538,13 +6819,13 @@ for(;;)
 #if PCRE2_CODE_UNIT_WIDTH != 8
           if (c > 255) c = 255;
 #endif
-          if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
+          if ((start_bits[c/8] & (1u << (c&7))) != 0) break;
           start_match++;
           }
 
         /* See comment above in first_cu checking about the next few lines. */
 
-        if (!mb->partial && start_match >= mb->end_subject)
+        if (mb->partial == 0 && start_match >= mb->end_subject)
           {
           rc = MATCH_NOMATCH;
           break;
@@ -6558,8 +6839,10 @@ for(;;)
 
     /* The following two optimizations must be disabled for partial matching. */
 
-    if (!mb->partial)
+    if (mb->partial == 0)
       {
+      PCRE2_SPTR p;
+
       /* The minimum matching length is a lower bound; no string of that length
       may actually match the pattern. Although the value is, strictly, in
       characters, we treat it as code units to avoid spending too much time in
@@ -6583,60 +6866,57 @@ for(;;)
       memchr() twice in the caseless case because we only need to check for the
       presence of the character in either case, not find the first occurrence.
 
+      The search can be skipped if the code unit was found later than the
+      current starting point in a previous iteration of the bumpalong loop.
+
       HOWEVER: when the subject string is very, very long, searching to its end
       can take a long time, and give bad performance on quite ordinary
-      patterns. This showed up when somebody was matching something like
-      /^\d+C/ on a 32-megabyte string... so we don't do this when the string is
-      sufficiently long. */
+      anchored patterns. This showed up when somebody was matching something
+      like /^\d+C/ on a 32-megabyte string... so we don't do this when the
+      string is sufficiently long, but it's worth searching a lot more for
+      unanchored patterns. */
 
-      if (has_req_cu && end_subject - start_match < REQ_CU_MAX)
+      p = start_match + (has_first_cu? 1:0);
+      if (has_req_cu && p > req_cu_ptr)
         {
-        PCRE2_SPTR p = start_match + (has_first_cu? 1:0);
-
-        /* We don't need to repeat the search if we haven't yet reached the
-        place we found it last time round the bumpalong loop. */
+        PCRE2_SIZE check_length = end_subject - start_match;
 
-        if (p > req_cu_ptr)
+        if (check_length < REQ_CU_MAX ||
+              (!anchored && check_length < REQ_CU_MAX * 1000))
           {
-          if (p < end_subject)
+          if (req_cu != req_cu2)  /* Caseless */
             {
-            if (req_cu != req_cu2)  /* Caseless */
-              {
 #if PCRE2_CODE_UNIT_WIDTH != 8
-              do
-                {
-                uint32_t pp = UCHAR21INCTEST(p);
-                if (pp == req_cu || pp == req_cu2) { p--; break; }
-                }
-              while (p < end_subject);
-
+            while (p < end_subject)
+              {
+              uint32_t pp = UCHAR21INCTEST(p);
+              if (pp == req_cu || pp == req_cu2) { p--; break; }
+              }
 #else  /* 8-bit code units */
-              PCRE2_SPTR pp = p;
-              p = memchr(pp, req_cu, end_subject - pp);
-              if (p == NULL)
-                {
-                p = memchr(pp, req_cu2, end_subject - pp);
-                if (p == NULL) p = end_subject;
-                }
-#endif /* PCRE2_CODE_UNIT_WIDTH != 8 */
+            PCRE2_SPTR pp = p;
+            p = memchr(pp, req_cu, end_subject - pp);
+            if (p == NULL)
+              {
+              p = memchr(pp, req_cu2, end_subject - pp);
+              if (p == NULL) p = end_subject;
               }
+#endif /* PCRE2_CODE_UNIT_WIDTH != 8 */
+            }
 
-            /* The caseful case */
+          /* The caseful case */
 
-            else
-              {
+          else
+            {
 #if PCRE2_CODE_UNIT_WIDTH != 8
-              do
-                {
-                if (UCHAR21INCTEST(p) == req_cu) { p--; break; }
-                }
-              while (p < end_subject);
+            while (p < end_subject)
+              {
+              if (UCHAR21INCTEST(p) == req_cu) { p--; break; }
+              }
 
 #else  /* 8-bit code units */
-              p = memchr(p, req_cu, end_subject - p);
-              if (p == NULL) p = end_subject;
+            p = memchr(p, req_cu, end_subject - p);
+            if (p == NULL) p = end_subject;
 #endif
-              }
             }
 
           /* If we can't find the required code unit, break the bumpalong loop,
@@ -6676,6 +6956,11 @@ for(;;)
 
   mb->start_used_ptr = start_match;
   mb->last_used_ptr = start_match;
+#ifdef SUPPORT_UNICODE
+  mb->moptions = options | fragment_options;
+#else
+  mb->moptions = options;
+#endif
   mb->match_call_count = 0;
   mb->end_offset_top = 0;
   mb->skip_arg_count = 0;
@@ -6801,6 +7086,68 @@ for(;;)
 
 ENDLOOP:
 
+/* If end_subject != true_end_subject, it means we are handling invalid UTF,
+and have just processed a non-terminal fragment. If this resulted in no match
+or a partial match we must carry on to the next fragment (a partial match is
+returned to the caller only at the very end of the subject). A loop is used to
+avoid trying to match against empty fragments; if the pattern can match an
+empty string it would have done so already. */
+
+#ifdef SUPPORT_UNICODE
+if (utf && end_subject != true_end_subject &&
+    (rc == MATCH_NOMATCH || rc == PCRE2_ERROR_PARTIAL))
+  {
+  for (;;)
+    {
+    /* Advance past the first bad code unit, and then skip invalid character
+    starting code units in 8-bit and 16-bit modes. */
+
+    start_match = end_subject + 1;
+#if PCRE2_CODE_UNIT_WIDTH != 32
+    while (start_match < true_end_subject && NOT_FIRSTCU(*start_match))
+      start_match++;
+#endif
+
+    /* If we have hit the end of the subject, there isn't another non-empty
+    fragment, so give up. */
+
+    if (start_match >= true_end_subject)
+      {
+      rc = MATCH_NOMATCH;  /* In case it was partial */
+      break;
+      }
+
+    /* Check the rest of the subject */
+
+    mb->check_subject = start_match;
+    rc = PRIV(valid_utf)(start_match, length - (start_match - subject),
+      &(match_data->startchar));
+
+    /* The rest of the subject is valid UTF. */
+
+    if (rc == 0)
+      {
+      mb->end_subject = end_subject = true_end_subject;
+      fragment_options = PCRE2_NOTBOL;
+      goto FRAGMENT_RESTART;
+      }
+
+    /* A subsequent UTF error has been found; if the next fragment is
+    non-empty, set up to process it. Otherwise, let the loop advance. */
+
+    else if (rc < 0)
+      {
+      mb->end_subject = end_subject = start_match + match_data->startchar;
+      if (end_subject > start_match)
+        {
+        fragment_options = PCRE2_NOTBOL|PCRE2_NOTEOL;
+        goto FRAGMENT_RESTART;
+        }
+      }
+    }
+  }
+#endif  /* SUPPORT_UNICODE */
+
 /* Release an enlarged frame vector that is on the heap. */
 
 if (mb->match_frames != mb->stack_frames)
@@ -6809,13 +7156,13 @@ if (mb->match_frames != mb->stack_frames)
 /* Fill in fields that are always returned in the match data. */
 
 match_data->code = re;
-match_data->subject = subject;
 match_data->mark = mb->mark;
 match_data->matchedby = PCRE2_MATCHEDBY_INTERPRETER;
 
 /* Handle a fully successful match. Set the return code to the number of
 captured strings, or 0 if there were too many to fit into the ovector, and then
-set the remaining returned values before returning. */
+set the remaining returned values before returning. Make a copy of the subject
+string if requested. */
 
 if (rc == MATCH_MATCH)
   {
@@ -6825,6 +7172,16 @@ if (rc == MATCH_MATCH)
   match_data->leftchar = mb->start_used_ptr - subject;
   match_data->rightchar = ((mb->last_used_ptr > mb->end_match_ptr)?
     mb->last_used_ptr : mb->end_match_ptr) - subject;
+  if ((options & PCRE2_COPY_MATCHED_SUBJECT) != 0)
+    {
+    length = CU2BYTES(length + was_zero_terminated);
+    match_data->subject = match_data->memctl.malloc(length,
+      match_data->memctl.memory_data);
+    if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY;
+    memcpy((void *)match_data->subject, subject, length);
+    match_data->flags |= PCRE2_MD_COPIED_SUBJECT;
+    }
+  else match_data->subject = subject;
   return match_data->rc;
   }
 
@@ -6838,10 +7195,14 @@ match_data->mark = mb->nomatch_mark;
 
 if (rc != MATCH_NOMATCH && rc != PCRE2_ERROR_PARTIAL) match_data->rc = rc;
 
-/* Handle a partial match. */
+/* Handle a partial match. If a "soft" partial match was requested, searching
+for a complete match will have continued, and the value of rc at this point
+will be MATCH_NOMATCH. For a "hard" partial match, it will already be
+PCRE2_ERROR_PARTIAL. */
 
 else if (match_partial != NULL)
   {
+  match_data->subject = subject;
   match_data->ovector[0] = match_partial - subject;
   match_data->ovector[1] = end_subject - subject;
   match_data->startchar = match_partial - subject;
index b297f326b556289c63fccd4c39a276e8ef6d65ec..53e469870796445843786654a07322f155067cea 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) 2016-2017 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -63,6 +63,7 @@ yield = PRIV(memctl_malloc)(
   (pcre2_memctl *)gcontext);
 if (yield == NULL) return NULL;
 yield->oveccount = oveccount;
+yield->flags = 0;
 return yield;
 }
 
@@ -93,7 +94,12 @@ PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
 pcre2_match_data_free(pcre2_match_data *match_data)
 {
 if (match_data != NULL)
+  {
+  if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0)
+    match_data->memctl.free((void *)match_data->subject,
+      match_data->memctl.memory_data);
   match_data->memctl.free(match_data, match_data->memctl.memory_data);
+  }
 }
 
 
@@ -144,4 +150,17 @@ pcre2_get_startchar(pcre2_match_data *match_data)
 return match_data->startchar;
 }
 
+
+
+/*************************************************
+*         Get size of match data block           *
+*************************************************/
+
+PCRE2_EXP_DEFN PCRE2_SIZE PCRE2_CALL_CONVENTION
+pcre2_get_match_data_size(pcre2_match_data *match_data)
+{
+return offsetof(pcre2_match_data, ovector) +
+  2 * (match_data->oveccount) * sizeof(PCRE2_SIZE);
+}
+
 /* End of pcre2_match_data.c */
index bd10c6b1da3d233f268c8810bae3f3bd58cc72a6..b9bab025ab38fce379683a00ef9a137b6f7dad86 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -392,7 +392,10 @@ for(;;)
     case OP_ASSERT_NOT:
     case OP_ASSERTBACK:
     case OP_ASSERTBACK_NOT:
+    case OP_ASSERT_NA:
+    case OP_ASSERTBACK_NA:
     case OP_ONCE:
+    case OP_SCRIPT_RUN:
     case OP_COND:
     case OP_SCOND:
     case OP_REVERSE:
@@ -672,17 +675,18 @@ for(;;)
         map = (uint8_t *)ccode;
         if (invertmap)
           {
-          for (i = 0; i < 32; i++) inverted_map[i] = ~map[i];
+          /* Using 255 ^ instead of ~ avoids clang sanitize warning. */
+          for (i = 0; i < 32; i++) inverted_map[i] = 255 ^ map[i];
           map = inverted_map;
           }
 
         for (i = 0; i < 256; i++)
           {
-          if ((map[i/8] & (1 << (i&7))) != 0)
+          if ((map[i/8] & (1u << (i&7))) != 0)
             {
             int j;
             for (j = i+1; j < 256; j++)
-              if ((map[j/8] & (1 << (j&7))) == 0) break;
+              if ((map[j/8] & (1u << (j&7))) == 0) break;
             if (i == '-' || i == ']') fprintf(f, "\\");
             if (PRINTABLE(i)) fprintf(f, "%c", i);
               else fprintf(f, "\\x%02x", i);
diff --git a/src/pcre2_script_run.c b/src/pcre2_script_run.c
new file mode 100644 (file)
index 0000000..91a4833
--- /dev/null
@@ -0,0 +1,441 @@
+/*************************************************
+*      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-2018 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 the function for checking a script run. */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pcre2_internal.h"
+
+
+/*************************************************
+*                Check script run                *
+*************************************************/
+
+/* A script run is conceptually a sequence of characters all in the same
+Unicode script. However, it isn't quite that simple. There are special rules
+for scripts that are commonly used together, and also special rules for digits.
+This function implements the appropriate checks, which is possible only when
+PCRE2 is compiled with Unicode support. The function returns TRUE if there is
+no Unicode support; however, it should never be called in that circumstance
+because an error is given by pcre2_compile() if a script run is called for in a
+version of PCRE2 compiled without Unicode support.
+
+Arguments:
+  pgr       point to the first character
+  endptr    point after the last character
+  utf       TRUE if in UTF mode
+
+Returns:    TRUE if this is a valid script run
+*/
+
+/* These dummy values must be less than the negation of the largest offset in
+the PRIV(ucd_script_sets) vector, which is held in a 16-bit field in UCD
+records (and is only likely to be a few hundred). */
+
+#define SCRIPT_UNSET        (-99999)
+#define SCRIPT_HANPENDING   (-99998)
+#define SCRIPT_HANHIRAKATA  (-99997)
+#define SCRIPT_HANBOPOMOFO  (-99996)
+#define SCRIPT_HANHANGUL    (-99995)
+#define SCRIPT_LIST         (-99994)
+
+#define INTERSECTION_LIST_SIZE 50
+
+BOOL
+PRIV(script_run)(PCRE2_SPTR ptr, PCRE2_SPTR endptr, BOOL utf)
+{
+#ifdef SUPPORT_UNICODE
+int require_script = SCRIPT_UNSET;
+uint8_t intersection_list[INTERSECTION_LIST_SIZE];
+const uint8_t *require_list = NULL;
+uint32_t require_digitset = 0;
+uint32_t c;
+
+#if PCRE2_CODE_UNIT_WIDTH == 32
+(void)utf;    /* Avoid compiler warning */
+#endif
+
+/* Any string containing fewer than 2 characters is a valid script run. */
+
+if (ptr >= endptr) return TRUE;
+GETCHARINCTEST(c, ptr);
+if (ptr >= endptr) return TRUE;
+
+/* Scan strings of two or more characters, checking the Unicode characteristics
+of each code point. We make use of the Script Extensions property. There is
+special code for scripts that can be combined with characters from the Han
+Chinese script. This may be used in conjunction with four other scripts in
+these combinations:
+
+. Han with Hiragana and Katakana is allowed (for Japanese).
+. Han with Bopomofo is allowed (for Taiwanese Mandarin).
+. Han with Hangul is allowed (for Korean).
+
+If the first significant character's script is one of the four, the required
+script type is immediately known. However, if the first significant
+character's script is Han, we have to keep checking for a non-Han character.
+Hence the SCRIPT_HANPENDING state. */
+
+for (;;)
+  {
+  const ucd_record *ucd = GET_UCD(c);
+  int32_t scriptx = ucd->scriptx;
+
+  /* If the script extension is Unknown, the string is not a valid script run.
+  Such characters can only form script runs of length one. */
+
+  if (scriptx == ucp_Unknown) return FALSE;
+
+  /* A character whose script extension is Inherited is always accepted with
+  any script, and plays no further part in this testing. A character whose
+  script is Common is always accepted, but must still be tested for a digit
+  below. The scriptx value at this point is non-zero, because zero is
+  ucp_Unknown, tested for above. */
+
+  if (scriptx != ucp_Inherited)
+    {
+    if (scriptx != ucp_Common)
+      {
+      /* If the script extension value is positive, the character is not a mark
+      that can be used with many scripts. In the simple case we either set or
+      compare with the required script. However, handling the scripts that can
+      combine with Han are more complicated, as is the case when the previous
+      characters have been man-script marks. */
+
+      if (scriptx > 0)
+        {
+        switch(require_script)
+          {
+          /* Either the first significant character (require_script unset) or
+          after only Han characters. */
+
+          case SCRIPT_UNSET:
+          case SCRIPT_HANPENDING:
+          switch(scriptx)
+            {
+            case ucp_Han:
+            require_script = SCRIPT_HANPENDING;
+            break;
+
+            case ucp_Hiragana:
+            case ucp_Katakana:
+            require_script = SCRIPT_HANHIRAKATA;
+            break;
+
+            case ucp_Bopomofo:
+            require_script = SCRIPT_HANBOPOMOFO;
+            break;
+
+            case ucp_Hangul:
+            require_script = SCRIPT_HANHANGUL;
+            break;
+
+            /* Not a Han-related script. If expecting one, fail. Otherise set
+            the requirement to this script. */
+
+            default:
+            if (require_script == SCRIPT_HANPENDING) return FALSE;
+            require_script = scriptx;
+            break;
+            }
+          break;
+
+          /* Previously encountered one of the "with Han" scripts. Check that
+          this character is appropriate. */
+
+          case SCRIPT_HANHIRAKATA:
+          if (scriptx != ucp_Han && scriptx != ucp_Hiragana && 
+              scriptx != ucp_Katakana)
+            return FALSE;
+          break;
+
+          case SCRIPT_HANBOPOMOFO:
+          if (scriptx != ucp_Han && scriptx != ucp_Bopomofo) return FALSE;
+          break;
+
+          case SCRIPT_HANHANGUL:
+          if (scriptx != ucp_Han && scriptx != ucp_Hangul) return FALSE;
+          break;
+
+          /* We have a list of scripts to check that is derived from one or
+          more previous characters. This is either one of the lists in
+          ucd_script_sets[] (for one previous character) or the intersection of
+          several lists for multiple characters. */
+
+          case SCRIPT_LIST:
+            {
+            const uint8_t *list;
+            for (list = require_list; *list != 0; list++)
+              {
+              if (*list == scriptx) break;
+              }
+            if (*list == 0) return FALSE;
+            }
+
+          /* The rest of the string must be in this script, but we have to 
+          allow for the Han complications. */
+          
+          switch(scriptx)
+            {
+            case ucp_Han:
+            require_script = SCRIPT_HANPENDING;
+            break;
+
+            case ucp_Hiragana:
+            case ucp_Katakana:
+            require_script = SCRIPT_HANHIRAKATA;
+            break;
+
+            case ucp_Bopomofo:
+            require_script = SCRIPT_HANBOPOMOFO;
+            break;
+
+            case ucp_Hangul:
+            require_script = SCRIPT_HANHANGUL;
+            break;
+
+            default:
+            require_script = scriptx;
+            break;
+            }  
+          break;
+
+          /* This is the easy case when a single script is required. */
+
+          default:
+          if (scriptx != require_script) return FALSE;
+          break;
+          }
+        }  /* End of handing positive scriptx */
+
+      /* If scriptx is negative, this character is a mark-type character that
+      has a list of permitted scripts. */
+
+      else
+        {
+        uint32_t chspecial;
+        const uint8_t *clist, *rlist;
+        const uint8_t *list = PRIV(ucd_script_sets) - scriptx;
+        
+        switch(require_script)
+          {
+          case SCRIPT_UNSET:
+          require_list = PRIV(ucd_script_sets) - scriptx;
+          require_script = SCRIPT_LIST;
+          break;
+
+          /* An inspection of the Unicode 11.0.0 files shows that there are the
+          following types of Script Extension list that involve the Han,
+          Bopomofo, Hiragana, Katakana, and Hangul scripts:
+
+          . Bopomofo + Han
+          . Han + Hiragana + Katakana
+          . Hiragana + Katakana
+          . Bopopmofo + Hangul + Han + Hiragana + Katakana
+
+          The following code tries to make sense of this. */
+
+#define FOUND_BOPOMOFO 1
+#define FOUND_HIRAGANA 2
+#define FOUND_KATAKANA 4
+#define FOUND_HANGUL   8
+
+          case SCRIPT_HANPENDING:
+          chspecial = 0;
+          for (; *list != 0; list++)
+            {
+            switch (*list)
+              {
+              case ucp_Bopomofo: chspecial |= FOUND_BOPOMOFO; break;
+              case ucp_Hiragana: chspecial |= FOUND_HIRAGANA; break;
+              case ucp_Katakana: chspecial |= FOUND_KATAKANA; break;
+              case ucp_Hangul:   chspecial |= FOUND_HANGUL; break;
+              default: break;
+              }
+            }
+
+           if (chspecial == 0) return FALSE;
+
+           if (chspecial == FOUND_BOPOMOFO)
+             {
+             require_script = SCRIPT_HANBOPOMOFO;
+             }
+           else if (chspecial == (FOUND_HIRAGANA|FOUND_KATAKANA))
+             {
+             require_script = SCRIPT_HANHIRAKATA;
+             }
+
+          /* Otherwise it must be allowed with all of them, so remain in
+          the pending state. */
+
+          break;
+
+          case SCRIPT_HANHIRAKATA:
+          for (; *list != 0; list++)
+            {
+            if (*list == ucp_Hiragana || *list == ucp_Katakana) break;
+            }
+          if (*list == 0) return FALSE;
+          break;
+
+          case SCRIPT_HANBOPOMOFO:
+          for (; *list != 0; list++)
+            {
+            if (*list == ucp_Bopomofo) break;
+            }
+          if (*list == 0) return FALSE;
+          break;
+
+          case SCRIPT_HANHANGUL:
+          for (; *list != 0; list++)
+            {
+            if (*list == ucp_Hangul) break;
+            }
+          if (*list == 0) return FALSE;
+          break;
+
+          /* Previously encountered one or more characters that are allowed
+          with a list of scripts. Build the intersection of the required list
+          with this character's list in intersection_list[]. This code is
+          written so that it still works OK if the required list is already in
+          that vector. */
+
+          case SCRIPT_LIST:
+            {
+            int i = 0;
+            for (rlist = require_list; *rlist != 0; rlist++)
+              {
+              for (clist = list; *clist != 0; clist++)
+                {
+                if (*rlist == *clist)
+                  {
+                  intersection_list[i++] = *rlist;
+                  break;
+                  }
+                }
+              }
+            if (i == 0) return FALSE;  /* No scripts in common */
+
+            /* If there's just one script in common, we can set it as the
+            unique required script. Otherwise, terminate the intersection list
+            and make it the required list. */
+
+            if (i == 1)
+              {
+              require_script = intersection_list[0];
+              }
+            else
+              {
+              intersection_list[i] = 0;
+              require_list = intersection_list;
+              }
+            }
+          break;
+
+          /* The previously set required script is a single script, not
+          Han-related. Check that it is in this character's list. */
+
+          default:
+          for (; *list != 0; list++)
+            {
+            if (*list == require_script) break;
+            }
+          if (*list == 0) return FALSE;
+          break;
+          }
+        }  /* End of handling negative scriptx */
+      }    /* End of checking non-Common character */
+
+    /* The character is in an acceptable script. We must now ensure that all
+    decimal digits in the string come from the same set. Some scripts (e.g.
+    Common, Arabic) have more than one set of decimal digits. This code does
+    not allow mixing sets, even within the same script. The vector called
+    PRIV(ucd_digit_sets)[] contains, in its first element, the number of
+    following elements, and then, in ascending order, the code points of the
+    '9' characters in every set of 10 digits. Each set is identified by the
+    offset in the vector of its '9' character. An initial check of the first
+    value picks up ASCII digits quickly. Otherwise, a binary chop is used. */
+
+    if (ucd->chartype == ucp_Nd)
+      {
+      uint32_t digitset;
+
+      if (c <= PRIV(ucd_digit_sets)[1]) digitset = 1; else
+        {
+        int mid;
+        int bot = 1;
+        int top = PRIV(ucd_digit_sets)[0];
+        for (;;)
+          {
+          if (top <= bot + 1)    /* <= rather than == is paranoia */
+            {
+            digitset = top;
+            break;
+            }
+          mid = (top + bot) / 2;
+          if (c <= PRIV(ucd_digit_sets)[mid]) top = mid; else bot = mid;
+          }
+        }
+
+      /* A required value of 0 means "unset". */
+
+      if (require_digitset == 0) require_digitset = digitset;
+        else if (digitset != require_digitset) return FALSE;
+      }   /* End digit handling */
+    }     /* End checking non-Inherited character */
+
+  /* If we haven't yet got to the end, pick up the next character. */
+
+  if (ptr >= endptr) return TRUE;
+  GETCHARINCTEST(c, ptr);
+  }  /* End checking loop */
+
+#else   /* NOT SUPPORT_UNICODE */
+(void)ptr;
+(void)endptr;
+(void)utf;
+return TRUE;
+#endif  /* SUPPORT_UNICODE */
+}
+
+/* End of pcre2_script_run.c */
index acbf98b41b51d93679d4740d6b81fe1e348b5770..2883868618d9c8d3ae1d489420d4255dd16f6f47 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -54,7 +54,7 @@ collecting data (e.g. minimum matching length). */
 
 /* Set a bit in the starting code unit bit map. */
 
-#define SET_BIT(c) re->start_bitmap[(c)/8] |= (1 << ((c)&7))
+#define SET_BIT(c) re->start_bitmap[(c)/8] |= (1u << ((c)&7))
 
 /* Returns from set_start_bits() */
 
@@ -88,11 +88,13 @@ Arguments:
   countptr        pointer to call count (to catch over complexity)
   backref_cache   vector for caching back references.
 
+This function is no longer called when the pattern contains (*ACCEPT); however,
+the old code for returning -1 is retained, just in case.
+
 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)
 */
@@ -103,6 +105,7 @@ find_minlength(const pcre2_real_code *re, PCRE2_SPTR code,
   int *backref_cache)
 {
 int length = -1;
+int branchlength = 0;
 int prev_cap_recno = -1;
 int prev_cap_d = 0;
 int prev_recurse_recno = -1;
@@ -110,9 +113,9 @@ 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;
-int branchlength = 0;
+PCRE2_SPTR nextbranch = code + GET(code, 1);
 PCRE2_UCHAR *cc = (PCRE2_UCHAR *)code + 1 + LINK_SIZE;
+recurse_check this_recurse;
 
 /* If this is a "could be empty" group, its minimum length is 0. */
 
@@ -128,16 +131,20 @@ 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. */
+passes 16-bits, reset to that value and skip the rest of the branch. */
 
 for (;;)
   {
   int d, min, recno;
-  PCRE2_UCHAR *cs, *ce;
-  PCRE2_UCHAR op = *cc;
+  PCRE2_UCHAR op, *cs, *ce;
 
-  if (branchlength >= UINT16_MAX) return UINT16_MAX;
+  if (branchlength >= UINT16_MAX)
+    {
+    branchlength = UINT16_MAX;
+    cc = (PCRE2_UCHAR *)nextbranch;
+    }
 
+  op = *cc;
   switch (op)
     {
     case OP_COND:
@@ -171,6 +178,7 @@ for (;;)
     /* Fall through */
 
     case OP_ONCE:
+    case OP_SCRIPT_RUN:
     case OP_SBRA:
     case OP_BRAPOS:
     case OP_SBRAPOS:
@@ -205,7 +213,9 @@ for (;;)
     cc += 1 + LINK_SIZE;
     break;
 
-    /* ACCEPT makes things far too complicated; we have to give up. */
+    /* ACCEPT makes things far too complicated; we have to give up. In fact,
+    from 10.34 onwards, if a pattern contains (*ACCEPT), this function is not
+    used. However, leave the code in place, just in case. */
 
     case OP_ACCEPT:
     case OP_ASSERT_ACCEPT:
@@ -213,9 +223,9 @@ for (;;)
 
     /* Reached end of a branch; if it's a ket it is the end of a nested
     call. If it's ALT it is an alternation in a nested call. If it is END it's
-    the end of the outer call. All can be handled by the same code. If an
-    ACCEPT was previously encountered, use the length that was in force at that
-    time, and pass back the shortest ACCEPT length. */
+    the end of the outer call. All can be handled by the same code. If the
+    length of any branch is zero, there is no need to scan any subsequent
+    branches. */
 
     case OP_ALT:
     case OP_KET:
@@ -225,7 +235,8 @@ for (;;)
     case OP_END:
     if (length < 0 || (!had_recurse && branchlength < length))
       length = branchlength;
-    if (op != OP_ALT) return length;
+    if (op != OP_ALT || length == 0) return length;
+    nextbranch = cc + GET(cc, 1);
     cc += 1 + LINK_SIZE;
     branchlength = 0;
     had_recurse = FALSE;
@@ -237,6 +248,8 @@ for (;;)
     case OP_ASSERT_NOT:
     case OP_ASSERTBACK:
     case OP_ASSERTBACK_NOT:
+    case OP_ASSERT_NA:
+    case OP_ASSERTBACK_NA:
     do cc += GET(cc, 1); while (*cc == OP_ALT);
     /* Fall through */
 
@@ -450,15 +463,17 @@ for (;;)
 
     If PCRE2_MATCH_UNSET_BACKREF is set, a backreference to an unset bracket
     matches an empty string (by default it causes a matching failure), so in
-    that case we must set the minimum length to zero. */
+    that case we must set the minimum length to zero.
+
+    For backreferenes, if duplicate numbers are present in the pattern we check
+    for a reference to a duplicate. If it is, we don't know which version will
+    be referenced, so we have to set the minimum length to zero. */
 
-    /* Duplicate named pattern back reference. We cannot reliably find a length
-    for this if duplicate numbers are present in the pattern. */
+    /* Duplicate named pattern back reference. */
 
     case OP_DNREF:
     case OP_DNREFI:
-    if (dupcapused) return -1;
-    if ((re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0)
+    if (!dupcapused && (re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0)
       {
       int count = GET2(cc, 1+IMM2_SIZE);
       PCRE2_UCHAR *slot =
@@ -481,28 +496,32 @@ for (;;)
           ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, recno);
           if (cs == NULL) return -2;
           do ce += GET(ce, 1); while (*ce == OP_ALT);
-          if (cc > cs && cc < ce)    /* Simple recursion */
-            {
-            dd = 0;
-            had_recurse = TRUE;
-            }
-          else
+
+          dd = 0;
+          if (!dupcapused ||
+              (PCRE2_UCHAR *)PRIV(find_bracket)(ce, utf, recno) == NULL)
             {
-            recurse_check *r = recurses;
-            for (r = recurses; r != NULL; r = r->prev)
-              if (r->group == cs) break;
-            if (r != NULL)           /* Mutual recursion */
+            if (cc > cs && cc < ce)    /* Simple recursion */
               {
-              dd = 0;
               had_recurse = TRUE;
               }
             else
               {
-              this_recurse.prev = recurses;
-              this_recurse.group = cs;
-              dd = find_minlength(re, cs, startcode, utf, &this_recurse,
-                countptr, backref_cache);
-              if (dd < 0) return dd;
+              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;  /* No recursion */
+                this_recurse.group = cs;
+                dd = find_minlength(re, cs, startcode, utf, &this_recurse,
+                  countptr, backref_cache);
+                if (dd < 0) return dd;
+                }
               }
             }
 
@@ -520,48 +539,51 @@ for (;;)
     cc += 1 + 2*IMM2_SIZE;
     goto REPEAT_BACK_REFERENCE;
 
-    /* Single back reference. We cannot find a length for this if duplicate
-    numbers are present in the pattern. */
+    /* Single back reference by number. References by name are converted to by
+    number when there is no duplication. */
 
     case OP_REF:
     case OP_REFI:
-    if (dupcapused) return -1;
     recno = GET2(cc, 1);
     if (recno <= backref_cache[0] && backref_cache[recno] >= 0)
       d = backref_cache[recno];
     else
       {
       int i;
+      d = 0;
+
       if ((re->overall_options & PCRE2_MATCH_UNSET_BACKREF) == 0)
         {
         ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, recno);
         if (cs == NULL) return -2;
         do ce += GET(ce, 1); while (*ce == OP_ALT);
-        if (cc > cs && cc < ce)    /* Simple recursion */
-          {
-          d = 0;
-          had_recurse = TRUE;
-          }
-        else
+
+        if (!dupcapused ||
+            (PCRE2_UCHAR *)PRIV(find_bracket)(ce, utf, recno) == NULL)
           {
-          recurse_check *r = recurses;
-          for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
-          if (r != NULL)           /* Mutual recursion */
+          if (cc > cs && cc < ce)    /* Simple recursion */
             {
-            d = 0;
             had_recurse = TRUE;
             }
           else
             {
-            this_recurse.prev = recurses;
-            this_recurse.group = cs;
-            d = find_minlength(re, cs, startcode, utf, &this_recurse, countptr,
-              backref_cache);
-            if (d < 0) return d;
+            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                     /* No recursion */
+              {
+              this_recurse.prev = recurses;
+              this_recurse.group = cs;
+              d = find_minlength(re, cs, startcode, utf, &this_recurse, countptr,
+                backref_cache);
+              if (d < 0) return d;
+              }
             }
           }
         }
-      else d = 0;
 
       backref_cache[recno] = d;
       for (i = backref_cache[0] + 1; i < recno; i++) backref_cache[i] = -1;
@@ -842,7 +864,7 @@ for (c = 0; c < table_limit; c++)
 if (table_limit == 32) return;
 for (c = 128; c < 256; c++)
   {
-  if ((re->tables[cbits_offset + c/8] & (1 << (c&7))) != 0)
+  if ((re->tables[cbits_offset + c/8] & (1u << (c&7))) != 0)
     {
     PCRE2_UCHAR buff[6];
     (void)PRIV(ord2utf)(c, buff);
@@ -887,7 +909,7 @@ if (table_limit != 32) for (c = 24; c < 32; c++) re->start_bitmap[c] = 0xff;
 
 
 /*************************************************
-*          Create bitmap of starting bytes       *
+*      Create bitmap of starting code units      *
 *************************************************/
 
 /* This function scans a compiled unanchored expression recursively and
@@ -937,6 +959,9 @@ do
     {
     int rc;
     uint8_t *classmap = NULL;
+#ifdef SUPPORT_WIDE_CHARS
+    PCRE2_UCHAR xclassflags;
+#endif
 
     switch(*tcode)
       {
@@ -1075,7 +1100,9 @@ do
       case OP_CBRAPOS:
       case OP_SCBRAPOS:
       case OP_ONCE:
+      case OP_SCRIPT_RUN:
       case OP_ASSERT:
+      case OP_ASSERT_NA:
       rc = set_start_bits(re, tcode, utf);
       if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc;
       if (rc == SSB_DONE) try_next = FALSE; else
@@ -1118,6 +1145,7 @@ do
       case OP_ASSERT_NOT:
       case OP_ASSERTBACK:
       case OP_ASSERTBACK_NOT:
+      case OP_ASSERTBACK_NA:
       do tcode += GET(tcode, 1); while (*tcode == OP_ALT);
       tcode += 1 + LINK_SIZE;
       break;
@@ -1442,20 +1470,59 @@ do
       negative XCLASS without a map, give up. If there are no property checks,
       there must be wide characters on the XCLASS list, because otherwise an
       XCLASS would not have been created. This means that code points >= 255
-      are always potential starters. */
+      are potential starters. In the UTF-8 case we can scan them and set bits
+      for the relevant leading bytes. */
 
 #ifdef SUPPORT_WIDE_CHARS
       case OP_XCLASS:
-      if ((tcode[1 + LINK_SIZE] & XCL_HASPROP) != 0 ||
-          (tcode[1 + LINK_SIZE] & (XCL_MAP|XCL_NOT)) == XCL_NOT)
+      xclassflags = tcode[1 + LINK_SIZE];
+      if ((xclassflags & XCL_HASPROP) != 0 ||
+          (xclassflags & (XCL_MAP|XCL_NOT)) == XCL_NOT)
         return SSB_FAIL;
 
       /* We have a positive XCLASS or a negative one without a map. Set up the
       map pointer if there is one, and fall through. */
 
-      classmap = ((tcode[1 + LINK_SIZE] & XCL_MAP) == 0)? NULL :
+      classmap = ((xclassflags & XCL_MAP) == 0)? NULL :
         (uint8_t *)(tcode + 1 + LINK_SIZE + 1);
-#endif
+
+      /* In UTF-8 mode, scan the character list and set bits for leading bytes,
+      then jump to handle the map. */
+
+#if PCRE2_CODE_UNIT_WIDTH == 8
+      if (utf && (xclassflags & XCL_NOT) == 0)
+        {
+        PCRE2_UCHAR b, e;
+        PCRE2_SPTR p = tcode + 1 + LINK_SIZE + 1 + ((classmap == NULL)? 0:32);
+        tcode += GET(tcode, 1);
+
+        for (;;) switch (*p++)
+          {
+          case XCL_SINGLE:
+          b = *p++;
+          while ((*p & 0xc0) == 0x80) p++;
+          re->start_bitmap[b/8] |= (1u << (b&7));
+          break;
+
+          case XCL_RANGE:
+          b = *p++;
+          while ((*p & 0xc0) == 0x80) p++;
+          e = *p++;
+          while ((*p & 0xc0) == 0x80) p++;
+          for (; b <= e; b++)
+            re->start_bitmap[b/8] |= (1u << (b&7));
+          break;
+
+          case XCL_END:
+          goto HANDLE_CLASSMAP;
+
+          default:
+          return SSB_UNKNOWN;   /* Internal error, should not occur */
+          }
+        }
+#endif  /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8 */
+#endif  /* SUPPORT_WIDE_CHARS */
+
       /* It seems that the fall through comment must be outside the #ifdef if
       it is to avoid the gcc compiler warning. */
 
@@ -1497,6 +1564,9 @@ do
       greater than 127. In fact, there are only two possible starting bytes for
       characters in the range 128 - 255. */
 
+#if defined SUPPORT_WIDE_CHARS && PCRE2_CODE_UNIT_WIDTH == 8
+      HANDLE_CLASSMAP:
+#endif
       if (classmap != NULL)
         {
 #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == 8
@@ -1505,11 +1575,11 @@ do
           for (c = 0; c < 16; c++) re->start_bitmap[c] |= classmap[c];
           for (c = 128; c < 256; c++)
             {
-            if ((classmap[c/8] & (1 << (c&7))) != 0)
+            if ((classmap[c/8] & (1u << (c&7))) != 0)
               {
-              int d = (c >> 6) | 0xc0;            /* Set bit for this starter */
-              re->start_bitmap[d/8] |= (1 << (d&7));  /* and then skip on to the */
-              c = (c & 0xc0) + 0x40 - 1;          /* next relevant character. */
+              int d = (c >> 6) | 0xc0;                 /* Set bit for this starter */
+              re->start_bitmap[d/8] |= (1u << (d&7));  /* and then skip on to the */
+              c = (c & 0xc0) + 0x40 - 1;               /* next relevant character. */
               }
             }
           }
@@ -1567,7 +1637,9 @@ return yield;
 /* This function is handed a compiled expression that it must study to produce
 information that will speed up the matching.
 
-Argument:  points to the compiled expression
+Argument:
+  re       points to the compiled expression
+
 Returns:   0 normally; non-zero should never normally occur
            1 unknown opcode in set_start_bits
            2 missing capturing bracket
@@ -1577,7 +1649,6 @@ Returns:   0 normally; non-zero should never normally occur
 int
 PRIV(study)(pcre2_real_code *re)
 {
-int min;
 int count = 0;
 PCRE2_UCHAR *code;
 BOOL utf = (re->overall_options & PCRE2_UTF) != 0;
@@ -1595,25 +1666,121 @@ if ((re->flags & (PCRE2_FIRSTSET|PCRE2_STARTLINE)) == 0)
   {
   int rc = set_start_bits(re, code, utf);
   if (rc == SSB_UNKNOWN) return 1;
-  if (rc == SSB_DONE) re->flags |= PCRE2_FIRSTMAPSET;
+
+  /* If a list of starting code units was set up, scan the list to see if only
+  one or two were listed. Having only one listed is rare because usually a
+  single starting code unit will have been recognized and PCRE2_FIRSTSET set.
+  If two are listed, see if they are caseless versions of the same character;
+  if so we can replace the list with a caseless first code unit. This gives
+  better performance and is plausibly worth doing for patterns such as [Ww]ord
+  or (word|WORD). */
+
+  if (rc == SSB_DONE)
+    {
+    int i;
+    int a = -1;
+    int b = -1;
+    uint8_t *p = re->start_bitmap;
+    uint32_t flags = PCRE2_FIRSTMAPSET;
+
+    for (i = 0; i < 256; p++, i += 8)
+      {
+      uint8_t x = *p;
+      if (x != 0)
+        {
+        int c;
+        uint8_t y = x & (~x + 1);   /* Least significant bit */
+        if (y != x) goto DONE;      /* More than one bit set */
+
+        /* In the 16-bit and 32-bit libraries, the bit for 0xff means "0xff and
+        all wide characters", so we cannot use it here. */
+
+#if PCRE2_CODE_UNIT_WIDTH != 8
+        if (i == 248 && x == 0x80) goto DONE;
+#endif
+
+        /* Compute the character value */
+
+        c = i;
+        switch (x)
+          {
+          case 1:   break;
+          case 2:   c += 1; break;  case 4:  c += 2; break;
+          case 8:   c += 3; break;  case 16: c += 4; break;
+          case 32:  c += 5; break;  case 64: c += 6; break;
+          case 128: c += 7; break;
+          }
+
+        /* c contains the code unit value, in the range 0-255. In 8-bit UTF
+        mode, only values < 128 can be used. */
+
+#if PCRE2_CODE_UNIT_WIDTH == 8
+        if (c > 127) goto DONE;
+#endif
+        if (a < 0) a = c;   /* First one found */
+        else if (b < 0)     /* Second one found */
+          {
+          int d = TABLE_GET((unsigned int)c, re->tables + fcc_offset, c);
+
+#ifdef SUPPORT_UNICODE
+#if PCRE2_CODE_UNIT_WIDTH == 8
+          if (utf && UCD_CASESET(c) != 0) goto DONE;   /* Multiple case set */
+#else   /* 16-bit or 32-bit */
+          if (UCD_CASESET(c) != 0) goto DONE;     /* Multiple case set */
+          if (utf && c > 127) d = UCD_OTHERCASE(c);
+#endif  /* Code width */
+#endif  /* SUPPORT_UNICODE */
+
+          if (d != a) goto DONE;   /* Not other case of a */
+          b = c;
+          }
+        else goto DONE;   /* More than two characters found */
+        }
+      }
+
+    /* Replace the start code unit bits with a first code unit, but only if it
+    is not the same as a required later code unit. This is because a search for
+    a required code unit starts after an explicit first code unit, but at a
+    code unit found from the bitmap. Patterns such as /a*a/ don't work
+    if both the start unit and required unit are the same. */
+
+    if (a >= 0 &&
+        (
+        (re->flags & PCRE2_LASTSET) == 0 ||
+          (
+          re->last_codeunit != (uint32_t)a &&
+          (b < 0 || re->last_codeunit != (uint32_t)b)
+          )
+        ))
+      {
+      re->first_codeunit = a;
+      flags = PCRE2_FIRSTSET;
+      if (b >= 0) flags |= PCRE2_FIRSTCASELESS;
+      }
+
+    DONE:
+    re->flags |= flags;
+    }
   }
 
 /* Find the minimum length of subject string. If the pattern can match an empty
-string, the minimum length is already known. If there are more back references
-than the size of the vector we are going to cache them in, do nothing. A
-pattern that complicated will probably take a long time to analyze and may in
-any case turn out to be too complicated. Note that back reference minima are
-held as 16-bit numbers. */
-
-if ((re->flags & PCRE2_MATCH_EMPTY) == 0 &&
+string, the minimum length is already known. If the pattern contains (*ACCEPT)
+all bets are off, and we don't even try to find a minimum length. If there are
+more back references than the size of the vector we are going to cache them in,
+do nothing. A pattern that complicated will probably take a long time to
+analyze and may in any case turn out to be too complicated. Note that back
+reference minima are held as 16-bit numbers. */
+
+if ((re->flags & (PCRE2_MATCH_EMPTY|PCRE2_HASACCEPT)) == 0 &&
      re->top_backref <= MAX_CACHE_BACKREF)
   {
+  int min;
   int backref_cache[MAX_CACHE_BACKREF+1];
   backref_cache[0] = 0;    /* Highest one that is set */
   min = find_minlength(re, code, code, utf, NULL, &count, backref_cache);
   switch(min)
     {
-    case -1:  /* \C in UTF mode or (*ACCEPT) or over-complex regex */
+    case -1:  /* \C in UTF mode or over-complex regex */
     break;    /* Leave minlength unchanged (will be zero) */
 
     case -2:
@@ -1623,8 +1790,7 @@ if ((re->flags & PCRE2_MATCH_EMPTY) == 0 &&
     return 3; /* unrecognized opcode */
 
     default:
-    if (min > UINT16_MAX) min = UINT16_MAX;
-    re->minlength = min;
+    re->minlength = (min > UINT16_MAX)? UINT16_MAX : min;
     break;
     }
   }
index ab8d10908aa21a6bfa96db828803252d8de29c83..ec3dd66df973cbd3d0f19ba3240d0f59088afa56 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -129,7 +129,7 @@ for (; ptr < ptrend; ptr++)
 
     ptr += 1;  /* Must point after \ */
     erc = PRIV(check_escape)(&ptr, ptrend, &ch, &errorcode,
-      code->overall_options, FALSE, NULL);
+      code->overall_options, code->extra_options, FALSE, NULL);
     ptr -= 1;  /* Back to last code unit of escape */
     if (errorcode != 0)
       {
@@ -239,13 +239,17 @@ PCRE2_SIZE extra_needed = 0;
 PCRE2_SIZE buff_offset, buff_length, lengthleft, fraglength;
 PCRE2_SIZE *ovector;
 PCRE2_SIZE ovecsave[3];
+pcre2_substitute_callout_block scb;
+
+/* General initialization */
 
 buff_offset = 0;
 lengthleft = buff_length = *blength;
 *blength = PCRE2_UNSET;
 ovecsave[0] = ovecsave[1] = ovecsave[2] = PCRE2_UNSET;
 
-/* Partial matching is not valid. */
+/* Partial matching is not valid. This must come after setting *blength to 
+PCRE2_UNSET, so as not to imply an offset in the replacement. */
 
 if ((options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0)
   return PCRE2_ERROR_BADOPTION;
@@ -264,6 +268,13 @@ if (match_data == NULL)
 ovector = pcre2_get_ovector_pointer(match_data);
 ovector_count = pcre2_get_ovector_count(match_data);
 
+/* Fixed things in the callout block */
+
+scb.version = 0;
+scb.input = subject;
+scb.output = (PCRE2_SPTR)buffer;
+scb.ovector = ovector;
+
 /* Find lengths of zero-terminated strings and the end of the replacement. */
 
 if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
@@ -390,7 +401,7 @@ do
     rc = PCRE2_ERROR_INTERNAL_DUPMATCH;
     goto EXIT;   
     }   
-
+    
   /* Count substitutions with a paranoid check for integer overflow; surely no
   real call to this function would ever hit this! */
 
@@ -401,11 +412,14 @@ do
     }
   subs++;
 
-  /* Copy the text leading up to the match. */
+  /* Copy the text leading up to the match, and remember where the insert
+  begins and how many ovector pairs are set. */
 
   if (rc == 0) rc = ovector_count;
   fraglength = ovector[0] - start_offset;
   CHECKMEMCPY(subject + start_offset, fraglength);
+  scb.output_offsets[0] = buff_offset;
+  scb.oveccount = rc;
 
   /* Process the replacement string. Literal mode is set by \Q, but only in
   extended mode when backslashes are being interpreted. In extended mode we
@@ -421,7 +435,7 @@ do
 
     if (ptr >= repend)
       {
-      if (ptrstackptr <= 0) break;       /* End of replacement string */
+      if (ptrstackptr == 0) break;       /* End of replacement string */
       repend = ptrstack[--ptrstackptr];
       ptr = ptrstack[--ptrstackptr];
       continue;
@@ -702,7 +716,7 @@ do
               {
               if (((code->tables + cbits_offset +
                   ((forcecase > 0)? cbit_upper:cbit_lower)
-                  )[ch/8] & (1 << (ch%8))) == 0)
+                  )[ch/8] & (1u << (ch%8))) == 0)
                 ch = (code->tables + fcc_offset)[ch];
               }
             forcecase = forcecasereset;
@@ -760,7 +774,7 @@ do
 
       ptr++;  /* Point after \ */
       rc = PRIV(check_escape)(&ptr, repend, &ch, &errorcode,
-        code->overall_options, FALSE, NULL);
+        code->overall_options, code->extra_options, FALSE, NULL);
       if (errorcode != 0) goto BADESCAPE;
 
       switch(rc)
@@ -804,7 +818,7 @@ do
           {
           if (((code->tables + cbits_offset +
               ((forcecase > 0)? cbit_upper:cbit_lower)
-              )[ch/8] & (1 << (ch%8))) == 0)
+              )[ch/8] & (1u << (ch%8))) == 0)
             ch = (code->tables + fcc_offset)[ch];
           }
         forcecase = forcecasereset;
@@ -821,10 +835,37 @@ do
       } /* End handling a literal code unit */
     }   /* End of loop for scanning the replacement. */
 
-  /* The replacement has been copied to the output. Save the details of this
-  match. See above for how this data is used. If we matched an empty string, do
-  the magic for global matches. Finally, update the start offset to point to
-  the rest of the subject string. */
+  /* The replacement has been copied to the output, or its size has been 
+  remembered. Do the callout if there is one and we have done an actual 
+  replacement. */
+  
+  if (!overflowed && mcontext != NULL && mcontext->substitute_callout != NULL)
+    {
+    scb.subscount = subs;  
+    scb.output_offsets[1] = buff_offset;
+    rc = mcontext->substitute_callout(&scb, mcontext->substitute_callout_data); 
+
+    /* A non-zero return means cancel this substitution. Instead, copy the 
+    matched string fragment. */
+
+    if (rc != 0)
+      {
+      PCRE2_SIZE newlength = scb.output_offsets[1] - scb.output_offsets[0];
+      PCRE2_SIZE oldlength = ovector[1] - ovector[0];
+      
+      buff_offset -= newlength;
+      lengthleft += newlength;
+      CHECKMEMCPY(subject + ovector[0], oldlength);    
+      
+      /* A negative return means do not do any more. */
+      
+      if (rc < 0) suboptions &= (~PCRE2_SUBSTITUTE_GLOBAL);
+      }
+    }   
+  /* Save the details of this match. See above for how this data is used. If we
+  matched an empty string, do the magic for global matches. Finally, update the
+  start offset to point to the rest of the subject string. */
   
   ovecsave[0] = ovector[0];                                
   ovecsave[1] = ovector[1];                                        
index 83d6f9de55ed679f5835770396afbe2922e2f688..25531d98c6890dc27c2e21a759fdf5940ee053a3 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -142,7 +142,7 @@ ucp_gbXX values defined in pcre2_ucp.h. These changed between Unicode versions
 code points. The left property selects a word from the table, and the right
 property selects a bit from that word like this:
 
-  PRIV(ucp_gbtable)[left-property] & (1 << right-property)
+  PRIV(ucp_gbtable)[left-property] & (1u << right-property)
 
 The value is non-zero if a grapheme break is NOT permitted between the relevant
 two code points. The breaking rules are as follows:
@@ -183,25 +183,25 @@ are implementing).
 #define ESZ (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbZWJ)
 
 const uint32_t PRIV(ucp_gbtable)[] = {
-   (1<<ucp_gbLF),                                      /*  0 CR */
-   0,                                                  /*  1 LF */
-   0,                                                  /*  2 Control */
-   ESZ,                                                /*  3 Extend */
-   ESZ|(1<<ucp_gbPrepend)|                             /*  4 Prepend */
-       (1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbT)|
-       (1<<ucp_gbLV)|(1<<ucp_gbLVT)|(1<<ucp_gbOther)|
-       (1<<ucp_gbRegionalIndicator),
-   ESZ,                                                /*  5 SpacingMark */
-   ESZ|(1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbLV)|        /*  6 L */
-       (1<<ucp_gbLVT),
-   ESZ|(1<<ucp_gbV)|(1<<ucp_gbT),                      /*  7 V */
-   ESZ|(1<<ucp_gbT),                                   /*  8 T */
-   ESZ|(1<<ucp_gbV)|(1<<ucp_gbT),                      /*  9 LV */
-   ESZ|(1<<ucp_gbT),                                   /* 10 LVT */
-   (1<<ucp_gbRegionalIndicator),                       /* 11 RegionalIndicator */
-   ESZ,                                                /* 12 Other */
-   ESZ,                                                /* 13 ZWJ */
-   ESZ|(1<<ucp_gbExtended_Pictographic)                /* 14 Extended Pictographic */
+   (1u<<ucp_gbLF),                                      /*  0 CR */
+   0,                                                   /*  1 LF */
+   0,                                                   /*  2 Control */
+   ESZ,                                                 /*  3 Extend */
+   ESZ|(1u<<ucp_gbPrepend)|                             /*  4 Prepend */
+       (1u<<ucp_gbL)|(1u<<ucp_gbV)|(1u<<ucp_gbT)|
+       (1u<<ucp_gbLV)|(1u<<ucp_gbLVT)|(1u<<ucp_gbOther)|
+       (1u<<ucp_gbRegionalIndicator),
+   ESZ,                                                 /*  5 SpacingMark */
+   ESZ|(1u<<ucp_gbL)|(1u<<ucp_gbV)|(1u<<ucp_gbLV)|      /*  6 L */
+       (1u<<ucp_gbLVT),
+   ESZ|(1u<<ucp_gbV)|(1u<<ucp_gbT),                     /*  7 V */
+   ESZ|(1u<<ucp_gbT),                                   /*  8 T */
+   ESZ|(1u<<ucp_gbV)|(1u<<ucp_gbT),                     /*  9 LV */
+   ESZ|(1u<<ucp_gbT),                                   /* 10 LVT */
+   (1u<<ucp_gbRegionalIndicator),                       /* 11 RegionalIndicator */
+   ESZ,                                                 /* 12 Other */
+   ESZ,                                                 /* 13 ZWJ */
+   ESZ|(1u<<ucp_gbExtended_Pictographic)                /* 14 Extended Pictographic */
 };
 
 #undef ESZ
@@ -279,6 +279,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #define STRING_Duployan0 STR_D STR_u STR_p STR_l STR_o STR_y STR_a STR_n "\0"
 #define STRING_Egyptian_Hieroglyphs0 STR_E STR_g STR_y STR_p STR_t 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_Elbasan0 STR_E STR_l STR_b STR_a STR_s STR_a STR_n "\0"
+#define STRING_Elymaic0 STR_E STR_l STR_y STR_m STR_a STR_i STR_c "\0"
 #define STRING_Ethiopic0 STR_E STR_t STR_h STR_i STR_o STR_p STR_i STR_c "\0"
 #define STRING_Georgian0 STR_G STR_e STR_o STR_r STR_g STR_i STR_a STR_n "\0"
 #define STRING_Glagolitic0 STR_G STR_l STR_a STR_g STR_o STR_l STR_i STR_t STR_i STR_c "\0"
@@ -348,6 +349,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #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"
+#define STRING_Nandinagari0 STR_N STR_a STR_n STR_d STR_i STR_n STR_a STR_g STR_a STR_r STR_i "\0"
 #define STRING_Nd0 STR_N STR_d "\0"
 #define STRING_New_Tai_Lue0 STR_N STR_e STR_w STR_UNDERSCORE STR_T STR_a STR_i STR_UNDERSCORE STR_L STR_u STR_e "\0"
 #define STRING_Newa0 STR_N STR_e STR_w STR_a "\0"
@@ -355,6 +357,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #define STRING_Nl0 STR_N STR_l "\0"
 #define STRING_No0 STR_N STR_o "\0"
 #define STRING_Nushu0 STR_N STR_u STR_s STR_h STR_u "\0"
+#define STRING_Nyiakeng_Puachue_Hmong0 STR_N STR_y STR_i STR_a STR_k STR_e STR_n STR_g STR_UNDERSCORE STR_P STR_u STR_a STR_c STR_h STR_u STR_e STR_UNDERSCORE STR_H STR_m STR_o STR_n STR_g "\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"
@@ -417,7 +420,9 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
 #define STRING_Tifinagh0 STR_T STR_i STR_f STR_i STR_n STR_a STR_g STR_h "\0"
 #define STRING_Tirhuta0 STR_T STR_i STR_r STR_h STR_u STR_t STR_a "\0"
 #define STRING_Ugaritic0 STR_U STR_g STR_a STR_r STR_i STR_t STR_i STR_c "\0"
+#define STRING_Unknown0 STR_U STR_n STR_k STR_n STR_o STR_w STR_n "\0"
 #define STRING_Vai0 STR_V STR_a STR_i "\0"
+#define STRING_Wancho0 STR_W STR_a STR_n STR_c STR_h STR_o "\0"
 #define STRING_Warang_Citi0 STR_W STR_a STR_r STR_a STR_n STR_g STR_UNDERSCORE STR_C STR_i STR_t STR_i "\0"
 #define STRING_Xan0 STR_X STR_a STR_n "\0"
 #define STRING_Xps0 STR_X STR_p STR_s "\0"
@@ -473,6 +478,7 @@ const char PRIV(utt_names)[] =
   STRING_Duployan0
   STRING_Egyptian_Hieroglyphs0
   STRING_Elbasan0
+  STRING_Elymaic0
   STRING_Ethiopic0
   STRING_Georgian0
   STRING_Glagolitic0
@@ -542,6 +548,7 @@ const char PRIV(utt_names)[] =
   STRING_Myanmar0
   STRING_N0
   STRING_Nabataean0
+  STRING_Nandinagari0
   STRING_Nd0
   STRING_New_Tai_Lue0
   STRING_Newa0
@@ -549,6 +556,7 @@ const char PRIV(utt_names)[] =
   STRING_Nl0
   STRING_No0
   STRING_Nushu0
+  STRING_Nyiakeng_Puachue_Hmong0
   STRING_Ogham0
   STRING_Ol_Chiki0
   STRING_Old_Hungarian0
@@ -611,7 +619,9 @@ const char PRIV(utt_names)[] =
   STRING_Tifinagh0
   STRING_Tirhuta0
   STRING_Ugaritic0
+  STRING_Unknown0
   STRING_Vai0
+  STRING_Wancho0
   STRING_Warang_Citi0
   STRING_Xan0
   STRING_Xps0
@@ -667,157 +677,162 @@ const ucp_type_table PRIV(utt)[] = {
   { 299, PT_SC, ucp_Duployan },
   { 308, PT_SC, ucp_Egyptian_Hieroglyphs },
   { 329, PT_SC, ucp_Elbasan },
-  { 337, PT_SC, ucp_Ethiopic },
-  { 346, PT_SC, ucp_Georgian },
-  { 355, PT_SC, ucp_Glagolitic },
-  { 366, PT_SC, ucp_Gothic },
-  { 373, PT_SC, ucp_Grantha },
-  { 381, PT_SC, ucp_Greek },
-  { 387, PT_SC, ucp_Gujarati },
-  { 396, PT_SC, ucp_Gunjala_Gondi },
-  { 410, PT_SC, ucp_Gurmukhi },
-  { 419, PT_SC, ucp_Han },
-  { 423, PT_SC, ucp_Hangul },
-  { 430, PT_SC, ucp_Hanifi_Rohingya },
-  { 446, PT_SC, ucp_Hanunoo },
-  { 454, PT_SC, ucp_Hatran },
-  { 461, PT_SC, ucp_Hebrew },
-  { 468, PT_SC, ucp_Hiragana },
-  { 477, PT_SC, ucp_Imperial_Aramaic },
-  { 494, PT_SC, ucp_Inherited },
-  { 504, PT_SC, ucp_Inscriptional_Pahlavi },
-  { 526, PT_SC, ucp_Inscriptional_Parthian },
-  { 549, PT_SC, ucp_Javanese },
-  { 558, PT_SC, ucp_Kaithi },
-  { 565, PT_SC, ucp_Kannada },
-  { 573, PT_SC, ucp_Katakana },
-  { 582, PT_SC, ucp_Kayah_Li },
-  { 591, PT_SC, ucp_Kharoshthi },
-  { 602, PT_SC, ucp_Khmer },
-  { 608, PT_SC, ucp_Khojki },
-  { 615, PT_SC, ucp_Khudawadi },
-  { 625, PT_GC, ucp_L },
-  { 627, PT_LAMP, 0 },
-  { 630, PT_SC, ucp_Lao },
-  { 634, PT_SC, ucp_Latin },
-  { 640, PT_SC, ucp_Lepcha },
-  { 647, PT_SC, ucp_Limbu },
-  { 653, PT_SC, ucp_Linear_A },
-  { 662, PT_SC, ucp_Linear_B },
-  { 671, PT_SC, ucp_Lisu },
-  { 676, PT_PC, ucp_Ll },
-  { 679, PT_PC, ucp_Lm },
-  { 682, PT_PC, ucp_Lo },
-  { 685, PT_PC, ucp_Lt },
-  { 688, PT_PC, ucp_Lu },
-  { 691, PT_SC, ucp_Lycian },
-  { 698, PT_SC, ucp_Lydian },
-  { 705, PT_GC, ucp_M },
-  { 707, PT_SC, ucp_Mahajani },
-  { 716, PT_SC, ucp_Makasar },
-  { 724, PT_SC, ucp_Malayalam },
-  { 734, PT_SC, ucp_Mandaic },
-  { 742, PT_SC, ucp_Manichaean },
-  { 753, PT_SC, ucp_Marchen },
-  { 761, PT_SC, ucp_Masaram_Gondi },
-  { 775, PT_PC, ucp_Mc },
-  { 778, PT_PC, ucp_Me },
-  { 781, PT_SC, ucp_Medefaidrin },
-  { 793, PT_SC, ucp_Meetei_Mayek },
-  { 806, PT_SC, ucp_Mende_Kikakui },
-  { 820, PT_SC, ucp_Meroitic_Cursive },
-  { 837, PT_SC, ucp_Meroitic_Hieroglyphs },
-  { 858, PT_SC, ucp_Miao },
-  { 863, PT_PC, ucp_Mn },
-  { 866, PT_SC, ucp_Modi },
-  { 871, PT_SC, ucp_Mongolian },
-  { 881, PT_SC, ucp_Mro },
-  { 885, PT_SC, ucp_Multani },
-  { 893, PT_SC, ucp_Myanmar },
-  { 901, PT_GC, ucp_N },
-  { 903, PT_SC, ucp_Nabataean },
-  { 913, PT_PC, ucp_Nd },
-  { 916, PT_SC, ucp_New_Tai_Lue },
-  { 928, PT_SC, ucp_Newa },
-  { 933, PT_SC, ucp_Nko },
-  { 937, PT_PC, ucp_Nl },
-  { 940, PT_PC, ucp_No },
-  { 943, PT_SC, ucp_Nushu },
-  { 949, PT_SC, ucp_Ogham },
-  { 955, PT_SC, ucp_Ol_Chiki },
-  { 964, PT_SC, ucp_Old_Hungarian },
-  { 978, PT_SC, ucp_Old_Italic },
-  { 989, PT_SC, ucp_Old_North_Arabian },
-  { 1007, PT_SC, ucp_Old_Permic },
-  { 1018, PT_SC, ucp_Old_Persian },
-  { 1030, PT_SC, ucp_Old_Sogdian },
-  { 1042, PT_SC, ucp_Old_South_Arabian },
-  { 1060, PT_SC, ucp_Old_Turkic },
-  { 1071, PT_SC, ucp_Oriya },
-  { 1077, PT_SC, ucp_Osage },
-  { 1083, PT_SC, ucp_Osmanya },
-  { 1091, PT_GC, ucp_P },
-  { 1093, PT_SC, ucp_Pahawh_Hmong },
-  { 1106, PT_SC, ucp_Palmyrene },
-  { 1116, PT_SC, ucp_Pau_Cin_Hau },
-  { 1128, PT_PC, ucp_Pc },
-  { 1131, PT_PC, ucp_Pd },
-  { 1134, PT_PC, ucp_Pe },
-  { 1137, PT_PC, ucp_Pf },
-  { 1140, PT_SC, ucp_Phags_Pa },
-  { 1149, PT_SC, ucp_Phoenician },
-  { 1160, PT_PC, ucp_Pi },
-  { 1163, PT_PC, ucp_Po },
-  { 1166, PT_PC, ucp_Ps },
-  { 1169, PT_SC, ucp_Psalter_Pahlavi },
-  { 1185, PT_SC, ucp_Rejang },
-  { 1192, PT_SC, ucp_Runic },
-  { 1198, PT_GC, ucp_S },
-  { 1200, PT_SC, ucp_Samaritan },
-  { 1210, PT_SC, ucp_Saurashtra },
-  { 1221, PT_PC, ucp_Sc },
-  { 1224, PT_SC, ucp_Sharada },
-  { 1232, PT_SC, ucp_Shavian },
-  { 1240, PT_SC, ucp_Siddham },
-  { 1248, PT_SC, ucp_SignWriting },
-  { 1260, PT_SC, ucp_Sinhala },
-  { 1268, PT_PC, ucp_Sk },
-  { 1271, PT_PC, ucp_Sm },
-  { 1274, PT_PC, ucp_So },
-  { 1277, PT_SC, ucp_Sogdian },
-  { 1285, PT_SC, ucp_Sora_Sompeng },
-  { 1298, PT_SC, ucp_Soyombo },
-  { 1306, PT_SC, ucp_Sundanese },
-  { 1316, PT_SC, ucp_Syloti_Nagri },
-  { 1329, PT_SC, ucp_Syriac },
-  { 1336, PT_SC, ucp_Tagalog },
-  { 1344, PT_SC, ucp_Tagbanwa },
-  { 1353, PT_SC, ucp_Tai_Le },
-  { 1360, PT_SC, ucp_Tai_Tham },
-  { 1369, PT_SC, ucp_Tai_Viet },
-  { 1378, PT_SC, ucp_Takri },
-  { 1384, PT_SC, ucp_Tamil },
-  { 1390, PT_SC, ucp_Tangut },
-  { 1397, PT_SC, ucp_Telugu },
-  { 1404, PT_SC, ucp_Thaana },
-  { 1411, PT_SC, ucp_Thai },
-  { 1416, PT_SC, ucp_Tibetan },
-  { 1424, PT_SC, ucp_Tifinagh },
-  { 1433, PT_SC, ucp_Tirhuta },
-  { 1441, PT_SC, ucp_Ugaritic },
-  { 1450, PT_SC, ucp_Vai },
-  { 1454, PT_SC, ucp_Warang_Citi },
-  { 1466, PT_ALNUM, 0 },
-  { 1470, PT_PXSPACE, 0 },
-  { 1474, PT_SPACE, 0 },
-  { 1478, PT_UCNC, 0 },
-  { 1482, PT_WORD, 0 },
-  { 1486, PT_SC, ucp_Yi },
-  { 1489, PT_GC, ucp_Z },
-  { 1491, PT_SC, ucp_Zanabazar_Square },
-  { 1508, PT_PC, ucp_Zl },
-  { 1511, PT_PC, ucp_Zp },
-  { 1514, PT_PC, ucp_Zs }
+  { 337, PT_SC, ucp_Elymaic },
+  { 345, PT_SC, ucp_Ethiopic },
+  { 354, PT_SC, ucp_Georgian },
+  { 363, PT_SC, ucp_Glagolitic },
+  { 374, PT_SC, ucp_Gothic },
+  { 381, PT_SC, ucp_Grantha },
+  { 389, PT_SC, ucp_Greek },
+  { 395, PT_SC, ucp_Gujarati },
+  { 404, PT_SC, ucp_Gunjala_Gondi },
+  { 418, PT_SC, ucp_Gurmukhi },
+  { 427, PT_SC, ucp_Han },
+  { 431, PT_SC, ucp_Hangul },
+  { 438, PT_SC, ucp_Hanifi_Rohingya },
+  { 454, PT_SC, ucp_Hanunoo },
+  { 462, PT_SC, ucp_Hatran },
+  { 469, PT_SC, ucp_Hebrew },
+  { 476, PT_SC, ucp_Hiragana },
+  { 485, PT_SC, ucp_Imperial_Aramaic },
+  { 502, PT_SC, ucp_Inherited },
+  { 512, PT_SC, ucp_Inscriptional_Pahlavi },
+  { 534, PT_SC, ucp_Inscriptional_Parthian },
+  { 557, PT_SC, ucp_Javanese },
+  { 566, PT_SC, ucp_Kaithi },
+  { 573, PT_SC, ucp_Kannada },
+  { 581, PT_SC, ucp_Katakana },
+  { 590, PT_SC, ucp_Kayah_Li },
+  { 599, PT_SC, ucp_Kharoshthi },
+  { 610, PT_SC, ucp_Khmer },
+  { 616, PT_SC, ucp_Khojki },
+  { 623, PT_SC, ucp_Khudawadi },
+  { 633, PT_GC, ucp_L },
+  { 635, PT_LAMP, 0 },
+  { 638, PT_SC, ucp_Lao },
+  { 642, PT_SC, ucp_Latin },
+  { 648, PT_SC, ucp_Lepcha },
+  { 655, PT_SC, ucp_Limbu },
+  { 661, PT_SC, ucp_Linear_A },
+  { 670, PT_SC, ucp_Linear_B },
+  { 679, PT_SC, ucp_Lisu },
+  { 684, PT_PC, ucp_Ll },
+  { 687, PT_PC, ucp_Lm },
+  { 690, PT_PC, ucp_Lo },
+  { 693, PT_PC, ucp_Lt },
+  { 696, PT_PC, ucp_Lu },
+  { 699, PT_SC, ucp_Lycian },
+  { 706, PT_SC, ucp_Lydian },
+  { 713, PT_GC, ucp_M },
+  { 715, PT_SC, ucp_Mahajani },
+  { 724, PT_SC, ucp_Makasar },
+  { 732, PT_SC, ucp_Malayalam },
+  { 742, PT_SC, ucp_Mandaic },
+  { 750, PT_SC, ucp_Manichaean },
+  { 761, PT_SC, ucp_Marchen },
+  { 769, PT_SC, ucp_Masaram_Gondi },
+  { 783, PT_PC, ucp_Mc },
+  { 786, PT_PC, ucp_Me },
+  { 789, PT_SC, ucp_Medefaidrin },
+  { 801, PT_SC, ucp_Meetei_Mayek },
+  { 814, PT_SC, ucp_Mende_Kikakui },
+  { 828, PT_SC, ucp_Meroitic_Cursive },
+  { 845, PT_SC, ucp_Meroitic_Hieroglyphs },
+  { 866, PT_SC, ucp_Miao },
+  { 871, PT_PC, ucp_Mn },
+  { 874, PT_SC, ucp_Modi },
+  { 879, PT_SC, ucp_Mongolian },
+  { 889, PT_SC, ucp_Mro },
+  { 893, PT_SC, ucp_Multani },
+  { 901, PT_SC, ucp_Myanmar },
+  { 909, PT_GC, ucp_N },
+  { 911, PT_SC, ucp_Nabataean },
+  { 921, PT_SC, ucp_Nandinagari },
+  { 933, PT_PC, ucp_Nd },
+  { 936, PT_SC, ucp_New_Tai_Lue },
+  { 948, PT_SC, ucp_Newa },
+  { 953, PT_SC, ucp_Nko },
+  { 957, PT_PC, ucp_Nl },
+  { 960, PT_PC, ucp_No },
+  { 963, PT_SC, ucp_Nushu },
+  { 969, PT_SC, ucp_Nyiakeng_Puachue_Hmong },
+  { 992, PT_SC, ucp_Ogham },
+  { 998, PT_SC, ucp_Ol_Chiki },
+  { 1007, PT_SC, ucp_Old_Hungarian },
+  { 1021, PT_SC, ucp_Old_Italic },
+  { 1032, PT_SC, ucp_Old_North_Arabian },
+  { 1050, PT_SC, ucp_Old_Permic },
+  { 1061, PT_SC, ucp_Old_Persian },
+  { 1073, PT_SC, ucp_Old_Sogdian },
+  { 1085, PT_SC, ucp_Old_South_Arabian },
+  { 1103, PT_SC, ucp_Old_Turkic },
+  { 1114, PT_SC, ucp_Oriya },
+  { 1120, PT_SC, ucp_Osage },
+  { 1126, PT_SC, ucp_Osmanya },
+  { 1134, PT_GC, ucp_P },
+  { 1136, PT_SC, ucp_Pahawh_Hmong },
+  { 1149, PT_SC, ucp_Palmyrene },
+  { 1159, PT_SC, ucp_Pau_Cin_Hau },
+  { 1171, PT_PC, ucp_Pc },
+  { 1174, PT_PC, ucp_Pd },
+  { 1177, PT_PC, ucp_Pe },
+  { 1180, PT_PC, ucp_Pf },
+  { 1183, PT_SC, ucp_Phags_Pa },
+  { 1192, PT_SC, ucp_Phoenician },
+  { 1203, PT_PC, ucp_Pi },
+  { 1206, PT_PC, ucp_Po },
+  { 1209, PT_PC, ucp_Ps },
+  { 1212, PT_SC, ucp_Psalter_Pahlavi },
+  { 1228, PT_SC, ucp_Rejang },
+  { 1235, PT_SC, ucp_Runic },
+  { 1241, PT_GC, ucp_S },
+  { 1243, PT_SC, ucp_Samaritan },
+  { 1253, PT_SC, ucp_Saurashtra },
+  { 1264, PT_PC, ucp_Sc },
+  { 1267, PT_SC, ucp_Sharada },
+  { 1275, PT_SC, ucp_Shavian },
+  { 1283, PT_SC, ucp_Siddham },
+  { 1291, PT_SC, ucp_SignWriting },
+  { 1303, PT_SC, ucp_Sinhala },
+  { 1311, PT_PC, ucp_Sk },
+  { 1314, PT_PC, ucp_Sm },
+  { 1317, PT_PC, ucp_So },
+  { 1320, PT_SC, ucp_Sogdian },
+  { 1328, PT_SC, ucp_Sora_Sompeng },
+  { 1341, PT_SC, ucp_Soyombo },
+  { 1349, PT_SC, ucp_Sundanese },
+  { 1359, PT_SC, ucp_Syloti_Nagri },
+  { 1372, PT_SC, ucp_Syriac },
+  { 1379, PT_SC, ucp_Tagalog },
+  { 1387, PT_SC, ucp_Tagbanwa },
+  { 1396, PT_SC, ucp_Tai_Le },
+  { 1403, PT_SC, ucp_Tai_Tham },
+  { 1412, PT_SC, ucp_Tai_Viet },
+  { 1421, PT_SC, ucp_Takri },
+  { 1427, PT_SC, ucp_Tamil },
+  { 1433, PT_SC, ucp_Tangut },
+  { 1440, PT_SC, ucp_Telugu },
+  { 1447, PT_SC, ucp_Thaana },
+  { 1454, PT_SC, ucp_Thai },
+  { 1459, PT_SC, ucp_Tibetan },
+  { 1467, PT_SC, ucp_Tifinagh },
+  { 1476, PT_SC, ucp_Tirhuta },
+  { 1484, PT_SC, ucp_Ugaritic },
+  { 1493, PT_SC, ucp_Unknown },
+  { 1501, PT_SC, ucp_Vai },
+  { 1505, PT_SC, ucp_Wancho },
+  { 1512, PT_SC, ucp_Warang_Citi },
+  { 1524, PT_ALNUM, 0 },
+  { 1528, PT_PXSPACE, 0 },
+  { 1532, PT_SPACE, 0 },
+  { 1536, PT_UCNC, 0 },
+  { 1540, PT_WORD, 0 },
+  { 1544, PT_SC, ucp_Yi },
+  { 1547, PT_GC, ucp_Z },
+  { 1549, PT_SC, ucp_Zanabazar_Square },
+  { 1566, PT_PC, ucp_Zl },
+  { 1569, PT_PC, ucp_Zp },
+  { 1572, PT_PC, ucp_Zs }
 };
 
 const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
index 275a4be2fe47500e5e19377b85782d0389699eaa..55ba03bd43304dc0c11d62eb0d69627740dcbe17 100644 (file)
@@ -20,7 +20,7 @@ needed. */
 
 /* Unicode character database. */
 /* This file was autogenerated by the MultiStage2.py script. */
-/* Total size: 92592 bytes, block size: 128. */
+/* Total size: 99316 bytes, block size: 128. */
 
 /* The tables herein are needed only when UCP support is built,
 and in PCRE2 that happens automatically with UTF support.
@@ -30,16 +30,16 @@ a comment was received about space saving - maybe the guy linked
 all the modules rather than using a library - so we include a
 condition to cut out the tables when not needed. But don't leave
 a totally empty module because some compilers barf at that.
-Instead, just supply small dummy tables. */
+Instead, just supply some small dummy tables. */
 
 #ifndef SUPPORT_UNICODE
-const ucd_record PRIV(ucd_records)[] = {{0,0,0,0,0 }};
+const ucd_record PRIV(ucd_records)[] = {{0,0,0,0,0,0,0 }};
 const uint16_t PRIV(ucd_stage1)[] = {0};
 const uint16_t PRIV(ucd_stage2)[] = {0};
 const uint32_t PRIV(ucd_caseless_sets)[] = {0};
 #else
 
-const char *PRIV(unicode_version) = "11.0.0";
+const char *PRIV(unicode_version) = "12.1.0";
 
 /* If the 32-bit library is run in non-32-bit mode, character values
 greater than 0x10ffff may be encountered. For these we set up a
@@ -47,11 +47,13 @@ special record. */
 
 #if PCRE2_CODE_UNIT_WIDTH == 32
 const ucd_record PRIV(dummy_ucd_record)[] = {{
-  ucp_Common,    /* script */
-  ucp_Cn,        /* type unassigned */
-  ucp_gbOther,   /* grapheme break property */
-  0,             /* case set */
-  0,             /* other case */
+  ucp_Unknown,    /* script */
+  ucp_Cn,         /* type unassigned */
+  ucp_gbOther,    /* grapheme break property */
+  0,              /* case set */
+  0,              /* other case */
+  ucp_Unknown,    /* script extension */
+  0,              /* dummy filler */
   }};
 #endif
 
@@ -65,9 +67,13 @@ uint8_t property_1;
 uint8_t property_2;
 uint8_t property_3;
 pcre_int32 property_4;
+pcre_int16 property_5;
+uint16_t property_6;
 } ucd_record;
 */
 
+/* This table contains lists of characters that are caseless sets of
+more than one character. Each list is terminated by NOTACHAR. */
 
 const uint32_t PRIV(ucd_caseless_sets)[] = {
   NOTACHAR,
@@ -100,865 +106,1049 @@ const uint32_t PRIV(ucd_caseless_sets)[] = {
   0x1c88,   0xa64a,   0xa64b,   NOTACHAR,
 };
 
-/* When #included in pcre2test, we don't need this large table. */
+/* When #included in pcre2test, we don't need the table of digit
+sets, nor the the large main UCD tables. */
 
 #ifndef PCRE2_PCRE2TEST
 
-const ucd_record PRIV(ucd_records)[] = { /* 6832 bytes, record size 8 */
-  {     9,      0,      2,      0,      0, }, /*   0 */
-  {     9,      0,      1,      0,      0, }, /*   1 */
-  {     9,      0,      0,      0,      0, }, /*   2 */
-  {     9,     29,     12,      0,      0, }, /*   3 */
-  {     9,     21,     12,      0,      0, }, /*   4 */
-  {     9,     23,     12,      0,      0, }, /*   5 */
-  {     9,     22,     12,      0,      0, }, /*   6 */
-  {     9,     18,     12,      0,      0, }, /*   7 */
-  {     9,     25,     12,      0,      0, }, /*   8 */
-  {     9,     17,     12,      0,      0, }, /*   9 */
-  {     9,     13,     12,      0,      0, }, /*  10 */
-  {    33,      9,     12,      0,     32, }, /*  11 */
-  {    33,      9,     12,    100,     32, }, /*  12 */
-  {    33,      9,     12,      1,     32, }, /*  13 */
-  {     9,     24,     12,      0,      0, }, /*  14 */
-  {     9,     16,     12,      0,      0, }, /*  15 */
-  {    33,      5,     12,      0,    -32, }, /*  16 */
-  {    33,      5,     12,    100,    -32, }, /*  17 */
-  {    33,      5,     12,      1,    -32, }, /*  18 */
-  {     9,     26,     12,      0,      0, }, /*  19 */
-  {     9,     26,     14,      0,      0, }, /*  20 */
-  {    33,      7,     12,      0,      0, }, /*  21 */
-  {     9,     20,     12,      0,      0, }, /*  22 */
-  {     9,      1,      2,      0,      0, }, /*  23 */
-  {     9,     15,     12,      0,      0, }, /*  24 */
-  {     9,      5,     12,     26,    775, }, /*  25 */
-  {     9,     19,     12,      0,      0, }, /*  26 */
-  {    33,      9,     12,    104,     32, }, /*  27 */
-  {    33,      5,     12,      0,   7615, }, /*  28 */
-  {    33,      5,     12,    104,    -32, }, /*  29 */
-  {    33,      5,     12,      0,    121, }, /*  30 */
-  {    33,      9,     12,      0,      1, }, /*  31 */
-  {    33,      5,     12,      0,     -1, }, /*  32 */
-  {    33,      9,     12,      0,      0, }, /*  33 */
-  {    33,      5,     12,      0,      0, }, /*  34 */
-  {    33,      9,     12,      0,   -121, }, /*  35 */
-  {    33,      5,     12,      1,   -268, }, /*  36 */
-  {    33,      5,     12,      0,    195, }, /*  37 */
-  {    33,      9,     12,      0,    210, }, /*  38 */
-  {    33,      9,     12,      0,    206, }, /*  39 */
-  {    33,      9,     12,      0,    205, }, /*  40 */
-  {    33,      9,     12,      0,     79, }, /*  41 */
-  {    33,      9,     12,      0,    202, }, /*  42 */
-  {    33,      9,     12,      0,    203, }, /*  43 */
-  {    33,      9,     12,      0,    207, }, /*  44 */
-  {    33,      5,     12,      0,     97, }, /*  45 */
-  {    33,      9,     12,      0,    211, }, /*  46 */
-  {    33,      9,     12,      0,    209, }, /*  47 */
-  {    33,      5,     12,      0,    163, }, /*  48 */
-  {    33,      9,     12,      0,    213, }, /*  49 */
-  {    33,      5,     12,      0,    130, }, /*  50 */
-  {    33,      9,     12,      0,    214, }, /*  51 */
-  {    33,      9,     12,      0,    218, }, /*  52 */
-  {    33,      9,     12,      0,    217, }, /*  53 */
-  {    33,      9,     12,      0,    219, }, /*  54 */
-  {    33,      5,     12,      0,     56, }, /*  55 */
-  {    33,      9,     12,      5,      2, }, /*  56 */
-  {    33,      8,     12,      5,      1, }, /*  57 */
-  {    33,      5,     12,      5,     -2, }, /*  58 */
-  {    33,      9,     12,      9,      2, }, /*  59 */
-  {    33,      8,     12,      9,      1, }, /*  60 */
-  {    33,      5,     12,      9,     -2, }, /*  61 */
-  {    33,      9,     12,     13,      2, }, /*  62 */
-  {    33,      8,     12,     13,      1, }, /*  63 */
-  {    33,      5,     12,     13,     -2, }, /*  64 */
-  {    33,      5,     12,      0,    -79, }, /*  65 */
-  {    33,      9,     12,     17,      2, }, /*  66 */
-  {    33,      8,     12,     17,      1, }, /*  67 */
-  {    33,      5,     12,     17,     -2, }, /*  68 */
-  {    33,      9,     12,      0,    -97, }, /*  69 */
-  {    33,      9,     12,      0,    -56, }, /*  70 */
-  {    33,      9,     12,      0,   -130, }, /*  71 */
-  {    33,      9,     12,      0,  10795, }, /*  72 */
-  {    33,      9,     12,      0,   -163, }, /*  73 */
-  {    33,      9,     12,      0,  10792, }, /*  74 */
-  {    33,      5,     12,      0,  10815, }, /*  75 */
-  {    33,      9,     12,      0,   -195, }, /*  76 */
-  {    33,      9,     12,      0,     69, }, /*  77 */
-  {    33,      9,     12,      0,     71, }, /*  78 */
-  {    33,      5,     12,      0,  10783, }, /*  79 */
-  {    33,      5,     12,      0,  10780, }, /*  80 */
-  {    33,      5,     12,      0,  10782, }, /*  81 */
-  {    33,      5,     12,      0,   -210, }, /*  82 */
-  {    33,      5,     12,      0,   -206, }, /*  83 */
-  {    33,      5,     12,      0,   -205, }, /*  84 */
-  {    33,      5,     12,      0,   -202, }, /*  85 */
-  {    33,      5,     12,      0,   -203, }, /*  86 */
-  {    33,      5,     12,      0,  42319, }, /*  87 */
-  {    33,      5,     12,      0,  42315, }, /*  88 */
-  {    33,      5,     12,      0,   -207, }, /*  89 */
-  {    33,      5,     12,      0,  42280, }, /*  90 */
-  {    33,      5,     12,      0,  42308, }, /*  91 */
-  {    33,      5,     12,      0,   -209, }, /*  92 */
-  {    33,      5,     12,      0,   -211, }, /*  93 */
-  {    33,      5,     12,      0,  10743, }, /*  94 */
-  {    33,      5,     12,      0,  42305, }, /*  95 */
-  {    33,      5,     12,      0,  10749, }, /*  96 */
-  {    33,      5,     12,      0,   -213, }, /*  97 */
-  {    33,      5,     12,      0,   -214, }, /*  98 */
-  {    33,      5,     12,      0,  10727, }, /*  99 */
-  {    33,      5,     12,      0,   -218, }, /* 100 */
-  {    33,      5,     12,      0,  42282, }, /* 101 */
-  {    33,      5,     12,      0,    -69, }, /* 102 */
-  {    33,      5,     12,      0,   -217, }, /* 103 */
-  {    33,      5,     12,      0,    -71, }, /* 104 */
-  {    33,      5,     12,      0,   -219, }, /* 105 */
-  {    33,      5,     12,      0,  42261, }, /* 106 */
-  {    33,      5,     12,      0,  42258, }, /* 107 */
-  {    33,      6,     12,      0,      0, }, /* 108 */
-  {     9,      6,     12,      0,      0, }, /* 109 */
-  {     3,     24,     12,      0,      0, }, /* 110 */
-  {    27,     12,      3,      0,      0, }, /* 111 */
-  {    27,     12,      3,     21,    116, }, /* 112 */
-  {    19,      9,     12,      0,      1, }, /* 113 */
-  {    19,      5,     12,      0,     -1, }, /* 114 */
-  {    19,     24,     12,      0,      0, }, /* 115 */
-  {     9,      2,     12,      0,      0, }, /* 116 */
-  {    19,      6,     12,      0,      0, }, /* 117 */
-  {    19,      5,     12,      0,    130, }, /* 118 */
-  {    19,      9,     12,      0,    116, }, /* 119 */
-  {    19,      9,     12,      0,     38, }, /* 120 */
-  {    19,      9,     12,      0,     37, }, /* 121 */
-  {    19,      9,     12,      0,     64, }, /* 122 */
-  {    19,      9,     12,      0,     63, }, /* 123 */
-  {    19,      5,     12,      0,      0, }, /* 124 */
-  {    19,      9,     12,      0,     32, }, /* 125 */
-  {    19,      9,     12,     34,     32, }, /* 126 */
-  {    19,      9,     12,     59,     32, }, /* 127 */
-  {    19,      9,     12,     38,     32, }, /* 128 */
-  {    19,      9,     12,     21,     32, }, /* 129 */
-  {    19,      9,     12,     51,     32, }, /* 130 */
-  {    19,      9,     12,     26,     32, }, /* 131 */
-  {    19,      9,     12,     47,     32, }, /* 132 */
-  {    19,      9,     12,     55,     32, }, /* 133 */
-  {    19,      9,     12,     30,     32, }, /* 134 */
-  {    19,      9,     12,     43,     32, }, /* 135 */
-  {    19,      9,     12,     96,     32, }, /* 136 */
-  {    19,      5,     12,      0,    -38, }, /* 137 */
-  {    19,      5,     12,      0,    -37, }, /* 138 */
-  {    19,      5,     12,      0,    -32, }, /* 139 */
-  {    19,      5,     12,     34,    -32, }, /* 140 */
-  {    19,      5,     12,     59,    -32, }, /* 141 */
-  {    19,      5,     12,     38,    -32, }, /* 142 */
-  {    19,      5,     12,     21,   -116, }, /* 143 */
-  {    19,      5,     12,     51,    -32, }, /* 144 */
-  {    19,      5,     12,     26,   -775, }, /* 145 */
-  {    19,      5,     12,     47,    -32, }, /* 146 */
-  {    19,      5,     12,     55,    -32, }, /* 147 */
-  {    19,      5,     12,     30,      1, }, /* 148 */
-  {    19,      5,     12,     30,    -32, }, /* 149 */
-  {    19,      5,     12,     43,    -32, }, /* 150 */
-  {    19,      5,     12,     96,    -32, }, /* 151 */
-  {    19,      5,     12,      0,    -64, }, /* 152 */
-  {    19,      5,     12,      0,    -63, }, /* 153 */
-  {    19,      9,     12,      0,      8, }, /* 154 */
-  {    19,      5,     12,     34,    -30, }, /* 155 */
-  {    19,      5,     12,     38,    -25, }, /* 156 */
-  {    19,      9,     12,      0,      0, }, /* 157 */
-  {    19,      5,     12,     43,    -15, }, /* 158 */
-  {    19,      5,     12,     47,    -22, }, /* 159 */
-  {    19,      5,     12,      0,     -8, }, /* 160 */
-  {    10,      9,     12,      0,      1, }, /* 161 */
-  {    10,      5,     12,      0,     -1, }, /* 162 */
-  {    19,      5,     12,     51,    -54, }, /* 163 */
-  {    19,      5,     12,     55,    -48, }, /* 164 */
-  {    19,      5,     12,      0,      7, }, /* 165 */
-  {    19,      5,     12,      0,   -116, }, /* 166 */
-  {    19,      9,     12,     38,    -60, }, /* 167 */
-  {    19,      5,     12,     59,    -64, }, /* 168 */
-  {    19,     25,     12,      0,      0, }, /* 169 */
-  {    19,      9,     12,      0,     -7, }, /* 170 */
-  {    19,      9,     12,      0,   -130, }, /* 171 */
-  {    12,      9,     12,      0,     80, }, /* 172 */
-  {    12,      9,     12,      0,     32, }, /* 173 */
-  {    12,      9,     12,     63,     32, }, /* 174 */
-  {    12,      9,     12,     67,     32, }, /* 175 */
-  {    12,      9,     12,     71,     32, }, /* 176 */
-  {    12,      9,     12,     75,     32, }, /* 177 */
-  {    12,      9,     12,     79,     32, }, /* 178 */
-  {    12,      9,     12,     84,     32, }, /* 179 */
-  {    12,      5,     12,      0,    -32, }, /* 180 */
-  {    12,      5,     12,     63,    -32, }, /* 181 */
-  {    12,      5,     12,     67,    -32, }, /* 182 */
-  {    12,      5,     12,     71,    -32, }, /* 183 */
-  {    12,      5,     12,     75,    -32, }, /* 184 */
-  {    12,      5,     12,     79,    -32, }, /* 185 */
-  {    12,      5,     12,     84,    -32, }, /* 186 */
-  {    12,      5,     12,      0,    -80, }, /* 187 */
-  {    12,      9,     12,      0,      1, }, /* 188 */
-  {    12,      5,     12,      0,     -1, }, /* 189 */
-  {    12,      9,     12,     88,      1, }, /* 190 */
-  {    12,      5,     12,     88,     -1, }, /* 191 */
-  {    12,     26,     12,      0,      0, }, /* 192 */
-  {    12,     12,      3,      0,      0, }, /* 193 */
-  {    12,     11,      3,      0,      0, }, /* 194 */
-  {    12,      9,     12,      0,     15, }, /* 195 */
-  {    12,      5,     12,      0,    -15, }, /* 196 */
-  {     1,      9,     12,      0,     48, }, /* 197 */
-  {     1,      6,     12,      0,      0, }, /* 198 */
-  {     1,     21,     12,      0,      0, }, /* 199 */
-  {     1,      5,     12,      0,      0, }, /* 200 */
-  {     1,      5,     12,      0,    -48, }, /* 201 */
-  {     1,     17,     12,      0,      0, }, /* 202 */
-  {     1,     26,     12,      0,      0, }, /* 203 */
-  {     1,     23,     12,      0,      0, }, /* 204 */
-  {    25,     12,      3,      0,      0, }, /* 205 */
-  {    25,     17,     12,      0,      0, }, /* 206 */
-  {    25,     21,     12,      0,      0, }, /* 207 */
-  {    25,      7,     12,      0,      0, }, /* 208 */
-  {     0,      1,      4,      0,      0, }, /* 209 */
-  {     9,      1,      4,      0,      0, }, /* 210 */
-  {     0,     25,     12,      0,      0, }, /* 211 */
-  {     0,     21,     12,      0,      0, }, /* 212 */
-  {     0,     23,     12,      0,      0, }, /* 213 */
-  {     0,     26,     12,      0,      0, }, /* 214 */
-  {     0,     12,      3,      0,      0, }, /* 215 */
-  {     0,      1,      2,      0,      0, }, /* 216 */
-  {     0,      7,     12,      0,      0, }, /* 217 */
-  {     0,     13,     12,      0,      0, }, /* 218 */
-  {     0,      6,     12,      0,      0, }, /* 219 */
-  {    49,     21,     12,      0,      0, }, /* 220 */
-  {    49,      1,      4,      0,      0, }, /* 221 */
-  {    49,      7,     12,      0,      0, }, /* 222 */
-  {    49,     12,      3,      0,      0, }, /* 223 */
-  {    55,      7,     12,      0,      0, }, /* 224 */
-  {    55,     12,      3,      0,      0, }, /* 225 */
-  {    63,     13,     12,      0,      0, }, /* 226 */
-  {    63,      7,     12,      0,      0, }, /* 227 */
-  {    63,     12,      3,      0,      0, }, /* 228 */
-  {    63,      6,     12,      0,      0, }, /* 229 */
-  {    63,     26,     12,      0,      0, }, /* 230 */
-  {    63,     21,     12,      0,      0, }, /* 231 */
-  {    63,     23,     12,      0,      0, }, /* 232 */
-  {    89,      7,     12,      0,      0, }, /* 233 */
-  {    89,     12,      3,      0,      0, }, /* 234 */
-  {    89,      6,     12,      0,      0, }, /* 235 */
-  {    89,     21,     12,      0,      0, }, /* 236 */
-  {    94,      7,     12,      0,      0, }, /* 237 */
-  {    94,     12,      3,      0,      0, }, /* 238 */
-  {    94,     21,     12,      0,      0, }, /* 239 */
-  {    14,     12,      3,      0,      0, }, /* 240 */
-  {    14,     10,      5,      0,      0, }, /* 241 */
-  {    14,      7,     12,      0,      0, }, /* 242 */
-  {    14,     13,     12,      0,      0, }, /* 243 */
-  {    14,     21,     12,      0,      0, }, /* 244 */
-  {    14,      6,     12,      0,      0, }, /* 245 */
-  {     2,      7,     12,      0,      0, }, /* 246 */
-  {     2,     12,      3,      0,      0, }, /* 247 */
-  {     2,     10,      5,      0,      0, }, /* 248 */
-  {     2,     10,      3,      0,      0, }, /* 249 */
-  {     2,     13,     12,      0,      0, }, /* 250 */
-  {     2,     23,     12,      0,      0, }, /* 251 */
-  {     2,     15,     12,      0,      0, }, /* 252 */
-  {     2,     26,     12,      0,      0, }, /* 253 */
-  {     2,     21,     12,      0,      0, }, /* 254 */
-  {    21,     12,      3,      0,      0, }, /* 255 */
-  {    21,     10,      5,      0,      0, }, /* 256 */
-  {    21,      7,     12,      0,      0, }, /* 257 */
-  {    21,     13,     12,      0,      0, }, /* 258 */
-  {    21,     21,     12,      0,      0, }, /* 259 */
-  {    20,     12,      3,      0,      0, }, /* 260 */
-  {    20,     10,      5,      0,      0, }, /* 261 */
-  {    20,      7,     12,      0,      0, }, /* 262 */
-  {    20,     13,     12,      0,      0, }, /* 263 */
-  {    20,     21,     12,      0,      0, }, /* 264 */
-  {    20,     23,     12,      0,      0, }, /* 265 */
-  {    43,     12,      3,      0,      0, }, /* 266 */
-  {    43,     10,      5,      0,      0, }, /* 267 */
-  {    43,      7,     12,      0,      0, }, /* 268 */
-  {    43,     10,      3,      0,      0, }, /* 269 */
-  {    43,     13,     12,      0,      0, }, /* 270 */
-  {    43,     26,     12,      0,      0, }, /* 271 */
-  {    43,     15,     12,      0,      0, }, /* 272 */
-  {    53,     12,      3,      0,      0, }, /* 273 */
-  {    53,      7,     12,      0,      0, }, /* 274 */
-  {    53,     10,      3,      0,      0, }, /* 275 */
-  {    53,     10,      5,      0,      0, }, /* 276 */
-  {    53,     13,     12,      0,      0, }, /* 277 */
-  {    53,     15,     12,      0,      0, }, /* 278 */
-  {    53,     26,     12,      0,      0, }, /* 279 */
-  {    53,     23,     12,      0,      0, }, /* 280 */
-  {    54,     12,      3,      0,      0, }, /* 281 */
-  {    54,     10,      5,      0,      0, }, /* 282 */
-  {    54,      7,     12,      0,      0, }, /* 283 */
-  {    54,     13,     12,      0,      0, }, /* 284 */
-  {    54,     15,     12,      0,      0, }, /* 285 */
-  {    54,     26,     12,      0,      0, }, /* 286 */
-  {    28,      7,     12,      0,      0, }, /* 287 */
-  {    28,     12,      3,      0,      0, }, /* 288 */
-  {    28,     10,      5,      0,      0, }, /* 289 */
-  {    28,     21,     12,      0,      0, }, /* 290 */
-  {    28,     10,      3,      0,      0, }, /* 291 */
-  {    28,     13,     12,      0,      0, }, /* 292 */
-  {    36,     12,      3,      0,      0, }, /* 293 */
-  {    36,     10,      5,      0,      0, }, /* 294 */
-  {    36,      7,     12,      0,      0, }, /* 295 */
-  {    36,     10,      3,      0,      0, }, /* 296 */
-  {    36,      7,      4,      0,      0, }, /* 297 */
-  {    36,     26,     12,      0,      0, }, /* 298 */
-  {    36,     15,     12,      0,      0, }, /* 299 */
-  {    36,     13,     12,      0,      0, }, /* 300 */
-  {    47,     10,      5,      0,      0, }, /* 301 */
-  {    47,      7,     12,      0,      0, }, /* 302 */
-  {    47,     12,      3,      0,      0, }, /* 303 */
-  {    47,     10,      3,      0,      0, }, /* 304 */
-  {    47,     13,     12,      0,      0, }, /* 305 */
-  {    47,     21,     12,      0,      0, }, /* 306 */
-  {    56,      7,     12,      0,      0, }, /* 307 */
-  {    56,     12,      3,      0,      0, }, /* 308 */
-  {    56,      7,      5,      0,      0, }, /* 309 */
-  {    56,      6,     12,      0,      0, }, /* 310 */
-  {    56,     21,     12,      0,      0, }, /* 311 */
-  {    56,     13,     12,      0,      0, }, /* 312 */
-  {    32,      7,     12,      0,      0, }, /* 313 */
-  {    32,     12,      3,      0,      0, }, /* 314 */
-  {    32,      7,      5,      0,      0, }, /* 315 */
-  {    32,      6,     12,      0,      0, }, /* 316 */
-  {    32,     13,     12,      0,      0, }, /* 317 */
-  {    57,      7,     12,      0,      0, }, /* 318 */
-  {    57,     26,     12,      0,      0, }, /* 319 */
-  {    57,     21,     12,      0,      0, }, /* 320 */
-  {    57,     12,      3,      0,      0, }, /* 321 */
-  {    57,     13,     12,      0,      0, }, /* 322 */
-  {    57,     15,     12,      0,      0, }, /* 323 */
-  {    57,     22,     12,      0,      0, }, /* 324 */
-  {    57,     18,     12,      0,      0, }, /* 325 */
-  {    57,     10,      5,      0,      0, }, /* 326 */
-  {    38,      7,     12,      0,      0, }, /* 327 */
-  {    38,     10,     12,      0,      0, }, /* 328 */
-  {    38,     12,      3,      0,      0, }, /* 329 */
-  {    38,     10,      5,      0,      0, }, /* 330 */
-  {    38,     13,     12,      0,      0, }, /* 331 */
-  {    38,     21,     12,      0,      0, }, /* 332 */
-  {    38,     26,     12,      0,      0, }, /* 333 */
-  {    16,      9,     12,      0,   7264, }, /* 334 */
-  {    16,      5,     12,      0,   3008, }, /* 335 */
-  {    16,      6,     12,      0,      0, }, /* 336 */
-  {    23,      7,      6,      0,      0, }, /* 337 */
-  {    23,      7,      7,      0,      0, }, /* 338 */
-  {    23,      7,      8,      0,      0, }, /* 339 */
-  {    15,      7,     12,      0,      0, }, /* 340 */
-  {    15,     12,      3,      0,      0, }, /* 341 */
-  {    15,     21,     12,      0,      0, }, /* 342 */
-  {    15,     15,     12,      0,      0, }, /* 343 */
-  {    15,     26,     12,      0,      0, }, /* 344 */
-  {     8,      9,     12,      0,  38864, }, /* 345 */
-  {     8,      9,     12,      0,      8, }, /* 346 */
-  {     8,      5,     12,      0,     -8, }, /* 347 */
-  {     7,     17,     12,      0,      0, }, /* 348 */
-  {     7,      7,     12,      0,      0, }, /* 349 */
-  {     7,     21,     12,      0,      0, }, /* 350 */
-  {    40,     29,     12,      0,      0, }, /* 351 */
-  {    40,      7,     12,      0,      0, }, /* 352 */
-  {    40,     22,     12,      0,      0, }, /* 353 */
-  {    40,     18,     12,      0,      0, }, /* 354 */
-  {    45,      7,     12,      0,      0, }, /* 355 */
-  {    45,     14,     12,      0,      0, }, /* 356 */
-  {    50,      7,     12,      0,      0, }, /* 357 */
-  {    50,     12,      3,      0,      0, }, /* 358 */
-  {    24,      7,     12,      0,      0, }, /* 359 */
-  {    24,     12,      3,      0,      0, }, /* 360 */
-  {     6,      7,     12,      0,      0, }, /* 361 */
-  {     6,     12,      3,      0,      0, }, /* 362 */
-  {    51,      7,     12,      0,      0, }, /* 363 */
-  {    51,     12,      3,      0,      0, }, /* 364 */
-  {    31,      7,     12,      0,      0, }, /* 365 */
-  {    31,     12,      3,      0,      0, }, /* 366 */
-  {    31,     10,      5,      0,      0, }, /* 367 */
-  {    31,     21,     12,      0,      0, }, /* 368 */
-  {    31,      6,     12,      0,      0, }, /* 369 */
-  {    31,     23,     12,      0,      0, }, /* 370 */
-  {    31,     13,     12,      0,      0, }, /* 371 */
-  {    31,     15,     12,      0,      0, }, /* 372 */
-  {    37,     21,     12,      0,      0, }, /* 373 */
-  {    37,     17,     12,      0,      0, }, /* 374 */
-  {    37,     12,      3,      0,      0, }, /* 375 */
-  {    37,      1,      2,      0,      0, }, /* 376 */
-  {    37,     13,     12,      0,      0, }, /* 377 */
-  {    37,      7,     12,      0,      0, }, /* 378 */
-  {    37,      6,     12,      0,      0, }, /* 379 */
-  {    34,      7,     12,      0,      0, }, /* 380 */
-  {    34,     12,      3,      0,      0, }, /* 381 */
-  {    34,     10,      5,      0,      0, }, /* 382 */
-  {    34,     26,     12,      0,      0, }, /* 383 */
-  {    34,     21,     12,      0,      0, }, /* 384 */
-  {    34,     13,     12,      0,      0, }, /* 385 */
-  {    52,      7,     12,      0,      0, }, /* 386 */
-  {    39,      7,     12,      0,      0, }, /* 387 */
-  {    39,     13,     12,      0,      0, }, /* 388 */
-  {    39,     15,     12,      0,      0, }, /* 389 */
-  {    39,     26,     12,      0,      0, }, /* 390 */
-  {    31,     26,     12,      0,      0, }, /* 391 */
-  {     5,      7,     12,      0,      0, }, /* 392 */
-  {     5,     12,      3,      0,      0, }, /* 393 */
-  {     5,     10,      5,      0,      0, }, /* 394 */
-  {     5,     21,     12,      0,      0, }, /* 395 */
-  {    90,      7,     12,      0,      0, }, /* 396 */
-  {    90,     10,      5,      0,      0, }, /* 397 */
-  {    90,     12,      3,      0,      0, }, /* 398 */
-  {    90,     10,     12,      0,      0, }, /* 399 */
-  {    90,     13,     12,      0,      0, }, /* 400 */
-  {    90,     21,     12,      0,      0, }, /* 401 */
-  {    90,      6,     12,      0,      0, }, /* 402 */
-  {    27,     11,      3,      0,      0, }, /* 403 */
-  {    61,     12,      3,      0,      0, }, /* 404 */
-  {    61,     10,      5,      0,      0, }, /* 405 */
-  {    61,      7,     12,      0,      0, }, /* 406 */
-  {    61,     13,     12,      0,      0, }, /* 407 */
-  {    61,     21,     12,      0,      0, }, /* 408 */
-  {    61,     26,     12,      0,      0, }, /* 409 */
-  {    75,     12,      3,      0,      0, }, /* 410 */
-  {    75,     10,      5,      0,      0, }, /* 411 */
-  {    75,      7,     12,      0,      0, }, /* 412 */
-  {    75,     13,     12,      0,      0, }, /* 413 */
-  {    92,      7,     12,      0,      0, }, /* 414 */
-  {    92,     12,      3,      0,      0, }, /* 415 */
-  {    92,     10,      5,      0,      0, }, /* 416 */
-  {    92,     21,     12,      0,      0, }, /* 417 */
-  {    69,      7,     12,      0,      0, }, /* 418 */
-  {    69,     10,      5,      0,      0, }, /* 419 */
-  {    69,     12,      3,      0,      0, }, /* 420 */
-  {    69,     21,     12,      0,      0, }, /* 421 */
-  {    69,     13,     12,      0,      0, }, /* 422 */
-  {    72,     13,     12,      0,      0, }, /* 423 */
-  {    72,      7,     12,      0,      0, }, /* 424 */
-  {    72,      6,     12,      0,      0, }, /* 425 */
-  {    72,     21,     12,      0,      0, }, /* 426 */
-  {    12,      5,     12,     63,  -6222, }, /* 427 */
-  {    12,      5,     12,     67,  -6221, }, /* 428 */
-  {    12,      5,     12,     71,  -6212, }, /* 429 */
-  {    12,      5,     12,     75,  -6210, }, /* 430 */
-  {    12,      5,     12,     79,  -6210, }, /* 431 */
-  {    12,      5,     12,     79,  -6211, }, /* 432 */
-  {    12,      5,     12,     84,  -6204, }, /* 433 */
-  {    12,      5,     12,     88,  -6180, }, /* 434 */
-  {    12,      5,     12,    108,  35267, }, /* 435 */
-  {    16,      9,     12,      0,  -3008, }, /* 436 */
-  {    75,     21,     12,      0,      0, }, /* 437 */
-  {     9,     10,      5,      0,      0, }, /* 438 */
-  {     9,      7,     12,      0,      0, }, /* 439 */
-  {    12,      5,     12,      0,      0, }, /* 440 */
-  {    12,      6,     12,      0,      0, }, /* 441 */
-  {    33,      5,     12,      0,  35332, }, /* 442 */
-  {    33,      5,     12,      0,   3814, }, /* 443 */
-  {    33,      9,     12,     92,      1, }, /* 444 */
-  {    33,      5,     12,     92,     -1, }, /* 445 */
-  {    33,      5,     12,     92,    -58, }, /* 446 */
-  {    33,      9,     12,      0,  -7615, }, /* 447 */
-  {    19,      5,     12,      0,      8, }, /* 448 */
-  {    19,      9,     12,      0,     -8, }, /* 449 */
-  {    19,      5,     12,      0,     74, }, /* 450 */
-  {    19,      5,     12,      0,     86, }, /* 451 */
-  {    19,      5,     12,      0,    100, }, /* 452 */
-  {    19,      5,     12,      0,    128, }, /* 453 */
-  {    19,      5,     12,      0,    112, }, /* 454 */
-  {    19,      5,     12,      0,    126, }, /* 455 */
-  {    19,      8,     12,      0,     -8, }, /* 456 */
-  {    19,      5,     12,      0,      9, }, /* 457 */
-  {    19,      9,     12,      0,    -74, }, /* 458 */
-  {    19,      8,     12,      0,     -9, }, /* 459 */
-  {    19,      5,     12,     21,  -7173, }, /* 460 */
-  {    19,      9,     12,      0,    -86, }, /* 461 */
-  {    19,      9,     12,      0,   -100, }, /* 462 */
-  {    19,      9,     12,      0,   -112, }, /* 463 */
-  {    19,      9,     12,      0,   -128, }, /* 464 */
-  {    19,      9,     12,      0,   -126, }, /* 465 */
-  {    27,      1,      3,      0,      0, }, /* 466 */
-  {    27,      1,     13,      0,      0, }, /* 467 */
-  {     9,     27,      2,      0,      0, }, /* 468 */
-  {     9,     28,      2,      0,      0, }, /* 469 */
-  {     9,     21,     14,      0,      0, }, /* 470 */
-  {     9,      2,      2,      0,      0, }, /* 471 */
-  {     9,      9,     12,      0,      0, }, /* 472 */
-  {     9,      5,     12,      0,      0, }, /* 473 */
-  {    19,      9,     12,     96,  -7517, }, /* 474 */
-  {    33,      9,     12,    100,  -8383, }, /* 475 */
-  {    33,      9,     12,    104,  -8262, }, /* 476 */
-  {    33,      9,     12,      0,     28, }, /* 477 */
-  {     9,      5,     14,      0,      0, }, /* 478 */
-  {    33,      5,     12,      0,    -28, }, /* 479 */
-  {    33,     14,     12,      0,     16, }, /* 480 */
-  {    33,     14,     12,      0,    -16, }, /* 481 */
-  {    33,     14,     12,      0,      0, }, /* 482 */
-  {     9,     25,     14,      0,      0, }, /* 483 */
-  {     9,     26,     12,      0,     26, }, /* 484 */
-  {     9,     26,     14,      0,     26, }, /* 485 */
-  {     9,     26,     12,      0,    -26, }, /* 486 */
-  {     4,     26,     12,      0,      0, }, /* 487 */
-  {    17,      9,     12,      0,     48, }, /* 488 */
-  {    17,      5,     12,      0,    -48, }, /* 489 */
-  {    33,      9,     12,      0, -10743, }, /* 490 */
-  {    33,      9,     12,      0,  -3814, }, /* 491 */
-  {    33,      9,     12,      0, -10727, }, /* 492 */
-  {    33,      5,     12,      0, -10795, }, /* 493 */
-  {    33,      5,     12,      0, -10792, }, /* 494 */
-  {    33,      9,     12,      0, -10780, }, /* 495 */
-  {    33,      9,     12,      0, -10749, }, /* 496 */
-  {    33,      9,     12,      0, -10783, }, /* 497 */
-  {    33,      9,     12,      0, -10782, }, /* 498 */
-  {    33,      9,     12,      0, -10815, }, /* 499 */
-  {    10,      5,     12,      0,      0, }, /* 500 */
-  {    10,     26,     12,      0,      0, }, /* 501 */
-  {    10,     12,      3,      0,      0, }, /* 502 */
-  {    10,     21,     12,      0,      0, }, /* 503 */
-  {    10,     15,     12,      0,      0, }, /* 504 */
-  {    16,      5,     12,      0,  -7264, }, /* 505 */
-  {    58,      7,     12,      0,      0, }, /* 506 */
-  {    58,      6,     12,      0,      0, }, /* 507 */
-  {    58,     21,     12,      0,      0, }, /* 508 */
-  {    58,     12,      3,      0,      0, }, /* 509 */
-  {    22,     26,     12,      0,      0, }, /* 510 */
-  {    22,      6,     12,      0,      0, }, /* 511 */
-  {    22,     14,     12,      0,      0, }, /* 512 */
-  {    23,     10,      3,      0,      0, }, /* 513 */
-  {     9,     17,     14,      0,      0, }, /* 514 */
-  {    26,      7,     12,      0,      0, }, /* 515 */
-  {    26,      6,     12,      0,      0, }, /* 516 */
-  {    29,      7,     12,      0,      0, }, /* 517 */
-  {    29,      6,     12,      0,      0, }, /* 518 */
-  {     3,      7,     12,      0,      0, }, /* 519 */
-  {    23,      7,     12,      0,      0, }, /* 520 */
-  {    23,     26,     12,      0,      0, }, /* 521 */
-  {    29,     26,     12,      0,      0, }, /* 522 */
-  {    22,      7,     12,      0,      0, }, /* 523 */
-  {    60,      7,     12,      0,      0, }, /* 524 */
-  {    60,      6,     12,      0,      0, }, /* 525 */
-  {    60,     26,     12,      0,      0, }, /* 526 */
-  {    85,      7,     12,      0,      0, }, /* 527 */
-  {    85,      6,     12,      0,      0, }, /* 528 */
-  {    85,     21,     12,      0,      0, }, /* 529 */
-  {    76,      7,     12,      0,      0, }, /* 530 */
-  {    76,      6,     12,      0,      0, }, /* 531 */
-  {    76,     21,     12,      0,      0, }, /* 532 */
-  {    76,     13,     12,      0,      0, }, /* 533 */
-  {    12,      9,     12,    108,      1, }, /* 534 */
-  {    12,      5,     12,    108, -35267, }, /* 535 */
-  {    12,      7,     12,      0,      0, }, /* 536 */
-  {    12,     21,     12,      0,      0, }, /* 537 */
-  {    78,      7,     12,      0,      0, }, /* 538 */
-  {    78,     14,     12,      0,      0, }, /* 539 */
-  {    78,     12,      3,      0,      0, }, /* 540 */
-  {    78,     21,     12,      0,      0, }, /* 541 */
-  {    33,      9,     12,      0, -35332, }, /* 542 */
-  {    33,      9,     12,      0, -42280, }, /* 543 */
-  {    33,      9,     12,      0, -42308, }, /* 544 */
-  {    33,      9,     12,      0, -42319, }, /* 545 */
-  {    33,      9,     12,      0, -42315, }, /* 546 */
-  {    33,      9,     12,      0, -42305, }, /* 547 */
-  {    33,      9,     12,      0, -42258, }, /* 548 */
-  {    33,      9,     12,      0, -42282, }, /* 549 */
-  {    33,      9,     12,      0, -42261, }, /* 550 */
-  {    33,      9,     12,      0,    928, }, /* 551 */
-  {    48,      7,     12,      0,      0, }, /* 552 */
-  {    48,     12,      3,      0,      0, }, /* 553 */
-  {    48,     10,      5,      0,      0, }, /* 554 */
-  {    48,     26,     12,      0,      0, }, /* 555 */
-  {    64,      7,     12,      0,      0, }, /* 556 */
-  {    64,     21,     12,      0,      0, }, /* 557 */
-  {    74,     10,      5,      0,      0, }, /* 558 */
-  {    74,      7,     12,      0,      0, }, /* 559 */
-  {    74,     12,      3,      0,      0, }, /* 560 */
-  {    74,     21,     12,      0,      0, }, /* 561 */
-  {    74,     13,     12,      0,      0, }, /* 562 */
-  {    68,     13,     12,      0,      0, }, /* 563 */
-  {    68,      7,     12,      0,      0, }, /* 564 */
-  {    68,     12,      3,      0,      0, }, /* 565 */
-  {    68,     21,     12,      0,      0, }, /* 566 */
-  {    73,      7,     12,      0,      0, }, /* 567 */
-  {    73,     12,      3,      0,      0, }, /* 568 */
-  {    73,     10,      5,      0,      0, }, /* 569 */
-  {    73,     21,     12,      0,      0, }, /* 570 */
-  {    83,     12,      3,      0,      0, }, /* 571 */
-  {    83,     10,      5,      0,      0, }, /* 572 */
-  {    83,      7,     12,      0,      0, }, /* 573 */
-  {    83,     21,     12,      0,      0, }, /* 574 */
-  {    83,     13,     12,      0,      0, }, /* 575 */
-  {    38,      6,     12,      0,      0, }, /* 576 */
-  {    67,      7,     12,      0,      0, }, /* 577 */
-  {    67,     12,      3,      0,      0, }, /* 578 */
-  {    67,     10,      5,      0,      0, }, /* 579 */
-  {    67,     13,     12,      0,      0, }, /* 580 */
-  {    67,     21,     12,      0,      0, }, /* 581 */
-  {    91,      7,     12,      0,      0, }, /* 582 */
-  {    91,     12,      3,      0,      0, }, /* 583 */
-  {    91,      6,     12,      0,      0, }, /* 584 */
-  {    91,     21,     12,      0,      0, }, /* 585 */
-  {    86,      7,     12,      0,      0, }, /* 586 */
-  {    86,     10,      5,      0,      0, }, /* 587 */
-  {    86,     12,      3,      0,      0, }, /* 588 */
-  {    86,     21,     12,      0,      0, }, /* 589 */
-  {    86,      6,     12,      0,      0, }, /* 590 */
-  {    33,      5,     12,      0,   -928, }, /* 591 */
-  {     8,      5,     12,      0, -38864, }, /* 592 */
-  {    86,     13,     12,      0,      0, }, /* 593 */
-  {    23,      7,      9,      0,      0, }, /* 594 */
-  {    23,      7,     10,      0,      0, }, /* 595 */
-  {     9,      4,      2,      0,      0, }, /* 596 */
-  {     9,      3,     12,      0,      0, }, /* 597 */
-  {    25,     25,     12,      0,      0, }, /* 598 */
-  {     0,     24,     12,      0,      0, }, /* 599 */
-  {     9,      6,      3,      0,      0, }, /* 600 */
-  {    35,      7,     12,      0,      0, }, /* 601 */
-  {    19,     14,     12,      0,      0, }, /* 602 */
-  {    19,     15,     12,      0,      0, }, /* 603 */
-  {    19,     26,     12,      0,      0, }, /* 604 */
-  {    70,      7,     12,      0,      0, }, /* 605 */
-  {    66,      7,     12,      0,      0, }, /* 606 */
-  {    41,      7,     12,      0,      0, }, /* 607 */
-  {    41,     15,     12,      0,      0, }, /* 608 */
-  {    18,      7,     12,      0,      0, }, /* 609 */
-  {    18,     14,     12,      0,      0, }, /* 610 */
-  {   117,      7,     12,      0,      0, }, /* 611 */
-  {   117,     12,      3,      0,      0, }, /* 612 */
-  {    59,      7,     12,      0,      0, }, /* 613 */
-  {    59,     21,     12,      0,      0, }, /* 614 */
-  {    42,      7,     12,      0,      0, }, /* 615 */
-  {    42,     21,     12,      0,      0, }, /* 616 */
-  {    42,     14,     12,      0,      0, }, /* 617 */
-  {    13,      9,     12,      0,     40, }, /* 618 */
-  {    13,      5,     12,      0,    -40, }, /* 619 */
-  {    46,      7,     12,      0,      0, }, /* 620 */
-  {    44,      7,     12,      0,      0, }, /* 621 */
-  {    44,     13,     12,      0,      0, }, /* 622 */
-  {   135,      9,     12,      0,     40, }, /* 623 */
-  {   135,      5,     12,      0,    -40, }, /* 624 */
-  {   105,      7,     12,      0,      0, }, /* 625 */
-  {   103,      7,     12,      0,      0, }, /* 626 */
-  {   103,     21,     12,      0,      0, }, /* 627 */
-  {   109,      7,     12,      0,      0, }, /* 628 */
-  {    11,      7,     12,      0,      0, }, /* 629 */
-  {    80,      7,     12,      0,      0, }, /* 630 */
-  {    80,     21,     12,      0,      0, }, /* 631 */
-  {    80,     15,     12,      0,      0, }, /* 632 */
-  {   119,      7,     12,      0,      0, }, /* 633 */
-  {   119,     26,     12,      0,      0, }, /* 634 */
-  {   119,     15,     12,      0,      0, }, /* 635 */
-  {   115,      7,     12,      0,      0, }, /* 636 */
-  {   115,     15,     12,      0,      0, }, /* 637 */
-  {   127,      7,     12,      0,      0, }, /* 638 */
-  {   127,     15,     12,      0,      0, }, /* 639 */
-  {    65,      7,     12,      0,      0, }, /* 640 */
-  {    65,     15,     12,      0,      0, }, /* 641 */
-  {    65,     21,     12,      0,      0, }, /* 642 */
-  {    71,      7,     12,      0,      0, }, /* 643 */
-  {    71,     21,     12,      0,      0, }, /* 644 */
-  {    97,      7,     12,      0,      0, }, /* 645 */
-  {    96,      7,     12,      0,      0, }, /* 646 */
-  {    96,     15,     12,      0,      0, }, /* 647 */
-  {    30,      7,     12,      0,      0, }, /* 648 */
-  {    30,     12,      3,      0,      0, }, /* 649 */
-  {    30,     15,     12,      0,      0, }, /* 650 */
-  {    30,     21,     12,      0,      0, }, /* 651 */
-  {    87,      7,     12,      0,      0, }, /* 652 */
-  {    87,     15,     12,      0,      0, }, /* 653 */
-  {    87,     21,     12,      0,      0, }, /* 654 */
-  {   116,      7,     12,      0,      0, }, /* 655 */
-  {   116,     15,     12,      0,      0, }, /* 656 */
-  {   111,      7,     12,      0,      0, }, /* 657 */
-  {   111,     26,     12,      0,      0, }, /* 658 */
-  {   111,     12,      3,      0,      0, }, /* 659 */
-  {   111,     15,     12,      0,      0, }, /* 660 */
-  {   111,     21,     12,      0,      0, }, /* 661 */
-  {    77,      7,     12,      0,      0, }, /* 662 */
-  {    77,     21,     12,      0,      0, }, /* 663 */
-  {    82,      7,     12,      0,      0, }, /* 664 */
-  {    82,     15,     12,      0,      0, }, /* 665 */
-  {    81,      7,     12,      0,      0, }, /* 666 */
-  {    81,     15,     12,      0,      0, }, /* 667 */
-  {   120,      7,     12,      0,      0, }, /* 668 */
-  {   120,     21,     12,      0,      0, }, /* 669 */
-  {   120,     15,     12,      0,      0, }, /* 670 */
-  {    88,      7,     12,      0,      0, }, /* 671 */
-  {   129,      9,     12,      0,     64, }, /* 672 */
-  {   129,      5,     12,      0,    -64, }, /* 673 */
-  {   129,     15,     12,      0,      0, }, /* 674 */
-  {   143,      7,     12,      0,      0, }, /* 675 */
-  {   143,     12,      3,      0,      0, }, /* 676 */
-  {   143,     13,     12,      0,      0, }, /* 677 */
-  {     0,     15,     12,      0,      0, }, /* 678 */
-  {   146,      7,     12,      0,      0, }, /* 679 */
-  {   146,     15,     12,      0,      0, }, /* 680 */
-  {   147,      7,     12,      0,      0, }, /* 681 */
-  {   147,     12,      3,      0,      0, }, /* 682 */
-  {   147,     15,     12,      0,      0, }, /* 683 */
-  {   147,     21,     12,      0,      0, }, /* 684 */
-  {    93,     10,      5,      0,      0, }, /* 685 */
-  {    93,     12,      3,      0,      0, }, /* 686 */
-  {    93,      7,     12,      0,      0, }, /* 687 */
-  {    93,     21,     12,      0,      0, }, /* 688 */
-  {    93,     15,     12,      0,      0, }, /* 689 */
-  {    93,     13,     12,      0,      0, }, /* 690 */
-  {    84,     12,      3,      0,      0, }, /* 691 */
-  {    84,     10,      5,      0,      0, }, /* 692 */
-  {    84,      7,     12,      0,      0, }, /* 693 */
-  {    84,     21,     12,      0,      0, }, /* 694 */
-  {    84,      1,      4,      0,      0, }, /* 695 */
-  {   100,      7,     12,      0,      0, }, /* 696 */
-  {   100,     13,     12,      0,      0, }, /* 697 */
-  {    95,     12,      3,      0,      0, }, /* 698 */
-  {    95,      7,     12,      0,      0, }, /* 699 */
-  {    95,     10,      5,      0,      0, }, /* 700 */
-  {    95,     13,     12,      0,      0, }, /* 701 */
-  {    95,     21,     12,      0,      0, }, /* 702 */
-  {   110,      7,     12,      0,      0, }, /* 703 */
-  {   110,     12,      3,      0,      0, }, /* 704 */
-  {   110,     21,     12,      0,      0, }, /* 705 */
-  {    99,     12,      3,      0,      0, }, /* 706 */
-  {    99,     10,      5,      0,      0, }, /* 707 */
-  {    99,      7,     12,      0,      0, }, /* 708 */
-  {    99,      7,      4,      0,      0, }, /* 709 */
-  {    99,     21,     12,      0,      0, }, /* 710 */
-  {    99,     13,     12,      0,      0, }, /* 711 */
-  {    47,     15,     12,      0,      0, }, /* 712 */
-  {   107,      7,     12,      0,      0, }, /* 713 */
-  {   107,     10,      5,      0,      0, }, /* 714 */
-  {   107,     12,      3,      0,      0, }, /* 715 */
-  {   107,     21,     12,      0,      0, }, /* 716 */
-  {   128,      7,     12,      0,      0, }, /* 717 */
-  {   128,     21,     12,      0,      0, }, /* 718 */
-  {   108,      7,     12,      0,      0, }, /* 719 */
-  {   108,     12,      3,      0,      0, }, /* 720 */
-  {   108,     10,      5,      0,      0, }, /* 721 */
-  {   108,     13,     12,      0,      0, }, /* 722 */
-  {   106,     12,      3,      0,      0, }, /* 723 */
-  {   106,     10,      5,      0,      0, }, /* 724 */
-  {   106,      7,     12,      0,      0, }, /* 725 */
-  {   106,     10,      3,      0,      0, }, /* 726 */
-  {   134,      7,     12,      0,      0, }, /* 727 */
-  {   134,     10,      5,      0,      0, }, /* 728 */
-  {   134,     12,      3,      0,      0, }, /* 729 */
-  {   134,     21,     12,      0,      0, }, /* 730 */
-  {   134,     13,     12,      0,      0, }, /* 731 */
-  {   123,      7,     12,      0,      0, }, /* 732 */
-  {   123,     10,      3,      0,      0, }, /* 733 */
-  {   123,     10,      5,      0,      0, }, /* 734 */
-  {   123,     12,      3,      0,      0, }, /* 735 */
-  {   123,     21,     12,      0,      0, }, /* 736 */
-  {   123,     13,     12,      0,      0, }, /* 737 */
-  {   122,      7,     12,      0,      0, }, /* 738 */
-  {   122,     10,      3,      0,      0, }, /* 739 */
-  {   122,     10,      5,      0,      0, }, /* 740 */
-  {   122,     12,      3,      0,      0, }, /* 741 */
-  {   122,     21,     12,      0,      0, }, /* 742 */
-  {   113,      7,     12,      0,      0, }, /* 743 */
-  {   113,     10,      5,      0,      0, }, /* 744 */
-  {   113,     12,      3,      0,      0, }, /* 745 */
-  {   113,     21,     12,      0,      0, }, /* 746 */
-  {   113,     13,     12,      0,      0, }, /* 747 */
-  {   101,      7,     12,      0,      0, }, /* 748 */
-  {   101,     12,      3,      0,      0, }, /* 749 */
-  {   101,     10,      5,      0,      0, }, /* 750 */
-  {   101,     13,     12,      0,      0, }, /* 751 */
-  {   125,      7,     12,      0,      0, }, /* 752 */
-  {   125,     12,      3,      0,      0, }, /* 753 */
-  {   125,     10,      5,      0,      0, }, /* 754 */
-  {   125,     13,     12,      0,      0, }, /* 755 */
-  {   125,     15,     12,      0,      0, }, /* 756 */
-  {   125,     21,     12,      0,      0, }, /* 757 */
-  {   125,     26,     12,      0,      0, }, /* 758 */
-  {   141,      7,     12,      0,      0, }, /* 759 */
-  {   141,     10,      5,      0,      0, }, /* 760 */
-  {   141,     12,      3,      0,      0, }, /* 761 */
-  {   141,     21,     12,      0,      0, }, /* 762 */
-  {   124,      9,     12,      0,     32, }, /* 763 */
-  {   124,      5,     12,      0,    -32, }, /* 764 */
-  {   124,     13,     12,      0,      0, }, /* 765 */
-  {   124,     15,     12,      0,      0, }, /* 766 */
-  {   124,      7,     12,      0,      0, }, /* 767 */
-  {   140,      7,     12,      0,      0, }, /* 768 */
-  {   140,     12,      3,      0,      0, }, /* 769 */
-  {   140,     10,      5,      0,      0, }, /* 770 */
-  {   140,      7,      4,      0,      0, }, /* 771 */
-  {   140,     21,     12,      0,      0, }, /* 772 */
-  {   139,      7,     12,      0,      0, }, /* 773 */
-  {   139,     12,      3,      0,      0, }, /* 774 */
-  {   139,     10,      5,      0,      0, }, /* 775 */
-  {   139,      7,      4,      0,      0, }, /* 776 */
-  {   139,     21,     12,      0,      0, }, /* 777 */
-  {   121,      7,     12,      0,      0, }, /* 778 */
-  {   132,      7,     12,      0,      0, }, /* 779 */
-  {   132,     10,      5,      0,      0, }, /* 780 */
-  {   132,     12,      3,      0,      0, }, /* 781 */
-  {   132,     21,     12,      0,      0, }, /* 782 */
-  {   132,     13,     12,      0,      0, }, /* 783 */
-  {   132,     15,     12,      0,      0, }, /* 784 */
-  {   133,     21,     12,      0,      0, }, /* 785 */
-  {   133,      7,     12,      0,      0, }, /* 786 */
-  {   133,     12,      3,      0,      0, }, /* 787 */
-  {   133,     10,      5,      0,      0, }, /* 788 */
-  {   137,      7,     12,      0,      0, }, /* 789 */
-  {   137,     12,      3,      0,      0, }, /* 790 */
-  {   137,      7,      4,      0,      0, }, /* 791 */
-  {   137,     13,     12,      0,      0, }, /* 792 */
-  {   142,      7,     12,      0,      0, }, /* 793 */
-  {   142,     10,      5,      0,      0, }, /* 794 */
-  {   142,     12,      3,      0,      0, }, /* 795 */
-  {   142,     13,     12,      0,      0, }, /* 796 */
-  {   144,      7,     12,      0,      0, }, /* 797 */
-  {   144,     12,      3,      0,      0, }, /* 798 */
-  {   144,     10,      5,      0,      0, }, /* 799 */
-  {   144,     21,     12,      0,      0, }, /* 800 */
-  {    62,      7,     12,      0,      0, }, /* 801 */
-  {    62,     14,     12,      0,      0, }, /* 802 */
-  {    62,     21,     12,      0,      0, }, /* 803 */
-  {    79,      7,     12,      0,      0, }, /* 804 */
-  {   126,      7,     12,      0,      0, }, /* 805 */
-  {   114,      7,     12,      0,      0, }, /* 806 */
-  {   114,     13,     12,      0,      0, }, /* 807 */
-  {   114,     21,     12,      0,      0, }, /* 808 */
-  {   102,      7,     12,      0,      0, }, /* 809 */
-  {   102,     12,      3,      0,      0, }, /* 810 */
-  {   102,     21,     12,      0,      0, }, /* 811 */
-  {   118,      7,     12,      0,      0, }, /* 812 */
-  {   118,     12,      3,      0,      0, }, /* 813 */
-  {   118,     21,     12,      0,      0, }, /* 814 */
-  {   118,     26,     12,      0,      0, }, /* 815 */
-  {   118,      6,     12,      0,      0, }, /* 816 */
-  {   118,     13,     12,      0,      0, }, /* 817 */
-  {   118,     15,     12,      0,      0, }, /* 818 */
-  {   145,      9,     12,      0,     32, }, /* 819 */
-  {   145,      5,     12,      0,    -32, }, /* 820 */
-  {   145,     15,     12,      0,      0, }, /* 821 */
-  {   145,     21,     12,      0,      0, }, /* 822 */
-  {    98,      7,     12,      0,      0, }, /* 823 */
-  {    98,     10,      5,      0,      0, }, /* 824 */
-  {    98,     12,      3,      0,      0, }, /* 825 */
-  {    98,      6,     12,      0,      0, }, /* 826 */
-  {   136,      6,     12,      0,      0, }, /* 827 */
-  {   138,      6,     12,      0,      0, }, /* 828 */
-  {   136,      7,     12,      0,      0, }, /* 829 */
-  {   138,      7,     12,      0,      0, }, /* 830 */
-  {   104,      7,     12,      0,      0, }, /* 831 */
-  {   104,     26,     12,      0,      0, }, /* 832 */
-  {   104,     12,      3,      0,      0, }, /* 833 */
-  {   104,     21,     12,      0,      0, }, /* 834 */
-  {     9,     10,      3,      0,      0, }, /* 835 */
-  {    19,     12,      3,      0,      0, }, /* 836 */
-  {   130,     26,     12,      0,      0, }, /* 837 */
-  {   130,     12,      3,      0,      0, }, /* 838 */
-  {   130,     21,     12,      0,      0, }, /* 839 */
-  {    17,     12,      3,      0,      0, }, /* 840 */
-  {   112,      7,     12,      0,      0, }, /* 841 */
-  {   112,     15,     12,      0,      0, }, /* 842 */
-  {   112,     12,      3,      0,      0, }, /* 843 */
-  {   131,      9,     12,      0,     34, }, /* 844 */
-  {   131,      5,     12,      0,    -34, }, /* 845 */
-  {   131,     12,      3,      0,      0, }, /* 846 */
-  {   131,     13,     12,      0,      0, }, /* 847 */
-  {   131,     21,     12,      0,      0, }, /* 848 */
-  {     9,      2,     14,      0,      0, }, /* 849 */
-  {     9,     26,     11,      0,      0, }, /* 850 */
-  {    26,     26,     12,      0,      0, }, /* 851 */
-  {     9,     24,      3,      0,      0, }, /* 852 */
-  {     9,      1,      3,      0,      0, }, /* 853 */
+/* This table lists the code points for the '9' characters in each
+set of decimal digits. It is used to ensure that all the digits in
+a script run come from the same set. */
+
+const uint32_t PRIV(ucd_digit_sets)[] = {
+  63,  /* Number of subsequent values */
+  0x00039, 0x00669, 0x006f9, 0x007c9, 0x0096f, 0x009ef, 0x00a6f, 0x00aef,
+  0x00b6f, 0x00bef, 0x00c6f, 0x00cef, 0x00d6f, 0x00def, 0x00e59, 0x00ed9,
+  0x00f29, 0x01049, 0x01099, 0x017e9, 0x01819, 0x0194f, 0x019d9, 0x01a89,
+  0x01a99, 0x01b59, 0x01bb9, 0x01c49, 0x01c59, 0x0a629, 0x0a8d9, 0x0a909,
+  0x0a9d9, 0x0a9f9, 0x0aa59, 0x0abf9, 0x0ff19, 0x104a9, 0x10d39, 0x1106f,
+  0x110f9, 0x1113f, 0x111d9, 0x112f9, 0x11459, 0x114d9, 0x11659, 0x116c9,
+  0x11739, 0x118e9, 0x11c59, 0x11d59, 0x11da9, 0x16a69, 0x16b59, 0x1d7d7,
+  0x1d7e1, 0x1d7eb, 0x1d7f5, 0x1d7ff, 0x1e149, 0x1e2f9, 0x1e959,
+};
+
+/* This vector is a list of lists of scripts for the Script Extension
+property. Each sublist is zero-terminated. */
+
+const uint8_t PRIV(ucd_script_sets)[] = {
+  /*   0 */   0,
+  /*   1 */   1,  11,   0,
+  /*   4 */   1, 144,   0,
+  /*   7 */   1,  50,   0,
+  /*  10 */   1,  56,   0,
+  /*  13 */   2,  17,   0,
+  /*  16 */   3,  15,   0,
+  /*  19 */   4,  23,   0,
+  /*  22 */   6,  84,   0,
+  /*  25 */  12,  36,   0,
+  /*  28 */  13,  18,   0,
+  /*  31 */  13,  34,   0,
+  /*  34 */  13, 118,   0,
+  /*  37 */  15, 107,   0,
+  /*  40 */  15, 150,   0,
+  /*  43 */  15, 100,   0,
+  /*  46 */  15,  54,   0,
+  /*  49 */  17,  34,   0,
+  /*  52 */ 107,  54,   0,
+  /*  55 */  21, 108,   0,
+  /*  58 */  22, 129,   0,
+  /*  61 */  27,  30,   0,
+  /*  64 */  29, 150,   0,
+  /*  67 */  34,  38,   0,
+  /*  70 */  38,  65,   0,
+  /*  73 */   1,  50,  56,   0,
+  /*  77 */   3,  96,  49,   0,
+  /*  81 */  96,  39,  53,   0,
+  /*  85 */  12, 110,  36,   0,
+  /*  89 */  15, 107,  29,   0,
+  /*  93 */  15, 107,  34,   0,
+  /*  97 */  23,  27,  30,   0,
+  /* 101 */  69,  34,  39,   0,
+  /* 105 */   1, 144,  50,  56,   0,
+  /* 110 */   3,  15, 107,  29,   0,
+  /* 115 */   7,  25,  52,  51,   0,
+  /* 120 */  15, 142,  85, 111,   0,
+  /* 125 */   4,  24,  23,  27,  30,   0,
+  /* 131 */   4,  24,  23,  27,  30,  61,   0,
+  /* 138 */  15,  29,  37,  44,  54,  55,   0,
+  /* 145 */ 132,   1,  95, 112, 121, 144, 148,  50,   0,
+  /* 154 */   3,  15, 107,  29, 150,  44,  55, 124,   0,
+  /* 163 */  15, 142,  21,  22, 108,  85, 111, 114, 109, 102, 124,   0,
+  /* 175 */   3,  15, 107,  21,  22,  29,  34,  37,  44,  54,  55, 124,   0,
+  /* 188 */   3,  15, 107,  21,  22,  29,  34,  37,  44, 100,  54,  55, 124,   0,
+  /* 202 */  15, 142,  21,  22, 108,  29,  85, 111, 114, 150, 109, 102, 124,   0,
+  /* 216 */  15, 142,  21,  22, 108,  29,  85, 111,  37, 114, 150, 109, 102, 124,   0,
+  /* 231 */   3,  15, 142, 143, 138, 107,  21,  22,  29, 111,  37, 150,  44, 109,  48,  49, 102,  54,  55, 124,   0,
+  /* 252 */   3,  15, 142, 143, 138, 107,  21,  22,  29,  35, 111,  37, 150,  44, 109,  48,  49, 102,  54,  55, 124,   0,
+  /* 274 */
+};
+
+/* These are the main two-stage UCD tables. The fields in each record are:
+script (8 bits), character type (8 bits), grapheme break property (8 bits),
+offset to multichar other cases or zero (8 bits), offset to other case
+or zero (32 bits, signed), script extension (16 bits, signed), and a dummy
+16-bit field to make the whole thing a multiple of 4 bytes. */
+
+const ucd_record PRIV(ucd_records)[] = { /* 11508 bytes, record size 12 */
+  {    10,      0,      2,      0,      0,     10,    256, }, /*   0 */
+  {    10,      0,      2,      0,      0,     10,      0, }, /*   1 */
+  {    10,      0,      1,      0,      0,     10,      0, }, /*   2 */
+  {    10,      0,      0,      0,      0,     10,      0, }, /*   3 */
+  {    10,     29,     12,      0,      0,     10,      0, }, /*   4 */
+  {    10,     21,     12,      0,      0,     10,      0, }, /*   5 */
+  {    10,     23,     12,      0,      0,     10,      0, }, /*   6 */
+  {    10,     22,     12,      0,      0,     10,      0, }, /*   7 */
+  {    10,     18,     12,      0,      0,     10,      0, }, /*   8 */
+  {    10,     25,     12,      0,      0,     10,      0, }, /*   9 */
+  {    10,     17,     12,      0,      0,     10,      0, }, /*  10 */
+  {    10,     13,     12,      0,      0,     10,      0, }, /*  11 */
+  {    34,      9,     12,      0,     32,     34,      0, }, /*  12 */
+  {    34,      9,     12,    100,     32,     34,      0, }, /*  13 */
+  {    34,      9,     12,      1,     32,     34,      0, }, /*  14 */
+  {    10,     24,     12,      0,      0,     10,      0, }, /*  15 */
+  {    10,     16,     12,      0,      0,     10,      0, }, /*  16 */
+  {    34,      5,     12,      0,    -32,     34,      0, }, /*  17 */
+  {    34,      5,     12,    100,    -32,     34,      0, }, /*  18 */
+  {    34,      5,     12,      1,    -32,     34,      0, }, /*  19 */
+  {    10,     26,     12,      0,      0,     10,      0, }, /*  20 */
+  {    10,     26,     14,      0,      0,     10,      0, }, /*  21 */
+  {    34,      7,     12,      0,      0,     34,      0, }, /*  22 */
+  {    10,     20,     12,      0,      0,     10,      0, }, /*  23 */
+  {    10,      1,      2,      0,      0,     10,      0, }, /*  24 */
+  {    10,     15,     12,      0,      0,     10,      0, }, /*  25 */
+  {    10,      5,     12,     26,    775,     10,      0, }, /*  26 */
+  {    10,     19,     12,      0,      0,     10,      0, }, /*  27 */
+  {    34,      9,     12,    104,     32,     34,      0, }, /*  28 */
+  {    34,      5,     12,      0,   7615,     34,      0, }, /*  29 */
+  {    34,      5,     12,    104,    -32,     34,      0, }, /*  30 */
+  {    34,      5,     12,      0,    121,     34,      0, }, /*  31 */
+  {    34,      9,     12,      0,      1,     34,      0, }, /*  32 */
+  {    34,      5,     12,      0,     -1,     34,      0, }, /*  33 */
+  {    34,      9,     12,      0,      0,     34,      0, }, /*  34 */
+  {    34,      5,     12,      0,      0,     34,      0, }, /*  35 */
+  {    34,      9,     12,      0,   -121,     34,      0, }, /*  36 */
+  {    34,      5,     12,      1,   -268,     34,      0, }, /*  37 */
+  {    34,      5,     12,      0,    195,     34,      0, }, /*  38 */
+  {    34,      9,     12,      0,    210,     34,      0, }, /*  39 */
+  {    34,      9,     12,      0,    206,     34,      0, }, /*  40 */
+  {    34,      9,     12,      0,    205,     34,      0, }, /*  41 */
+  {    34,      9,     12,      0,     79,     34,      0, }, /*  42 */
+  {    34,      9,     12,      0,    202,     34,      0, }, /*  43 */
+  {    34,      9,     12,      0,    203,     34,      0, }, /*  44 */
+  {    34,      9,     12,      0,    207,     34,      0, }, /*  45 */
+  {    34,      5,     12,      0,     97,     34,      0, }, /*  46 */
+  {    34,      9,     12,      0,    211,     34,      0, }, /*  47 */
+  {    34,      9,     12,      0,    209,     34,      0, }, /*  48 */
+  {    34,      5,     12,      0,    163,     34,      0, }, /*  49 */
+  {    34,      9,     12,      0,    213,     34,      0, }, /*  50 */
+  {    34,      5,     12,      0,    130,     34,      0, }, /*  51 */
+  {    34,      9,     12,      0,    214,     34,      0, }, /*  52 */
+  {    34,      9,     12,      0,    218,     34,      0, }, /*  53 */
+  {    34,      9,     12,      0,    217,     34,      0, }, /*  54 */
+  {    34,      9,     12,      0,    219,     34,      0, }, /*  55 */
+  {    34,      5,     12,      0,     56,     34,      0, }, /*  56 */
+  {    34,      9,     12,      5,      2,     34,      0, }, /*  57 */
+  {    34,      8,     12,      5,      1,     34,      0, }, /*  58 */
+  {    34,      5,     12,      5,     -2,     34,      0, }, /*  59 */
+  {    34,      9,     12,      9,      2,     34,      0, }, /*  60 */
+  {    34,      8,     12,      9,      1,     34,      0, }, /*  61 */
+  {    34,      5,     12,      9,     -2,     34,      0, }, /*  62 */
+  {    34,      9,     12,     13,      2,     34,      0, }, /*  63 */
+  {    34,      8,     12,     13,      1,     34,      0, }, /*  64 */
+  {    34,      5,     12,     13,     -2,     34,      0, }, /*  65 */
+  {    34,      5,     12,      0,    -79,     34,      0, }, /*  66 */
+  {    34,      9,     12,     17,      2,     34,      0, }, /*  67 */
+  {    34,      8,     12,     17,      1,     34,      0, }, /*  68 */
+  {    34,      5,     12,     17,     -2,     34,      0, }, /*  69 */
+  {    34,      9,     12,      0,    -97,     34,      0, }, /*  70 */
+  {    34,      9,     12,      0,    -56,     34,      0, }, /*  71 */
+  {    34,      9,     12,      0,   -130,     34,      0, }, /*  72 */
+  {    34,      9,     12,      0,  10795,     34,      0, }, /*  73 */
+  {    34,      9,     12,      0,   -163,     34,      0, }, /*  74 */
+  {    34,      9,     12,      0,  10792,     34,      0, }, /*  75 */
+  {    34,      5,     12,      0,  10815,     34,      0, }, /*  76 */
+  {    34,      9,     12,      0,   -195,     34,      0, }, /*  77 */
+  {    34,      9,     12,      0,     69,     34,      0, }, /*  78 */
+  {    34,      9,     12,      0,     71,     34,      0, }, /*  79 */
+  {    34,      5,     12,      0,  10783,     34,      0, }, /*  80 */
+  {    34,      5,     12,      0,  10780,     34,      0, }, /*  81 */
+  {    34,      5,     12,      0,  10782,     34,      0, }, /*  82 */
+  {    34,      5,     12,      0,   -210,     34,      0, }, /*  83 */
+  {    34,      5,     12,      0,   -206,     34,      0, }, /*  84 */
+  {    34,      5,     12,      0,   -205,     34,      0, }, /*  85 */
+  {    34,      5,     12,      0,   -202,     34,      0, }, /*  86 */
+  {    34,      5,     12,      0,   -203,     34,      0, }, /*  87 */
+  {    34,      5,     12,      0,  42319,     34,      0, }, /*  88 */
+  {    34,      5,     12,      0,  42315,     34,      0, }, /*  89 */
+  {    34,      5,     12,      0,   -207,     34,      0, }, /*  90 */
+  {    34,      5,     12,      0,  42280,     34,      0, }, /*  91 */
+  {    34,      5,     12,      0,  42308,     34,      0, }, /*  92 */
+  {    34,      5,     12,      0,   -209,     34,      0, }, /*  93 */
+  {    34,      5,     12,      0,   -211,     34,      0, }, /*  94 */
+  {    34,      5,     12,      0,  10743,     34,      0, }, /*  95 */
+  {    34,      5,     12,      0,  42305,     34,      0, }, /*  96 */
+  {    34,      5,     12,      0,  10749,     34,      0, }, /*  97 */
+  {    34,      5,     12,      0,   -213,     34,      0, }, /*  98 */
+  {    34,      5,     12,      0,   -214,     34,      0, }, /*  99 */
+  {    34,      5,     12,      0,  10727,     34,      0, }, /* 100 */
+  {    34,      5,     12,      0,   -218,     34,      0, }, /* 101 */
+  {    34,      5,     12,      0,  42307,     34,      0, }, /* 102 */
+  {    34,      5,     12,      0,  42282,     34,      0, }, /* 103 */
+  {    34,      5,     12,      0,    -69,     34,      0, }, /* 104 */
+  {    34,      5,     12,      0,   -217,     34,      0, }, /* 105 */
+  {    34,      5,     12,      0,    -71,     34,      0, }, /* 106 */
+  {    34,      5,     12,      0,   -219,     34,      0, }, /* 107 */
+  {    34,      5,     12,      0,  42261,     34,      0, }, /* 108 */
+  {    34,      5,     12,      0,  42258,     34,      0, }, /* 109 */
+  {    34,      6,     12,      0,      0,     34,      0, }, /* 110 */
+  {    10,      6,     12,      0,      0,     10,      0, }, /* 111 */
+  {     4,     24,     12,      0,      0,      4,      0, }, /* 112 */
+  {    28,     12,      3,      0,      0,     28,      0, }, /* 113 */
+  {    28,     12,      3,      0,      0,     20,      0, }, /* 114 */
+  {    28,     12,      3,     21,    116,     20,      0, }, /* 115 */
+  {    28,     12,      3,      0,      0,     34,      0, }, /* 116 */
+  {    20,      9,     12,      0,      1,     20,      0, }, /* 117 */
+  {    20,      5,     12,      0,     -1,     20,      0, }, /* 118 */
+  {    20,     24,     12,      0,      0,     20,      0, }, /* 119 */
+  {     0,      2,     12,      0,      0,      0,      0, }, /* 120 */
+  {    20,      6,     12,      0,      0,     20,      0, }, /* 121 */
+  {    20,      5,     12,      0,    130,     20,      0, }, /* 122 */
+  {    20,      9,     12,      0,    116,     20,      0, }, /* 123 */
+  {    20,      9,     12,      0,     38,     20,      0, }, /* 124 */
+  {    20,      9,     12,      0,     37,     20,      0, }, /* 125 */
+  {    20,      9,     12,      0,     64,     20,      0, }, /* 126 */
+  {    20,      9,     12,      0,     63,     20,      0, }, /* 127 */
+  {    20,      5,     12,      0,      0,     20,      0, }, /* 128 */
+  {    20,      9,     12,      0,     32,     20,      0, }, /* 129 */
+  {    20,      9,     12,     34,     32,     20,      0, }, /* 130 */
+  {    20,      9,     12,     59,     32,     20,      0, }, /* 131 */
+  {    20,      9,     12,     38,     32,     20,      0, }, /* 132 */
+  {    20,      9,     12,     21,     32,     20,      0, }, /* 133 */
+  {    20,      9,     12,     51,     32,     20,      0, }, /* 134 */
+  {    20,      9,     12,     26,     32,     20,      0, }, /* 135 */
+  {    20,      9,     12,     47,     32,     20,      0, }, /* 136 */
+  {    20,      9,     12,     55,     32,     20,      0, }, /* 137 */
+  {    20,      9,     12,     30,     32,     20,      0, }, /* 138 */
+  {    20,      9,     12,     43,     32,     20,      0, }, /* 139 */
+  {    20,      9,     12,     96,     32,     20,      0, }, /* 140 */
+  {    20,      5,     12,      0,    -38,     20,      0, }, /* 141 */
+  {    20,      5,     12,      0,    -37,     20,      0, }, /* 142 */
+  {    20,      5,     12,      0,    -32,     20,      0, }, /* 143 */
+  {    20,      5,     12,     34,    -32,     20,      0, }, /* 144 */
+  {    20,      5,     12,     59,    -32,     20,      0, }, /* 145 */
+  {    20,      5,     12,     38,    -32,     20,      0, }, /* 146 */
+  {    20,      5,     12,     21,   -116,     20,      0, }, /* 147 */
+  {    20,      5,     12,     51,    -32,     20,      0, }, /* 148 */
+  {    20,      5,     12,     26,   -775,     20,      0, }, /* 149 */
+  {    20,      5,     12,     47,    -32,     20,      0, }, /* 150 */
+  {    20,      5,     12,     55,    -32,     20,      0, }, /* 151 */
+  {    20,      5,     12,     30,      1,     20,      0, }, /* 152 */
+  {    20,      5,     12,     30,    -32,     20,      0, }, /* 153 */
+  {    20,      5,     12,     43,    -32,     20,      0, }, /* 154 */
+  {    20,      5,     12,     96,    -32,     20,      0, }, /* 155 */
+  {    20,      5,     12,      0,    -64,     20,      0, }, /* 156 */
+  {    20,      5,     12,      0,    -63,     20,      0, }, /* 157 */
+  {    20,      9,     12,      0,      8,     20,      0, }, /* 158 */
+  {    20,      5,     12,     34,    -30,     20,      0, }, /* 159 */
+  {    20,      5,     12,     38,    -25,     20,      0, }, /* 160 */
+  {    20,      9,     12,      0,      0,     20,      0, }, /* 161 */
+  {    20,      5,     12,     43,    -15,     20,      0, }, /* 162 */
+  {    20,      5,     12,     47,    -22,     20,      0, }, /* 163 */
+  {    20,      5,     12,      0,     -8,     20,      0, }, /* 164 */
+  {    11,      9,     12,      0,      1,     11,      0, }, /* 165 */
+  {    11,      5,     12,      0,     -1,     11,      0, }, /* 166 */
+  {    20,      5,     12,     51,    -54,     20,      0, }, /* 167 */
+  {    20,      5,     12,     55,    -48,     20,      0, }, /* 168 */
+  {    20,      5,     12,      0,      7,     20,      0, }, /* 169 */
+  {    20,      5,     12,      0,   -116,     20,      0, }, /* 170 */
+  {    20,      9,     12,     38,    -60,     20,      0, }, /* 171 */
+  {    20,      5,     12,     59,    -64,     20,      0, }, /* 172 */
+  {    20,     25,     12,      0,      0,     20,      0, }, /* 173 */
+  {    20,      9,     12,      0,     -7,     20,      0, }, /* 174 */
+  {    20,      9,     12,      0,   -130,     20,      0, }, /* 175 */
+  {    13,      9,     12,      0,     80,     13,      0, }, /* 176 */
+  {    13,      9,     12,      0,     32,     13,      0, }, /* 177 */
+  {    13,      9,     12,     63,     32,     13,      0, }, /* 178 */
+  {    13,      9,     12,     67,     32,     13,      0, }, /* 179 */
+  {    13,      9,     12,     71,     32,     13,      0, }, /* 180 */
+  {    13,      9,     12,     75,     32,     13,      0, }, /* 181 */
+  {    13,      9,     12,     79,     32,     13,      0, }, /* 182 */
+  {    13,      9,     12,     84,     32,     13,      0, }, /* 183 */
+  {    13,      5,     12,      0,    -32,     13,      0, }, /* 184 */
+  {    13,      5,     12,     63,    -32,     13,      0, }, /* 185 */
+  {    13,      5,     12,     67,    -32,     13,      0, }, /* 186 */
+  {    13,      5,     12,     71,    -32,     13,      0, }, /* 187 */
+  {    13,      5,     12,     75,    -32,     13,      0, }, /* 188 */
+  {    13,      5,     12,     79,    -32,     13,      0, }, /* 189 */
+  {    13,      5,     12,     84,    -32,     13,      0, }, /* 190 */
+  {    13,      5,     12,      0,    -80,     13,      0, }, /* 191 */
+  {    13,      9,     12,      0,      1,     13,      0, }, /* 192 */
+  {    13,      5,     12,      0,     -1,     13,      0, }, /* 193 */
+  {    13,      9,     12,     88,      1,     13,      0, }, /* 194 */
+  {    13,      5,     12,     88,     -1,     13,      0, }, /* 195 */
+  {    13,     26,     12,      0,      0,     13,      0, }, /* 196 */
+  {    13,     12,      3,      0,      0,    -34,      0, }, /* 197 */
+  {    13,     12,      3,      0,      0,    -28,      0, }, /* 198 */
+  {    28,     12,      3,      0,      0,    -31,      0, }, /* 199 */
+  {    13,     11,      3,      0,      0,     13,      0, }, /* 200 */
+  {    13,      9,     12,      0,     15,     13,      0, }, /* 201 */
+  {    13,      5,     12,      0,    -15,     13,      0, }, /* 202 */
+  {     2,      9,     12,      0,     48,      2,      0, }, /* 203 */
+  {     2,      6,     12,      0,      0,      2,      0, }, /* 204 */
+  {     2,     21,     12,      0,      0,      2,      0, }, /* 205 */
+  {     2,      5,     12,      0,      0,      2,      0, }, /* 206 */
+  {     2,      5,     12,      0,    -48,      2,      0, }, /* 207 */
+  {    10,     21,     12,      0,      0,    -13,      0, }, /* 208 */
+  {     2,     17,     12,      0,      0,      2,      0, }, /* 209 */
+  {     2,     26,     12,      0,      0,      2,      0, }, /* 210 */
+  {     2,     23,     12,      0,      0,      2,      0, }, /* 211 */
+  {    26,     12,      3,      0,      0,     26,      0, }, /* 212 */
+  {    26,     17,     12,      0,      0,     26,      0, }, /* 213 */
+  {    26,     21,     12,      0,      0,     26,      0, }, /* 214 */
+  {    26,      7,     12,      0,      0,     26,      0, }, /* 215 */
+  {     1,      1,      4,      0,      0,      1,      0, }, /* 216 */
+  {    10,      1,      4,      0,      0,     10,      0, }, /* 217 */
+  {     1,     25,     12,      0,      0,      1,      0, }, /* 218 */
+  {     1,     21,     12,      0,      0,      1,      0, }, /* 219 */
+  {     1,     23,     12,      0,      0,      1,      0, }, /* 220 */
+  {    10,     21,     12,      0,      0,   -105,      0, }, /* 221 */
+  {     1,     26,     12,      0,      0,      1,      0, }, /* 222 */
+  {     1,     12,      3,      0,      0,      1,      0, }, /* 223 */
+  {     1,      1,      2,      0,      0,    -73,      0, }, /* 224 */
+  {     1,      7,     12,      0,      0,      1,      0, }, /* 225 */
+  {    10,      6,     12,      0,      0,   -145,      0, }, /* 226 */
+  {    28,     12,      3,      0,      0,     -7,      0, }, /* 227 */
+  {     1,     13,     12,      0,      0,    -10,      0, }, /* 228 */
+  {     1,     21,     12,      0,      0,     -4,      0, }, /* 229 */
+  {     1,      6,     12,      0,      0,      1,      0, }, /* 230 */
+  {     1,     13,     12,      0,      0,      1,      0, }, /* 231 */
+  {    50,     21,     12,      0,      0,     50,      0, }, /* 232 */
+  {    50,      1,      4,      0,      0,     50,      0, }, /* 233 */
+  {    50,      7,     12,      0,      0,     50,      0, }, /* 234 */
+  {    50,     12,      3,      0,      0,     50,      0, }, /* 235 */
+  {    56,      7,     12,      0,      0,     56,      0, }, /* 236 */
+  {    56,     12,      3,      0,      0,     56,      0, }, /* 237 */
+  {    64,     13,     12,      0,      0,     64,      0, }, /* 238 */
+  {    64,      7,     12,      0,      0,     64,      0, }, /* 239 */
+  {    64,     12,      3,      0,      0,     64,      0, }, /* 240 */
+  {    64,      6,     12,      0,      0,     64,      0, }, /* 241 */
+  {    64,     26,     12,      0,      0,     64,      0, }, /* 242 */
+  {    64,     21,     12,      0,      0,     64,      0, }, /* 243 */
+  {    64,     23,     12,      0,      0,     64,      0, }, /* 244 */
+  {    90,      7,     12,      0,      0,     90,      0, }, /* 245 */
+  {    90,     12,      3,      0,      0,     90,      0, }, /* 246 */
+  {    90,      6,     12,      0,      0,     90,      0, }, /* 247 */
+  {    90,     21,     12,      0,      0,     90,      0, }, /* 248 */
+  {    95,      7,     12,      0,      0,     95,      0, }, /* 249 */
+  {    95,     12,      3,      0,      0,     95,      0, }, /* 250 */
+  {    95,     21,     12,      0,      0,     95,      0, }, /* 251 */
+  {    15,     12,      3,      0,      0,     15,      0, }, /* 252 */
+  {    15,     10,      5,      0,      0,     15,      0, }, /* 253 */
+  {    15,      7,     12,      0,      0,     15,      0, }, /* 254 */
+  {    28,     12,      3,      0,      0,   -188,      0, }, /* 255 */
+  {    28,     12,      3,      0,      0,   -175,      0, }, /* 256 */
+  {    10,     21,     12,      0,      0,   -231,      0, }, /* 257 */
+  {    10,     21,     12,      0,      0,   -252,      0, }, /* 258 */
+  {    15,     13,     12,      0,      0,   -120,      0, }, /* 259 */
+  {    15,     21,     12,      0,      0,     15,      0, }, /* 260 */
+  {    15,      6,     12,      0,      0,     15,      0, }, /* 261 */
+  {     3,      7,     12,      0,      0,      3,      0, }, /* 262 */
+  {     3,     12,      3,      0,      0,      3,      0, }, /* 263 */
+  {     3,     10,      5,      0,      0,      3,      0, }, /* 264 */
+  {     3,     10,      3,      0,      0,      3,      0, }, /* 265 */
+  {     3,     13,     12,      0,      0,    -77,      0, }, /* 266 */
+  {     3,     23,     12,      0,      0,      3,      0, }, /* 267 */
+  {     3,     15,     12,      0,      0,      3,      0, }, /* 268 */
+  {     3,     26,     12,      0,      0,      3,      0, }, /* 269 */
+  {     3,     21,     12,      0,      0,      3,      0, }, /* 270 */
+  {    22,     12,      3,      0,      0,     22,      0, }, /* 271 */
+  {    22,     10,      5,      0,      0,     22,      0, }, /* 272 */
+  {    22,      7,     12,      0,      0,     22,      0, }, /* 273 */
+  {    22,     13,     12,      0,      0,    -58,      0, }, /* 274 */
+  {    22,     21,     12,      0,      0,     22,      0, }, /* 275 */
+  {    21,     12,      3,      0,      0,     21,      0, }, /* 276 */
+  {    21,     10,      5,      0,      0,     21,      0, }, /* 277 */
+  {    21,      7,     12,      0,      0,     21,      0, }, /* 278 */
+  {    21,     13,     12,      0,      0,    -55,      0, }, /* 279 */
+  {    21,     21,     12,      0,      0,     21,      0, }, /* 280 */
+  {    21,     23,     12,      0,      0,     21,      0, }, /* 281 */
+  {    44,     12,      3,      0,      0,     44,      0, }, /* 282 */
+  {    44,     10,      5,      0,      0,     44,      0, }, /* 283 */
+  {    44,      7,     12,      0,      0,     44,      0, }, /* 284 */
+  {    44,     10,      3,      0,      0,     44,      0, }, /* 285 */
+  {    44,     13,     12,      0,      0,     44,      0, }, /* 286 */
+  {    44,     26,     12,      0,      0,     44,      0, }, /* 287 */
+  {    44,     15,     12,      0,      0,     44,      0, }, /* 288 */
+  {    54,     12,      3,      0,      0,     54,      0, }, /* 289 */
+  {    54,      7,     12,      0,      0,     54,      0, }, /* 290 */
+  {    54,     10,      3,      0,      0,     54,      0, }, /* 291 */
+  {    54,     10,      5,      0,      0,     54,      0, }, /* 292 */
+  {    54,     13,     12,      0,      0,    -52,      0, }, /* 293 */
+  {    54,     15,     12,      0,      0,    -52,      0, }, /* 294 */
+  {    54,     26,     12,      0,      0,    -52,      0, }, /* 295 */
+  {    54,     26,     12,      0,      0,     54,      0, }, /* 296 */
+  {    54,     23,     12,      0,      0,     54,      0, }, /* 297 */
+  {    55,     12,      3,      0,      0,     55,      0, }, /* 298 */
+  {    55,     10,      5,      0,      0,     55,      0, }, /* 299 */
+  {    55,      7,     12,      0,      0,     55,      0, }, /* 300 */
+  {    55,     13,     12,      0,      0,     55,      0, }, /* 301 */
+  {    55,     21,     12,      0,      0,     55,      0, }, /* 302 */
+  {    55,     15,     12,      0,      0,     55,      0, }, /* 303 */
+  {    55,     26,     12,      0,      0,     55,      0, }, /* 304 */
+  {    29,      7,     12,      0,      0,     29,      0, }, /* 305 */
+  {    29,     12,      3,      0,      0,     29,      0, }, /* 306 */
+  {    29,     10,      5,      0,      0,     29,      0, }, /* 307 */
+  {    29,     21,     12,      0,      0,     29,      0, }, /* 308 */
+  {    29,     10,      3,      0,      0,     29,      0, }, /* 309 */
+  {    29,     13,     12,      0,      0,    -64,      0, }, /* 310 */
+  {    37,     12,      3,      0,      0,     37,      0, }, /* 311 */
+  {    37,     10,      5,      0,      0,     37,      0, }, /* 312 */
+  {    37,      7,     12,      0,      0,     37,      0, }, /* 313 */
+  {    37,     10,      3,      0,      0,     37,      0, }, /* 314 */
+  {    37,      7,      4,      0,      0,     37,      0, }, /* 315 */
+  {    37,     26,     12,      0,      0,     37,      0, }, /* 316 */
+  {    37,     15,     12,      0,      0,     37,      0, }, /* 317 */
+  {    37,     13,     12,      0,      0,     37,      0, }, /* 318 */
+  {    48,     10,      5,      0,      0,     48,      0, }, /* 319 */
+  {    48,      7,     12,      0,      0,     48,      0, }, /* 320 */
+  {    48,     12,      3,      0,      0,     48,      0, }, /* 321 */
+  {    48,     10,      3,      0,      0,     48,      0, }, /* 322 */
+  {    48,     13,     12,      0,      0,     48,      0, }, /* 323 */
+  {    48,     21,     12,      0,      0,     48,      0, }, /* 324 */
+  {    57,      7,     12,      0,      0,     57,      0, }, /* 325 */
+  {    57,     12,      3,      0,      0,     57,      0, }, /* 326 */
+  {    57,      7,      5,      0,      0,     57,      0, }, /* 327 */
+  {    57,      6,     12,      0,      0,     57,      0, }, /* 328 */
+  {    57,     21,     12,      0,      0,     57,      0, }, /* 329 */
+  {    57,     13,     12,      0,      0,     57,      0, }, /* 330 */
+  {    33,      7,     12,      0,      0,     33,      0, }, /* 331 */
+  {    33,     12,      3,      0,      0,     33,      0, }, /* 332 */
+  {    33,      7,      5,      0,      0,     33,      0, }, /* 333 */
+  {    33,      6,     12,      0,      0,     33,      0, }, /* 334 */
+  {    33,     13,     12,      0,      0,     33,      0, }, /* 335 */
+  {    58,      7,     12,      0,      0,     58,      0, }, /* 336 */
+  {    58,     26,     12,      0,      0,     58,      0, }, /* 337 */
+  {    58,     21,     12,      0,      0,     58,      0, }, /* 338 */
+  {    58,     12,      3,      0,      0,     58,      0, }, /* 339 */
+  {    58,     13,     12,      0,      0,     58,      0, }, /* 340 */
+  {    58,     15,     12,      0,      0,     58,      0, }, /* 341 */
+  {    58,     22,     12,      0,      0,     58,      0, }, /* 342 */
+  {    58,     18,     12,      0,      0,     58,      0, }, /* 343 */
+  {    58,     10,      5,      0,      0,     58,      0, }, /* 344 */
+  {    39,      7,     12,      0,      0,     39,      0, }, /* 345 */
+  {    39,     10,     12,      0,      0,     39,      0, }, /* 346 */
+  {    39,     12,      3,      0,      0,     39,      0, }, /* 347 */
+  {    39,     10,      5,      0,      0,     39,      0, }, /* 348 */
+  {    39,     13,     12,      0,      0,    -81,      0, }, /* 349 */
+  {    39,     21,     12,      0,      0,     39,      0, }, /* 350 */
+  {    39,     13,     12,      0,      0,     39,      0, }, /* 351 */
+  {    39,     26,     12,      0,      0,     39,      0, }, /* 352 */
+  {    17,      9,     12,      0,   7264,     17,      0, }, /* 353 */
+  {    17,      5,     12,      0,   3008,     17,      0, }, /* 354 */
+  {    10,     21,     12,      0,      0,    -49,      0, }, /* 355 */
+  {    17,      6,     12,      0,      0,     17,      0, }, /* 356 */
+  {    24,      7,      6,      0,      0,     24,      0, }, /* 357 */
+  {    24,      7,      7,      0,      0,     24,      0, }, /* 358 */
+  {    24,      7,      8,      0,      0,     24,      0, }, /* 359 */
+  {    16,      7,     12,      0,      0,     16,      0, }, /* 360 */
+  {    16,     12,      3,      0,      0,     16,      0, }, /* 361 */
+  {    16,     21,     12,      0,      0,     16,      0, }, /* 362 */
+  {    16,     15,     12,      0,      0,     16,      0, }, /* 363 */
+  {    16,     26,     12,      0,      0,     16,      0, }, /* 364 */
+  {     9,      9,     12,      0,  38864,      9,      0, }, /* 365 */
+  {     9,      9,     12,      0,      8,      9,      0, }, /* 366 */
+  {     9,      5,     12,      0,     -8,      9,      0, }, /* 367 */
+  {     8,     17,     12,      0,      0,      8,      0, }, /* 368 */
+  {     8,      7,     12,      0,      0,      8,      0, }, /* 369 */
+  {     8,     26,     12,      0,      0,      8,      0, }, /* 370 */
+  {     8,     21,     12,      0,      0,      8,      0, }, /* 371 */
+  {    41,     29,     12,      0,      0,     41,      0, }, /* 372 */
+  {    41,      7,     12,      0,      0,     41,      0, }, /* 373 */
+  {    41,     22,     12,      0,      0,     41,      0, }, /* 374 */
+  {    41,     18,     12,      0,      0,     41,      0, }, /* 375 */
+  {    46,      7,     12,      0,      0,     46,      0, }, /* 376 */
+  {    46,     14,     12,      0,      0,     46,      0, }, /* 377 */
+  {    51,      7,     12,      0,      0,     51,      0, }, /* 378 */
+  {    51,     12,      3,      0,      0,     51,      0, }, /* 379 */
+  {    25,      7,     12,      0,      0,     25,      0, }, /* 380 */
+  {    25,     12,      3,      0,      0,     25,      0, }, /* 381 */
+  {    10,     21,     12,      0,      0,   -115,      0, }, /* 382 */
+  {     7,      7,     12,      0,      0,      7,      0, }, /* 383 */
+  {     7,     12,      3,      0,      0,      7,      0, }, /* 384 */
+  {    52,      7,     12,      0,      0,     52,      0, }, /* 385 */
+  {    52,     12,      3,      0,      0,     52,      0, }, /* 386 */
+  {    32,      7,     12,      0,      0,     32,      0, }, /* 387 */
+  {    32,     12,      3,      0,      0,     32,      0, }, /* 388 */
+  {    32,     10,      5,      0,      0,     32,      0, }, /* 389 */
+  {    32,     21,     12,      0,      0,     32,      0, }, /* 390 */
+  {    32,      6,     12,      0,      0,     32,      0, }, /* 391 */
+  {    32,     23,     12,      0,      0,     32,      0, }, /* 392 */
+  {    32,     13,     12,      0,      0,     32,      0, }, /* 393 */
+  {    32,     15,     12,      0,      0,     32,      0, }, /* 394 */
+  {    38,     21,     12,      0,      0,     38,      0, }, /* 395 */
+  {    10,     21,     12,      0,      0,    -70,      0, }, /* 396 */
+  {    38,     17,     12,      0,      0,     38,      0, }, /* 397 */
+  {    38,     12,      3,      0,      0,     38,      0, }, /* 398 */
+  {    38,      1,      2,      0,      0,     38,      0, }, /* 399 */
+  {    38,     13,     12,      0,      0,     38,      0, }, /* 400 */
+  {    38,      7,     12,      0,      0,     38,      0, }, /* 401 */
+  {    38,      6,     12,      0,      0,     38,      0, }, /* 402 */
+  {    35,      7,     12,      0,      0,     35,      0, }, /* 403 */
+  {    35,     12,      3,      0,      0,     35,      0, }, /* 404 */
+  {    35,     10,      5,      0,      0,     35,      0, }, /* 405 */
+  {    35,     26,     12,      0,      0,     35,      0, }, /* 406 */
+  {    35,     21,     12,      0,      0,     35,      0, }, /* 407 */
+  {    35,     13,     12,      0,      0,     35,      0, }, /* 408 */
+  {    53,      7,     12,      0,      0,     53,      0, }, /* 409 */
+  {    40,      7,     12,      0,      0,     40,      0, }, /* 410 */
+  {    40,     13,     12,      0,      0,     40,      0, }, /* 411 */
+  {    40,     15,     12,      0,      0,     40,      0, }, /* 412 */
+  {    40,     26,     12,      0,      0,     40,      0, }, /* 413 */
+  {    32,     26,     12,      0,      0,     32,      0, }, /* 414 */
+  {     6,      7,     12,      0,      0,      6,      0, }, /* 415 */
+  {     6,     12,      3,      0,      0,      6,      0, }, /* 416 */
+  {     6,     10,      5,      0,      0,      6,      0, }, /* 417 */
+  {     6,     21,     12,      0,      0,      6,      0, }, /* 418 */
+  {    91,      7,     12,      0,      0,     91,      0, }, /* 419 */
+  {    91,     10,      5,      0,      0,     91,      0, }, /* 420 */
+  {    91,     12,      3,      0,      0,     91,      0, }, /* 421 */
+  {    91,     10,     12,      0,      0,     91,      0, }, /* 422 */
+  {    91,     13,     12,      0,      0,     91,      0, }, /* 423 */
+  {    91,     21,     12,      0,      0,     91,      0, }, /* 424 */
+  {    91,      6,     12,      0,      0,     91,      0, }, /* 425 */
+  {    28,     11,      3,      0,      0,     28,      0, }, /* 426 */
+  {    62,     12,      3,      0,      0,     62,      0, }, /* 427 */
+  {    62,     10,      5,      0,      0,     62,      0, }, /* 428 */
+  {    62,      7,     12,      0,      0,     62,      0, }, /* 429 */
+  {    62,     10,      3,      0,      0,     62,      0, }, /* 430 */
+  {    62,     13,     12,      0,      0,     62,      0, }, /* 431 */
+  {    62,     21,     12,      0,      0,     62,      0, }, /* 432 */
+  {    62,     26,     12,      0,      0,     62,      0, }, /* 433 */
+  {    76,     12,      3,      0,      0,     76,      0, }, /* 434 */
+  {    76,     10,      5,      0,      0,     76,      0, }, /* 435 */
+  {    76,      7,     12,      0,      0,     76,      0, }, /* 436 */
+  {    76,     13,     12,      0,      0,     76,      0, }, /* 437 */
+  {    93,      7,     12,      0,      0,     93,      0, }, /* 438 */
+  {    93,     12,      3,      0,      0,     93,      0, }, /* 439 */
+  {    93,     10,      5,      0,      0,     93,      0, }, /* 440 */
+  {    93,     21,     12,      0,      0,     93,      0, }, /* 441 */
+  {    70,      7,     12,      0,      0,     70,      0, }, /* 442 */
+  {    70,     10,      5,      0,      0,     70,      0, }, /* 443 */
+  {    70,     12,      3,      0,      0,     70,      0, }, /* 444 */
+  {    70,     21,     12,      0,      0,     70,      0, }, /* 445 */
+  {    70,     13,     12,      0,      0,     70,      0, }, /* 446 */
+  {    73,     13,     12,      0,      0,     73,      0, }, /* 447 */
+  {    73,      7,     12,      0,      0,     73,      0, }, /* 448 */
+  {    73,      6,     12,      0,      0,     73,      0, }, /* 449 */
+  {    73,     21,     12,      0,      0,     73,      0, }, /* 450 */
+  {    13,      5,     12,     63,  -6222,     13,      0, }, /* 451 */
+  {    13,      5,     12,     67,  -6221,     13,      0, }, /* 452 */
+  {    13,      5,     12,     71,  -6212,     13,      0, }, /* 453 */
+  {    13,      5,     12,     75,  -6210,     13,      0, }, /* 454 */
+  {    13,      5,     12,     79,  -6210,     13,      0, }, /* 455 */
+  {    13,      5,     12,     79,  -6211,     13,      0, }, /* 456 */
+  {    13,      5,     12,     84,  -6204,     13,      0, }, /* 457 */
+  {    13,      5,     12,     88,  -6180,     13,      0, }, /* 458 */
+  {    13,      5,     12,    108,  35267,     13,      0, }, /* 459 */
+  {    17,      9,     12,      0,  -3008,     17,      0, }, /* 460 */
+  {    76,     21,     12,      0,      0,     76,      0, }, /* 461 */
+  {    28,     12,      3,      0,      0,   -110,      0, }, /* 462 */
+  {    28,     12,      3,      0,      0,     15,      0, }, /* 463 */
+  {    10,     21,     12,      0,      0,    -37,      0, }, /* 464 */
+  {    28,     12,      3,      0,      0,    -16,      0, }, /* 465 */
+  {    28,     12,      3,      0,      0,    -43,      0, }, /* 466 */
+  {    28,     12,      3,      0,      0,   -138,      0, }, /* 467 */
+  {    10,     10,      5,      0,      0,    -16,      0, }, /* 468 */
+  {    10,      7,     12,      0,      0,    -40,      0, }, /* 469 */
+  {    10,      7,     12,      0,      0,    -16,      0, }, /* 470 */
+  {    10,      7,     12,      0,      0,     15,      0, }, /* 471 */
+  {    10,      7,     12,      0,      0,   -154,      0, }, /* 472 */
+  {    10,      7,     12,      0,      0,    -37,      0, }, /* 473 */
+  {    28,     12,      3,      0,      0,    -89,      0, }, /* 474 */
+  {    10,     10,      5,      0,      0,      3,      0, }, /* 475 */
+  {    28,     12,      3,      0,      0,    -37,      0, }, /* 476 */
+  {    10,      7,     12,      0,      0,    150,      0, }, /* 477 */
+  {    13,      5,     12,      0,      0,     13,      0, }, /* 478 */
+  {    13,      6,     12,      0,      0,     13,      0, }, /* 479 */
+  {    34,      5,     12,      0,  35332,     34,      0, }, /* 480 */
+  {    34,      5,     12,      0,   3814,     34,      0, }, /* 481 */
+  {    34,      5,     12,      0,  35384,     34,      0, }, /* 482 */
+  {    34,      9,     12,     92,      1,     34,      0, }, /* 483 */
+  {    34,      5,     12,     92,     -1,     34,      0, }, /* 484 */
+  {    34,      5,     12,     92,    -58,     34,      0, }, /* 485 */
+  {    34,      9,     12,      0,  -7615,     34,      0, }, /* 486 */
+  {    20,      5,     12,      0,      8,     20,      0, }, /* 487 */
+  {    20,      9,     12,      0,     -8,     20,      0, }, /* 488 */
+  {    20,      5,     12,      0,     74,     20,      0, }, /* 489 */
+  {    20,      5,     12,      0,     86,     20,      0, }, /* 490 */
+  {    20,      5,     12,      0,    100,     20,      0, }, /* 491 */
+  {    20,      5,     12,      0,    128,     20,      0, }, /* 492 */
+  {    20,      5,     12,      0,    112,     20,      0, }, /* 493 */
+  {    20,      5,     12,      0,    126,     20,      0, }, /* 494 */
+  {    20,      8,     12,      0,     -8,     20,      0, }, /* 495 */
+  {    20,      5,     12,      0,      9,     20,      0, }, /* 496 */
+  {    20,      9,     12,      0,    -74,     20,      0, }, /* 497 */
+  {    20,      8,     12,      0,     -9,     20,      0, }, /* 498 */
+  {    20,      5,     12,     21,  -7173,     20,      0, }, /* 499 */
+  {    20,      9,     12,      0,    -86,     20,      0, }, /* 500 */
+  {    20,      9,     12,      0,   -100,     20,      0, }, /* 501 */
+  {    20,      9,     12,      0,   -112,     20,      0, }, /* 502 */
+  {    20,      9,     12,      0,   -128,     20,      0, }, /* 503 */
+  {    20,      9,     12,      0,   -126,     20,      0, }, /* 504 */
+  {    28,      1,      3,      0,      0,     28,      0, }, /* 505 */
+  {    28,      1,     13,      0,      0,     28,      0, }, /* 506 */
+  {    10,     27,      2,      0,      0,     10,      0, }, /* 507 */
+  {    10,     28,      2,      0,      0,     10,      0, }, /* 508 */
+  {    10,     29,     12,      0,      0,    -67,      0, }, /* 509 */
+  {    10,     21,     14,      0,      0,     10,      0, }, /* 510 */
+  {     0,      2,      2,      0,      0,      0,      0, }, /* 511 */
+  {    28,     12,      3,      0,      0,    -93,      0, }, /* 512 */
+  {    10,      9,     12,      0,      0,     10,      0, }, /* 513 */
+  {    10,      5,     12,      0,      0,     10,      0, }, /* 514 */
+  {    20,      9,     12,     96,  -7517,     20,      0, }, /* 515 */
+  {    34,      9,     12,    100,  -8383,     34,      0, }, /* 516 */
+  {    34,      9,     12,    104,  -8262,     34,      0, }, /* 517 */
+  {    34,      9,     12,      0,     28,     34,      0, }, /* 518 */
+  {    10,      7,     12,      0,      0,     10,      0, }, /* 519 */
+  {    10,      5,     14,      0,      0,     10,      0, }, /* 520 */
+  {    34,      5,     12,      0,    -28,     34,      0, }, /* 521 */
+  {    34,     14,     12,      0,     16,     34,      0, }, /* 522 */
+  {    34,     14,     12,      0,    -16,     34,      0, }, /* 523 */
+  {    34,     14,     12,      0,      0,     34,      0, }, /* 524 */
+  {    10,     25,     14,      0,      0,     10,      0, }, /* 525 */
+  {    10,     26,     12,      0,     26,     10,      0, }, /* 526 */
+  {    10,     26,     14,      0,     26,     10,      0, }, /* 527 */
+  {    10,     26,     12,      0,    -26,     10,      0, }, /* 528 */
+  {     5,     26,     12,      0,      0,      5,      0, }, /* 529 */
+  {    18,      9,     12,      0,     48,     18,      0, }, /* 530 */
+  {    18,      5,     12,      0,    -48,     18,      0, }, /* 531 */
+  {    34,      9,     12,      0, -10743,     34,      0, }, /* 532 */
+  {    34,      9,     12,      0,  -3814,     34,      0, }, /* 533 */
+  {    34,      9,     12,      0, -10727,     34,      0, }, /* 534 */
+  {    34,      5,     12,      0, -10795,     34,      0, }, /* 535 */
+  {    34,      5,     12,      0, -10792,     34,      0, }, /* 536 */
+  {    34,      9,     12,      0, -10780,     34,      0, }, /* 537 */
+  {    34,      9,     12,      0, -10749,     34,      0, }, /* 538 */
+  {    34,      9,     12,      0, -10783,     34,      0, }, /* 539 */
+  {    34,      9,     12,      0, -10782,     34,      0, }, /* 540 */
+  {    34,      9,     12,      0, -10815,     34,      0, }, /* 541 */
+  {    11,      5,     12,      0,      0,     11,      0, }, /* 542 */
+  {    11,     26,     12,      0,      0,     11,      0, }, /* 543 */
+  {    11,     12,      3,      0,      0,     11,      0, }, /* 544 */
+  {    11,     21,     12,      0,      0,     11,      0, }, /* 545 */
+  {    11,     15,     12,      0,      0,     11,      0, }, /* 546 */
+  {    17,      5,     12,      0,  -7264,     17,      0, }, /* 547 */
+  {    59,      7,     12,      0,      0,     59,      0, }, /* 548 */
+  {    59,      6,     12,      0,      0,     59,      0, }, /* 549 */
+  {    59,     21,     12,      0,      0,     59,      0, }, /* 550 */
+  {    59,     12,      3,      0,      0,     59,      0, }, /* 551 */
+  {    13,     12,      3,      0,      0,     13,      0, }, /* 552 */
+  {    10,     21,     12,      0,      0,    -28,      0, }, /* 553 */
+  {    23,     26,     12,      0,      0,     23,      0, }, /* 554 */
+  {    10,     21,     12,      0,      0,   -131,      0, }, /* 555 */
+  {    10,     21,     12,      0,      0,   -125,      0, }, /* 556 */
+  {    23,      6,     12,      0,      0,     23,      0, }, /* 557 */
+  {    10,      7,     12,      0,      0,     23,      0, }, /* 558 */
+  {    23,     14,     12,      0,      0,     23,      0, }, /* 559 */
+  {    10,     22,     12,      0,      0,   -131,      0, }, /* 560 */
+  {    10,     18,     12,      0,      0,   -131,      0, }, /* 561 */
+  {    10,     26,     12,      0,      0,   -125,      0, }, /* 562 */
+  {    10,     17,     12,      0,      0,   -125,      0, }, /* 563 */
+  {    10,     22,     12,      0,      0,   -125,      0, }, /* 564 */
+  {    10,     18,     12,      0,      0,   -125,      0, }, /* 565 */
+  {    28,     12,      3,      0,      0,    -19,      0, }, /* 566 */
+  {    24,     10,      3,      0,      0,     24,      0, }, /* 567 */
+  {    10,     17,     14,      0,      0,   -125,      0, }, /* 568 */
+  {    10,      6,     12,      0,      0,    -61,      0, }, /* 569 */
+  {    10,      7,     12,      0,      0,    -97,      0, }, /* 570 */
+  {    10,     21,     14,      0,      0,    -97,      0, }, /* 571 */
+  {    10,     26,     12,      0,      0,     23,      0, }, /* 572 */
+  {    27,      7,     12,      0,      0,     27,      0, }, /* 573 */
+  {    28,     12,      3,      0,      0,    -61,      0, }, /* 574 */
+  {    10,     24,     12,      0,      0,    -61,      0, }, /* 575 */
+  {    27,      6,     12,      0,      0,     27,      0, }, /* 576 */
+  {    10,     17,     12,      0,      0,    -61,      0, }, /* 577 */
+  {    30,      7,     12,      0,      0,     30,      0, }, /* 578 */
+  {    30,      6,     12,      0,      0,     30,      0, }, /* 579 */
+  {     4,      7,     12,      0,      0,      4,      0, }, /* 580 */
+  {    24,      7,     12,      0,      0,     24,      0, }, /* 581 */
+  {    10,     15,     12,      0,      0,     23,      0, }, /* 582 */
+  {    24,     26,     12,      0,      0,     24,      0, }, /* 583 */
+  {    10,     26,     14,      0,      0,     23,      0, }, /* 584 */
+  {    30,     26,     12,      0,      0,     30,      0, }, /* 585 */
+  {    23,      7,     12,      0,      0,     23,      0, }, /* 586 */
+  {    61,      7,     12,      0,      0,     61,      0, }, /* 587 */
+  {    61,      6,     12,      0,      0,     61,      0, }, /* 588 */
+  {    61,     26,     12,      0,      0,     61,      0, }, /* 589 */
+  {    86,      7,     12,      0,      0,     86,      0, }, /* 590 */
+  {    86,      6,     12,      0,      0,     86,      0, }, /* 591 */
+  {    86,     21,     12,      0,      0,     86,      0, }, /* 592 */
+  {    77,      7,     12,      0,      0,     77,      0, }, /* 593 */
+  {    77,      6,     12,      0,      0,     77,      0, }, /* 594 */
+  {    77,     21,     12,      0,      0,     77,      0, }, /* 595 */
+  {    77,     13,     12,      0,      0,     77,      0, }, /* 596 */
+  {    13,      9,     12,    108,      1,     13,      0, }, /* 597 */
+  {    13,      5,     12,    108, -35267,     13,      0, }, /* 598 */
+  {    13,      7,     12,      0,      0,     13,      0, }, /* 599 */
+  {    13,     21,     12,      0,      0,     13,      0, }, /* 600 */
+  {    79,      7,     12,      0,      0,     79,      0, }, /* 601 */
+  {    79,     14,     12,      0,      0,     79,      0, }, /* 602 */
+  {    79,     12,      3,      0,      0,     79,      0, }, /* 603 */
+  {    79,     21,     12,      0,      0,     79,      0, }, /* 604 */
+  {    34,      9,     12,      0, -35332,     34,      0, }, /* 605 */
+  {    34,      9,     12,      0, -42280,     34,      0, }, /* 606 */
+  {    34,      5,     12,      0,     48,     34,      0, }, /* 607 */
+  {    34,      9,     12,      0, -42308,     34,      0, }, /* 608 */
+  {    34,      9,     12,      0, -42319,     34,      0, }, /* 609 */
+  {    34,      9,     12,      0, -42315,     34,      0, }, /* 610 */
+  {    34,      9,     12,      0, -42305,     34,      0, }, /* 611 */
+  {    34,      9,     12,      0, -42258,     34,      0, }, /* 612 */
+  {    34,      9,     12,      0, -42282,     34,      0, }, /* 613 */
+  {    34,      9,     12,      0, -42261,     34,      0, }, /* 614 */
+  {    34,      9,     12,      0,    928,     34,      0, }, /* 615 */
+  {    34,      9,     12,      0,    -48,     34,      0, }, /* 616 */
+  {    34,      9,     12,      0, -42307,     34,      0, }, /* 617 */
+  {    34,      9,     12,      0, -35384,     34,      0, }, /* 618 */
+  {    49,      7,     12,      0,      0,     49,      0, }, /* 619 */
+  {    49,     12,      3,      0,      0,     49,      0, }, /* 620 */
+  {    49,     10,      5,      0,      0,     49,      0, }, /* 621 */
+  {    49,     26,     12,      0,      0,     49,      0, }, /* 622 */
+  {    10,     15,     12,      0,      0,   -216,      0, }, /* 623 */
+  {    10,     15,     12,      0,      0,   -202,      0, }, /* 624 */
+  {    10,     26,     12,      0,      0,   -163,      0, }, /* 625 */
+  {    10,     23,     12,      0,      0,   -163,      0, }, /* 626 */
+  {    65,      7,     12,      0,      0,     65,      0, }, /* 627 */
+  {    65,     21,     12,      0,      0,     65,      0, }, /* 628 */
+  {    75,     10,      5,      0,      0,     75,      0, }, /* 629 */
+  {    75,      7,     12,      0,      0,     75,      0, }, /* 630 */
+  {    75,     12,      3,      0,      0,     75,      0, }, /* 631 */
+  {    75,     21,     12,      0,      0,     75,      0, }, /* 632 */
+  {    75,     13,     12,      0,      0,     75,      0, }, /* 633 */
+  {    15,     12,      3,      0,      0,    -16,      0, }, /* 634 */
+  {    15,      7,     12,      0,      0,    -46,      0, }, /* 635 */
+  {    69,     13,     12,      0,      0,     69,      0, }, /* 636 */
+  {    69,      7,     12,      0,      0,     69,      0, }, /* 637 */
+  {    69,     12,      3,      0,      0,     69,      0, }, /* 638 */
+  {    10,     21,     12,      0,      0,   -101,      0, }, /* 639 */
+  {    69,     21,     12,      0,      0,     69,      0, }, /* 640 */
+  {    74,      7,     12,      0,      0,     74,      0, }, /* 641 */
+  {    74,     12,      3,      0,      0,     74,      0, }, /* 642 */
+  {    74,     10,      5,      0,      0,     74,      0, }, /* 643 */
+  {    74,     21,     12,      0,      0,     74,      0, }, /* 644 */
+  {    84,     12,      3,      0,      0,     84,      0, }, /* 645 */
+  {    84,     10,      5,      0,      0,     84,      0, }, /* 646 */
+  {    84,      7,     12,      0,      0,     84,      0, }, /* 647 */
+  {    84,     21,     12,      0,      0,     84,      0, }, /* 648 */
+  {    10,      6,     12,      0,      0,    -22,      0, }, /* 649 */
+  {    84,     13,     12,      0,      0,     84,      0, }, /* 650 */
+  {    39,      6,     12,      0,      0,     39,      0, }, /* 651 */
+  {    68,      7,     12,      0,      0,     68,      0, }, /* 652 */
+  {    68,     12,      3,      0,      0,     68,      0, }, /* 653 */
+  {    68,     10,      5,      0,      0,     68,      0, }, /* 654 */
+  {    68,     13,     12,      0,      0,     68,      0, }, /* 655 */
+  {    68,     21,     12,      0,      0,     68,      0, }, /* 656 */
+  {    92,      7,     12,      0,      0,     92,      0, }, /* 657 */
+  {    92,     12,      3,      0,      0,     92,      0, }, /* 658 */
+  {    92,      6,     12,      0,      0,     92,      0, }, /* 659 */
+  {    92,     21,     12,      0,      0,     92,      0, }, /* 660 */
+  {    87,      7,     12,      0,      0,     87,      0, }, /* 661 */
+  {    87,     10,      5,      0,      0,     87,      0, }, /* 662 */
+  {    87,     12,      3,      0,      0,     87,      0, }, /* 663 */
+  {    87,     21,     12,      0,      0,     87,      0, }, /* 664 */
+  {    87,      6,     12,      0,      0,     87,      0, }, /* 665 */
+  {    34,      5,     12,      0,   -928,     34,      0, }, /* 666 */
+  {     9,      5,     12,      0, -38864,      9,      0, }, /* 667 */
+  {    87,     13,     12,      0,      0,     87,      0, }, /* 668 */
+  {    24,      7,      9,      0,      0,     24,      0, }, /* 669 */
+  {    24,      7,     10,      0,      0,     24,      0, }, /* 670 */
+  {     0,      4,     12,      0,      0,      0,      0, }, /* 671 */
+  {     0,      3,     12,      0,      0,      0,      0, }, /* 672 */
+  {    26,     25,     12,      0,      0,     26,      0, }, /* 673 */
+  {     1,     24,     12,      0,      0,      1,      0, }, /* 674 */
+  {     1,      7,     12,      0,      0,    -10,      0, }, /* 675 */
+  {     1,     26,     12,      0,      0,    -10,      0, }, /* 676 */
+  {    10,      6,      3,      0,      0,    -61,      0, }, /* 677 */
+  {    36,      7,     12,      0,      0,     36,      0, }, /* 678 */
+  {    10,     21,     12,      0,      0,    -25,      0, }, /* 679 */
+  {    10,     15,     12,      0,      0,    -85,      0, }, /* 680 */
+  {    10,     26,     12,      0,      0,    -25,      0, }, /* 681 */
+  {    20,     14,     12,      0,      0,     20,      0, }, /* 682 */
+  {    20,     15,     12,      0,      0,     20,      0, }, /* 683 */
+  {    20,     26,     12,      0,      0,     20,      0, }, /* 684 */
+  {    71,      7,     12,      0,      0,     71,      0, }, /* 685 */
+  {    67,      7,     12,      0,      0,     67,      0, }, /* 686 */
+  {    28,     12,      3,      0,      0,     -1,      0, }, /* 687 */
+  {    10,     15,     12,      0,      0,     -1,      0, }, /* 688 */
+  {    42,      7,     12,      0,      0,     42,      0, }, /* 689 */
+  {    42,     15,     12,      0,      0,     42,      0, }, /* 690 */
+  {    19,      7,     12,      0,      0,     19,      0, }, /* 691 */
+  {    19,     14,     12,      0,      0,     19,      0, }, /* 692 */
+  {   118,      7,     12,      0,      0,    118,      0, }, /* 693 */
+  {   118,     12,      3,      0,      0,    118,      0, }, /* 694 */
+  {    60,      7,     12,      0,      0,     60,      0, }, /* 695 */
+  {    60,     21,     12,      0,      0,     60,      0, }, /* 696 */
+  {    43,      7,     12,      0,      0,     43,      0, }, /* 697 */
+  {    43,     21,     12,      0,      0,     43,      0, }, /* 698 */
+  {    43,     14,     12,      0,      0,     43,      0, }, /* 699 */
+  {    14,      9,     12,      0,     40,     14,      0, }, /* 700 */
+  {    14,      5,     12,      0,    -40,     14,      0, }, /* 701 */
+  {    47,      7,     12,      0,      0,     47,      0, }, /* 702 */
+  {    45,      7,     12,      0,      0,     45,      0, }, /* 703 */
+  {    45,     13,     12,      0,      0,     45,      0, }, /* 704 */
+  {   136,      9,     12,      0,     40,    136,      0, }, /* 705 */
+  {   136,      5,     12,      0,    -40,    136,      0, }, /* 706 */
+  {   106,      7,     12,      0,      0,    106,      0, }, /* 707 */
+  {   104,      7,     12,      0,      0,    104,      0, }, /* 708 */
+  {   104,     21,     12,      0,      0,    104,      0, }, /* 709 */
+  {   110,      7,     12,      0,      0,    110,      0, }, /* 710 */
+  {    12,      7,     12,      0,      0,     12,      0, }, /* 711 */
+  {    81,      7,     12,      0,      0,     81,      0, }, /* 712 */
+  {    81,     21,     12,      0,      0,     81,      0, }, /* 713 */
+  {    81,     15,     12,      0,      0,     81,      0, }, /* 714 */
+  {   120,      7,     12,      0,      0,    120,      0, }, /* 715 */
+  {   120,     26,     12,      0,      0,    120,      0, }, /* 716 */
+  {   120,     15,     12,      0,      0,    120,      0, }, /* 717 */
+  {   116,      7,     12,      0,      0,    116,      0, }, /* 718 */
+  {   116,     15,     12,      0,      0,    116,      0, }, /* 719 */
+  {   128,      7,     12,      0,      0,    128,      0, }, /* 720 */
+  {   128,     15,     12,      0,      0,    128,      0, }, /* 721 */
+  {    66,      7,     12,      0,      0,     66,      0, }, /* 722 */
+  {    66,     15,     12,      0,      0,     66,      0, }, /* 723 */
+  {    66,     21,     12,      0,      0,     66,      0, }, /* 724 */
+  {    72,      7,     12,      0,      0,     72,      0, }, /* 725 */
+  {    72,     21,     12,      0,      0,     72,      0, }, /* 726 */
+  {    98,      7,     12,      0,      0,     98,      0, }, /* 727 */
+  {    97,      7,     12,      0,      0,     97,      0, }, /* 728 */
+  {    97,     15,     12,      0,      0,     97,      0, }, /* 729 */
+  {    31,      7,     12,      0,      0,     31,      0, }, /* 730 */
+  {    31,     12,      3,      0,      0,     31,      0, }, /* 731 */
+  {    31,     15,     12,      0,      0,     31,      0, }, /* 732 */
+  {    31,     21,     12,      0,      0,     31,      0, }, /* 733 */
+  {    88,      7,     12,      0,      0,     88,      0, }, /* 734 */
+  {    88,     15,     12,      0,      0,     88,      0, }, /* 735 */
+  {    88,     21,     12,      0,      0,     88,      0, }, /* 736 */
+  {   117,      7,     12,      0,      0,    117,      0, }, /* 737 */
+  {   117,     15,     12,      0,      0,    117,      0, }, /* 738 */
+  {   112,      7,     12,      0,      0,    112,      0, }, /* 739 */
+  {   112,     26,     12,      0,      0,    112,      0, }, /* 740 */
+  {   112,     12,      3,      0,      0,    112,      0, }, /* 741 */
+  {   112,     15,     12,      0,      0,    112,      0, }, /* 742 */
+  {   112,     21,     12,      0,      0,    112,      0, }, /* 743 */
+  {    78,      7,     12,      0,      0,     78,      0, }, /* 744 */
+  {    78,     21,     12,      0,      0,     78,      0, }, /* 745 */
+  {    83,      7,     12,      0,      0,     83,      0, }, /* 746 */
+  {    83,     15,     12,      0,      0,     83,      0, }, /* 747 */
+  {    82,      7,     12,      0,      0,     82,      0, }, /* 748 */
+  {    82,     15,     12,      0,      0,     82,      0, }, /* 749 */
+  {   121,      7,     12,      0,      0,    121,      0, }, /* 750 */
+  {   121,     21,     12,      0,      0,    121,      0, }, /* 751 */
+  {   121,     15,     12,      0,      0,    121,      0, }, /* 752 */
+  {    89,      7,     12,      0,      0,     89,      0, }, /* 753 */
+  {   130,      9,     12,      0,     64,    130,      0, }, /* 754 */
+  {   130,      5,     12,      0,    -64,    130,      0, }, /* 755 */
+  {   130,     15,     12,      0,      0,    130,      0, }, /* 756 */
+  {   144,      7,     12,      0,      0,    144,      0, }, /* 757 */
+  {   144,     12,      3,      0,      0,    144,      0, }, /* 758 */
+  {   144,     13,     12,      0,      0,    144,      0, }, /* 759 */
+  {     1,     15,     12,      0,      0,      1,      0, }, /* 760 */
+  {   147,      7,     12,      0,      0,    147,      0, }, /* 761 */
+  {   147,     15,     12,      0,      0,    147,      0, }, /* 762 */
+  {   148,      7,     12,      0,      0,    148,      0, }, /* 763 */
+  {   148,     12,      3,      0,      0,    148,      0, }, /* 764 */
+  {   148,     15,     12,      0,      0,    148,      0, }, /* 765 */
+  {   148,     21,     12,      0,      0,    148,      0, }, /* 766 */
+  {   149,      7,     12,      0,      0,    149,      0, }, /* 767 */
+  {    94,     10,      5,      0,      0,     94,      0, }, /* 768 */
+  {    94,     12,      3,      0,      0,     94,      0, }, /* 769 */
+  {    94,      7,     12,      0,      0,     94,      0, }, /* 770 */
+  {    94,     21,     12,      0,      0,     94,      0, }, /* 771 */
+  {    94,     15,     12,      0,      0,     94,      0, }, /* 772 */
+  {    94,     13,     12,      0,      0,     94,      0, }, /* 773 */
+  {    85,     12,      3,      0,      0,     85,      0, }, /* 774 */
+  {    85,     10,      5,      0,      0,     85,      0, }, /* 775 */
+  {    85,      7,     12,      0,      0,     85,      0, }, /* 776 */
+  {    85,     21,     12,      0,      0,     85,      0, }, /* 777 */
+  {    85,      1,      4,      0,      0,     85,      0, }, /* 778 */
+  {   101,      7,     12,      0,      0,    101,      0, }, /* 779 */
+  {   101,     13,     12,      0,      0,    101,      0, }, /* 780 */
+  {    96,     12,      3,      0,      0,     96,      0, }, /* 781 */
+  {    96,      7,     12,      0,      0,     96,      0, }, /* 782 */
+  {    96,     10,      5,      0,      0,     96,      0, }, /* 783 */
+  {    96,     13,     12,      0,      0,     96,      0, }, /* 784 */
+  {    96,     21,     12,      0,      0,     96,      0, }, /* 785 */
+  {   111,      7,     12,      0,      0,    111,      0, }, /* 786 */
+  {   111,     12,      3,      0,      0,    111,      0, }, /* 787 */
+  {   111,     21,     12,      0,      0,    111,      0, }, /* 788 */
+  {   100,     12,      3,      0,      0,    100,      0, }, /* 789 */
+  {   100,     10,      5,      0,      0,    100,      0, }, /* 790 */
+  {   100,      7,     12,      0,      0,    100,      0, }, /* 791 */
+  {   100,      7,      4,      0,      0,    100,      0, }, /* 792 */
+  {   100,     21,     12,      0,      0,    100,      0, }, /* 793 */
+  {   100,     13,     12,      0,      0,    100,      0, }, /* 794 */
+  {    48,     15,     12,      0,      0,     48,      0, }, /* 795 */
+  {   108,      7,     12,      0,      0,    108,      0, }, /* 796 */
+  {   108,     10,      5,      0,      0,    108,      0, }, /* 797 */
+  {   108,     12,      3,      0,      0,    108,      0, }, /* 798 */
+  {   108,     21,     12,      0,      0,    108,      0, }, /* 799 */
+  {   129,      7,     12,      0,      0,    129,      0, }, /* 800 */
+  {   129,     21,     12,      0,      0,    129,      0, }, /* 801 */
+  {   109,      7,     12,      0,      0,    109,      0, }, /* 802 */
+  {   109,     12,      3,      0,      0,    109,      0, }, /* 803 */
+  {   109,     10,      5,      0,      0,    109,      0, }, /* 804 */
+  {   109,     13,     12,      0,      0,    109,      0, }, /* 805 */
+  {   107,     12,      3,      0,      0,    107,      0, }, /* 806 */
+  {   107,     12,      3,      0,      0,    -52,      0, }, /* 807 */
+  {   107,     10,      5,      0,      0,    107,      0, }, /* 808 */
+  {   107,     10,      5,      0,      0,    -52,      0, }, /* 809 */
+  {   107,      7,     12,      0,      0,    107,      0, }, /* 810 */
+  {    28,     12,      3,      0,      0,    -52,      0, }, /* 811 */
+  {   107,     10,      3,      0,      0,    107,      0, }, /* 812 */
+  {   135,      7,     12,      0,      0,    135,      0, }, /* 813 */
+  {   135,     10,      5,      0,      0,    135,      0, }, /* 814 */
+  {   135,     12,      3,      0,      0,    135,      0, }, /* 815 */
+  {   135,     21,     12,      0,      0,    135,      0, }, /* 816 */
+  {   135,     13,     12,      0,      0,    135,      0, }, /* 817 */
+  {   124,      7,     12,      0,      0,    124,      0, }, /* 818 */
+  {   124,     10,      3,      0,      0,    124,      0, }, /* 819 */
+  {   124,     10,      5,      0,      0,    124,      0, }, /* 820 */
+  {   124,     12,      3,      0,      0,    124,      0, }, /* 821 */
+  {   124,     21,     12,      0,      0,    124,      0, }, /* 822 */
+  {   124,     13,     12,      0,      0,    124,      0, }, /* 823 */
+  {   123,      7,     12,      0,      0,    123,      0, }, /* 824 */
+  {   123,     10,      3,      0,      0,    123,      0, }, /* 825 */
+  {   123,     10,      5,      0,      0,    123,      0, }, /* 826 */
+  {   123,     12,      3,      0,      0,    123,      0, }, /* 827 */
+  {   123,     21,     12,      0,      0,    123,      0, }, /* 828 */
+  {   114,      7,     12,      0,      0,    114,      0, }, /* 829 */
+  {   114,     10,      5,      0,      0,    114,      0, }, /* 830 */
+  {   114,     12,      3,      0,      0,    114,      0, }, /* 831 */
+  {   114,     21,     12,      0,      0,    114,      0, }, /* 832 */
+  {   114,     13,     12,      0,      0,    114,      0, }, /* 833 */
+  {   102,      7,     12,      0,      0,    102,      0, }, /* 834 */
+  {   102,     12,      3,      0,      0,    102,      0, }, /* 835 */
+  {   102,     10,      5,      0,      0,    102,      0, }, /* 836 */
+  {   102,     13,     12,      0,      0,    102,      0, }, /* 837 */
+  {   126,      7,     12,      0,      0,    126,      0, }, /* 838 */
+  {   126,     12,      3,      0,      0,    126,      0, }, /* 839 */
+  {   126,     10,      5,      0,      0,    126,      0, }, /* 840 */
+  {   126,     13,     12,      0,      0,    126,      0, }, /* 841 */
+  {   126,     15,     12,      0,      0,    126,      0, }, /* 842 */
+  {   126,     21,     12,      0,      0,    126,      0, }, /* 843 */
+  {   126,     26,     12,      0,      0,    126,      0, }, /* 844 */
+  {   142,      7,     12,      0,      0,    142,      0, }, /* 845 */
+  {   142,     10,      5,      0,      0,    142,      0, }, /* 846 */
+  {   142,     12,      3,      0,      0,    142,      0, }, /* 847 */
+  {   142,     21,     12,      0,      0,    142,      0, }, /* 848 */
+  {   125,      9,     12,      0,     32,    125,      0, }, /* 849 */
+  {   125,      5,     12,      0,    -32,    125,      0, }, /* 850 */
+  {   125,     13,     12,      0,      0,    125,      0, }, /* 851 */
+  {   125,     15,     12,      0,      0,    125,      0, }, /* 852 */
+  {   125,      7,     12,      0,      0,    125,      0, }, /* 853 */
+  {   150,      7,     12,      0,      0,    150,      0, }, /* 854 */
+  {   150,     10,      5,      0,      0,    150,      0, }, /* 855 */
+  {   150,     12,      3,      0,      0,    150,      0, }, /* 856 */
+  {   150,     21,     12,      0,      0,    150,      0, }, /* 857 */
+  {   141,      7,     12,      0,      0,    141,      0, }, /* 858 */
+  {   141,     12,      3,      0,      0,    141,      0, }, /* 859 */
+  {   141,     10,      5,      0,      0,    141,      0, }, /* 860 */
+  {   141,      7,      4,      0,      0,    141,      0, }, /* 861 */
+  {   141,     21,     12,      0,      0,    141,      0, }, /* 862 */
+  {   140,      7,     12,      0,      0,    140,      0, }, /* 863 */
+  {   140,     12,      3,      0,      0,    140,      0, }, /* 864 */
+  {   140,     10,      5,      0,      0,    140,      0, }, /* 865 */
+  {   140,      7,      4,      0,      0,    140,      0, }, /* 866 */
+  {   140,     21,     12,      0,      0,    140,      0, }, /* 867 */
+  {   122,      7,     12,      0,      0,    122,      0, }, /* 868 */
+  {   133,      7,     12,      0,      0,    133,      0, }, /* 869 */
+  {   133,     10,      5,      0,      0,    133,      0, }, /* 870 */
+  {   133,     12,      3,      0,      0,    133,      0, }, /* 871 */
+  {   133,     21,     12,      0,      0,    133,      0, }, /* 872 */
+  {   133,     13,     12,      0,      0,    133,      0, }, /* 873 */
+  {   133,     15,     12,      0,      0,    133,      0, }, /* 874 */
+  {   134,     21,     12,      0,      0,    134,      0, }, /* 875 */
+  {   134,      7,     12,      0,      0,    134,      0, }, /* 876 */
+  {   134,     12,      3,      0,      0,    134,      0, }, /* 877 */
+  {   134,     10,      5,      0,      0,    134,      0, }, /* 878 */
+  {   138,      7,     12,      0,      0,    138,      0, }, /* 879 */
+  {   138,     12,      3,      0,      0,    138,      0, }, /* 880 */
+  {   138,      7,      4,      0,      0,    138,      0, }, /* 881 */
+  {   138,     13,     12,      0,      0,    138,      0, }, /* 882 */
+  {   143,      7,     12,      0,      0,    143,      0, }, /* 883 */
+  {   143,     10,      5,      0,      0,    143,      0, }, /* 884 */
+  {   143,     12,      3,      0,      0,    143,      0, }, /* 885 */
+  {   143,     13,     12,      0,      0,    143,      0, }, /* 886 */
+  {   145,      7,     12,      0,      0,    145,      0, }, /* 887 */
+  {   145,     12,      3,      0,      0,    145,      0, }, /* 888 */
+  {   145,     10,      5,      0,      0,    145,      0, }, /* 889 */
+  {   145,     21,     12,      0,      0,    145,      0, }, /* 890 */
+  {    54,     15,     12,      0,      0,     54,      0, }, /* 891 */
+  {    54,     21,     12,      0,      0,     54,      0, }, /* 892 */
+  {    63,      7,     12,      0,      0,     63,      0, }, /* 893 */
+  {    63,     14,     12,      0,      0,     63,      0, }, /* 894 */
+  {    63,     21,     12,      0,      0,     63,      0, }, /* 895 */
+  {    80,      7,     12,      0,      0,     80,      0, }, /* 896 */
+  {    80,      1,      2,      0,      0,     80,      0, }, /* 897 */
+  {   127,      7,     12,      0,      0,    127,      0, }, /* 898 */
+  {   115,      7,     12,      0,      0,    115,      0, }, /* 899 */
+  {   115,     13,     12,      0,      0,    115,      0, }, /* 900 */
+  {   115,     21,     12,      0,      0,    115,      0, }, /* 901 */
+  {   103,      7,     12,      0,      0,    103,      0, }, /* 902 */
+  {   103,     12,      3,      0,      0,    103,      0, }, /* 903 */
+  {   103,     21,     12,      0,      0,    103,      0, }, /* 904 */
+  {   119,      7,     12,      0,      0,    119,      0, }, /* 905 */
+  {   119,     12,      3,      0,      0,    119,      0, }, /* 906 */
+  {   119,     21,     12,      0,      0,    119,      0, }, /* 907 */
+  {   119,     26,     12,      0,      0,    119,      0, }, /* 908 */
+  {   119,      6,     12,      0,      0,    119,      0, }, /* 909 */
+  {   119,     13,     12,      0,      0,    119,      0, }, /* 910 */
+  {   119,     15,     12,      0,      0,    119,      0, }, /* 911 */
+  {   146,      9,     12,      0,     32,    146,      0, }, /* 912 */
+  {   146,      5,     12,      0,    -32,    146,      0, }, /* 913 */
+  {   146,     15,     12,      0,      0,    146,      0, }, /* 914 */
+  {   146,     21,     12,      0,      0,    146,      0, }, /* 915 */
+  {    99,      7,     12,      0,      0,     99,      0, }, /* 916 */
+  {    99,     12,      3,      0,      0,     99,      0, }, /* 917 */
+  {    99,     10,      5,      0,      0,     99,      0, }, /* 918 */
+  {    99,      6,     12,      0,      0,     99,      0, }, /* 919 */
+  {   137,      6,     12,      0,      0,    137,      0, }, /* 920 */
+  {   139,      6,     12,      0,      0,    139,      0, }, /* 921 */
+  {   137,      7,     12,      0,      0,    137,      0, }, /* 922 */
+  {   139,      7,     12,      0,      0,    139,      0, }, /* 923 */
+  {   105,      7,     12,      0,      0,    105,      0, }, /* 924 */
+  {   105,     26,     12,      0,      0,    105,      0, }, /* 925 */
+  {   105,     12,      3,      0,      0,    105,      0, }, /* 926 */
+  {   105,     21,     12,      0,      0,    105,      0, }, /* 927 */
+  {    10,      1,      2,      0,      0,    105,      0, }, /* 928 */
+  {    10,     10,      3,      0,      0,     10,      0, }, /* 929 */
+  {    10,     10,      5,      0,      0,     10,      0, }, /* 930 */
+  {    20,     12,      3,      0,      0,     20,      0, }, /* 931 */
+  {   131,     26,     12,      0,      0,    131,      0, }, /* 932 */
+  {   131,     12,      3,      0,      0,    131,      0, }, /* 933 */
+  {   131,     21,     12,      0,      0,    131,      0, }, /* 934 */
+  {    18,     12,      3,      0,      0,     18,      0, }, /* 935 */
+  {   151,      7,     12,      0,      0,    151,      0, }, /* 936 */
+  {   151,     12,      3,      0,      0,    151,      0, }, /* 937 */
+  {   151,      6,     12,      0,      0,    151,      0, }, /* 938 */
+  {   151,     13,     12,      0,      0,    151,      0, }, /* 939 */
+  {   151,     26,     12,      0,      0,    151,      0, }, /* 940 */
+  {   152,      7,     12,      0,      0,    152,      0, }, /* 941 */
+  {   152,     12,      3,      0,      0,    152,      0, }, /* 942 */
+  {   152,     13,     12,      0,      0,    152,      0, }, /* 943 */
+  {   152,     23,     12,      0,      0,    152,      0, }, /* 944 */
+  {   113,      7,     12,      0,      0,    113,      0, }, /* 945 */
+  {   113,     15,     12,      0,      0,    113,      0, }, /* 946 */
+  {   113,     12,      3,      0,      0,    113,      0, }, /* 947 */
+  {   132,      9,     12,      0,     34,    132,      0, }, /* 948 */
+  {   132,      5,     12,      0,    -34,    132,      0, }, /* 949 */
+  {   132,     12,      3,      0,      0,    132,      0, }, /* 950 */
+  {   132,      6,     12,      0,      0,    132,      0, }, /* 951 */
+  {   132,     13,     12,      0,      0,    132,      0, }, /* 952 */
+  {   132,     21,     12,      0,      0,    132,      0, }, /* 953 */
+  {     0,      2,     14,      0,      0,      0,      0, }, /* 954 */
+  {    10,     26,     11,      0,      0,     10,      0, }, /* 955 */
+  {    27,     26,     12,      0,      0,     27,      0, }, /* 956 */
+  {    10,     24,      3,      0,      0,     10,      0, }, /* 957 */
+  {    10,      1,      3,      0,      0,     10,      0, }, /* 958 */
 };
 
 const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */
@@ -968,3216 +1158,3296 @@ const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */
  46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, /* U+1800 */
  62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* U+2000 */
  77, 77, 78, 79, 66, 66, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, /* U+2800 */
- 90, 91, 92, 93, 94, 95, 96, 71, 97, 97, 97, 97, 97, 97, 97, 97, /* U+3000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+3800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+4000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 97, 97, 97, 97, /* U+4800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+5000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+5800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+6000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+6800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+7000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+7800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+8000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+8800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+9000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 99, /* U+9800 */
-100,101,101,101,101,101,101,101,101,102,103,103,104,105,106,107, /* U+A000 */
-108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,116, /* U+A800 */
-117,118,119,120,121,122,116,117,118,119,120,121,122,116,117,118, /* U+B000 */
-119,120,121,122,116,117,118,119,120,121,122,116,117,118,119,120, /* U+B800 */
-121,122,116,117,118,119,120,121,122,116,117,118,119,120,121,122, /* U+C000 */
-116,117,118,119,120,121,122,116,117,118,119,120,121,122,116,117, /* U+C800 */
-118,119,120,121,122,116,117,118,119,120,121,122,116,117,118,123, /* U+D000 */
-124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+D800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+E000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+E800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F000 */
-125,125, 97, 97,126,127,128,129,130,130,131,132,133,134,135,136, /* U+F800 */
-137,138,139,140,141,142,143,144,145,146,147,141,148,148,149,141, /* U+10000 */
-150,151,152,153,154,155,156,157,158,159,160,141,161,141,162,141, /* U+10800 */
-163,164,165,166,167,168,169,141,170,171,141,172,173,174,175,141, /* U+11000 */
-176,177,141,141,178,179,141,141,180,181,182,183,141,184,141,141, /* U+11800 */
-185,185,185,185,185,185,185,186,187,185,188,141,141,141,141,141, /* U+12000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+12800 */
-189,189,189,189,189,189,189,189,190,141,141,141,141,141,141,141, /* U+13000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+13800 */
-141,141,141,141,141,141,141,141,191,191,191,191,192,141,141,141, /* U+14000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+14800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+15000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+15800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+16000 */
-193,193,193,193,194,195,196,197,141,141,141,141,198,199,200,201, /* U+16800 */
-202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202, /* U+17000 */
-202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202, /* U+17800 */
-202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,203, /* U+18000 */
-202,202,202,202,202,204,141,141,141,141,141,141,141,141,141,141, /* U+18800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+19000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+19800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1A000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1A800 */
-205,206,207,208,208,209,141,141,141,141,141,141,141,141,141,141, /* U+1B000 */
-141,141,141,141,141,141,141,141,210,211,141,141,141,141,141,141, /* U+1B800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1C000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1C800 */
- 71,212,213,214,215,216,217,141,218,219,220,221,222,223,224,225, /* U+1D000 */
-226,226,226,226,227,228,141,141,141,141,141,141,141,141,141,141, /* U+1D800 */
-229,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1E000 */
-230,231,232,141,141,141,141,141,233,234,141,141,235,236,141,141, /* U+1E800 */
-237,238,239,240,241,242,243,244,243,243,245,243,246,247,248,249, /* U+1F000 */
-250,251,252,253,254,242,242,242,242,242,242,242,242,242,242,255, /* U+1F800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+20000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+20800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+21000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+21800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+22000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+22800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+23000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+23800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+24000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+24800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+25000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+25800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+26000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+26800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+27000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+27800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+28000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+28800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+29000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+29800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,256, 97, 97, /* U+2A000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2A800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,257, 97, /* U+2B000 */
-258, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2B800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2C000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,259, 97, 97, /* U+2C800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2D000 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2D800 */
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2E000 */
- 97, 97, 97, 97, 97, 97, 97,260,141,141,141,141,141,141,141,141, /* U+2E800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+2F000 */
- 97, 97, 97, 97,261,141,141,141,141,141,141,141,141,141,141,141, /* U+2F800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+30000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+30800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+31000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+31800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+32000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+32800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+33000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+33800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+34000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+34800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+35000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+35800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+36000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+36800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+37000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+37800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+38000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+38800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+39000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+39800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3A000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3A800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3B000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3B800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3C000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3C800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3D000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3D800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3E000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3E800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3F000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3F800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+40000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+40800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+41000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+41800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+42000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+42800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+43000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+43800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+44000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+44800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+45000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+45800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+46000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+46800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+47000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+47800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+48000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+48800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+49000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+49800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4A000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4A800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4B000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4B800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4C000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4C800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4D000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4D800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4E000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4E800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4F000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4F800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+50000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+50800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+51000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+51800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+52000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+52800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+53000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+53800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+54000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+54800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+55000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+55800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+56000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+56800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+57000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+57800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+58000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+58800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+59000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+59800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5A000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5A800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5B000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5B800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5C000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5C800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5D000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5D800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5E000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5E800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5F000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5F800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+60000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+60800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+61000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+61800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+62000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+62800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+63000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+63800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+64000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+64800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+65000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+65800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+66000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+66800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+67000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+67800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+68000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+68800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+69000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+69800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6A000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6A800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6B000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6B800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6C000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6C800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6D000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6D800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6E000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6E800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6F000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6F800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+70000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+70800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+71000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+71800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+72000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+72800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+73000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+73800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+74000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+74800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+75000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+75800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+76000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+76800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+77000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+77800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+78000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+78800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+79000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+79800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7A000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7A800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7B000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7B800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7C000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7C800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7D000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7D800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7E000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7E800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7F000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7F800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+80000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+80800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+81000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+81800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+82000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+82800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+83000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+83800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+84000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+84800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+85000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+85800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+86000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+86800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+87000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+87800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+88000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+88800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+89000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+89800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8A000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8A800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8B000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8B800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8C000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8C800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8D000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8D800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8E000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8E800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8F000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8F800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+90000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+90800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+91000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+91800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+92000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+92800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+93000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+93800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+94000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+94800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+95000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+95800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+96000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+96800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+97000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+97800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+98000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+98800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+99000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+99800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9A000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9A800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9B000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9B800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9C000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9C800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9D000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9D800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9E000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9E800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9F000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9F800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A0000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A0800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A1000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A1800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A2000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A2800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A3000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A3800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A4000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A4800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A5000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A5800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A6000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A6800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A7000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A7800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A8000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A8800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A9000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A9800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AA000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AA800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AB000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AB800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AC000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AC800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AD000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AD800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AE000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AE800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AF000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AF800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B0000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B0800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B1000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B1800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B2000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B2800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B3000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B3800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B4000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B4800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B5000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B5800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B6000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B6800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B7000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B7800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B8000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B8800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B9000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B9800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BA000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BA800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BB000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BB800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BC000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BC800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BD000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BD800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BE000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BE800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BF000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BF800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C0000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C0800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C1000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C1800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C2000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C2800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C3000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C3800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C4000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C4800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C5000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C5800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C6000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C6800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C7000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C7800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C8000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C8800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C9000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C9800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CA000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CA800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CB000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CB800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CC000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CC800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CD000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CD800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CE000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CE800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CF000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CF800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D0000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D0800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D1000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D1800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D2000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D2800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D3000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D3800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D4000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D4800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D5000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D5800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D6000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D6800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D7000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D7800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D8000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D8800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D9000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D9800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DA000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DA800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DB000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DB800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DC000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DC800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DD000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DD800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DE000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DE800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DF000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DF800 */
-262,263,264,265,263,263,263,263,263,263,263,263,263,263,263,263, /* U+E0000 */
-263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, /* U+E0800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E1000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E1800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E2000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E2800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E3000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E3800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E4000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E4800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E5000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E5800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E6000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E6800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E7000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E7800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E8000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E8800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E9000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E9800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EA000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EA800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EB000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EB800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EC000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EC800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+ED000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+ED800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EE000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EE800 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EF000 */
-141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EF800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F0000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F0800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F1000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F1800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F2000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F2800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F3000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F3800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F4000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F4800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F5000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F5800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F6000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F6800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F7000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F7800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F8000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F8800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F9000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F9800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FA000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FA800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FB000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FB800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FC000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FC800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FD000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FD800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FE000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FE800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FF000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,266, /* U+FF800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+100000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+100800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+101000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+101800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+102000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+102800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+103000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+103800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+104000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+104800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+105000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+105800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+106000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+106800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+107000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+107800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+108000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+108800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+109000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+109800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10A000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10A800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10B000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10B800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10C000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10C800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10D000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10D800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10E000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10E800 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10F000 */
-125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,266, /* U+10F800 */
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, 98, 98, 98, 98, 98, 98, 98, /* U+3000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+3800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+4000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, 98, 98, 98, 98, /* U+4800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+5000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+5800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+6000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+6800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+7000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+7800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+8000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+8800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+9000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,100, /* U+9800 */
+101,102,102,102,102,102,102,102,102,103,104,104,105,106,107,108, /* U+A000 */
+109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,117, /* U+A800 */
+118,119,120,121,122,123,117,118,119,120,121,122,123,117,118,119, /* U+B000 */
+120,121,122,123,117,118,119,120,121,122,123,117,118,119,120,121, /* U+B800 */
+122,123,117,118,119,120,121,122,123,117,118,119,120,121,122,123, /* U+C000 */
+117,118,119,120,121,122,123,117,118,119,120,121,122,123,117,118, /* U+C800 */
+119,120,121,122,123,117,118,119,120,121,122,123,117,118,119,124, /* U+D000 */
+125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+D800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+E000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+E800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F000 */
+126,126, 98, 98,127,128,129,130,131,131,132,133,134,135,136,137, /* U+F800 */
+138,139,140,141,142,143,144,145,146,147,148,142,149,149,150,142, /* U+10000 */
+151,152,153,154,155,156,157,158,159,160,161,142,162,142,163,164, /* U+10800 */
+165,166,167,168,169,170,171,142,172,173,142,174,175,176,177,142, /* U+11000 */
+178,179,142,180,181,182,142,142,183,184,185,186,142,187,142,188, /* U+11800 */
+189,189,189,189,189,189,189,190,191,189,192,142,142,142,142,142, /* U+12000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+12800 */
+193,193,193,193,193,193,193,193,194,142,142,142,142,142,142,142, /* U+13000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+13800 */
+142,142,142,142,142,142,142,142,195,195,195,195,196,142,142,142, /* U+14000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+14800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+15000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+15800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+16000 */
+197,197,197,197,198,199,200,201,142,142,142,142,202,203,204,205, /* U+16800 */
+206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206, /* U+17000 */
+206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,206, /* U+17800 */
+206,206,206,206,206,206,206,206,206,206,206,206,206,206,206,207, /* U+18000 */
+206,206,206,206,206,208,142,142,142,142,142,142,142,142,142,142, /* U+18800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+19000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+19800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1A000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1A800 */
+209,210,211,212,212,213,142,142,142,142,142,142,142,142,142,142, /* U+1B000 */
+142,142,142,142,142,142,142,142,214,215,142,142,142,142,142,142, /* U+1B800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1C000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+1C800 */
+ 71,216,217,218,219,220,221,142,222,223,224,225,226,227,228,229, /* U+1D000 */
+230,230,230,230,231,232,142,142,142,142,142,142,142,142,142,142, /* U+1D800 */
+233,142,234,142,142,235,142,142,142,142,142,142,142,142,142,142, /* U+1E000 */
+236,237,238,142,142,142,142,142,239,240,241,142,242,243,142,142, /* U+1E800 */
+244,245,246,247,248,249,250,251,250,250,252,250,253,254,255,256, /* U+1F000 */
+257,258,259,260,261,262,249,249,249,249,249,249,249,249,249,263, /* U+1F800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+20000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+20800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+21000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+21800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+22000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+22800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+23000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+23800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+24000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+24800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+25000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+25800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+26000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+26800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+27000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+27800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+28000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+28800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+29000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+29800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,264, 98, 98, /* U+2A000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2A800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,265, 98, /* U+2B000 */
+266, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2B800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2C000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,267, 98, 98, /* U+2C800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2D000 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2D800 */
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, /* U+2E000 */
+ 98, 98, 98, 98, 98, 98, 98,268,142,142,142,142,142,142,142,142, /* U+2E800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+2F000 */
+ 98, 98, 98, 98,269,142,142,142,142,142,142,142,142,142,142,142, /* U+2F800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+30000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+30800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+31000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+31800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+32000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+32800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+33000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+33800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+34000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+34800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+35000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+35800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+36000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+36800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+37000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+37800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+38000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+38800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+39000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+39800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3A000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3A800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3B000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3B800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3C000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3C800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3D000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3D800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3E000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3E800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3F000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+3F800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+40000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+40800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+41000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+41800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+42000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+42800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+43000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+43800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+44000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+44800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+45000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+45800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+46000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+46800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+47000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+47800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+48000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+48800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+49000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+49800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4A000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4A800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4B000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4B800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4C000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4C800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4D000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4D800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4E000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4E800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4F000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+4F800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+50000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+50800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+51000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+51800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+52000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+52800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+53000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+53800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+54000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+54800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+55000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+55800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+56000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+56800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+57000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+57800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+58000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+58800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+59000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+59800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5A000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5A800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5B000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5B800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5C000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5C800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5D000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5D800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5E000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5E800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5F000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+5F800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+60000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+60800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+61000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+61800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+62000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+62800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+63000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+63800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+64000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+64800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+65000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+65800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+66000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+66800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+67000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+67800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+68000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+68800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+69000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+69800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6A000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6A800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6B000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6B800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6C000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6C800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6D000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6D800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6E000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6E800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6F000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+6F800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+70000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+70800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+71000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+71800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+72000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+72800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+73000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+73800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+74000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+74800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+75000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+75800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+76000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+76800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+77000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+77800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+78000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+78800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+79000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+79800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7A000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7A800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7B000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7B800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7C000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7C800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7D000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7D800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7E000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7E800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7F000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+7F800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+80000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+80800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+81000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+81800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+82000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+82800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+83000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+83800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+84000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+84800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+85000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+85800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+86000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+86800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+87000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+87800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+88000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+88800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+89000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+89800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8A000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8A800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8B000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8B800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8C000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8C800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8D000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8D800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8E000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8E800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8F000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+8F800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+90000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+90800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+91000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+91800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+92000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+92800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+93000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+93800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+94000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+94800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+95000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+95800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+96000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+96800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+97000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+97800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+98000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+98800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+99000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+99800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9A000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9A800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9B000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9B800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9C000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9C800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9D000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9D800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9E000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9E800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9F000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+9F800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A0000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A0800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A1000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A1800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A2000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A2800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A3000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A3800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A4000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A4800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A5000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A5800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A6000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A6800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A7000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A7800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A8000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A8800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A9000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+A9800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AA000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AA800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AB000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AB800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AC000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AC800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AD000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AD800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AE000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AE800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AF000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+AF800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B0000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B0800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B1000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B1800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B2000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B2800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B3000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B3800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B4000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B4800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B5000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B5800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B6000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B6800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B7000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B7800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B8000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B8800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B9000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+B9800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BA000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BA800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BB000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BB800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BC000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BC800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BD000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BD800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BE000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BE800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BF000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+BF800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C0000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C0800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C1000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C1800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C2000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C2800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C3000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C3800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C4000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C4800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C5000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C5800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C6000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C6800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C7000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C7800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C8000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C8800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C9000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+C9800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CA000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CA800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CB000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CB800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CC000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CC800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CD000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CD800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CE000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CE800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CF000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+CF800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D0000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D0800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D1000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D1800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D2000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D2800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D3000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D3800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D4000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D4800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D5000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D5800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D6000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D6800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D7000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D7800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D8000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D8800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D9000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+D9800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DA000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DA800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DB000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DB800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DC000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DC800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DD000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DD800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DE000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DE800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DF000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+DF800 */
+270,271,272,273,271,271,271,271,271,271,271,271,271,271,271,271, /* U+E0000 */
+271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271, /* U+E0800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E1000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E1800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E2000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E2800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E3000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E3800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E4000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E4800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E5000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E5800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E6000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E6800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E7000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E7800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E8000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E8800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E9000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+E9800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EA000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EA800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EB000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EB800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EC000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EC800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+ED000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+ED800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EE000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EE800 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EF000 */
+142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, /* U+EF800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F0000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F0800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F1000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F1800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F2000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F2800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F3000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F3800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F4000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F4800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F5000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F5800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F6000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F6800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F7000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F7800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F8000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F8800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F9000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+F9800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FA000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FA800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FB000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FB800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FC000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FC800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FD000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FD800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FE000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FE800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+FF000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,274, /* U+FF800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+100000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+100800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+101000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+101800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+102000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+102800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+103000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+103800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+104000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+104800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+105000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+105800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+106000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+106800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+107000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+107800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+108000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+108800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+109000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+109800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10A000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10A800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10B000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10B800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10C000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10C800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10D000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10D800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10E000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10E800 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, /* U+10F000 */
+126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,274, /* U+10F800 */
 };
 
-const uint16_t PRIV(ucd_stage2)[] = { /* 68352 bytes, block = 128 */
+const uint16_t PRIV(ucd_stage2)[] = { /* 70400 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,
-  3,  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, 12, 11, 11, 11, 11,
- 11, 11, 11, 13, 11, 11, 11, 11, 11, 11, 11,  6,  4,  7, 14, 15,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 16, 16, 16, 16,
- 16, 16, 16, 18, 16, 16, 16, 16, 16, 16, 16,  6,  8,  7,  8,  0,
+  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  1,  1,  3,  1,  1,
+  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
+  4,  5,  5,  5,  6,  5,  5,  5,  7,  8,  5,  9,  5, 10,  5,  5,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  5,  5,  9,  9,  9,  5,
+  5, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 12, 12, 12, 12,
+ 12, 12, 12, 14, 12, 12, 12, 12, 12, 12, 12,  7,  5,  8, 15, 16,
+ 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 17, 17, 17, 17,
+ 17, 17, 17, 19, 17, 17, 17, 17, 17, 17, 17,  7,  9,  8,  9,  1,
 
 /* block 1 */
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  3,  4,  5,  5,  5,  5, 19,  4, 14, 20, 21, 22,  8, 23, 20, 14,
19,  8, 24, 24, 14, 25,  4,  4, 14, 24, 21, 26, 24, 24, 24,  4,
- 11, 11, 11, 11, 11, 27, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11,  8, 11, 11, 11, 11, 11, 11, 11, 28,
- 16, 16, 16, 16, 16, 29, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16,  8, 16, 16, 16, 16, 16, 16, 16, 30,
+  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
+  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
+  4,  5,  6,  6,  6,  6, 20,  5, 15, 21, 22, 23,  9, 24, 21, 15,
20,  9, 25, 25, 15, 26,  5,  5, 15, 25, 22, 27, 25, 25, 25,  5,
+ 12, 12, 12, 12, 12, 28, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12,  9, 12, 12, 12, 12, 12, 12, 12, 29,
+ 17, 17, 17, 17, 17, 30, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17,  9, 17, 17, 17, 17, 17, 17, 17, 31,
 
 /* block 2 */
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 33, 34, 31, 32, 31, 32, 31, 32, 34, 31, 32, 31, 32, 31, 32, 31,
- 32, 31, 32, 31, 32, 31, 32, 31, 32, 34, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 35, 31, 32, 31, 32, 31, 32, 36,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 34, 35, 32, 33, 32, 33, 32, 33, 35, 32, 33, 32, 33, 32, 33, 32,
+ 33, 32, 33, 32, 33, 32, 33, 32, 33, 35, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 36, 32, 33, 32, 33, 32, 33, 37,
 
 /* block 3 */
- 37, 38, 31, 32, 31, 32, 39, 31, 32, 40, 40, 31, 32, 34, 41, 42,
- 43, 31, 32, 40, 44, 45, 46, 47, 31, 32, 48, 34, 46, 49, 50, 51,
- 31, 32, 31, 32, 31, 32, 52, 31, 32, 52, 34, 34, 31, 32, 52, 31,
- 32, 53, 53, 31, 32, 31, 32, 54, 31, 32, 34, 21, 31, 32, 34, 55,
- 21, 21, 21, 21, 56, 57, 58, 59, 60, 61, 62, 63, 64, 31, 32, 31,
- 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 65, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 34, 66, 67, 68, 31, 32, 69, 70, 31, 32, 31, 32, 31, 32, 31, 32,
+ 38, 39, 32, 33, 32, 33, 40, 32, 33, 41, 41, 32, 33, 35, 42, 43,
+ 44, 32, 33, 41, 45, 46, 47, 48, 32, 33, 49, 35, 47, 50, 51, 52,
+ 32, 33, 32, 33, 32, 33, 53, 32, 33, 53, 35, 35, 32, 33, 53, 32,
+ 33, 54, 54, 32, 33, 32, 33, 55, 32, 33, 35, 22, 32, 33, 35, 56,
+ 22, 22, 22, 22, 57, 58, 59, 60, 61, 62, 63, 64, 65, 32, 33, 32,
+ 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 66, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 35, 67, 68, 69, 32, 33, 70, 71, 32, 33, 32, 33, 32, 33, 32, 33,
 
 /* block 4 */
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 71, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 34, 34, 34, 34, 34, 34, 72, 31, 32, 73, 74, 75,
- 75, 31, 32, 76, 77, 78, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
79, 80, 81, 82, 83, 34, 84, 84, 34, 85, 34, 86, 87, 34, 34, 34,
- 84, 88, 34, 89, 34, 90, 91, 34, 92, 93, 91, 94, 95, 34, 34, 93,
- 34, 96, 97, 34, 34, 98, 34, 34, 34, 34, 34, 34, 34, 99, 34, 34,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 72, 35, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 35, 35, 35, 35, 35, 35, 73, 32, 33, 74, 75, 76,
+ 76, 32, 33, 77, 78, 79, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
80, 81, 82, 83, 84, 35, 85, 85, 35, 86, 35, 87, 88, 35, 35, 35,
+ 85, 89, 35, 90, 35, 91, 92, 35, 93, 94, 92, 95, 96, 35, 35, 94,
+ 35, 97, 98, 35, 35, 99, 35, 35, 35, 35, 35, 35, 35,100, 35, 35,
 
 /* block 5 */
-100, 34, 34,100, 34, 34, 34,101,100,102,103,103,104, 34, 34, 34,
- 34, 34,105, 34, 21, 34, 34, 34, 34, 34, 34, 34, 34,106,107, 34,
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
-108,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109,
-109,109, 14, 14, 14, 14,109,109,109,109,109,109,109,109,109,109,
-109,109, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-108,108,108,108,108, 14, 14, 14, 14, 14,110,110,109, 14,109, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+101, 35,102,101, 35, 35, 35,103,101,104,105,105,106, 35, 35, 35,
+ 35, 35,107, 35, 22, 35, 35, 35, 35, 35, 35, 35, 35,108,109, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+110,110,110,110,110,110,110,110,110,111,111,111,111,111,111,111,
+111,111, 15, 15, 15, 15,111,111,111,111,111,111,111,111,111,111,
+111,111, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+110,110,110,110,110, 15, 15, 15, 15, 15,112,112,111, 15,111, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
 
 /* block 6 */
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,112,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-113,114,113,114,109,115,113,114,116,116,117,118,118,118,  4,119,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,114,113,113,115,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,116,116,116,116,116,116,116,116,116,116,116,116,116,
+117,118,117,118,111,119,117,118,120,120,121,122,122,122,  5,123,
 
 /* block 7 */
-116,116,116,116,115, 14,120,  4,121,121,121,116,122,116,123,123,
-124,125,126,125,125,127,125,125,128,129,130,125,131,125,125,125,
-132,133,116,134,125,125,135,125,125,136,125,125,137,138,138,138,
-124,139,140,139,139,141,139,139,142,143,144,139,145,139,139,139,
-146,147,148,149,139,139,150,139,139,151,139,139,152,153,153,154,
-155,156,157,157,157,158,159,160,113,114,113,114,113,114,113,114,
-113,114,161,162,161,162,161,162,161,162,161,162,161,162,161,162,
-163,164,165,166,167,168,169,113,114,170,113,114,124,171,171,171,
+120,120,120,120,119, 15,124,  5,125,125,125,120,126,120,127,127,
+128,129,130,129,129,131,129,129,132,133,134,129,135,129,129,129,
+136,137,120,138,129,129,139,129,129,140,129,129,141,142,142,142,
+128,143,144,143,143,145,143,143,146,147,148,143,149,143,143,143,
+150,151,152,153,143,143,154,143,143,155,143,143,156,157,157,158,
+159,160,161,161,161,162,163,164,117,118,117,118,117,118,117,118,
+117,118,165,166,165,166,165,166,165,166,165,166,165,166,165,166,
+167,168,169,170,171,172,173,117,118,174,117,118,128,175,175,175,
 
 /* block 8 */
-172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
-173,173,174,173,175,173,173,173,173,173,173,173,173,173,176,173,
-173,177,178,173,173,173,173,173,173,173,179,173,173,173,173,173,
-180,180,181,180,182,180,180,180,180,180,180,180,180,180,183,180,
-180,184,185,180,180,180,180,180,180,180,186,180,180,180,180,180,
-187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,
-188,189,190,191,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
+176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,
+177,177,178,177,179,177,177,177,177,177,177,177,177,177,180,177,
+177,181,182,177,177,177,177,177,177,177,183,177,177,177,177,177,
+184,184,185,184,186,184,184,184,184,184,184,184,184,184,187,184,
+184,188,189,184,184,184,184,184,184,184,190,184,184,184,184,184,
+191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,
+192,193,194,195,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
 
 /* block 9 */
-188,189,192,193,193,111,111,193,194,194,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-195,188,189,188,189,188,189,188,189,188,189,188,189,188,189,196,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
+192,193,196,197,198,199,199,198,200,200,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+201,192,193,192,193,192,193,192,193,192,193,192,193,192,193,202,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
 
 /* block 10 */
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-116,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,
-197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,
-197,197,197,197,197,197,197,116,116,198,199,199,199,199,199,199,
-200,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
-201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+120,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,
+203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,
+203,203,203,203,203,203,203,120,120,204,205,205,205,205,205,205,
+206,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,
 
 /* block 11 */
-201,201,201,201,201,201,201,200,200,  4,202,116,116,203,203,204,
-116,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,205,205,205,205,206,205,
-207,205,205,207,205,205,207,205,116,116,116,116,116,116,116,116,
-208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,
-208,208,208,208,208,208,208,208,208,208,208,116,116,116,116,208,
-208,208,208,207,207,116,116,116,116,116,116,116,116,116,116,116,
+207,207,207,207,207,207,207,206,206,208,209,120,120,210,210,211,
+120,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,
+212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,
+212,212,212,212,212,212,212,212,212,212,212,212,212,212,213,212,
+214,212,212,214,212,212,214,212,120,120,120,120,120,120,120,120,
+215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
+215,215,215,215,215,215,215,215,215,215,215,120,120,120,120,215,
+215,215,215,214,214,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 12 */
-209,209,209,209,209,210,211,211,211,212,212,213,  4,212,214,214,
-215,215,215,215,215,215,215,215,215,215,215,  4,216,116,212,  4,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-109,217,217,217,217,217,217,217,217,217,217,111,111,111,111,111,
-111,111,111,111,111,111,215,215,215,215,215,215,215,215,215,215,
-218,218,218,218,218,218,218,218,218,218,212,212,212,212,217,217,
-111,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
+216,216,216,216,216,217,218,218,218,219,219,220,221,219,222,222,
+223,223,223,223,223,223,223,223,223,223,223,221,224,120,219,221,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+226,225,225,225,225,225,225,225,225,225,225,227,227,227,227,227,
+227,227,227,227,227,227,223,223,223,223,223,223,223,223,223,223,
+228,228,228,228,228,228,228,228,228,228,219,219,219,219,225,225,
+227,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
 
 /* block 13 */
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,212,217,215,215,215,215,215,215,215,210,214,215,
-215,215,215,215,215,219,219,215,215,214,215,215,215,215,217,217,
-218,218,218,218,218,218,218,218,218,218,217,217,217,214,214,217,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,229,225,223,223,223,223,223,223,223,217,222,223,
+223,223,223,223,223,230,230,223,223,222,223,223,223,223,225,225,
+231,231,231,231,231,231,231,231,231,231,225,225,225,222,222,225,
 
 /* block 14 */
-220,220,220,220,220,220,220,220,220,220,220,220,220,220,116,221,
-222,223,222,222,222,222,222,222,222,222,222,222,222,222,222,222,
-222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,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,116,116,222,222,222,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
+232,232,232,232,232,232,232,232,232,232,232,232,232,232,120,233,
+234,235,234,234,234,234,234,234,234,234,234,234,234,234,234,234,
+234,234,234,234,234,234,234,234,234,234,234,234,234,234,234,234,
+235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
+235,235,235,235,235,235,235,235,235,235,235,120,120,234,234,234,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
 
 /* block 15 */
-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,225,225,225,225,225,225,225,225,225,225,
-225,224,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227,
-227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,
-227,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,
-228,228,228,228,229,229,230,231,231,231,229,116,116,228,232,232,
+236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,
+236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,
+236,236,236,236,236,236,237,237,237,237,237,237,237,237,237,237,
+237,236,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+238,238,238,238,238,238,238,238,238,238,239,239,239,239,239,239,
+239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,
+239,239,239,239,239,239,239,239,239,239,239,240,240,240,240,240,
+240,240,240,240,241,241,242,243,243,243,241,120,120,240,244,244,
 
 /* block 16 */
-233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,
-233,233,233,233,233,233,234,234,234,234,235,234,234,234,234,234,
-234,234,234,234,235,234,234,234,235,234,234,234,234,234,116,116,
-236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,116,
-237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,
-237,237,237,237,237,237,237,237,237,238,238,238,116,116,239,116,
-222,222,222,222,222,222,222,222,222,222,222,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,
+245,245,245,245,245,245,246,246,246,246,247,246,246,246,246,246,
+246,246,246,246,247,246,246,246,247,246,246,246,246,246,120,120,
+248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,120,
+249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,
+249,249,249,249,249,249,249,249,249,250,250,250,120,120,251,120,
+234,234,234,234,234,234,234,234,234,234,234,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 17 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,116,217,217,217,217,217,217,217,217,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,215,215,215,215,215,215,215,215,215,215,215,215,215,
-215,215,210,215,215,215,215,215,215,215,215,215,215,215,215,215,
-215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,120,225,225,225,225,225,225,225,225,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,223,223,223,223,223,223,223,223,223,223,223,223,223,
+223,223,217,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,
 
 /* block 18 */
-240,240,240,241,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
-242,242,242,242,242,242,242,242,242,242,240,241,240,242,241,241,
-241,240,240,240,240,240,240,240,240,241,241,241,241,240,241,241,
-242,111,111,240,240,240,240,240,242,242,242,242,242,242,242,242,
-242,242,240,240,  4,  4,243,243,243,243,243,243,243,243,243,243,
-244,245,242,242,242,242,242,242,242,242,242,242,242,242,242,242,
+252,252,252,253,254,254,254,254,254,254,254,254,254,254,254,254,
+254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,
+254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,
+254,254,254,254,254,254,254,254,254,254,252,253,252,254,253,253,
+253,252,252,252,252,252,252,252,252,253,253,253,253,252,253,253,
+254,255,256,113,113,252,252,252,254,254,254,254,254,254,254,254,
+254,254,252,252,257,258,259,259,259,259,259,259,259,259,259,259,
+260,261,254,254,254,254,254,254,254,254,254,254,254,254,254,254,
 
 /* block 19 */
-246,247,248,248,116,246,246,246,246,246,246,246,246,116,116,246,
-246,116,116,246,246,246,246,246,246,246,246,246,246,246,246,246,
-246,246,246,246,246,246,246,246,246,116,246,246,246,246,246,246,
-246,116,246,116,116,116,246,246,246,246,116,116,247,246,249,248,
-248,247,247,247,247,116,116,248,248,116,116,248,248,247,246,116,
-116,116,116,116,116,116,116,249,116,116,116,116,246,246,116,246,
-246,246,247,247,116,116,250,250,250,250,250,250,250,250,250,250,
-246,246,251,251,252,252,252,252,252,252,253,251,246,254,247,116,
+262,263,264,264,120,262,262,262,262,262,262,262,262,120,120,262,
+262,120,120,262,262,262,262,262,262,262,262,262,262,262,262,262,
+262,262,262,262,262,262,262,262,262,120,262,262,262,262,262,262,
+262,120,262,120,120,120,262,262,262,262,120,120,263,262,265,264,
+264,263,263,263,263,120,120,264,264,120,120,264,264,263,262,120,
+120,120,120,120,120,120,120,265,120,120,120,120,262,262,120,262,
+262,262,263,263,120,120,266,266,266,266,266,266,266,266,266,266,
+262,262,267,267,268,268,268,268,268,268,269,267,262,270,263,120,
 
 /* block 20 */
-116,255,255,256,116,257,257,257,257,257,257,116,116,116,116,257,
-257,116,116,257,257,257,257,257,257,257,257,257,257,257,257,257,
-257,257,257,257,257,257,257,257,257,116,257,257,257,257,257,257,
-257,116,257,257,116,257,257,116,257,257,116,116,255,116,256,256,
-256,255,255,116,116,116,116,255,255,116,116,255,255,255,116,116,
-116,255,116,116,116,116,116,116,116,257,257,257,257,116,257,116,
-116,116,116,116,116,116,258,258,258,258,258,258,258,258,258,258,
-255,255,257,257,257,255,259,116,116,116,116,116,116,116,116,116,
+120,271,271,272,120,273,273,273,273,273,273,120,120,120,120,273,
+273,120,120,273,273,273,273,273,273,273,273,273,273,273,273,273,
+273,273,273,273,273,273,273,273,273,120,273,273,273,273,273,273,
+273,120,273,273,120,273,273,120,273,273,120,120,271,120,272,272,
+272,271,271,120,120,120,120,271,271,120,120,271,271,271,120,120,
+120,271,120,120,120,120,120,120,120,273,273,273,273,120,273,120,
+120,120,120,120,120,120,274,274,274,274,274,274,274,274,274,274,
+271,271,273,273,273,271,275,120,120,120,120,120,120,120,120,120,
 
 /* block 21 */
-116,260,260,261,116,262,262,262,262,262,262,262,262,262,116,262,
-262,262,116,262,262,262,262,262,262,262,262,262,262,262,262,262,
-262,262,262,262,262,262,262,262,262,116,262,262,262,262,262,262,
-262,116,262,262,116,262,262,262,262,262,116,116,260,262,261,261,
-261,260,260,260,260,260,116,260,260,261,116,261,261,260,116,116,
-262,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-262,262,260,260,116,116,263,263,263,263,263,263,263,263,263,263,
-264,265,116,116,116,116,116,116,116,262,260,260,260,260,260,260,
+120,276,276,277,120,278,278,278,278,278,278,278,278,278,120,278,
+278,278,120,278,278,278,278,278,278,278,278,278,278,278,278,278,
+278,278,278,278,278,278,278,278,278,120,278,278,278,278,278,278,
+278,120,278,278,120,278,278,278,278,278,120,120,276,278,277,277,
+277,276,276,276,276,276,120,276,276,277,120,277,277,276,120,120,
+278,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+278,278,276,276,120,120,279,279,279,279,279,279,279,279,279,279,
+280,281,120,120,120,120,120,120,120,278,276,276,276,276,276,276,
 
 /* block 22 */
-116,266,267,267,116,268,268,268,268,268,268,268,268,116,116,268,
-268,116,116,268,268,268,268,268,268,268,268,268,268,268,268,268,
-268,268,268,268,268,268,268,268,268,116,268,268,268,268,268,268,
-268,116,268,268,116,268,268,268,268,268,116,116,266,268,269,266,
-267,266,266,266,266,116,116,267,267,116,116,267,267,266,116,116,
-116,116,116,116,116,116,266,269,116,116,116,116,268,268,116,268,
-268,268,266,266,116,116,270,270,270,270,270,270,270,270,270,270,
-271,268,272,272,272,272,272,272,116,116,116,116,116,116,116,116,
+120,282,283,283,120,284,284,284,284,284,284,284,284,120,120,284,
+284,120,120,284,284,284,284,284,284,284,284,284,284,284,284,284,
+284,284,284,284,284,284,284,284,284,120,284,284,284,284,284,284,
+284,120,284,284,120,284,284,284,284,284,120,120,282,284,285,282,
+283,282,282,282,282,120,120,283,283,120,120,283,283,282,120,120,
+120,120,120,120,120,120,282,285,120,120,120,120,284,284,120,284,
+284,284,282,282,120,120,286,286,286,286,286,286,286,286,286,286,
+287,284,288,288,288,288,288,288,120,120,120,120,120,120,120,120,
 
 /* block 23 */
-116,116,273,274,116,274,274,274,274,274,274,116,116,116,274,274,
-274,116,274,274,274,274,116,116,116,274,274,116,274,116,274,274,
-116,116,116,274,274,116,116,116,274,274,274,116,116,116,274,274,
-274,274,274,274,274,274,274,274,274,274,116,116,116,116,275,276,
-273,276,276,116,116,116,276,276,276,116,276,276,276,273,116,116,
-274,116,116,116,116,116,116,275,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,277,277,277,277,277,277,277,277,277,277,
-278,278,278,279,279,279,279,279,279,280,279,116,116,116,116,116,
+120,120,289,290,120,290,290,290,290,290,290,120,120,120,290,290,
+290,120,290,290,290,290,120,120,120,290,290,120,290,120,290,290,
+120,120,120,290,290,120,120,120,290,290,290,120,120,120,290,290,
+290,290,290,290,290,290,290,290,290,290,120,120,120,120,291,292,
+289,292,292,120,120,120,292,292,292,120,292,292,292,289,120,120,
+290,120,120,120,120,120,120,291,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,293,293,293,293,293,293,293,293,293,293,
+294,294,294,295,296,296,296,296,296,297,296,120,120,120,120,120,
 
 /* block 24 */
-281,282,282,282,281,283,283,283,283,283,283,283,283,116,283,283,
-283,116,283,283,283,283,283,283,283,283,283,283,283,283,283,283,
-283,283,283,283,283,283,283,283,283,116,283,283,283,283,283,283,
-283,283,283,283,283,283,283,283,283,283,116,116,116,283,281,281,
-281,282,282,282,282,116,281,281,281,116,281,281,281,281,116,116,
-116,116,116,116,116,281,281,116,283,283,283,116,116,116,116,116,
-283,283,281,281,116,116,284,284,284,284,284,284,284,284,284,284,
-116,116,116,116,116,116,116,116,285,285,285,285,285,285,285,286,
+298,299,299,299,298,300,300,300,300,300,300,300,300,120,300,300,
+300,120,300,300,300,300,300,300,300,300,300,300,300,300,300,300,
+300,300,300,300,300,300,300,300,300,120,300,300,300,300,300,300,
+300,300,300,300,300,300,300,300,300,300,120,120,120,300,298,298,
+298,299,299,299,299,120,298,298,298,120,298,298,298,298,120,120,
+120,120,120,120,120,298,298,120,300,300,300,120,120,120,120,120,
+300,300,298,298,120,120,301,301,301,301,301,301,301,301,301,301,
+120,120,120,120,120,120,120,302,303,303,303,303,303,303,303,304,
 
 /* block 25 */
-287,288,289,289,290,287,287,287,287,287,287,287,287,116,287,287,
-287,116,287,287,287,287,287,287,287,287,287,287,287,287,287,287,
-287,287,287,287,287,287,287,287,287,116,287,287,287,287,287,287,
-287,287,287,287,116,287,287,287,287,287,116,116,288,287,289,288,
-289,289,291,289,289,116,288,289,289,116,289,289,288,288,116,116,
-116,116,116,116,116,291,291,116,116,116,116,116,116,116,287,116,
-287,287,288,288,116,116,292,292,292,292,292,292,292,292,292,292,
-116,287,287,116,116,116,116,116,116,116,116,116,116,116,116,116,
+305,306,307,307,308,305,305,305,305,305,305,305,305,120,305,305,
+305,120,305,305,305,305,305,305,305,305,305,305,305,305,305,305,
+305,305,305,305,305,305,305,305,305,120,305,305,305,305,305,305,
+305,305,305,305,120,305,305,305,305,305,120,120,306,305,307,306,
+307,307,309,307,307,120,306,307,307,120,307,307,306,306,120,120,
+120,120,120,120,120,309,309,120,120,120,120,120,120,120,305,120,
+305,305,306,306,120,120,310,310,310,310,310,310,310,310,310,310,
+120,305,305,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 26 */
-293,293,294,294,116,295,295,295,295,295,295,295,295,116,295,295,
-295,116,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,295,295,295,295,295,293,293,295,296,294,
-294,293,293,293,293,116,294,294,294,116,294,294,294,293,297,298,
-116,116,116,116,295,295,295,296,299,299,299,299,299,299,299,295,
-295,295,293,293,116,116,300,300,300,300,300,300,300,300,300,300,
-299,299,299,299,299,299,299,299,299,298,295,295,295,295,295,295,
+311,311,312,312,120,313,313,313,313,313,313,313,313,120,313,313,
+313,120,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,311,311,313,314,312,
+312,311,311,311,311,120,312,312,312,120,312,312,312,311,315,316,
+120,120,120,120,313,313,313,314,317,317,317,317,317,317,317,313,
+313,313,311,311,120,120,318,318,318,318,318,318,318,318,318,318,
+317,317,317,317,317,317,317,317,317,316,313,313,313,313,313,313,
 
 /* block 27 */
-116,116,301,301,116,302,302,302,302,302,302,302,302,302,302,302,
-302,302,302,302,302,302,302,116,116,116,302,302,302,302,302,302,
-302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,
-302,302,116,302,302,302,302,302,302,302,302,302,116,302,116,116,
-302,302,302,302,302,302,302,116,116,116,303,116,116,116,116,304,
-301,301,303,303,303,116,303,116,301,301,301,301,301,301,301,304,
-116,116,116,116,116,116,305,305,305,305,305,305,305,305,305,305,
-116,116,301,301,306,116,116,116,116,116,116,116,116,116,116,116,
+120,120,319,319,120,320,320,320,320,320,320,320,320,320,320,320,
+320,320,320,320,320,320,320,120,120,120,320,320,320,320,320,320,
+320,320,320,320,320,320,320,320,320,320,320,320,320,320,320,320,
+320,320,120,320,320,320,320,320,320,320,320,320,120,320,120,120,
+320,320,320,320,320,320,320,120,120,120,321,120,120,120,120,322,
+319,319,321,321,321,120,321,120,319,319,319,319,319,319,319,322,
+120,120,120,120,120,120,323,323,323,323,323,323,323,323,323,323,
+120,120,319,319,324,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 28 */
-116,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,
-307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,
-307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,
-307,308,307,309,308,308,308,308,308,308,308,116,116,116,116,  5,
-307,307,307,307,307,307,310,308,308,308,308,308,308,308,308,311,
-312,312,312,312,312,312,312,312,312,312,311,311,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+120,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,
+325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,
+325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,
+325,326,325,327,326,326,326,326,326,326,326,120,120,120,120,  6,
+325,325,325,325,325,325,328,326,326,326,326,326,326,326,326,329,
+330,330,330,330,330,330,330,330,330,330,329,329,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 29 */
-116,313,313,116,313,116,116,313,313,116,313,116,116,313,116,116,
-116,116,116,116,313,313,313,313,116,313,313,313,313,313,313,313,
-116,313,313,313,116,313,116,313,116,116,313,313,116,313,313,313,
-313,314,313,315,314,314,314,314,314,314,116,314,314,313,116,116,
-313,313,313,313,313,116,316,116,314,314,314,314,314,314,116,116,
-317,317,317,317,317,317,317,317,317,317,116,116,313,313,313,313,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+120,331,331,120,331,120,331,331,331,331,331,120,331,331,331,331,
+331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,
+331,331,331,331,120,331,120,331,331,331,331,331,331,331,331,331,
+331,332,331,333,332,332,332,332,332,332,332,332,332,331,120,120,
+331,331,331,331,331,120,334,120,332,332,332,332,332,332,120,120,
+335,335,335,335,335,335,335,335,335,335,120,120,331,331,331,331,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 30 */
-318,319,319,319,320,320,320,320,320,320,320,320,320,320,320,320,
-320,320,320,319,320,319,319,319,321,321,319,319,319,319,319,319,
-322,322,322,322,322,322,322,322,322,322,323,323,323,323,323,323,
-323,323,323,323,319,321,319,321,319,321,324,325,324,325,326,326,
-318,318,318,318,318,318,318,318,116,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,116,116,116,
-116,321,321,321,321,321,321,321,321,321,321,321,321,321,321,326,
+336,337,337,337,338,338,338,338,338,338,338,338,338,338,338,338,
+338,338,338,337,338,337,337,337,339,339,337,337,337,337,337,337,
+340,340,340,340,340,340,340,340,340,340,341,341,341,341,341,341,
+341,341,341,341,337,339,337,339,337,339,342,343,342,343,344,344,
+336,336,336,336,336,336,336,336,120,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,
+336,336,336,336,336,336,336,336,336,336,336,336,336,120,120,120,
+120,339,339,339,339,339,339,339,339,339,339,339,339,339,339,344,
 
 /* block 31 */
-321,321,321,321,321,320,321,321,318,318,318,318,318,321,321,321,
-321,321,321,321,321,321,321,321,116,321,321,321,321,321,321,321,
-321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,
-321,321,321,321,321,321,321,321,321,321,321,321,321,116,319,319,
-319,319,319,319,319,319,321,319,319,319,319,319,319,116,319,319,
-320,320,320,320,320, 19, 19, 19, 19,320,320,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+339,339,339,339,339,338,339,339,336,336,336,336,336,339,339,339,
+339,339,339,339,339,339,339,339,120,339,339,339,339,339,339,339,
+339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
+339,339,339,339,339,339,339,339,339,339,339,339,339,120,337,337,
+337,337,337,337,337,337,339,337,337,337,337,337,337,120,337,337,
+338,338,338,338,338, 20, 20, 20, 20,338,338,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 32 */
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-327,327,327,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,329,329,329,
-329,330,329,329,329,329,329,329,328,329,329,330,330,329,329,327,
-331,331,331,331,331,331,331,331,331,331,332,332,332,332,332,332,
-327,327,327,327,327,327,330,330,329,329,327,327,327,327,329,329,
-329,327,328,328,328,327,327,328,328,328,328,328,328,328,327,327,
-327,329,329,329,329,327,327,327,327,327,327,327,327,327,327,327,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+345,345,345,345,345,345,345,345,345,345,345,346,346,347,347,347,
+347,348,347,347,347,347,347,347,346,347,347,348,348,347,347,345,
+349,349,349,349,349,349,349,349,349,349,350,350,350,350,350,350,
+345,345,345,345,345,345,348,348,347,347,345,345,345,345,347,347,
+347,345,346,346,346,345,345,346,346,346,346,346,346,346,345,345,
+345,347,347,347,347,345,345,345,345,345,345,345,345,345,345,345,
 
 /* block 33 */
-327,327,329,328,330,329,329,328,328,328,328,328,328,329,327,328,
-331,331,331,331,331,331,331,331,331,331,328,328,328,329,333,333,
-334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,
-334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,
-334,334,334,334,334,334,116,334,116,116,116,116,116,334,116,116,
-335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
-335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,
-335,335,335,335,335,335,335,335,335,335,335,  4,336,335,335,335,
+345,345,347,346,348,347,347,346,346,346,346,346,346,347,345,346,
+351,351,351,351,351,351,351,351,351,351,346,346,346,347,352,352,
+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,120,353,120,120,120,120,120,353,120,120,
+354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,
+354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,
+354,354,354,354,354,354,354,354,354,354,354,355,356,354,354,354,
 
 /* block 34 */
-337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
-337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
-337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
-337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
-337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
-337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
-338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,
-338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,
+357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
+357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
+357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
+357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
+357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
+357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
+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,358,
 
 /* block 35 */
-338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,
-338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,
-338,338,338,338,338,338,338,338,339,339,339,339,339,339,339,339,
-339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
-339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
-339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
-339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
-339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
+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,358,
+358,358,358,358,358,358,358,358,359,359,359,359,359,359,359,359,
+359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,
+359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,
+359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,
+359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,
+359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,
 
 /* block 36 */
-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,340,340,340,340,340,340,340,340,340,340,340,340,
-340,340,340,340,340,340,340,340,340,116,340,340,340,340,116,116,
-340,340,340,340,340,340,340,116,340,116,340,340,340,340,116,116,
-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,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,120,360,360,360,360,120,120,
+360,360,360,360,360,360,360,120,360,120,360,360,360,360,120,120,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
 
 /* block 37 */
-340,340,340,340,340,340,340,340,340,116,340,340,340,340,116,116,
-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,116,340,340,340,340,116,116,340,340,340,340,340,340,340,116,
-340,116,340,340,340,340,116,116,340,340,340,340,340,340,340,340,
-340,340,340,340,340,340,340,116,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,
+360,360,360,360,360,360,360,360,360,120,360,360,360,360,120,120,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,120,360,360,360,360,120,120,360,360,360,360,360,360,360,120,
+360,120,360,360,360,360,120,120,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,120,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
 
 /* block 38 */
-340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,
-340,116,340,340,340,340,116,116,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,340,340,340,340,
-340,340,340,340,340,340,340,340,340,340,340,116,116,341,341,341,
-342,342,342,342,342,342,342,342,342,343,343,343,343,343,343,343,
-343,343,343,343,343,343,343,343,343,343,343,343,343,116,116,116,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,120,360,360,360,360,120,120,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,360,360,360,360,120,120,361,361,361,
+362,362,362,362,362,362,362,362,362,363,363,363,363,363,363,363,
+363,363,363,363,363,363,363,363,363,363,363,363,363,120,120,120,
 
 /* block 39 */
-340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,
-344,344,344,344,344,344,344,344,344,344,116,116,116,116,116,116,
-345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
-345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
-345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
-345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
-345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
-346,346,346,346,346,346,116,116,347,347,347,347,347,347,116,116,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+364,364,364,364,364,364,364,364,364,364,120,120,120,120,120,120,
+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,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,
+366,366,366,366,366,366,120,120,367,367,367,367,367,367,120,120,
 
 /* block 40 */
-348,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
+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,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,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,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 41 */
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
+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,
+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,
+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,
+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 42 */
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,350,350,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
+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,
+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,
+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,
+369,369,369,369,369,369,369,369,369,369,369,369,369,370,371,369,
+369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,
 
 /* block 43 */
-351,352,352,352,352,352,352,352,352,352,352,352,352,352,352,352,
-352,352,352,352,352,352,352,352,352,352,352,353,354,116,116,116,
-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,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,355,355,
-355,355,355,355,355,355,355,355,355,355,355,  4,  4,  4,356,356,
-356,355,355,355,355,355,355,355,355,116,116,116,116,116,116,116,
+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,374,375,120,120,120,
+376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,
+376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,
+376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,
+376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,
+376,376,376,376,376,376,376,376,376,376,376,  5,  5,  5,377,377,
+377,376,376,376,376,376,376,376,376,120,120,120,120,120,120,120,
 
 /* block 44 */
-357,357,357,357,357,357,357,357,357,357,357,357,357,116,357,357,
-357,357,358,358,358,116,116,116,116,116,116,116,116,116,116,116,
-359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,
-359,359,360,360,360,  4,  4,116,116,116,116,116,116,116,116,116,
-361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,
-361,361,362,362,116,116,116,116,116,116,116,116,116,116,116,116,
-363,363,363,363,363,363,363,363,363,363,363,363,363,116,363,363,
-363,116,364,364,116,116,116,116,116,116,116,116,116,116,116,116,
+378,378,378,378,378,378,378,378,378,378,378,378,378,120,378,378,
+378,378,379,379,379,120,120,120,120,120,120,120,120,120,120,120,
+380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,
+380,380,381,381,381,382,382,120,120,120,120,120,120,120,120,120,
+383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,
+383,383,384,384,120,120,120,120,120,120,120,120,120,120,120,120,
+385,385,385,385,385,385,385,385,385,385,385,385,385,120,385,385,
+385,120,386,386,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 45 */
-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,365,365,365,365,
-365,365,365,365,366,366,367,366,366,366,366,366,366,366,367,367,
-367,367,367,367,367,367,366,367,367,366,366,366,366,366,366,366,
-366,366,366,366,368,368,368,369,368,368,368,370,365,366,116,116,
-371,371,371,371,371,371,371,371,371,371,116,116,116,116,116,116,
-372,372,372,372,372,372,372,372,372,372,116,116,116,116,116,116,
+387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
+387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
+387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
+387,387,387,387,388,388,389,388,388,388,388,388,388,388,389,389,
+389,389,389,389,389,389,388,389,389,388,388,388,388,388,388,388,
+388,388,388,388,390,390,390,391,390,390,390,392,387,388,120,120,
+393,393,393,393,393,393,393,393,393,393,120,120,120,120,120,120,
+394,394,394,394,394,394,394,394,394,394,120,120,120,120,120,120,
 
 /* block 46 */
-373,373,  4,  4,373,  4,374,373,373,373,373,375,375,375,376,116,
-377,377,377,377,377,377,377,377,377,377,116,116,116,116,116,116,
-378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,
-378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,
-378,378,378,379,378,378,378,378,378,378,378,378,378,378,378,378,
-378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,
-378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,
-378,378,378,378,378,378,378,378,378,116,116,116,116,116,116,116,
+395,395,396,396,395,396,397,395,395,395,395,398,398,398,399,120,
+400,400,400,400,400,400,400,400,400,400,120,120,120,120,120,120,
+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,401,401,
+401,401,401,402,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,401,401,401,401,401,401,401,401,401,401,401,401,401,401,
+401,401,401,401,401,401,401,401,401,120,120,120,120,120,120,120,
 
 /* block 47 */
-378,378,378,378,378,375,375,378,378,378,378,378,378,378,378,378,
-378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,
-378,378,378,378,378,378,378,378,378,375,378,116,116,116,116,116,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,
-349,349,349,349,349,349,116,116,116,116,116,116,116,116,116,116,
+401,401,401,401,401,398,398,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,401,401,401,401,398,401,120,120,120,120,120,
+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,
+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,
+369,369,369,369,369,369,120,120,120,120,120,120,120,120,120,120,
 
 /* block 48 */
-380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,
-380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,116,
-381,381,381,382,382,382,382,381,381,382,382,382,116,116,116,116,
-382,382,381,382,382,382,382,382,382,381,381,381,116,116,116,116,
-383,116,116,116,384,384,385,385,385,385,385,385,385,385,385,385,
-386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,
-386,386,386,386,386,386,386,386,386,386,386,386,386,386,116,116,
-386,386,386,386,386,116,116,116,116,116,116,116,116,116,116,116,
+403,403,403,403,403,403,403,403,403,403,403,403,403,403,403,403,
+403,403,403,403,403,403,403,403,403,403,403,403,403,403,403,120,
+404,404,404,405,405,405,405,404,404,405,405,405,120,120,120,120,
+405,405,404,405,405,405,405,405,405,404,404,404,120,120,120,120,
+406,120,120,120,407,407,408,408,408,408,408,408,408,408,408,408,
+409,409,409,409,409,409,409,409,409,409,409,409,409,409,409,409,
+409,409,409,409,409,409,409,409,409,409,409,409,409,409,120,120,
+409,409,409,409,409,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 49 */
-387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
-387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
-387,387,387,387,387,387,387,387,387,387,387,387,116,116,116,116,
-387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,
-387,387,387,387,387,387,387,387,387,387,116,116,116,116,116,116,
-388,388,388,388,388,388,388,388,388,388,389,116,116,116,390,390,
-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,
+410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,
+410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,
+410,410,410,410,410,410,410,410,410,410,410,410,120,120,120,120,
+410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,
+410,410,410,410,410,410,410,410,410,410,120,120,120,120,120,120,
+411,411,411,411,411,411,411,411,411,411,412,120,120,120,413,413,
+414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,
+414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,
 
 /* block 50 */
-392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,
-392,392,392,392,392,392,392,393,393,394,394,393,116,116,395,395,
-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,396,396,396,396,396,396,396,396,396,396,396,396,
-396,396,396,396,396,397,398,397,398,398,398,398,398,398,398,116,
-398,399,398,399,399,398,398,398,398,398,398,398,398,397,397,397,
-397,397,397,398,398,398,398,398,398,398,398,398,398,116,116,398,
+415,415,415,415,415,415,415,415,415,415,415,415,415,415,415,415,
+415,415,415,415,415,415,415,416,416,417,417,416,120,120,418,418,
+419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
+419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
+419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,
+419,419,419,419,419,420,421,420,421,421,421,421,421,421,421,120,
+421,422,421,422,422,421,421,421,421,421,421,421,421,420,420,420,
+420,420,420,421,421,421,421,421,421,421,421,421,421,120,120,421,
 
 /* block 51 */
-400,400,400,400,400,400,400,400,400,400,116,116,116,116,116,116,
-400,400,400,400,400,400,400,400,400,400,116,116,116,116,116,116,
-401,401,401,401,401,401,401,402,401,401,401,401,401,401,116,116,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,403,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+423,423,423,423,423,423,423,423,423,423,120,120,120,120,120,120,
+423,423,423,423,423,423,423,423,423,423,120,120,120,120,120,120,
+424,424,424,424,424,424,424,425,424,424,424,424,424,424,120,120,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,426,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 52 */
-404,404,404,404,405,406,406,406,406,406,406,406,406,406,406,406,
-406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,
-406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,
-406,406,406,406,404,405,404,404,404,404,404,405,404,405,405,405,
-405,405,404,405,405,406,406,406,406,406,406,406,116,116,116,116,
-407,407,407,407,407,407,407,407,407,407,408,408,408,408,408,408,
-408,409,409,409,409,409,409,409,409,409,409,404,404,404,404,404,
-404,404,404,404,409,409,409,409,409,409,409,409,409,116,116,116,
+427,427,427,427,428,429,429,429,429,429,429,429,429,429,429,429,
+429,429,429,429,429,429,429,429,429,429,429,429,429,429,429,429,
+429,429,429,429,429,429,429,429,429,429,429,429,429,429,429,429,
+429,429,429,429,427,430,427,427,427,427,427,428,427,428,428,428,
+428,428,427,428,428,429,429,429,429,429,429,429,120,120,120,120,
+431,431,431,431,431,431,431,431,431,431,432,432,432,432,432,432,
+432,433,433,433,433,433,433,433,433,433,433,427,427,427,427,427,
+427,427,427,427,433,433,433,433,433,433,433,433,433,120,120,120,
 
 /* block 53 */
-410,410,411,412,412,412,412,412,412,412,412,412,412,412,412,412,
-412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,
-412,411,410,410,410,410,411,411,410,410,411,410,410,410,412,412,
-413,413,413,413,413,413,413,413,413,413,412,412,412,412,412,412,
-414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,
-414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,
-414,414,414,414,414,414,415,416,415,415,416,416,416,415,416,415,
-415,415,416,416,116,116,116,116,116,116,116,116,417,417,417,417,
+434,434,435,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,435,434,434,434,434,435,435,434,434,435,434,434,434,436,436,
+437,437,437,437,437,437,437,437,437,437,436,436,436,436,436,436,
+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,438,438,
+438,438,438,438,438,438,439,440,439,439,440,440,440,439,440,439,
+439,439,440,440,120,120,120,120,120,120,120,120,441,441,441,441,
 
 /* block 54 */
-418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,
-418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,
-418,418,418,418,419,419,419,419,419,419,419,419,420,420,420,420,
-420,420,420,420,419,419,420,420,116,116,116,421,421,421,421,421,
-422,422,422,422,422,422,422,422,422,422,116,116,116,418,418,418,
-423,423,423,423,423,423,423,423,423,423,424,424,424,424,424,424,
-424,424,424,424,424,424,424,424,424,424,424,424,424,424,424,424,
-424,424,424,424,424,424,424,424,425,425,425,425,425,425,426,426,
+442,442,442,442,442,442,442,442,442,442,442,442,442,442,442,442,
+442,442,442,442,442,442,442,442,442,442,442,442,442,442,442,442,
+442,442,442,442,443,443,443,443,443,443,443,443,444,444,444,444,
+444,444,444,444,443,443,444,444,120,120,120,445,445,445,445,445,
+446,446,446,446,446,446,446,446,446,446,120,120,120,442,442,442,
+447,447,447,447,447,447,447,447,447,447,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,449,449,449,449,449,449,450,450,
 
 /* block 55 */
-427,428,429,430,431,432,433,434,435,116,116,116,116,116,116,116,
-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,116,116,436,436,436,
-437,437,437,437,437,437,437,437,116,116,116,116,116,116,116,116,
-111,111,111,  4,111,111,111,111,111,111,111,111,111,111,111,111,
-111,438,111,111,111,111,111,111,111,439,439,439,439,111,439,439,
-439,439,438,438,111,439,439,438,111,111,116,116,116,116,116,116,
+451,452,453,454,455,456,457,458,459,120,120,120,120,120,120,120,
+460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,
+460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,
+460,460,460,460,460,460,460,460,460,460,460,120,120,460,460,460,
+461,461,461,461,461,461,461,461,120,120,120,120,120,120,120,120,
+462,463,462,464,463,465,465,466,465,466,467,463,466,466,463,463,
+466,468,463,463,463,463,463,463,463,469,470,471,471,465,471,471,
+471,471,472,473,474,470,470,475,476,476,477,120,120,120,120,120,
 
 /* block 56 */
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 34, 34,124,124,124,124,124,440,108,108,108,108,
-108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
-108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
-108,108,108,108,108,108,108,108,108,108,108,108,108,117,117,117,
-117,117,108,108,108,108,117,117,117,117,117, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 34, 34, 34, 34,441,442, 34, 34, 34,443, 34, 34,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35,128,128,128,128,128,478,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,121,121,121,
+121,121,110,110,110,110,121,121,121,121,121, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,479,480, 35, 35, 35,481, 35, 35,
 
 /* block 57 */
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,108,108,108,108,108,
-108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
-108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,117,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,116,111,111,111,111,111,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,482, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
+110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,121,
+114,114,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,120,113,113,113,113,113,
 
 /* block 58 */
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
-444,445, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+483,484, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
 
 /* block 59 */
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 34, 34, 34, 34, 34,446, 34, 34,447, 34,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 35, 35, 35, 35, 35,485, 35, 35,486, 35,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
 
 /* block 60 */
-448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449,
-448,448,448,448,448,448,116,116,449,449,449,449,449,449,116,116,
-448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449,
-448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449,
-448,448,448,448,448,448,116,116,449,449,449,449,449,449,116,116,
-124,448,124,448,124,448,124,448,116,449,116,449,116,449,116,449,
-448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449,
-450,450,451,451,451,451,452,452,453,453,454,454,455,455,116,116,
+487,487,487,487,487,487,487,487,488,488,488,488,488,488,488,488,
+487,487,487,487,487,487,120,120,488,488,488,488,488,488,120,120,
+487,487,487,487,487,487,487,487,488,488,488,488,488,488,488,488,
+487,487,487,487,487,487,487,487,488,488,488,488,488,488,488,488,
+487,487,487,487,487,487,120,120,488,488,488,488,488,488,120,120,
+128,487,128,487,128,487,128,487,120,488,120,488,120,488,120,488,
+487,487,487,487,487,487,487,487,488,488,488,488,488,488,488,488,
+489,489,490,490,490,490,491,491,492,492,493,493,494,494,120,120,
 
 /* block 61 */
-448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456,
-448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456,
-448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456,
-448,448,124,457,124,116,124,124,449,449,458,458,459,115,460,115,
-115,115,124,457,124,116,124,124,461,461,461,461,459,115,115,115,
-448,448,124,124,116,116,124,124,449,449,462,462,116,115,115,115,
-448,448,124,124,124,165,124,124,449,449,463,463,170,115,115,115,
-116,116,124,457,124,116,124,124,464,464,465,465,459,115,115,116,
+487,487,487,487,487,487,487,487,495,495,495,495,495,495,495,495,
+487,487,487,487,487,487,487,487,495,495,495,495,495,495,495,495,
+487,487,487,487,487,487,487,487,495,495,495,495,495,495,495,495,
+487,487,128,496,128,120,128,128,488,488,497,497,498,119,499,119,
+119,119,128,496,128,120,128,128,500,500,500,500,498,119,119,119,
+487,487,128,128,120,120,128,128,488,488,501,501,120,119,119,119,
+487,487,128,128,128,169,128,128,488,488,502,502,174,119,119,119,
+120,120,128,496,128,120,128,128,503,503,504,504,498,119,119,120,
 
 /* block 62 */
-  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3, 23,466,467, 23, 23,
 9,  9,  9,  9,  9,  9,  4,  4, 22, 26,  6, 22, 22, 26,  6, 22,
-  4,  4,  4,  4,  4,  4,  4,  4,468,469, 23, 23, 23, 23, 23,  3,
-  4,  4,  4,  4,  4,  4,  4,  4,  4, 22, 26,  4,470,  4,  4, 15,
- 15,  4,  4,  4,  8,  6,  7,  4,  4,470,  4,  4,  4,  4,  4,  4,
-  4,  4,  8,  4, 15,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  3,
- 23, 23, 23, 23, 23,471, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 24,108,116,116, 24, 24, 24, 24, 24, 24,  8,  8,  8,  6,  7,108,
+  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4, 24,505,506, 24, 24,
10, 10, 10, 10, 10, 10,  5,  5, 23, 27,  7, 23, 23, 27,  7, 23,
+  5,  5,  5,  5,  5,  5,  5,  5,507,508, 24, 24, 24, 24, 24,509,
+  5,  5,  5,  5,  5,  5,  5,  5,  5, 23, 27,  5,510,  5,  5, 16,
+ 16,  5,  5,  5,  9,  7,  8,  5,  5,510,  5,  5,  5,  5,  5,  5,
+  5,  5,  9,  5, 16,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  4,
+ 24, 24, 24, 24, 24,511, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 25,110,120,120, 25, 25, 25, 25, 25, 25,  9,  9,  9,  7,  8,110,
 
 /* block 63 */
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,  8,  8,  8,  6,  7,116,
-108,108,108,108,108,108,108,108,108,108,108,108,108,116,116,116,
-  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,  5,  5,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-111,111,111,111,111,111,111,111,111,111,111,111,111,403,403,403,
-403,111,403,403,403,111,111,111,111,111,111,111,111,111,111,111,
-111,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,  9,  9,  9,  7,  8,120,
+110,110,110,110,110,110,110,110,110,110,110,110,110,120,120,120,
+  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
+  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+113,113,113,113,113,113,113,113,113,113,113,113,113,426,426,426,
+426,113,426,426,426,113,113,113,113,113,113,113,113,113,113,113,
+512,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 64 */
19, 19,472, 19, 19, 19, 19,472, 19, 19,473,472,472,472,473,473,
-472,472,472,473, 19,472, 19, 19,  8,472,472,472,472,472, 19, 19,
19, 19, 20, 19,472, 19,474, 19,472, 19,475,476,472,472, 19,473,
-472,472,477,472,473,439,439,439,439,478, 19, 19,473,473,472,472,
-  8,  8,  8,  8,  8,472,473,473,473,473, 19,  8, 19, 19,479, 19,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,
-481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,
20, 20,513, 20, 20, 20, 20,513, 20, 20,514,513,513,513,514,514,
+513,513,513,514, 20,513, 20, 20,  9,513,513,513,513,513, 20, 20,
20, 20, 21, 20,513, 20,515, 20,513, 20,516,517,513,513, 20,514,
+513,513,518,513,514,519,519,519,519,520, 20, 20,514,514,513,513,
+  9,  9,  9,  9,  9,513,514,514,514,514, 20,  9, 20, 20,521, 20,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
+523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
 
 /* block 65 */
-482,482,482, 31, 32,482,482,482,482, 24, 19, 19,116,116,116,116,
-  8,  8,  8,  8,483, 20, 20, 20, 20, 20,  8,  8, 19, 19, 19, 19,
-  8, 19, 19,  8, 19, 19,  8, 19, 19, 20, 20, 19, 19, 19,  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,  8,  8,
19, 19,  8, 19,  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,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
+524,524,524, 32, 33,524,524,524,524, 25, 20, 20,120,120,120,120,
+  9,  9,  9,  9,525, 21, 21, 21, 21, 21,  9,  9, 20, 20, 20, 20,
+  9, 20, 20,  9, 20, 20,  9, 20, 20, 21, 21, 20, 20, 20,  9, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,  9,  9,
20, 20,  9, 20,  9, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
 
 /* block 66 */
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
 
 /* block 67 */
19, 19, 19, 19, 19, 19, 19, 19,  6,  7,  6,  7, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 19, 19, 19, 19,
-  8,  8, 19, 19, 19, 19, 19, 19, 20,  6,  7, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 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, 19, 19, 19,
20, 20, 20, 20, 20, 20, 20, 20,  7,  8,  7,  8, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 20, 20, 20, 20,
+  9,  9, 20, 20, 20, 20, 20, 20, 21,  7,  8, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,  9, 20, 20, 20,
 
 /* block 68 */
19, 19, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  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, 20,
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, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 19, 19, 19, 19, 20, 20, 20, 19, 19, 19, 19, 19,
20, 20, 20, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,  9,  9,  9,  9,
+  9,  9, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 20, 20, 20, 20, 21, 21, 21, 20, 20, 20, 20, 20,
 
 /* 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,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
 
 /* block 70 */
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19,484,484,484,484,484,484,484,484,484,484,
-484,484,485,484,484,484,484,484,484,484,484,484,484,484,484,484,
-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, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20,526,526,526,526,526,526,526,526,526,526,
+526,526,527,526,526,526,526,526,526,526,526,526,526,526,526,526,
+528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,
+528,528,528,528,528,528,528,528,528,528, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
 
 /* block 71 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 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 72 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 20,  8, 19, 19, 19, 19, 19, 19, 19, 19,
- 20,  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, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,  8,  8,  8,483,483,483,483,  8,
-
-/* block 73 */
- 20, 20, 20, 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,483,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-
-/* block 74 */
- 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+
+/* block 72 */
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 21,  9, 20, 20, 20, 20, 20, 20, 20, 20,
+ 21,  9, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20,  9,  9,  9,525,525,525,525,  9,
+
+/* block 73 */
+ 21, 21, 21, 21, 21, 21, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,525,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+
+/* block 74 */
+ 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
 
 /* block 75 */
- 20, 20, 20, 20, 20, 20, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 19, 20, 19, 20, 19, 19, 19, 19, 19, 19, 20, 19, 19,
19, 20, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 20, 19, 19, 20, 19, 19, 19, 19, 20, 19, 20, 19,
19, 19, 19, 20, 20, 20, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 20, 20, 20, 20, 20,  6,  7,  6,  7,  6,  7,  6,  7,
-  6,  7,  6,  7,  6,  7, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 21, 21, 21, 21, 21, 21, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 20, 21, 20, 21, 20, 20, 20, 20, 20, 20, 21, 20, 20,
20, 21, 20, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 21, 20, 20, 21, 20, 20, 20, 20, 21, 20, 21, 20,
20, 20, 20, 21, 21, 21, 20, 21, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 21, 21, 21, 21, 21,  7,  8,  7,  8,  7,  8,  7,  8,
+  7,  8,  7,  8,  7,  8, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
 
 /* block 76 */
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 19, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19,
19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20,
-  8,  8,  8,  8,  8,  6,  7,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  6,  7,  6,  7,  6,  7,  6,  7,  6,  7,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 20, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20,
20, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,
+  9,  9,  9,  9,  9,  7,  8,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  7,  8,  7,  8,  7,  8,  7,  8,  7,  8,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
 
 /* block 77 */
-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,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,487,487,
-487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,
+529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,
+529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,
+529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,
+529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,
+529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,
+529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,
+529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,
+529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,
 
 /* block 78 */
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,483,483,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,525,525,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
 
 /* block 79 */
-  8,  8,  8,  6,  7,  6,  7,  6,  7,  6,  7,  6,  7,  6,  7,  6,
-  7,  6,  7,  6,  7,  6,  7,  6,  7,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  6,  7,  6,  7,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  6,  7,  8,  8,
+  9,  9,  9,  7,  8,  7,  8,  7,  8,  7,  8,  7,  8,  7,  8,  7,
+  8,  7,  8,  7,  8,  7,  8,  7,  8,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  7,  8,  7,  8,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  7,  8,  9,  9,
 
 /* block 80 */
19, 19, 19, 19, 19, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 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,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8, 19, 19,  8,  8,  8,  8,  8,  8, 19, 19, 19,
- 20, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
20, 20, 20, 20, 20, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
+  9,  9,  9,  9,  9, 20, 20,  9,  9,  9,  9,  9,  9, 20, 20, 20,
+ 21, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20,120,120, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 
 /* block 81 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19,116, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20,120,120, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 
 /* block 82 */
-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,488,488,488,488,488,488,488,116,
-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,489,489,489,489,489,489,489,116,
- 31, 32,490,491,492,493,494, 31, 32, 31, 32, 31, 32,495,496,497,
-498, 34, 31, 32, 34, 31, 32, 34, 34, 34, 34, 34,108,108,499,499,
+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,120,
+531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,
+531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,
+531,531,531,531,531,531,531,531,531,531,531,531,531,531,531,120,
+ 32, 33,532,533,534,535,536, 32, 33, 32, 33, 32, 33,537,538,539,
+540, 35, 32, 33, 35, 32, 33, 35, 35, 35, 35, 35,110,110,541,541,
 
 /* block 83 */
-161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162,
-161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162,
-161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162,
-161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162,
-161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162,
-161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162,
-161,162,161,162,500,501,501,501,501,501,501,161,162,161,162,502,
-502,502,161,162,116,116,116,116,116,503,503,503,503,504,503,503,
+165,166,165,166,165,166,165,166,165,166,165,166,165,166,165,166,
+165,166,165,166,165,166,165,166,165,166,165,166,165,166,165,166,
+165,166,165,166,165,166,165,166,165,166,165,166,165,166,165,166,
+165,166,165,166,165,166,165,166,165,166,165,166,165,166,165,166,
+165,166,165,166,165,166,165,166,165,166,165,166,165,166,165,166,
+165,166,165,166,165,166,165,166,165,166,165,166,165,166,165,166,
+165,166,165,166,542,543,543,543,543,543,543,165,166,165,166,544,
+544,544,165,166,120,120,120,120,120,545,545,545,545,546,545,545,
 
 /* block 84 */
-505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,
-505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,
-505,505,505,505,505,505,116,505,116,116,116,116,116,505,116,116,
-506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,
-506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,
-506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,
-506,506,506,506,506,506,506,506,116,116,116,116,116,116,116,507,
-508,116,116,116,116,116,116,116,116,116,116,116,116,116,116,509,
+547,547,547,547,547,547,547,547,547,547,547,547,547,547,547,547,
+547,547,547,547,547,547,547,547,547,547,547,547,547,547,547,547,
+547,547,547,547,547,547,120,547,120,120,120,120,120,547,120,120,
+548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,
+548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,
+548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,
+548,548,548,548,548,548,548,548,120,120,120,120,120,120,120,549,
+550,120,120,120,120,120,120,120,120,120,120,120,120,120,120,551,
 
 /* block 85 */
-340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,
-340,340,340,340,340,340,340,116,116,116,116,116,116,116,116,116,
-340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116,
-340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116,
-340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116,
-340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116,
-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,193,193,193,193,193,
+360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,
+360,360,360,360,360,360,360,120,120,120,120,120,120,120,120,120,
+360,360,360,360,360,360,360,120,360,360,360,360,360,360,360,120,
+360,360,360,360,360,360,360,120,360,360,360,360,360,360,360,120,
+360,360,360,360,360,360,360,120,360,360,360,360,360,360,360,120,
+360,360,360,360,360,360,360,120,360,360,360,360,360,360,360,120,
+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,
 
 /* block 86 */
-  4,  4, 22, 26, 22, 26,  4,  4,  4, 22, 26,  4, 22, 26,  4,  4,
-  4,  4,  4,  4,  4,  4,  4,  9,  4,  4,  9,  4, 22, 26,  4,  4,
- 22, 26,  6,  7,  6,  7,  6,  7,  6,  7,  4,  4,  4,  4,  4,109,
-  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  9,  9,  4,  4,  4,  4,
 9,  4,  6,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+  5,  5, 23, 27, 23, 27,  5,  5,  5, 23, 27,  5, 23, 27,  5,  5,
+  5,  5,  5,  5,  5,  5,  5, 10,  5,  5, 10,  5, 23, 27,  5,  5,
+ 23, 27,  7,  8,  7,  8,  7,  8,  7,  8,  5,  5,  5,  5,  5,111,
+  5,  5,  5,  5,  5,  5,  5,  5,  5,  5, 10, 10,  5,  5,  5,  5,
10,  5,  7,553,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 87 */
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,116,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,116,116,116,116,116,116,116,116,116,116,116,116,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,120,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 88 */
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
 
 /* block 89 */
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,
-510,510,510,510,510,510,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,
+554,554,554,554,554,554,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,120,120,120,120,
 
 /* block 90 */
-  3,  4,  4,  4, 19,511,439,512,  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,512,512,512,512,512,512,512,512,512,111,111,111,111,513,513,
-514,109,109,109,109,109, 19, 19,512,512,512,511,439,470, 19, 19,
-116,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+  4,555,555,556, 20,557,558,559,560,561,560,561,560,561,560,561,
+560,561, 20,562,560,561,560,561,560,561,560,561,563,564,565,565,
20,559,559,559,559,559,559,559,559,559,566,566,566,566,567,567,
+568,569,569,569,569,569, 20,562,559,559,559,557,570,571,572,572,
+120,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
 
 /* block 91 */
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,116,116,111,111, 14, 14,516,516,515,
-  9,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,
-517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,
-517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,
-517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,
-517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,
-517,517,517,517,517,517,517,517,517,517,517,  4,109,518,518,517,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,120,120,574,574,575,575,576,576,573,
+577,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,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,578,578,578,578,578,578,578,578,578,578,555,569,579,579,578,
 
 /* block 92 */
-116,116,116,116,116,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,
-116,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,
-520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,
-520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,
-520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,
-520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,
+120,120,120,120,120,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,
+120,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 93 */
-520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,116,
- 19, 19, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-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,116,116,116,116,116,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,116,116,116,116,116,116,116,116,116,116,116,116,
-517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,
+581,581,581,581,581,581,581,581,581,581,581,581,581,581,581,120,
+572,572,582,582,582,582,572,572,572,572,572,572,572,572,572,572,
+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,120,120,120,120,120,
+572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,
+572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,
+572,572,572,572,120,120,120,120,120,120,120,120,120,120,120,120,
+578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,
 
 /* block 94 */
-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,521,521,521,116,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 24, 24, 24,
19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-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,521,521,521, 19,
+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,120,
+582,582,582,582,582,582,582,582,582,582,572,572,572,572,572,572,
+572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,
+572,572,572,572,572,572,572,572, 25, 25, 25, 25, 25, 25, 25, 25,
20, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+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, 20,
 
 /* block 95 */
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 20, 19, 20, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
-522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
-522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,116,
+582,582,582,582,582,582,582,582,582,582,572,572,572,572,572,572,
+572,572,572,572,572,572,572,584,572,584,572,572,572,572,572,572,
+572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,
+572, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+572,572,572,572,572,572,572,572,572,572,572,572, 20, 20, 20, 20,
+585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,
+585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,
+585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,572,
 
 /* block 96 */
-522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
-522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
-522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
-522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
-522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,
-522,522,522,522,522,522,522,522, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,
+585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,
+585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,
+585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,
+585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,585,
+585,585,585,585,585,585,585,585,572,572,572,572,572,572,572,572,
+572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,
+572, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,572,572,572,572,572,
 
 /* block 97 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,572,
+572,572,572,572,572,572,572,572,572,572,572,572,572,572,572, 20,
 
 /* block 98 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,116,116,116,116,116,116,116,116,116,116,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+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 99 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+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,120,120,120,120,120,120,120,120,120,120,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 
 /* block 100 */
-524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,
-524,524,524,524,524,525,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,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,
-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,524,524,524,
-524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,
+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,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 101 */
-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,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,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,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,524,524,524,524,524,524,524,524,524,524,524,524,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
+587,587,587,587,587,588,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,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,587,587,
+587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,
 
 /* block 102 */
-524,524,524,524,524,524,524,524,524,524,524,524,524,116,116,116,
-526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,
-526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,
-526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,
-526,526,526,526,526,526,526,116,116,116,116,116,116,116,116,116,
-527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,
-527,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,529,529,
+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,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,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,
 
 /* block 103 */
-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,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,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,
+587,587,587,587,587,587,587,587,587,587,587,587,587,120,120,120,
+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,589,
+589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,
+589,589,589,589,589,589,589,120,120,120,120,120,120,120,120,120,
+590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,
+590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,590,
+590,590,590,590,590,590,590,590,591,591,591,591,591,591,592,592,
 
 /* block 104 */
-530,530,530,530,530,530,530,530,530,530,530,530,531,532,532,532,
-530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,
-533,533,533,533,533,533,533,533,533,533,530,530,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-188,189,188,189,188,189,188,189,188,189,534,535,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,536,193,
-194,194,194,537,193,193,193,193,193,193,193,193,193,193,537,441,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
 
 /* block 105 */
-188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,
-188,189,188,189,188,189,188,189,188,189,188,189,441,441,193,193,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,539,539,539,539,539,539,539,539,539,539,
-540,540,541,541,541,541,541,541,116,116,116,116,116,116,116,116,
+593,593,593,593,593,593,593,593,593,593,593,593,594,595,595,595,
+593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,
+596,596,596,596,596,596,596,596,596,596,593,593,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+192,193,192,193,192,193,192,193,192,193,597,598,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,599,198,
+200,200,200,600,552,552,552,552,552,552,552,552,552,552,600,479,
 
 /* block 106 */
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14,109,109,109,109,109,109,109,109,109,
- 14, 14, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 34, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
- 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
-108, 34, 34, 34, 34, 34, 34, 34, 34, 31, 32, 31, 32,542, 31, 32,
+192,193,192,193,192,193,192,193,192,193,192,193,192,193,192,193,
+192,193,192,193,192,193,192,193,192,193,192,193,479,479,552,552,
+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,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,601,601,601,601,601,601,601,601,601,601,601,601,
+601,601,601,601,601,601,602,602,602,602,602,602,602,602,602,602,
+603,603,604,604,604,604,604,604,120,120,120,120,120,120,120,120,
 
 /* block 107 */
31, 32, 31, 32, 31, 32, 31, 32,109, 14, 14, 31, 32,543, 34, 21,
31, 32, 31, 32, 34, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
31, 32, 31, 32, 31, 32, 31, 32, 31, 32,544,545,546,547,544, 34,
-548,549,550,551, 31, 32, 31, 32, 31, 32,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116, 21,108,108, 34, 21, 21, 21, 21, 21,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15,111,111,111,111,111,111,111,111,111,
15, 15, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 35, 35, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+110, 35, 35, 35, 35, 35, 35, 35, 35, 32, 33, 32, 33,605, 32, 33,
 
 /* block 108 */
-552,552,553,552,552,552,553,552,552,552,552,553,552,552,552,552,
-552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,
-552,552,552,554,554,553,553,554,555,555,555,555,116,116,116,116,
- 24, 24, 24, 24, 24, 24, 19, 19,  5, 19,116,116,116,116,116,116,
-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,557,557,557,557,116,116,116,116,116,116,116,116,
+ 32, 33, 32, 33, 32, 33, 32, 33,111, 15, 15, 32, 33,606, 35, 22,
+ 32, 33, 32, 33,607, 35, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+ 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,608,609,610,611,608, 35,
+612,613,614,615, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33, 32, 33,
+120,120, 32, 33,616,617,618,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120, 22,110,110, 35, 22, 22, 22, 22, 22,
 
 /* block 109 */
-558,558,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,558,558,558,558,558,558,558,558,558,558,558,558,
-558,558,558,558,560,560,116,116,116,116,116,116,116,116,561,561,
-562,562,562,562,562,562,562,562,562,562,116,116,116,116,116,116,
-240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
-240,240,242,242,242,242,242,242,244,244,244,242,244,242,242,240,
+619,619,620,619,619,619,620,619,619,619,619,620,619,619,619,619,
+619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,
+619,619,619,621,621,620,620,621,622,622,622,622,120,120,120,120,
+623,623,623,624,624,624,625,625,626,625,120,120,120,120,120,120,
+627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,
+627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,
+627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,
+627,627,627,627,628,628,628,628,120,120,120,120,120,120,120,120,
 
 /* block 110 */
-563,563,563,563,563,563,563,563,563,563,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,565,565,565,565,565,565,565,565,  4,566,
-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,568,568,568,568,568,
-568,568,569,569,116,116,116,116,116,116,116,116,116,116,116,570,
-337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,
-337,337,337,337,337,337,337,337,337,337,337,337,337,116,116,116,
+629,629,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,629,629,629,629,629,629,629,629,629,629,629,629,
+629,629,629,629,631,631,120,120,120,120,120,120,120,120,632,632,
+633,633,633,633,633,633,633,633,633,633,120,120,120,120,120,120,
+252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
+252,634,254,635,254,254,254,254,260,260,260,254,260,254,254,252,
 
 /* block 111 */
-571,571,571,572,573,573,573,573,573,573,573,573,573,573,573,573,
-573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
-573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
-573,573,573,571,572,572,571,571,571,571,572,572,571,572,572,572,
-572,574,574,574,574,574,574,574,574,574,574,574,574,574,116,109,
-575,575,575,575,575,575,575,575,575,575,116,116,116,116,574,574,
-327,327,327,327,327,329,576,327,327,327,327,327,327,327,327,327,
-331,331,331,331,331,331,331,331,331,331,327,327,327,327,327,116,
+636,636,636,636,636,636,636,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,638,638,638,638,638,638,638,638,639,640,
+641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,
+641,641,641,641,641,641,641,642,642,642,642,642,642,642,642,642,
+642,642,643,643,120,120,120,120,120,120,120,120,120,120,120,644,
+357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,
+357,357,357,357,357,357,357,357,357,357,357,357,357,120,120,120,
 
 /* block 112 */
-577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,
-577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,
-577,577,577,577,577,577,577,577,577,578,578,578,578,578,578,579,
-579,578,578,579,579,578,578,116,116,116,116,116,116,116,116,116,
-577,577,577,578,577,577,577,577,577,577,577,577,578,579,116,116,
-580,580,580,580,580,580,580,580,580,580,116,116,581,581,581,581,
-327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,
-576,327,327,327,327,327,327,333,333,333,327,328,329,328,327,327,
+645,645,645,646,647,647,647,647,647,647,647,647,647,647,647,647,
+647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,
+647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,
+647,647,647,645,646,646,645,645,645,645,646,646,645,645,646,646,
+646,648,648,648,648,648,648,648,648,648,648,648,648,648,120,649,
+650,650,650,650,650,650,650,650,650,650,120,120,120,120,648,648,
+345,345,345,345,345,347,651,345,345,345,345,345,345,345,345,345,
+351,351,351,351,351,351,351,351,351,351,345,345,345,345,345,120,
 
 /* block 113 */
-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,582,582,582,582,
-583,582,583,583,583,582,582,583,583,582,582,582,582,582,583,583,
-582,583,582,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,582,582,584,585,585,
-586,586,586,586,586,586,586,586,586,586,586,587,588,588,587,587,
-589,589,586,590,590,587,588,116,116,116,116,116,116,116,116,116,
+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,652,652,652,652,652,652,653,653,653,653,653,653,654,
+654,653,653,654,654,653,653,120,120,120,120,120,120,120,120,120,
+652,652,652,653,652,652,652,652,652,652,652,652,653,654,120,120,
+655,655,655,655,655,655,655,655,655,655,120,120,656,656,656,656,
+345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,
+651,345,345,345,345,345,345,352,352,352,345,346,347,346,345,345,
 
 /* block 114 */
-116,340,340,340,340,340,340,116,116,340,340,340,340,340,340,116,
-116,340,340,340,340,340,340,116,116,116,116,116,116,116,116,116,
-340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116,
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34,591, 34, 34, 34, 34, 34, 34, 34, 14,108,108,108,108,
- 34, 34, 34, 34, 34,124,116,116,116,116,116,116,116,116,116,116,
-592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,
+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,
+658,657,658,658,658,657,657,658,658,657,657,657,657,657,658,658,
+657,658,657,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,657,657,659,660,660,
+661,661,661,661,661,661,661,661,661,661,661,662,663,663,662,662,
+664,664,661,665,665,662,663,120,120,120,120,120,120,120,120,120,
 
 /* block 115 */
-592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,
-592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,
-592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,
-592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,
-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,587,587,588,587,587,588,587,587,589,587,588,116,116,
-593,593,593,593,593,593,593,593,593,593,116,116,116,116,116,116,
+120,360,360,360,360,360,360,120,120,360,360,360,360,360,360,120,
+120,360,360,360,360,360,360,120,120,120,120,120,120,120,120,120,
+360,360,360,360,360,360,360,120,360,360,360,360,360,360,360,120,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35,666, 35, 35, 35, 35, 35, 35, 35, 15,110,110,110,110,
+ 35, 35, 35, 35, 35,128, 35, 35,120,120,120,120,120,120,120,120,
+667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,
 
 /* block 116 */
-594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
+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,667,
+667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,
+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,661,661,661,661,661,661,661,
+661,661,661,662,662,663,662,662,663,662,662,664,662,663,120,120,
+668,668,668,668,668,668,668,668,668,668,120,120,120,120,120,120,
 
 /* block 117 */
-595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595,
+669,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,669,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,669,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+669,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
 
 /* block 118 */
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
+670,670,670,670,670,670,670,670,670,670,670,670,669,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,669,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+669,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,669,670,670,670,
 
 /* block 119 */
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,669,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+669,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,669,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
 
 /* block 120 */
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,669,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+669,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,669,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
 
 /* block 121 */
-595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,669,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+669,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,669,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
 
 /* block 122 */
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
+670,670,670,670,669,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+669,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,669,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,669,670,670,670,670,670,670,670,670,670,670,670,
 
 /* block 123 */
-595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595,
-595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,
-595,595,595,595,116,116,116,116,116,116,116,116,116,116,116,116,
-338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,
-338,338,338,338,338,338,338,116,116,116,116,339,339,339,339,339,
-339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
-339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,
-339,339,339,339,339,339,339,339,339,339,339,339,116,116,116,116,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+669,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,669,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,669,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
 
 /* block 124 */
-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,
-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,
-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,
-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,
+670,670,670,670,670,670,670,670,669,670,670,670,670,670,670,670,
+670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,
+670,670,670,670,120,120,120,120,120,120,120,120,120,120,120,120,
+358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,
+358,358,358,358,358,358,358,120,120,120,120,359,359,359,359,359,
+359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,
+359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,
+359,359,359,359,359,359,359,359,359,359,359,359,120,120,120,120,
 
 /* block 125 */
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
+671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
+671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
+671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
+671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
+671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
+671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
+671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
+671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
 
 /* block 126 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
 
 /* block 127 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+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,120,120,
+586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,
 
 /* block 128 */
- 34, 34, 34, 34, 34, 34, 34,116,116,116,116,116,116,116,116,116,
-116,116,116,200,200,200,200,200,116,116,116,116,116,208,205,208,
-208,208,208,208,208,208,208,208,208,598,208,208,208,208,208,208,
-208,208,208,208,208,208,208,116,208,208,208,208,208,116,208,116,
-208,208,116,208,208,116,208,208,208,208,208,208,208,208,208,208,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
+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,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 129 */
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,599,599,599,599,599,599,599,599,599,599,599,599,599,599,
-599,599,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
+ 35, 35, 35, 35, 35, 35, 35,120,120,120,120,120,120,120,120,120,
+120,120,120,206,206,206,206,206,120,120,120,120,120,215,212,215,
+215,215,215,215,215,215,215,215,215,673,215,215,215,215,215,215,
+215,215,215,215,215,215,215,120,215,215,215,215,215,120,215,120,
+215,215,120,215,215,120,215,215,215,215,215,215,215,215,215,215,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
 
 /* block 130 */
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,674,674,674,674,674,674,674,674,674,674,674,674,674,674,
+674,674,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
 
 /* block 131 */
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,  7,  6,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
 
 /* block 132 */
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-116,116,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-217,217,217,217,217,217,217,217,217,217,217,217,213,214,116,116,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,  8,  7,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
 
 /* block 133 */
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-  4,  4,  4,  4,  4,  4,  4,  6,  7,  4,116,116,116,116,116,116,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,193,193,
-  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,116,  4,  4,  4,  4,  9,  6,  7,  6,  7,  6,  7,  4,
-  4,  4,  8,  9,  8,  8,  8,116,  4,  5,  4,  4,116,116,116,116,
-217,217,217,217,217,116,217,217,217,217,217,217,217,217,217,217,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+120,120,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+225,225,675,225,225,225,225,225,225,225,225,225,220,676,120,120,
 
 /* block 134 */
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,116,116, 23,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+  5,  5,  5,  5,  5,  5,  5,  7,  8,  5,120,120,120,120,120,120,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,552,552,
+  5, 10, 10, 16, 16,  7,  8,  7,  8,  7,  8,  7,  8,  7,  8,  7,
+  8,  7,  8,  7,  8,556,556,  7,  8,  5,  5,  5,  5, 16, 16, 16,
+  5,  5,  5,120,  5,  5,  5,  5, 10,  7,  8,  7,  8,  7,  8,  5,
+  5,  5,  9, 10,  9,  9,  9,120,  5,  6,  5,  5,120,120,120,120,
+225,225,225,225,225,120,225,225,225,225,225,225,225,225,225,225,
 
 /* block 135 */
-116,  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,517,517,517,517,517,517,517,517,517,517,
-109,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,120,120, 24,
 
 /* block 136 */
-517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,
-517,517,517,517,517,517,517,517,517,517,517,517,517,517,600,600,
-520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,
-520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,116,
-116,116,520,520,520,520,520,520,116,116,520,520,520,520,520,520,
-116,116,520,520,520,520,520,520,116,116,520,520,520,116,116,116,
-  5,  5,  8, 14, 19,  5,  5,116, 19,  8,  8,  8,  8, 19, 19,116,
-471,471,471,471,471,471,471,471,471, 23, 23, 23, 19, 19,116,116,
+120,  5,  5,  5,  6,  5,  5,  5,  7,  8,  5,  9,  5, 10,  5,  5,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  5,  5,  9,  9,  9,  5,
+  5, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  7,  5,  8, 15, 16,
+ 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,  7,  9,  8,  9,  7,
+  8,555,560,561,555,555,578,578,578,578,578,578,578,578,578,578,
+569,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,
 
 /* block 137 */
-601,601,601,601,601,601,601,601,601,601,601,601,116,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,116,601,601,601,601,601,601,601,601,
-601,601,601,601,601,601,601,601,601,601,601,116,601,601,116,601,
-601,601,601,601,601,601,601,601,601,601,601,601,601,601,116,116,
-601,601,601,601,601,601,601,601,601,601,601,601,601,601,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+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,677,677,
+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,120,
+120,120,581,581,581,581,581,581,120,120,581,581,581,581,581,581,
+120,120,581,581,581,581,581,581,120,120,581,581,581,120,120,120,
+  6,  6,  9, 15, 20,  6,  6,120, 20,  9,  9,  9,  9, 20, 20,120,
+511,511,511,511,511,511,511,511,511, 24, 24, 24, 20, 20,120,120,
 
 /* block 138 */
-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,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,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,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,601,601,601,601,601,601,601,601,
-601,601,601,601,601,601,601,601,601,601,601,116,116,116,116,116,
+678,678,678,678,678,678,678,678,678,678,678,678,120,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,120,678,678,678,678,678,678,678,678,
+678,678,678,678,678,678,678,678,678,678,678,120,678,678,120,678,
+678,678,678,678,678,678,678,678,678,678,678,678,678,678,120,120,
+678,678,678,678,678,678,678,678,678,678,678,678,678,678,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 139 */
-  4,  4,  4,116,116,116,116, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24,116,116,116, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-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,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,603,603,604,604,604,604,604,604,604,
+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,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,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,120,120,120,120,120,
 
 /* block 140 */
-604,604,604,604,604,604,604,604,604,604,603,603,604,604,604,116,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116,
-604,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,111,116,116,
+679,679,679,120,120,120,120,680,680,680,680,680,680,680,680,680,
+680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,
+680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,
+680,680,680,680,120,120,120,681,681,681,681,681,681,681,681,681,
+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,
+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,684,684,684,684,684,684,684,
 
 /* block 141 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+684,684,684,684,684,684,684,684,684,684,683,683,684,684,684,120,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,120,120,120,120,
+684,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,113,120,120,
 
 /* block 142 */
-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,116,116,116,
-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,606,606,606,606,606,
-606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,
-606,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-111, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,116,116,116,116,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 143 */
-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,607,607,607,607,
-608,608,608,608,116,116,116,116,116,116,116,116,116,607,607,607,
-609,609,609,609,609,609,609,609,609,609,609,609,609,609,609,609,
-609,610,609,609,609,609,609,609,609,609,610,116,116,116,116,116,
-611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,
-611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,
-611,611,611,611,611,611,612,612,612,612,612,116,116,116,116,116,
+685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,
+685,685,685,685,685,685,685,685,685,685,685,685,685,120,120,120,
+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,
+686,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+687,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,120,120,120,120,
 
 /* block 144 */
-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,613,116,614,
-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,615,615,615,615,
-615,615,615,615,116,116,116,116,615,615,615,615,615,615,615,615,
-616,617,617,617,617,617,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+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,
+690,690,690,690,120,120,120,120,120,120,120,120,120,689,689,689,
+691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,
+691,692,691,691,691,691,691,691,691,691,692,120,120,120,120,120,
+693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,
+693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,
+693,693,693,693,693,693,694,694,694,694,694,120,120,120,120,120,
 
 /* block 145 */
-618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,
-618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,
-618,618,618,618,618,618,618,618,619,619,619,619,619,619,619,619,
-619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,
-619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,
-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,
+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,120,696,
+697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,
+697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,697,
+697,697,697,697,120,120,120,120,697,697,697,697,697,697,697,697,
+698,699,699,699,699,699,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 146 */
-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,116,116,
-622,622,622,622,622,622,622,622,622,622,116,116,116,116,116,116,
-623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,
-623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,
-623,623,623,623,116,116,116,116,624,624,624,624,624,624,624,624,
-624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,
-624,624,624,624,624,624,624,624,624,624,624,624,116,116,116,116,
+700,700,700,700,700,700,700,700,700,700,700,700,700,700,700,700,
+700,700,700,700,700,700,700,700,700,700,700,700,700,700,700,700,
+700,700,700,700,700,700,700,700,701,701,701,701,701,701,701,701,
+701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,
+701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,
+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,
+702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,
 
 /* block 147 */
-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,116,116,116,116,116,116,116,116,
-626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,
-626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,
-626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,
-626,626,626,626,116,116,116,116,116,116,116,116,116,116,116,627,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+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,120,120,
+704,704,704,704,704,704,704,704,704,704,120,120,120,120,120,120,
+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,120,120,120,120,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,120,120,120,120,
 
 /* block 148 */
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
+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,120,120,120,120,120,120,120,120,
+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,120,120,120,120,120,120,120,120,120,120,120,709,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 149 */
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,628,116,116,116,116,116,116,116,116,116,
-628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,
-628,628,628,628,628,628,116,116,116,116,116,116,116,116,116,116,
-628,628,628,628,628,628,628,628,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
 
 /* block 150 */
-629,629,629,629,629,629,116,116,629,116,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,116,629,629,116,116,116,629,116,116,629,
-630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,
-630,630,630,630,630,630,116,631,632,632,632,632,632,632,632,632,
-633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,
-633,633,633,633,633,633,633,634,634,635,635,635,635,635,635,635,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,710,120,120,120,120,120,120,120,120,120,
+710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,
+710,710,710,710,710,710,120,120,120,120,120,120,120,120,120,120,
+710,710,710,710,710,710,710,710,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 151 */
-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,116,
-116,116,116,116,116,116,116,637,637,637,637,637,637,637,637,637,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-638,638,638,638,638,638,638,638,638,638,638,638,638,638,638,638,
-638,638,638,116,638,638,116,116,116,116,116,639,639,639,639,639,
+711,711,711,711,711,711,120,120,711,120,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,120,711,711,120,120,120,711,120,120,711,
+712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
+712,712,712,712,712,712,120,713,714,714,714,714,714,714,714,714,
+715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,
+715,715,715,715,715,715,715,716,716,717,717,717,717,717,717,717,
 
 /* block 152 */
-640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,
-640,640,640,640,640,640,641,641,641,641,641,641,116,116,116,642,
-643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,
-643,643,643,643,643,643,643,643,643,643,116,116,116,116,116,644,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+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,718,718,718,718,718,120,
+120,120,120,120,120,120,120,719,719,719,719,719,719,719,719,719,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+720,720,720,720,720,720,720,720,720,720,720,720,720,720,720,720,
+720,720,720,120,720,720,120,120,120,120,120,721,721,721,721,721,
 
 /* block 153 */
-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,645,645,645,645,645,645,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,116,116,116,116,647,647,646,646,
-647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,
-116,116,647,647,647,647,647,647,647,647,647,647,647,647,647,647,
-647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,
-647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,
+722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,
+722,722,722,722,722,722,723,723,723,723,723,723,120,120,120,724,
+725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,
+725,725,725,725,725,725,725,725,725,725,120,120,120,120,120,726,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 154 */
-648,649,649,649,116,649,649,116,116,116,116,116,649,649,649,649,
-648,648,648,648,116,648,648,648,116,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,116,116,649,649,649,116,116,116,116,649,
-650,650,650,650,650,650,650,650,650,116,116,116,116,116,116,116,
-651,651,651,651,651,651,651,651,651,116,116,116,116,116,116,116,
-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,653,654,
+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,
+728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,
+728,728,728,728,728,728,728,728,120,120,120,120,729,729,728,728,
+729,729,729,729,729,729,729,729,729,729,729,729,729,729,729,729,
+120,120,729,729,729,729,729,729,729,729,729,729,729,729,729,729,
+729,729,729,729,729,729,729,729,729,729,729,729,729,729,729,729,
+729,729,729,729,729,729,729,729,729,729,729,729,729,729,729,729,
 
 /* block 155 */
-655,655,655,655,655,655,655,655,655,655,655,655,655,655,655,655,
-655,655,655,655,655,655,655,655,655,655,655,655,655,656,656,656,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-657,657,657,657,657,657,657,657,658,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,659,659,116,116,116,116,660,660,660,660,660,
-661,661,661,661,661,661,661,116,116,116,116,116,116,116,116,116,
+730,731,731,731,120,731,731,120,120,120,120,120,731,731,731,731,
+730,730,730,730,120,730,730,730,120,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,120,120,731,731,731,120,120,120,120,731,
+732,732,732,732,732,732,732,732,732,120,120,120,120,120,120,120,
+733,733,733,733,733,733,733,733,733,120,120,120,120,120,120,120,
+734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,
+734,734,734,734,734,734,734,734,734,734,734,734,734,735,735,736,
 
 /* block 156 */
-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,
-662,662,662,662,662,662,116,116,116,663,663,663,663,663,663,663,
-664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,
-664,664,664,664,664,664,116,116,665,665,665,665,665,665,665,665,
-666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,
-666,666,666,116,116,116,116,116,667,667,667,667,667,667,667,667,
+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,738,738,738,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+739,739,739,739,739,739,739,739,740,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,741,741,120,120,120,120,742,742,742,742,742,
+743,743,743,743,743,743,743,120,120,120,120,120,120,120,120,120,
 
 /* block 157 */
-668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,
-668,668,116,116,116,116,116,116,116,669,669,669,669,116,116,116,
-116,116,116,116,116,116,116,116,116,670,670,670,670,670,670,670,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
+744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
+744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
+744,744,744,744,744,744,120,120,120,745,745,745,745,745,745,745,
+746,746,746,746,746,746,746,746,746,746,746,746,746,746,746,746,
+746,746,746,746,746,746,120,120,747,747,747,747,747,747,747,747,
+748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,
+748,748,748,120,120,120,120,120,749,749,749,749,749,749,749,749,
 
 /* block 158 */
-671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
-671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
-671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
-671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,
-671,671,671,671,671,671,671,671,671,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,
+750,750,120,120,120,120,120,120,120,751,751,751,751,120,120,120,
+120,120,120,120,120,120,120,120,120,752,752,752,752,752,752,752,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 159 */
-672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
-672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
-672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
-672,672,672,116,116,116,116,116,116,116,116,116,116,116,116,116,
-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,
-673,673,673,116,116,116,116,116,116,116,674,674,674,674,674,674,
+753,753,753,753,753,753,753,753,753,753,753,753,753,753,753,753,
+753,753,753,753,753,753,753,753,753,753,753,753,753,753,753,753,
+753,753,753,753,753,753,753,753,753,753,753,753,753,753,753,753,
+753,753,753,753,753,753,753,753,753,753,753,753,753,753,753,753,
+753,753,753,753,753,753,753,753,753,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 160 */
-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,676,676,676,116,116,116,116,116,116,116,116,
-677,677,677,677,677,677,677,677,677,677,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,
+754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,
+754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,
+754,754,754,120,120,120,120,120,120,120,120,120,120,120,120,120,
+755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,
+755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,
+755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,
+755,755,755,120,120,120,120,120,120,120,756,756,756,756,756,756,
 
 /* block 161 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-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,116,
+757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,
+757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,
+757,757,757,757,758,758,758,758,120,120,120,120,120,120,120,120,
+759,759,759,759,759,759,759,759,759,759,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 162 */
-679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,
-679,679,679,679,679,679,679,679,679,679,679,679,679,680,680,680,
-680,680,680,680,680,680,680,679,116,116,116,116,116,116,116,116,
-681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,
-681,681,681,681,681,681,682,682,682,682,682,682,682,682,682,682,
-682,683,683,683,683,684,684,684,684,684,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,
+760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,120,
 
 /* block 163 */
-685,686,685,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,686,686,686,686,686,686,686,686,
-686,686,686,686,686,686,686,688,688,688,688,688,688,688,116,116,
-116,116,689,689,689,689,689,689,689,689,689,689,689,689,689,689,
-689,689,689,689,689,689,690,690,690,690,690,690,690,690,690,690,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,686,
+761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,
+761,761,761,761,761,761,761,761,761,761,761,761,761,762,762,762,
+762,762,762,762,762,762,762,761,120,120,120,120,120,120,120,120,
+763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,
+763,763,763,763,763,763,764,764,764,764,764,764,764,764,764,764,
+764,765,765,765,765,766,766,766,766,766,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 164 */
-691,691,692,693,693,693,693,693,693,693,693,693,693,693,693,693,
-693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,
-693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,
-692,692,692,691,691,691,691,692,692,691,691,694,694,695,694,694,
-694,694,116,116,116,116,116,116,116,116,116,116,116,695,116,116,
-696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,
-696,696,696,696,696,696,696,696,696,116,116,116,116,116,116,116,
-697,697,697,697,697,697,697,697,697,697,116,116,116,116,116,116,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+767,767,767,767,767,767,767,767,767,767,767,767,767,767,767,767,
+767,767,767,767,767,767,767,120,120,120,120,120,120,120,120,120,
 
 /* block 165 */
-698,698,698,699,699,699,699,699,699,699,699,699,699,699,699,699,
-699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,
-699,699,699,699,699,699,699,698,698,698,698,698,700,698,698,698,
-698,698,698,698,698,116,701,701,701,701,701,701,701,701,701,701,
-702,702,702,702,699,700,700,116,116,116,116,116,116,116,116,116,
-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,
-703,703,703,704,705,705,703,116,116,116,116,116,116,116,116,116,
+768,769,768,770,770,770,770,770,770,770,770,770,770,770,770,770,
+770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,
+770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,770,
+770,770,770,770,770,770,770,770,769,769,769,769,769,769,769,769,
+769,769,769,769,769,769,769,771,771,771,771,771,771,771,120,120,
+120,120,772,772,772,772,772,772,772,772,772,772,772,772,772,772,
+772,772,772,772,772,772,773,773,773,773,773,773,773,773,773,773,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,769,
 
 /* block 166 */
-706,706,707,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,707,707,707,706,706,706,706,706,706,706,706,706,707,
-707,708,709,709,708,710,710,710,710,706,706,706,706,710,116,116,
-711,711,711,711,711,711,711,711,711,711,708,710,708,710,710,710,
-116,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712,
-712,712,712,712,712,116,116,116,116,116,116,116,116,116,116,116,
+774,774,775,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,
+775,775,775,774,774,774,774,775,775,774,774,777,777,778,777,777,
+777,777,120,120,120,120,120,120,120,120,120,120,120,778,120,120,
+779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,
+779,779,779,779,779,779,779,779,779,120,120,120,120,120,120,120,
+780,780,780,780,780,780,780,780,780,780,120,120,120,120,120,120,
 
 /* block 167 */
-713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,
-713,713,116,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,714,714,714,715,
-715,715,714,714,715,714,715,715,716,716,716,716,716,716,715,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+781,781,781,782,782,782,782,782,782,782,782,782,782,782,782,782,
+782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,
+782,782,782,782,782,782,782,781,781,781,781,781,783,781,781,781,
+781,781,781,781,781,120,784,784,784,784,784,784,784,784,784,784,
+785,785,785,785,782,783,783,120,120,120,120,120,120,120,120,120,
+786,786,786,786,786,786,786,786,786,786,786,786,786,786,786,786,
+786,786,786,786,786,786,786,786,786,786,786,786,786,786,786,786,
+786,786,786,787,788,788,786,120,120,120,120,120,120,120,120,120,
 
 /* block 168 */
-717,717,717,717,717,717,717,116,717,116,717,717,717,717,116,717,
-717,717,717,717,717,717,717,717,717,717,717,717,717,717,116,717,
-717,717,717,717,717,717,717,717,717,718,116,116,116,116,116,116,
-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,
-721,721,721,720,720,720,720,720,720,720,720,116,116,116,116,116,
-722,722,722,722,722,722,722,722,722,722,116,116,116,116,116,116,
+789,789,790,791,791,791,791,791,791,791,791,791,791,791,791,791,
+791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,
+791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,
+791,791,791,790,790,790,789,789,789,789,789,789,789,789,789,790,
+790,791,792,792,791,793,793,793,793,789,789,789,789,793,120,120,
+794,794,794,794,794,794,794,794,794,794,791,793,791,793,793,793,
+120,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,
+795,795,795,795,795,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 169 */
-723,723,724,724,116,725,725,725,725,725,725,725,725,116,116,725,
-725,116,116,725,725,725,725,725,725,725,725,725,725,725,725,725,
-725,725,725,725,725,725,725,725,725,116,725,725,725,725,725,725,
-725,116,725,725,116,725,725,725,725,725,116,111,723,725,726,724,
-723,724,724,724,724,116,116,724,724,116,116,724,724,724,116,116,
-725,116,116,116,116,116,116,726,116,116,116,116,116,725,725,725,
-725,725,724,724,116,116,723,723,723,723,723,723,723,116,116,116,
-723,723,723,723,723,116,116,116,116,116,116,116,116,116,116,116,
+796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,120,796,796,796,796,796,796,796,796,796,796,796,796,796,
+796,796,796,796,796,796,796,796,796,796,796,796,797,797,797,798,
+798,798,797,797,798,797,798,798,799,799,799,799,799,799,798,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 170 */
-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,727,727,
-727,727,727,727,727,728,728,728,729,729,729,729,729,729,729,729,
-728,728,729,729,729,728,729,727,727,727,727,730,730,730,730,730,
-731,731,731,731,731,731,731,731,731,731,116,730,116,730,729,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+800,800,800,800,800,800,800,120,800,120,800,800,800,800,120,800,
+800,800,800,800,800,800,800,800,800,800,800,800,800,800,120,800,
+800,800,800,800,800,800,800,800,800,801,120,120,120,120,120,120,
+802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,
+802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,
+802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,803,
+804,804,804,803,803,803,803,803,803,803,803,120,120,120,120,120,
+805,805,805,805,805,805,805,805,805,805,120,120,120,120,120,120,
 
 /* block 171 */
-732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,
-732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,
-732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,
-733,734,734,735,735,735,735,735,735,734,735,734,734,733,734,735,
-735,734,735,735,732,732,736,732,116,116,116,116,116,116,116,116,
-737,737,737,737,737,737,737,737,737,737,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+806,807,808,809,120,810,810,810,810,810,810,810,810,120,120,810,
+810,120,120,810,810,810,810,810,810,810,810,810,810,810,810,810,
+810,810,810,810,810,810,810,810,810,120,810,810,810,810,810,810,
+810,120,810,810,120,810,810,810,810,810,120,811,807,810,812,808,
+806,808,808,808,808,120,120,808,808,120,120,808,808,808,120,120,
+810,120,120,120,120,120,120,812,120,120,120,120,120,810,810,810,
+810,810,808,808,120,120,806,806,806,806,806,806,806,120,120,120,
+806,806,806,806,806,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 172 */
-738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
-738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
-738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,739,
-740,740,741,741,741,741,116,116,740,740,740,740,741,741,740,741,
-741,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,
-742,742,742,742,742,742,742,742,738,738,738,738,741,741,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,
+813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,
+813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,
+813,813,813,813,813,814,814,814,815,815,815,815,815,815,815,815,
+814,814,815,815,815,814,815,813,813,813,813,816,816,816,816,816,
+817,817,817,817,817,817,817,817,817,817,120,816,120,816,815,813,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 173 */
-743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,
-743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,
-743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,
-744,744,744,745,745,745,745,745,745,745,745,744,744,745,744,745,
-745,746,746,746,743,116,116,116,116,116,116,116,116,116,116,116,
-747,747,747,747,747,747,747,747,747,747,116,116,116,116,116,116,
-373,373,373,373,373,373,373,373,373,373,373,373,373,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+818,818,818,818,818,818,818,818,818,818,818,818,818,818,818,818,
+818,818,818,818,818,818,818,818,818,818,818,818,818,818,818,818,
+818,818,818,818,818,818,818,818,818,818,818,818,818,818,818,818,
+819,820,820,821,821,821,821,821,821,820,821,820,820,819,820,821,
+821,820,821,821,818,818,822,818,120,120,120,120,120,120,120,120,
+823,823,823,823,823,823,823,823,823,823,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 174 */
-748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,
-748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,
-748,748,748,748,748,748,748,748,748,748,748,749,750,749,750,750,
-749,749,749,749,749,749,750,749,116,116,116,116,116,116,116,116,
-751,751,751,751,751,751,751,751,751,751,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,
+824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,
+824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,825,
+826,826,827,827,827,827,120,120,826,826,826,826,827,827,826,827,
+827,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,
+828,828,828,828,828,828,828,828,824,824,824,824,827,827,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 175 */
-752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,
-752,752,752,752,752,752,752,752,752,752,752,116,116,753,753,753,
-754,754,753,753,753,753,754,753,753,753,753,753,116,116,116,116,
-755,755,755,755,755,755,755,755,755,755,756,756,757,757,757,758,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
+829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
+829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
+830,830,830,831,831,831,831,831,831,831,831,830,830,831,830,831,
+831,832,832,832,829,120,120,120,120,120,120,120,120,120,120,120,
+833,833,833,833,833,833,833,833,833,833,120,120,120,120,120,120,
+395,395,395,395,395,395,395,395,395,395,395,395,395,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 176 */
-759,759,759,759,759,759,759,759,759,759,759,759,759,759,759,759,
-759,759,759,759,759,759,759,759,759,759,759,759,759,759,759,759,
-759,759,759,759,759,759,759,759,759,759,759,759,760,760,760,761,
-761,761,761,761,761,761,761,761,760,761,761,762,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,
+834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,
+834,834,834,834,834,834,834,834,834,834,834,835,836,835,836,836,
+835,835,835,835,835,835,836,835,834,120,120,120,120,120,120,120,
+837,837,837,837,837,837,837,837,837,837,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 177 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,
-763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,
-764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,
-764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,
-765,765,765,765,765,765,765,765,765,765,766,766,766,766,766,766,
-766,766,766,116,116,116,116,116,116,116,116,116,116,116,116,767,
+838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,
+838,838,838,838,838,838,838,838,838,838,838,120,120,839,839,839,
+840,840,839,839,839,839,840,839,839,839,839,839,120,120,120,120,
+841,841,841,841,841,841,841,841,841,841,842,842,843,843,843,844,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 178 */
-768,769,769,769,769,769,769,769,769,769,769,768,768,768,768,768,
-768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,
-768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,
-768,768,768,769,769,769,769,769,769,770,771,769,769,769,769,772,
-772,772,772,772,772,772,772,769,116,116,116,116,116,116,116,116,
-773,774,774,774,774,774,774,775,775,774,774,774,773,773,773,773,
-773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,
-773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,
+845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,
+845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,
+845,845,845,845,845,845,845,845,845,845,845,845,846,846,846,847,
+847,847,847,847,847,847,847,847,846,847,847,848,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 179 */
-773,773,773,773,116,116,776,776,776,776,774,774,774,774,774,774,
-774,774,774,774,774,774,774,775,774,774,777,777,777,773,777,777,
-777,777,777,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,
-778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,
-778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,
-778,778,778,778,778,778,778,778,778,116,116,116,116,116,116,116,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
+849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
+850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,
+850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,
+851,851,851,851,851,851,851,851,851,851,852,852,852,852,852,852,
+852,852,852,120,120,120,120,120,120,120,120,120,120,120,120,853,
 
 /* block 180 */
-779,779,779,779,779,779,779,779,779,116,779,779,779,779,779,779,
-779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,
-779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,780,
-781,781,781,781,781,781,781,116,781,781,781,781,781,781,780,781,
-779,782,782,782,782,782,116,116,116,116,116,116,116,116,116,116,
-783,783,783,783,783,783,783,783,783,783,784,784,784,784,784,784,
-784,784,784,784,784,784,784,784,784,784,784,784,784,116,116,116,
-785,785,786,786,786,786,786,786,786,786,786,786,786,786,786,786,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+854,854,854,854,854,854,854,854,120,120,854,854,854,854,854,854,
+854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,
+854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,
+854,855,855,855,856,856,856,856,120,120,856,856,855,855,855,855,
+856,854,857,854,855,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 181 */
-786,786,786,786,786,786,786,786,786,786,786,786,786,786,786,786,
-116,116,787,787,787,787,787,787,787,787,787,787,787,787,787,787,
-787,787,787,787,787,787,787,787,116,788,787,787,787,787,787,787,
-787,788,787,787,788,787,787,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+858,859,859,859,859,859,859,859,859,859,859,858,858,858,858,858,
+858,858,858,858,858,858,858,858,858,858,858,858,858,858,858,858,
+858,858,858,858,858,858,858,858,858,858,858,858,858,858,858,858,
+858,858,858,859,859,859,859,859,859,860,861,859,859,859,859,862,
+862,862,862,862,862,862,862,859,120,120,120,120,120,120,120,120,
+863,864,864,864,864,864,864,865,865,864,864,864,863,863,863,863,
+863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,
+863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,
 
 /* block 182 */
-789,789,789,789,789,789,789,116,789,789,116,789,789,789,789,789,
-789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,
-789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,
-789,790,790,790,790,790,790,116,116,116,790,116,790,790,116,790,
-790,790,790,790,790,790,791,790,116,116,116,116,116,116,116,116,
-792,792,792,792,792,792,792,792,792,792,116,116,116,116,116,116,
-793,793,793,793,793,793,116,793,793,116,793,793,793,793,793,793,
-793,793,793,793,793,793,793,793,793,793,793,793,793,793,793,793,
+863,863,863,863,866,866,866,866,866,866,864,864,864,864,864,864,
+864,864,864,864,864,864,864,865,864,864,867,867,867,863,867,867,
+867,867,867,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+868,868,868,868,868,868,868,868,868,868,868,868,868,868,868,868,
+868,868,868,868,868,868,868,868,868,868,868,868,868,868,868,868,
+868,868,868,868,868,868,868,868,868,868,868,868,868,868,868,868,
+868,868,868,868,868,868,868,868,868,120,120,120,120,120,120,120,
 
 /* block 183 */
-793,793,793,793,793,793,793,793,793,793,794,794,794,794,794,116,
-795,795,116,794,794,795,794,795,793,116,116,116,116,116,116,116,
-796,796,796,796,796,796,796,796,796,796,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+869,869,869,869,869,869,869,869,869,120,869,869,869,869,869,869,
+869,869,869,869,869,869,869,869,869,869,869,869,869,869,869,869,
+869,869,869,869,869,869,869,869,869,869,869,869,869,869,869,870,
+871,871,871,871,871,871,871,120,871,871,871,871,871,871,870,871,
+869,872,872,872,872,872,120,120,120,120,120,120,120,120,120,120,
+873,873,873,873,873,873,873,873,873,873,874,874,874,874,874,874,
+874,874,874,874,874,874,874,874,874,874,874,874,874,120,120,120,
+875,875,876,876,876,876,876,876,876,876,876,876,876,876,876,876,
 
 /* block 184 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,
-797,797,797,798,798,799,799,800,800,116,116,116,116,116,116,116,
+876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,
+120,120,877,877,877,877,877,877,877,877,877,877,877,877,877,877,
+877,877,877,877,877,877,877,877,120,878,877,877,877,877,877,877,
+877,878,877,877,878,877,877,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 185 */
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
+879,879,879,879,879,879,879,120,879,879,120,879,879,879,879,879,
+879,879,879,879,879,879,879,879,879,879,879,879,879,879,879,879,
+879,879,879,879,879,879,879,879,879,879,879,879,879,879,879,879,
+879,880,880,880,880,880,880,120,120,120,880,120,880,880,120,880,
+880,880,880,880,880,880,881,880,120,120,120,120,120,120,120,120,
+882,882,882,882,882,882,882,882,882,882,120,120,120,120,120,120,
+883,883,883,883,883,883,120,883,883,120,883,883,883,883,883,883,
+883,883,883,883,883,883,883,883,883,883,883,883,883,883,883,883,
 
 /* block 186 */
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+883,883,883,883,883,883,883,883,883,883,884,884,884,884,884,120,
+885,885,120,884,884,885,884,885,883,120,120,120,120,120,120,120,
+886,886,886,886,886,886,886,886,886,886,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 187 */
-802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,
-802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,
-802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,
-802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,
-802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,
-802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,
-802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,116,
-803,803,803,803,803,116,116,116,116,116,116,116,116,116,116,116,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+887,887,887,887,887,887,887,887,887,887,887,887,887,887,887,887,
+887,887,887,888,888,889,889,890,890,120,120,120,120,120,120,120,
 
 /* block 188 */
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
-801,801,801,801,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,
+294,294,891,294,891,296,296,296,296,296,296,296,296,297,297,297,
+297,296,296,296,296,296,296,296,296,296,296,296,296,296,296,296,
+296,296,120,120,120,120,120,120,120,120,120,120,120,120,120,892,
 
 /* block 189 */
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
 
 /* block 190 */
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,
-804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 191 */
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
+894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,
+894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,
+894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,
+894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,
+894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,
+894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,
+894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,120,
+895,895,895,895,895,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 192 */
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,
-805,805,805,805,805,805,805,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,
+893,893,893,893,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 193 */
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
 
 /* block 194 */
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,
-538,538,538,538,538,538,538,538,538,116,116,116,116,116,116,116,
-806,806,806,806,806,806,806,806,806,806,806,806,806,806,806,806,
-806,806,806,806,806,806,806,806,806,806,806,806,806,806,806,116,
-807,807,807,807,807,807,807,807,807,807,116,116,116,116,808,808,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,
+896,896,896,896,896,896,896,896,896,896,896,896,896,896,896,120,
+897,897,897,897,897,897,897,897,897,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 195 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-809,809,809,809,809,809,809,809,809,809,809,809,809,809,809,809,
-809,809,809,809,809,809,809,809,809,809,809,809,809,809,116,116,
-810,810,810,810,810,811,116,116,116,116,116,116,116,116,116,116,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
 
 /* block 196 */
-812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,
-812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,
-812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,
-813,813,813,813,813,813,813,814,814,814,814,814,815,815,815,815,
-816,816,816,816,814,815,116,116,116,116,116,116,116,116,116,116,
-817,817,817,817,817,817,817,817,817,817,116,818,818,818,818,818,
-818,818,116,812,812,812,812,812,812,812,812,812,812,812,812,812,
-812,812,812,812,812,812,812,812,116,116,116,116,116,812,812,812,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,898,
+898,898,898,898,898,898,898,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 197 */
-812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+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,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,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,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,601,601,601,601,601,601,601,601,
+601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,
 
 /* block 198 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,
-819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,
-820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,
-820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,
+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,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,601,601,601,601,601,120,120,120,120,120,120,120,
+899,899,899,899,899,899,899,899,899,899,899,899,899,899,899,899,
+899,899,899,899,899,899,899,899,899,899,899,899,899,899,899,120,
+900,900,900,900,900,900,900,900,900,900,120,120,120,120,901,901,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 199 */
-821,821,821,821,821,821,821,821,821,821,821,821,821,821,821,821,
-821,821,821,821,821,821,821,822,822,822,822,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,902,
+902,902,902,902,902,902,902,902,902,902,902,902,902,902,120,120,
+903,903,903,903,903,904,120,120,120,120,120,120,120,120,120,120,
 
 /* block 200 */
-823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,
-823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,
-823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,
-823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,
-823,823,823,823,823,116,116,116,116,116,116,116,116,116,116,116,
-823,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,
-824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,
-824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,116,
+905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,
+905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,
+905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,
+906,906,906,906,906,906,906,907,907,907,907,907,908,908,908,908,
+909,909,909,909,907,908,120,120,120,120,120,120,120,120,120,120,
+910,910,910,910,910,910,910,910,910,910,120,911,911,911,911,911,
+911,911,120,905,905,905,905,905,905,905,905,905,905,905,905,905,
+905,905,905,905,905,905,905,905,120,120,120,120,120,905,905,905,
 
 /* block 201 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,825,
-825,825,825,826,826,826,826,826,826,826,826,826,826,826,826,826,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-827,828,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,905,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 202 */
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,
+912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,912,
+913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,
+913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,913,
 
 /* block 203 */
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,
+914,914,914,914,914,914,914,915,915,915,915,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 204 */
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,
-829,829,829,116,116,116,116,116,116,116,116,116,116,116,116,116,
+916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,
+916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,
+916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,
+916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,
+916,916,916,916,916,916,916,916,916,916,916,120,120,120,120,917,
+916,918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,
+918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,
+918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,918,
 
 /* block 205 */
-517,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+918,918,918,918,918,918,918,918,120,120,120,120,120,120,120,917,
+917,917,917,919,919,919,919,919,919,919,919,919,919,919,919,919,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+920,921,  5,111,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 206 */
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
 
 /* block 207 */
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,
-515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,120,120,120,120,120,120,120,120,
 
 /* block 208 */
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,922,
+922,922,922,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 209 */
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,
-830,830,830,830,830,830,830,830,830,830,830,830,116,116,116,116,
+578,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
 
 /* block 210 */
-831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,
-831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,
-831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,
-831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,
-831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,
-831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,
-831,831,831,831,831,831,831,831,831,831,831,116,116,116,116,116,
-831,831,831,831,831,831,831,831,831,831,831,831,831,116,116,116,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
 
 /* block 211 */
-831,831,831,831,831,831,831,831,831,116,116,116,116,116,116,116,
-831,831,831,831,831,831,831,831,831,831,116,116,832,833,833,834,
- 23, 23, 23, 23,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,
+573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+573,573,573,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,578,578,578,578,120,120,120,120,120,120,120,120,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
 
 /* 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, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,116,116,116,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
 
 /* block 213 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19,835,438,111,111,111, 19, 19, 19,438,835,835,
-835,835,835, 23, 23, 23, 23, 23, 23, 23, 23,111,111,111,111,111,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,923,
+923,923,923,923,923,923,923,923,923,923,923,923,120,120,120,120,
 
 /* block 214 */
-111,111,111, 19, 19,111,111,111,111,111,111,111, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,111,111,111,111, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,
+924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,
+924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,
+924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,
+924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,
+924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,924,
+924,924,924,924,924,924,924,924,924,924,924,120,120,120,120,120,
+924,924,924,924,924,924,924,924,924,924,924,924,924,120,120,120,
 
 /* block 215 */
-604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,
-604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,
-604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,
-604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,
-604,604,836,836,836,604,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+924,924,924,924,924,924,924,924,924,120,120,120,120,120,120,120,
+924,924,924,924,924,924,924,924,924,924,120,120,925,926,926,927,
+928,928,928,928,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 216 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24,116,116,116,116,116,116,116,116,116,116,116,116,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20,120,120,120,120,120,120,120,120,120,120,
 
 /* 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,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,116,116,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24,116,116,116,116,116,116,116,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20,120,120, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20,929,930,113,113,113, 20, 20, 20,930,929,929,
+929,929,929, 24, 24, 24, 24, 24, 24, 24, 24,113,113,113,113,113,
 
 /* block 218 */
-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,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,116,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,473,473,473,472,472,472,472,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
+113,113,113, 20, 20,113,113,113,113,113,113,113, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,113,113,113,113, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 219 */
-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,472,116,472,472,
-116,116,472,116,116,472,472,116,116,472,472,472,472,116,472,472,
-472,472,472,472,472,472,473,473,473,473,116,473,116,473,473,473,
-473,473,473,473,116,473,473,473,473,473,473,473,473,473,473,473,
-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,
+684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,
+684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,
+684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,
+684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,
+684,684,931,931,931,684,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 220 */
-473,473,473,473,472,472,116,472,472,472,472,116,116,472,472,472,
-472,472,472,472,472,116,472,472,472,472,472,472,472,116,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,472,472,116,472,472,472,472,116,
-472,472,472,472,472,116,472,116,116,116,472,472,472,472,472,472,
-472,116,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,472,472,472,472,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 221 */
-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,
-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,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,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20,120,120,120,120,120,120,120,120,120,
+582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,
+582,582, 25, 25, 25, 25, 25, 25, 25,120,120,120,120,120,120,120,
 
 /* block 222 */
-473,473,473,473,473,473,473,473,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,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,
-472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,
+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,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,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,514,514,514,120,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,513,513,513,513,513,513,513,513,
+513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,
 
 /* block 223 */
-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,116,116,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,  8,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,  8,473,473,473,473,
-473,473,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,  8,473,473,473,473,
+513,513,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,513,120,513,513,
+120,120,513,120,120,513,513,120,120,513,513,513,513,120,513,513,
+513,513,513,513,513,513,514,514,514,514,120,514,120,514,514,514,
+514,514,514,514,120,514,514,514,514,514,514,514,514,514,514,514,
+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,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
 
 /* block 224 */
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
-473,473,473,473,473,  8,473,473,473,473,473,473,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,  8,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,  8,
-473,473,473,473,473,473,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,  8,
-473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
+514,514,514,514,513,513,120,513,513,513,513,120,120,513,513,513,
+513,513,513,513,513,120,513,513,513,513,513,513,513,120,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,513,513,120,513,513,513,513,120,
+513,513,513,513,513,120,513,120,120,120,513,513,513,513,513,513,
+513,120,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,513,513,513,513,
+513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,
 
 /* block 225 */
-473,473,473,473,473,473,473,473,473,  8,473,473,473,473,473,473,
-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,  8,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,  8,473,473,473,473,473,473,472,473,116,116, 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,
+513,513,513,513,513,513,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+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,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,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,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
 
 /* block 226 */
-837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,
-837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,
-837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,
-837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,
-837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,
-837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,
-837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,
-837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,
+514,514,514,514,514,514,514,514,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,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,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,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,
 
 /* block 227 */
-838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,
-838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,
-838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,
-838,838,838,838,838,838,838,837,837,837,837,838,838,838,838,838,
-838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,
-838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,
-838,838,838,838,838,838,838,838,838,838,838,838,838,837,837,837,
-837,837,837,837,837,838,837,837,837,837,837,837,837,837,837,837,
+513,513,513,513,513,513,513,513,513,513,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,120,120,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,  9,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,  9,514,514,514,514,
+514,514,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,  9,514,514,514,514,
 
 /* block 228 */
-837,837,837,837,838,837,837,839,839,839,839,839,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,838,838,838,838,838,
-116,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,  9,514,514,514,514,514,514,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,  9,514,514,514,514,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,  9,
+514,514,514,514,514,514,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,  9,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
 
 /* block 229 */
-840,840,840,840,840,840,840,116,840,840,840,840,840,840,840,840,
-840,840,840,840,840,840,840,840,840,116,116,840,840,840,840,840,
-840,840,116,840,840,116,840,840,840,840,840,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+514,514,514,514,514,514,514,514,514,  9,514,514,514,514,514,514,
+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,  9,514,514,514,514,514,514,
+514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,
+514,514,514,  9,514,514,514,514,514,514,513,514,120,120, 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, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
 
 /* block 230 */
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
+932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
+932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
+932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
+932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
+932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
+932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
+932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
+932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
 
 /* block 231 */
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,
-841,841,841,841,841,116,116,842,842,842,842,842,842,842,842,842,
-843,843,843,843,843,843,843,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,
+933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,
+933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,
+933,933,933,933,933,933,933,932,932,932,932,933,933,933,933,933,
+933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,
+933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,
+933,933,933,933,933,933,933,933,933,933,933,933,933,932,932,932,
+932,932,932,932,932,933,932,932,932,932,932,932,932,932,932,932,
 
 /* block 232 */
-844,844,844,844,844,844,844,844,844,844,844,844,844,844,844,844,
-844,844,844,844,844,844,844,844,844,844,844,844,844,844,844,844,
-844,844,845,845,845,845,845,845,845,845,845,845,845,845,845,845,
-845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,
-845,845,845,845,846,846,846,846,846,846,846,116,116,116,116,116,
-847,847,847,847,847,847,847,847,847,847,116,116,116,116,848,848,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+932,932,932,932,933,932,932,934,934,934,934,934,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,933,933,933,933,933,
+120,933,933,933,933,933,933,933,933,933,933,933,933,933,933,933,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 233 */
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+935,935,935,935,935,935,935,120,935,935,935,935,935,935,935,935,
+935,935,935,935,935,935,935,935,935,120,120,935,935,935,935,935,
+935,935,120,935,935,120,935,935,935,935,935,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 234 */
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 24, 24, 24,
-  5, 24, 24, 24, 24,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+936,936,936,936,936,936,936,936,936,936,936,936,936,936,936,936,
+936,936,936,936,936,936,936,936,936,936,936,936,936,936,936,936,
+936,936,936,936,936,936,936,936,936,936,936,936,936,120,120,120,
+937,937,937,937,937,937,937,938,938,938,938,938,938,938,120,120,
+939,939,939,939,939,939,939,939,939,939,120,120,120,120,936,940,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 235 */
-217,217,217,217,116,217,217,217,217,217,217,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
-116,217,217,116,217,116,116,217,116,217,217,217,217,217,217,217,
-217,217,217,116,217,217,217,217,116,217,116,217,116,116,116,116,
-116,116,217,116,116,116,116,217,116,217,116,217,116,217,217,217,
-116,217,217,116,217,116,116,217,116,217,116,217,116,217,116,217,
-116,217,217,116,217,116,116,217,217,217,217,116,217,217,217,217,
-217,217,217,116,217,217,217,217,116,217,217,217,217,116,217,116,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+941,941,941,941,941,941,941,941,941,941,941,941,941,941,941,941,
+941,941,941,941,941,941,941,941,941,941,941,941,941,941,941,941,
+941,941,941,941,941,941,941,941,941,941,941,941,942,942,942,942,
+943,943,943,943,943,943,943,943,943,943,120,120,120,120,120,944,
 
 /* block 236 */
-217,217,217,217,217,217,217,217,217,217,116,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,116,116,116,116,
-116,217,217,217,116,217,217,217,217,217,116,217,217,217,217,217,
-217,217,217,217,217,217,217,217,217,217,217,217,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-211,211,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
 
 /* block 237 */
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,945,
+945,945,945,945,945,120,120,946,946,946,946,946,946,946,946,946,
+947,947,947,947,947,947,947,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 238 */
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,
-849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849,
+948,948,948,948,948,948,948,948,948,948,948,948,948,948,948,948,
+948,948,948,948,948,948,948,948,948,948,948,948,948,948,948,948,
+948,948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,
+949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,
+949,949,949,949,950,950,950,950,950,950,950,951,120,120,120,120,
+952,952,952,952,952,952,952,952,952,952,120,120,120,120,953,953,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 239 */
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,849,849,849,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,
- 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
 
 /* block 240 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 19,
19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,850,850,850,850,850,850,850,850,850,850,
-850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 20, 25, 25, 25,
+  6, 25, 25, 25, 25,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 241 */
-851, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20,
19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19,849,849,849,849,
- 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849,
- 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
- 20, 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
+120, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 20, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 242 */
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
+225,225,225,225,120,225,225,225,225,225,225,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
+120,225,225,120,225,120,120,225,120,225,225,225,225,225,225,225,
+225,225,225,120,225,225,225,225,120,225,120,225,120,120,120,120,
+120,120,225,120,120,120,120,225,120,225,120,225,120,225,225,225,
+120,225,225,120,225,120,120,225,120,225,120,225,120,225,120,225,
+120,225,225,120,225,120,120,225,225,225,225,120,225,225,225,225,
+225,225,225,120,225,225,225,225,120,225,225,225,225,120,225,120,
 
 /* block 243 */
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+225,225,225,225,225,225,225,225,225,225,120,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,120,120,120,120,
+120,225,225,225,120,225,225,225,225,225,120,225,225,225,225,225,
+225,225,225,225,225,225,225,225,225,225,225,225,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+218,218,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 244 */
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,852,852,852,852,852,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,954,954,954,954,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
 
 /* block 245 */
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19,
- 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21,954,954,954,954,954,954,954,954,954,954,954,954,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,954,
+954, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+954, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+954, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21,954,954,954,954,954,954,954,954,954,954,
 
 /* block 246 */
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,954,954,954,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,954,954,954,
+ 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21,
 
 /* block 247 */
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849,849,849,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 20,
+ 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,955,955,955,955,955,955,955,955,955,955,
+955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,
 
 /* block 248 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19,849,849,849,849,849,849,849,849,849,849,849,849,
+956, 21, 21,954,954,954,954,954,954,954,954,954,954,954,954,954,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,
20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20,954,954,954,954,
20, 20, 20, 20, 20, 20, 20, 20, 20,954,954,954,954,954,954,954,
+584,584,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
21, 21, 21, 21, 21, 21,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
 
 /* block 249 */
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 20, 20, 20, 20,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
 
 /* block 250 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849,849,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
 
 /* block 251 */
19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849,849,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,957,957,957,957,957,
 
 /* block 252 */
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 20, 20, 20,849,
- 20, 20, 20, 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20,849,849, 20, 20, 20, 20,849,849,849, 20,849, 20, 20, 20, 20,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20,
+ 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
 
 /* block 253 */
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849,849,849,
- 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 
 /* block 254 */
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21,954,954,954,954,954,954,954,954,954,954,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,954,954,954,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,954,954,954,954,954,
 
 /* block 255 */
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,
-849,849,849,849,849,849,849,849,849,849,849,849,849,849,116,116,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20,954,954,954,954,954,954,954,954,954,954,954,954,
 
 /* block 256 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 21, 21, 21, 21,954,954,954,954,954,954,954,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
 
 /* block 257 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,116,116,116,116,116,116,116,116,116,116,116,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,954,954,954,954,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20,954,954,954,954,954,954,954,954,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,954,954,954,954,954,954,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
 
 /* block 258 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
+ 20, 20, 20, 20, 20, 20, 20, 20,954,954,954,954,954,954,954,954,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
 
 /* block 259 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,954, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21,954, 21, 21, 21, 21,954,954,954, 21, 21, 21, 21, 21, 21,
 
 /* block 260 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21,954,954, 21, 21, 21, 21, 21, 21,954,954,954, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,954,954, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
 
 /* block 261 */
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,
-523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
-116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21,954,954,954,954,954,954,954,954,954,954,954,954,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,954,954,
+ 21, 21, 21, 21,954,954,954,954, 21, 21, 21,954,954,954,954,954,
 
 /* block 262 */
-471, 23,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,
-853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,
-853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,
-853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,
-853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,
-853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,
+ 21, 21, 21,954,954,954,954,954,954,954,954,954,954,954,954,954,
+ 21, 21, 21, 21, 21, 21,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
 
 /* block 263 */
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,954,
+954,954,954,954,954,954,954,954,954,954,954,954,954,954,120,120,
 
 /* block 264 */
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
+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,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
 
 /* block 265 */
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
-471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,
+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,120,120,120,120,120,120,120,120,120,120,120,
+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 266 */
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,
-597,597,597,597,597,597,597,597,597,597,597,597,597,597,116,116,
+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,120,120,
+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 267 */
+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,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+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 268 */
+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,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+
+/* block 269 */
+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,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
+
+/* block 270 */
+511, 24,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,
+958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,
+958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,
+958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,
+958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,
+958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,958,
+
+/* block 271 */
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+
+/* block 272 */
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+
+/* block 273 */
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
+511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,
+
+/* block 274 */
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,
+672,672,672,672,672,672,672,672,672,672,672,672,672,672,120,120,
 
 };
 
index 0c330edcb22e362f1609946b08e9b723a4335832..84b22fb06494ca070a7e5774157160094f74a492 100644 (file)
@@ -124,6 +124,7 @@ enum {
 /* These are the script identifications. */
 
 enum {
+  ucp_Unknown,
   ucp_Arabic,
   ucp_Armenian,
   ucp_Bengali,
@@ -280,7 +281,12 @@ enum {
   ucp_Makasar,
   ucp_Medefaidrin,
   ucp_Old_Sogdian,
-  ucp_Sogdian
+  ucp_Sogdian,
+  /* New for Unicode 12.0.0 */
+  ucp_Elymaic,
+  ucp_Nandinagari,
+  ucp_Nyiakeng_Puachue_Hmong,
+  ucp_Wancho
 };
 
 #endif  /* PCRE2_UCP_H_IDEMPOTENT_GUARD */
index 407d3f5b879699d25dcfa73fcf500d04c4139a50..8b052be66a544c7e5024e0cd535351ed8e28a198 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) 2016 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -85,10 +85,10 @@ if (c < 256)
   if ((*data & XCL_HASPROP) == 0)
     {
     if ((*data & XCL_MAP) == 0) return negated;
-    return (((uint8_t *)(data + 1))[c/8] & (1 << (c&7))) != 0;
+    return (((uint8_t *)(data + 1))[c/8] & (1u << (c&7))) != 0;
     }
   if ((*data & XCL_MAP) != 0 &&
-    (((uint8_t *)(data + 1))[c/8] & (1 << (c&7))) != 0)
+    (((uint8_t *)(data + 1))[c/8] & (1u << (c&7))) != 0)
     return !negated; /* char found */
   }
 
index 5d9b3217bb999e108dbd8facf07fbe1dc0b40d3c..a49f1f8e5bbd2402cb616410ec7689c77c49eee2 100644 (file)
@@ -87,12 +87,11 @@ uint32_t newline;
 
 PCRE2_SIZE erroroffset;
 PCRE2_SIZE *ovector;
+PCRE2_SIZE subject_length;
 
-size_t subject_length;
 pcre2_match_data *match_data;
 
 
-
 /**************************************************************************
 * First, sort out the command line. There is only one possible option at  *
 * the moment, "-g" to request repeated matching to find all occurrences,  *
@@ -121,12 +120,14 @@ if (argc - i != 2)
   return 1;
   }
 
-/* As pattern and subject are char arguments, they can be straightforwardly
-cast to PCRE2_SPTR as we are working in 8-bit code units. */
+/* Pattern and subject are char arguments, so they can be straightforwardly
+cast to PCRE2_SPTR because we are working in 8-bit code units. The subject
+length is cast to PCRE2_SIZE for completeness, though PCRE2_SIZE is in fact
+defined to be size_t. */
 
 pattern = (PCRE2_SPTR)argv[i];
 subject = (PCRE2_SPTR)argv[i+1];
-subject_length = strlen((char *)subject);
+subject_length = (PCRE2_SIZE)strlen((char *)subject);
 
 
 /*************************************************************************
@@ -155,17 +156,22 @@ if (re == NULL)
 
 
 /*************************************************************************
-* If the compilation succeeded, we call PCRE again, in order to do a     *
+* If the compilation succeeded, we call PCRE2 again, in order to do a    *
 * pattern match against the subject string. This does just ONE match. If *
 * further matching is needed, it will be done below. Before running the  *
-* match we must set up a match_data block for holding the result.        *
+* match we must set up a match_data block for holding the result. Using  *
+* pcre2_match_data_create_from_pattern() ensures that the block is       *
+* exactly the right size for the number of capturing parentheses in the  *
+* pattern. If you need to know the actual size of a match_data block as  *
+* a number of bytes, you can find it like this:                          *
+*                                                                        *
+* PCRE2_SIZE match_data_size = pcre2_get_match_data_size(match_data);    *
 *************************************************************************/
 
-/* Using this function ensures that the block is exactly the right size for
-the number of capturing parentheses in the pattern. */
-
 match_data = pcre2_match_data_create_from_pattern(re, NULL);
 
+/* Now run the match. */
+
 rc = pcre2_match(
   re,                   /* the compiled pattern */
   subject,              /* the subject string */
@@ -188,7 +194,7 @@ if (rc < 0)
     default: printf("Matching error %d\n", rc); break;
     }
   pcre2_match_data_free(match_data);   /* Release memory used for the match */
-  pcre2_code_free(re);                 /* data and the compiled pattern. */
+  pcre2_code_free(re);                 /*   data and the compiled pattern. */
   return 1;
   }
 
@@ -232,7 +238,7 @@ application you might want to do things other than print them. */
 for (i = 0; i < rc; i++)
   {
   PCRE2_SPTR substring_start = subject + ovector[2*i];
-  size_t substring_length = ovector[2*i+1] - ovector[2*i];
+  PCRE2_SIZE substring_length = ovector[2*i+1] - ovector[2*i];
   printf("%2d: %.*s\n", i, (int)substring_length, (char *)substring_start);
   }
 
index d5f34c81fb297e26fd29d5f2d3f03058aa97429d..12fe95e628ead309608fac01985a6a4d63dfd2c6 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-2018 University of Cambridge
+           Copyright (c) 1997-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -68,12 +68,18 @@ POSSIBILITY OF SUCH DAMAGE.
 #undef WIN32
 #endif
 
+#ifdef __VMS
+#include clidef
+#include descrip
+#include lib$routines
+#endif
+
 #ifdef WIN32
 #include <io.h>                /* For _setmode() */
 #include <fcntl.h>             /* For _O_BINARY */
 #endif
 
-#ifdef SUPPORT_PCRE2GREP_CALLOUT
+#if defined(SUPPORT_PCRE2GREP_CALLOUT) && defined(SUPPORT_PCRE2GREP_CALLOUT_FORK)
 #ifdef WIN32
 #include <process.h>
 #else
@@ -104,12 +110,25 @@ MSVC 10/2010. Except for VC6 (which is missing some fundamentals and fails). */
 #define snprintf _snprintf
 #endif
 
+/* VC and older compilers don't support %td or %zu, and even some that claim to
+be C99 don't support it (hence DISABLE_PERCENT_ZT). */
+
+#if defined(_MSC_VER) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L || defined(DISABLE_PERCENT_ZT)
+#define PTR_FORM "lu"
+#define SIZ_FORM "lu"
+#define SIZ_CAST (unsigned long int)
+#else
+#define PTR_FORM "td"
+#define SIZ_FORM "zu"
+#define SIZ_CAST
+#endif
+
 #define FALSE 0
 #define TRUE 1
 
 typedef int BOOL;
 
-#define OFFSET_SIZE 33
+#define DEFAULT_CAPTURE_MAX 50
 
 #if BUFSIZ > 8192
 #define MAXPATLEN BUFSIZ
@@ -236,6 +255,8 @@ static pcre2_compile_context *compile_context;
 static pcre2_match_context *match_context;
 static pcre2_match_data *match_data;
 static PCRE2_SIZE *offsets;
+static uint32_t offset_size;
+static uint32_t capture_max = DEFAULT_CAPTURE_MAX;
 
 static BOOL count_only = FALSE;
 static BOOL do_colour = FALSE;
@@ -385,6 +406,7 @@ used to identify them. */
 #define N_INCLUDE_FROM (-21)
 #define N_OM_SEPARATOR (-22)
 #define N_MAX_BUFSIZE  (-23)
+#define N_OM_CAPTURE   (-24)
 
 static option_item optionlist[] = {
   { OP_NODATA,     N_NULL,   NULL,              "",              "terminate options" },
@@ -431,6 +453,7 @@ static option_item optionlist[] = {
   { OP_STRING,     'O',      &output_text,       "output=text",   "show only this text (possibly expanded)" },
   { OP_OP_NUMBERS, 'o',      &only_matching_data, "only-matching=n", "show only the part of the line that matched" },
   { OP_STRING,     N_OM_SEPARATOR, &om_separator, "om-separator=text", "set separator for multiple -o output" },
+  { OP_U32NUMBER,  N_OM_CAPTURE, &capture_max,  "om-capture=n",  "set capture count for --only-matching" },
   { OP_NODATA,     'q',      NULL,              "quiet",         "suppress output, just set return code" },
   { OP_NODATA,     'r',      NULL,              "recursive",     "recursively scan sub-directories" },
   { OP_PATLIST,    N_EXCLUDE,&exclude_patdata,  "exclude=pattern","exclude matching files when recursing" },
@@ -445,6 +468,7 @@ static option_item optionlist[] = {
   { OP_NODATA,    's',      NULL,              "no-messages",   "suppress error messages" },
   { OP_NODATA,    't',      NULL,              "total-count",   "print total count of matching lines" },
   { OP_NODATA,    'u',      NULL,              "utf",           "use UTF mode" },
+  { OP_NODATA,    'U',      NULL,              "utf-allow-invalid", "use UTF mode, allow for invalid code units" },
   { OP_NODATA,    'V',      NULL,              "version",       "print version information and exit" },
   { OP_NODATA,    'v',      NULL,              "invert-match",  "select non-matching lines" },
   { OP_NODATA,    'w',      NULL,              "word-regex(p)", "force patterns to match only as words"  },
@@ -573,8 +597,6 @@ status of 1, which is not helpful. To help with this problem, define a symbol
 therein. */
 
 #ifdef __VMS
-#include descrip
-#include lib$routines
   char val_buf[4];
   $DESCRIPTOR(sym_nam, "PCRE2GREP_RC");
   $DESCRIPTOR(sym_val, val_buf);
@@ -1133,7 +1155,11 @@ printf("Search for PATTERN in each FILE or standard input." STDOUT_NL);
 printf("PATTERN must be present if neither -e nor -f is used." STDOUT_NL);
 
 #ifdef SUPPORT_PCRE2GREP_CALLOUT
-printf("Callout scripts in patterns are supported." STDOUT_NL);
+#ifdef SUPPORT_PCRE2GREP_CALLOUT_FORK
+printf("All callout scripts in patterns are supported." STDOUT_NL);
+#else
+printf("Non-fork callout scripts in patterns are supported." STDOUT_NL);
+#endif
 #else
 printf("Callout scripts are not supported in this pcre2grep." STDOUT_NL);
 #endif
@@ -1725,6 +1751,15 @@ for (i = 1; p != NULL; p = p->next, i++)
   fprintf(stderr, "%s", msg);
   FWRITE_IGNORE(matchptr, 1, slen, stderr);   /* In case binary zero included */
   fprintf(stderr, "\n\n");
+  if (*mrc <= PCRE2_ERROR_UTF8_ERR1 &&
+      *mrc >= PCRE2_ERROR_UTF8_ERR21)
+    {
+    unsigned char mbuffer[256];
+    PCRE2_SIZE startchar = pcre2_get_startchar(match_data);
+    (void)pcre2_get_error_message(*mrc, mbuffer, sizeof(mbuffer));
+    fprintf(stderr, "%s at offset %" SIZ_FORM "\n\n", mbuffer,
+      SIZ_CAST startchar);
+    }
   if (*mrc == PCRE2_ERROR_MATCHLIMIT || *mrc == PCRE2_ERROR_DEPTHLIMIT ||
       *mrc == PCRE2_ERROR_HEAPLIMIT || *mrc == PCRE2_ERROR_JIT_STACKLIMIT)
     resource_error = TRUE;
@@ -2017,10 +2052,10 @@ return printed;
 *        Parse and execute callout scripts       *
 *************************************************/
 
-/* This function parses a callout string block and executes the
-program specified by the string. The string is a list of substrings
-separated by pipe characters. The first substring represents the
-executable name, and the following substrings specify the arguments:
+/* If SUPPORT_PCRE2GREP_CALLOUT_FORK is defined, this function parses a callout
+string block and executes the program specified by the string. The string is a
+list of substrings separated by pipe characters. The first substring represents
+the executable name, and the following substrings specify the arguments:
 
   program_name|param1|param2|...
 
@@ -2037,8 +2072,9 @@ follows:
   dollar or $| replaced by a pipe character.
 
 Alternatively, if string starts with pipe, the remainder is taken as an output
-string, same as --output. In this case, --om-separator is used to separate each
-callout, defaulting to newline.
+string, same as --output. This is the only form that is supported if
+SUPPORT_PCRE2GREP_FORK is not defined. In this case, --om-separator is used to
+separate each callout, defaulting to newline.
 
 Example:
 
@@ -2066,6 +2102,8 @@ PCRE2_SPTR string = calloutptr->callout_string;
 PCRE2_SPTR subject = calloutptr->subject;
 PCRE2_SIZE *ovector = calloutptr->offset_vector;
 PCRE2_SIZE capture_top = calloutptr->capture_top;
+
+#ifdef SUPPORT_PCRE2GREP_CALLOUT_FORK
 PCRE2_SIZE argsvectorlen = 2;
 PCRE2_SIZE argslen = 1;
 char *args;
@@ -2076,10 +2114,12 @@ char **argsvectorptr;
 pid_t pid;
 #endif
 int result = 0;
+#endif  /* SUPPORT_PCRE2GREP_CALLOUT_FORK */
 
 (void)unused;   /* Avoid compiler warning */
 
 /* Only callout with strings are supported. */
+
 if (string == NULL || length == 0) return 0;
 
 /* If there's no command, output the remainder directly. */
@@ -2092,6 +2132,10 @@ if (*string == '|')
   return 0;
   }
 
+#ifndef SUPPORT_PCRE2GREP_CALLOUT_FORK
+return 0;
+#else
+
 /* Checking syntax and compute the number of string fragments. Callout strings
 are ignored in case of a syntax error. */
 
@@ -2272,11 +2316,34 @@ while (length > 0)
 *argsptr++ = '\0';
 *argsvectorptr = NULL;
 
+/* Running an external command is system-dependent. Handle Windows and VMS as
+necessary, otherwise assume fork(). */
+
 #ifdef WIN32
 result = _spawnvp(_P_WAIT, argsvector[0], (const char * const *)argsvector);
-#else
-pid = fork();
 
+#elif defined __VMS
+  {
+  char cmdbuf[500];
+  short i = 0;
+  int flags = CLI$M_NOCLISYM|CLI$M_NOLOGNAM|CLI$M_NOKEYPAD, status, retstat;
+  $DESCRIPTOR(cmd, cmdbuf);
+
+  cmdbuf[0] = 0;
+  while (argsvector[i])
+  {
+    strcat(cmdbuf, argsvector[i]);
+    strcat(cmdbuf, " ");
+    i++;
+  }
+  cmd.dsc$w_length = strlen(cmdbuf) - 1;
+  status = lib$spawn(&cmd, 0,0, &flags, 0,0, &retstat);
+  if (!(status & 1)) result = 0;
+  else result = retstat & 1 ? 0 : 1;
+  }
+
+#else  /* Neither Windows nor VMS */
+pid = fork();
 if (pid == 0)
   {
   (void)execv(argsvector[0], argsvector);
@@ -2285,7 +2352,7 @@ if (pid == 0)
   }
 else if (pid > 0)
   (void)waitpid(pid, &result, 0);
-#endif
+#endif  /* End Windows/VMS/other handling */
 
 free(args);
 free(argsvector);
@@ -2294,9 +2361,9 @@ free(argsvector);
 continues) or non-zero (match fails). */
 
 return result != 0;
+#endif  /* SUPPORT_PCRE2GREP_CALLOUT_FORK */
 }
-
-#endif
+#endif  /* SUPPORT_PCRE2GREP_CALLOUT */
 
 
 
@@ -2528,7 +2595,7 @@ while (ptr < endptr)
 
       for (i = 0; i < jfriedl_XR; i++)
           match = (pcre_exec(patterns->compiled, patterns->hint, ptr, length, 0,
-              PCRE2_NOTEMPTY, offsets, OFFSET_SIZE) >= 0);
+              PCRE2_NOTEMPTY, offsets, offset_size) >= 0);
 
       if (gettimeofday(&end_time, &dummy) != 0)
               perror("bad gettimeofday");
@@ -2648,7 +2715,7 @@ while (ptr < endptr)
           for (om = only_matching; om != NULL; om = om->next)
             {
             int n = om->groupnum;
-            if (n < mrc)
+            if (n == 0 || n < mrc)
               {
               int plen = offsets[2*n + 1] - offsets[2*n];
               if (plen > 0)
@@ -3361,6 +3428,7 @@ switch(letter)
   case 's': silent = TRUE; break;
   case 't': show_total_count = TRUE; break;
   case 'u': options |= PCRE2_UTF; utf = TRUE; break;
+  case 'U': options |= PCRE2_UTF|PCRE2_MATCH_INVALID_UTF; utf = TRUE; break;
   case 'v': invert = TRUE; break;
   case 'w': extra_options |= PCRE2_EXTRA_MATCH_WORD; break;
   case 'x': extra_options |= PCRE2_EXTRA_MATCH_LINE; break;
@@ -3599,6 +3667,7 @@ int rc = 1;
 BOOL only_one_at_top;
 patstr *cp;
 fnstr *fn;
+omstr *om;
 const char *locale_from = "--locale";
 
 #ifdef SUPPORT_PCRE2GREP_JIT
@@ -3615,20 +3684,6 @@ must use STDOUT_NL to terminate lines. */
 _setmode(_fileno(stdout), _O_BINARY);
 #endif
 
-/* Set up a default compile and match contexts and a match data block. */
-
-compile_context = pcre2_compile_context_create(NULL);
-match_context = pcre2_match_context_create(NULL);
-match_data = pcre2_match_data_create(OFFSET_SIZE, NULL);
-offsets = pcre2_get_ovector_pointer(match_data);
-
-/* If string (script) callouts are supported, set up the callout processing
-function. */
-
-#ifdef SUPPORT_PCRE2GREP_CALLOUT
-pcre2_set_callout(match_context, pcre2grep_callout, NULL);
-#endif
-
 /* Process the options */
 
 for (i = 1; i < argc; i++)
@@ -3975,12 +4030,40 @@ if (only_matching_count > 1)
   pcre2grep_exit(usage(2));
   }
 
+/* Check that there is a big enough ovector for all -o settings. */
+
+for (om = only_matching; om != NULL; om = om->next)
+  {
+  int n = om->groupnum;
+  if (n > (int)capture_max)
+    {
+    fprintf(stderr, "pcre2grep: Requested group %d cannot be captured.\n", n);
+    fprintf(stderr, "pcre2grep: Use --om-capture to increase the size of the capture vector.\n");
+    goto EXIT2;
+    }
+  }
+
 /* Check the text supplied to --output for errors. */
 
 if (output_text != NULL &&
     !syntax_check_output_text((PCRE2_SPTR)output_text, FALSE))
   goto EXIT2;
 
+/* Set up default compile and match contexts and a match data block. */
+
+offset_size = capture_max + 1;
+compile_context = pcre2_compile_context_create(NULL);
+match_context = pcre2_match_context_create(NULL);
+match_data = pcre2_match_data_create(offset_size, NULL);
+offsets = pcre2_get_ovector_pointer(match_data);
+
+/* If string (script) callouts are supported, set up the callout processing
+function. */
+
+#ifdef SUPPORT_PCRE2GREP_CALLOUT
+pcre2_set_callout(match_context, pcre2grep_callout, NULL);
+#endif
+
 /* Put limits into the match data block. */
 
 if (heap_limit != PCRE2_UNSET) pcre2_set_heap_limit(match_context, heap_limit);
@@ -4302,11 +4385,12 @@ if (show_total_count && counts_printed != 1 && filenames != FN_NOMATCH_ONLY)
 
 EXIT:
 #ifdef SUPPORT_PCRE2GREP_JIT
+pcre2_jit_free_unused_memory(NULL);
 if (jit_stack != NULL) pcre2_jit_stack_free(jit_stack);
 #endif
 
 free(main_buffer);
-free((void *)character_tables);
+if (character_tables != NULL) pcre2_maketables_free(NULL, character_tables);
 
 pcre2_compile_context_free(compile_context);
 pcre2_match_context_free(match_context);
index 7b9f4774227eaa4eb3699606d6d2b38f5107c4e0..b24620a459b70d525bc3663009757fb65bbaf451 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) 2016-2018 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,12 @@ POSSIBILITY OF SUCH DAMAGE.
 
 
 /* This module is a wrapper that provides a POSIX API to the underlying PCRE2
-functions. */
+functions. The operative functions are called pcre2_regcomp(), etc., with
+wrappers that use the plain POSIX names. In addition, pcre2posix.h defines the
+POSIX names as macros for the pcre2_xxx functions, so any program that includes
+it and uses the POSIX names will call the base functions directly. This makes
+it easier for an application to be sure it gets the PCRE2 versions in the
+presence of other POSIX regex libraries. */
 
 
 #ifdef HAVE_CONFIG_H
@@ -170,13 +175,59 @@ static const char *const pstring[] = {
 
 
 
+/*************************************************
+*      Wrappers with traditional POSIX names     *
+*************************************************/
+
+/* Keep defining them to preseve the ABI for applications linked to the pcre2
+POSIX library before these names were changed into macros in pcre2posix.h.
+This also ensures that the POSIX names are callable from languages that do not
+include pcre2posix.h. It is vital to #undef the macro definitions from
+pcre2posix.h! */
+
+#undef regerror
+PCRE2POSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
+PCRE2POSIX_EXP_DEFN size_t PCRE2_CALL_CONVENTION
+regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
+{
+return pcre2_regerror(errcode, preg, errbuf, errbuf_size);
+}
+
+#undef regfree
+PCRE2POSIX_EXP_DECL void regfree(regex_t *);
+PCRE2POSIX_EXP_DEFN void PCRE2_CALL_CONVENTION
+regfree(regex_t *preg)
+{
+pcre2_regfree(preg);
+}
+
+#undef regcomp
+PCRE2POSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
+PCRE2POSIX_EXP_DEFN int PCRE2_CALL_CONVENTION
+regcomp(regex_t *preg, const char *pattern, int cflags)
+{
+return pcre2_regcomp(preg, pattern, cflags);
+}
+
+#undef regexec
+PCRE2POSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
+  regmatch_t *, int);
+PCRE2POSIX_EXP_DEFN int PCRE2_CALL_CONVENTION
+regexec(const regex_t *preg, const char *string, size_t nmatch,
+  regmatch_t pmatch[], int eflags)
+{
+return pcre2_regexec(preg, string, nmatch, pmatch, eflags);
+}
+
+
 
 /*************************************************
 *          Translate error code to string        *
 *************************************************/
 
 PCRE2POSIX_EXP_DEFN size_t PCRE2_CALL_CONVENTION
-regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
+pcre2_regerror(int errcode, const regex_t *preg, char *errbuf,
+  size_t errbuf_size)
 {
 int used;
 const char *message;
@@ -199,13 +250,12 @@ return used + 1;
 
 
 
-
 /*************************************************
 *           Free store held by a regex           *
 *************************************************/
 
 PCRE2POSIX_EXP_DEFN void PCRE2_CALL_CONVENTION
-regfree(regex_t *preg)
+pcre2_regfree(regex_t *preg)
 {
 pcre2_match_data_free(preg->re_match_data);
 pcre2_code_free(preg->re_pcre2_code);
@@ -213,7 +263,6 @@ pcre2_code_free(preg->re_pcre2_code);
 
 
 
-
 /*************************************************
 *            Compile a regular expression        *
 *************************************************/
@@ -229,7 +278,7 @@ Returns:      0 on success
 */
 
 PCRE2POSIX_EXP_DEFN int PCRE2_CALL_CONVENTION
-regcomp(regex_t *preg, const char *pattern, int cflags)
+pcre2_regcomp(regex_t *preg, const char *pattern, int cflags)
 {
 PCRE2_SIZE erroffset;
 PCRE2_SIZE patlen;
@@ -274,6 +323,7 @@ if (preg->re_pcre2_code == NULL)
   PCRE2_INFO_CAPTURECOUNT, &re_nsub);
 preg->re_nsub = (size_t)re_nsub;
 preg->re_match_data = pcre2_match_data_create(re_nsub + 1, NULL);
+preg->re_erroffset = (size_t)(-1);  /* No meaning after successful compile */
 
 if (preg->re_match_data == NULL)
   {
@@ -296,7 +346,7 @@ for each match. If REG_NOSUB was specified at compile time, the nmatch and
 pmatch arguments are ignored, and the only result is yes/no/error. */
 
 PCRE2POSIX_EXP_DEFN int PCRE2_CALL_CONVENTION
-regexec(const regex_t *preg, const char *string, size_t nmatch,
+pcre2_regexec(const regex_t *preg, const char *string, size_t nmatch,
   regmatch_t pmatch[], int eflags)
 {
 int rc, so, eo;
@@ -307,8 +357,6 @@ if ((eflags & REG_NOTBOL) != 0) options |= PCRE2_NOTBOL;
 if ((eflags & REG_NOTEOL) != 0) options |= PCRE2_NOTEOL;
 if ((eflags & REG_NOTEMPTY) != 0) options |= PCRE2_NOTEMPTY;
 
-((regex_t *)preg)->re_erroffset = (size_t)(-1);  /* Only has meaning after compile */
-
 /* When REG_NOSUB was specified, or if no vector has been passed in which to
 put captured strings, ensure that nmatch is zero. This will stop any attempt to
 write to pmatch. */
index 4ae1d3c2a051a39baaa048d7c2a0bb022f0f32b3..3a663b9ff8b628b00222585b0274a976e66bf033 100644 (file)
@@ -3,11 +3,13 @@
 *************************************************/
 
 /* PCRE2 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.
+and semantics are as close as possible to those of the Perl 5 language. This is
+the public header file to be #included by applications that call PCRE2 via the
+POSIX wrapper interface.
 
                        Written by Philip Hazel
      Original API code Copyright (c) 1997-2012 University of Cambridge
-         New API code Copyright (c) 2016 University of Cambridge
+          New API code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -136,13 +138,30 @@ file. */
 #  endif
 #endif
 
-/* The functions */
+/* The functions. The actual code is in functions with pcre2_xxx names for
+uniqueness. POSIX names are provided as macros for API compatibility with POSIX
+regex functions. It's done this way to ensure to they are always linked from
+the PCRE2 library and not by accident from elsewhere (regex_t differs in size
+elsewhere). */
 
-PCRE2POSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
-PCRE2POSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
+PCRE2POSIX_EXP_DECL int pcre2_regcomp(regex_t *, const char *, int);
+PCRE2POSIX_EXP_DECL int pcre2_regexec(const regex_t *, const char *, size_t,
                      regmatch_t *, int);
-PCRE2POSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
-PCRE2POSIX_EXP_DECL void regfree(regex_t *);
+PCRE2POSIX_EXP_DECL size_t pcre2_regerror(int, const regex_t *, char *, size_t);
+PCRE2POSIX_EXP_DECL void pcre2_regfree(regex_t *);
+
+#define regcomp  pcre2_regcomp
+#define regexec  pcre2_regexec
+#define regerror pcre2_regerror
+#define regfree  pcre2_regfree
+
+/* Debian had a patch that used different names. These are now here to save
+them having to maintain their own patch, but are not documented by PCRE2. */
+
+#define PCRE2regcomp  pcre2_regcomp
+#define PCRE2regexec  pcre2_regexec
+#define PCRE2regerror pcre2_regerror
+#define PCRE2regfree  pcre2_regfree
 
 #ifdef __cplusplus
 }   /* extern "C" */
index 8cfb8e919e1ee89e45e41d8a80c1f5d5e4d9434d..57bd1103f4e9acc63339ab831270e61409fceb22 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) 2016-2018 University of Cambridge
+    Rewritten code Copyright (c) 2016-2019 University of Cambridge
 
 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -157,14 +157,24 @@ patterns. */
 #endif
 #endif
 
+/* VMS-specific code was included as suggested by a VMS user [1]. Another VMS
+user [2] provided alternative code which worked better for him. I have
+commented out the original, but kept it around just in case. */
+
 #ifdef __VMS
 #include <ssdef.h>
-void vms_setsymbol( char *, char *, int );
+/* These two includes came from [2]. */
+#include descrip
+#include lib$routines
+/* void vms_setsymbol( char *, char *, int ); Original code from [1]. */
 #endif
 
-/* VC and older compilers don't support %td or %zu. */
+/* VC and older compilers don't support %td or %zu, and even some that claim to
+be C99 don't support it (hence DISABLE_PERCENT_ZT). There are some non-C99
+environments where %lu gives a warning with 32-bit pointers. As there doesn't
+seem to be an easy way round this, just live with it (the cases are rare). */
 
-#if defined(_MSC_VER) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
+#if defined(_MSC_VER) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L || defined(DISABLE_PERCENT_ZT)
 #define PTR_FORM "lu"
 #define SIZ_FORM "lu"
 #define SIZ_CAST (unsigned long int)
@@ -204,6 +214,12 @@ void vms_setsymbol( char *, char *, int );
 #define REPLACE_MODSIZE 100       /* Field for reading 8-bit replacement */
 #define VERSION_SIZE 64           /* Size of buffer for the version strings */
 
+/* Default JIT compile options */
+
+#define JIT_DEFAULT (PCRE2_JIT_COMPLETE|\
+                     PCRE2_JIT_PARTIAL_SOFT|\
+                     PCRE2_JIT_PARTIAL_HARD)
+
 /* Make sure the buffer into which replacement strings are copied is big enough
 to hold them as 32-bit code units. */
 
@@ -484,13 +500,15 @@ so many of them that they are split into two fields. */
 
 /* 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
-#define CTL2_SUBJECT_LITERAL             0x00000010u
-#define CTL2_CALLOUT_NO_WHERE            0x00000020u
-#define CTL2_CALLOUT_EXTRA               0x00000040u
+#define CTL2_SUBSTITUTE_CALLOUT          0x00000001u
+#define CTL2_SUBSTITUTE_EXTENDED         0x00000002u
+#define CTL2_SUBSTITUTE_OVERFLOW_LENGTH  0x00000004u
+#define CTL2_SUBSTITUTE_UNKNOWN_UNSET    0x00000008u
+#define CTL2_SUBSTITUTE_UNSET_EMPTY      0x00000010u
+#define CTL2_SUBJECT_LITERAL             0x00000020u
+#define CTL2_CALLOUT_NO_WHERE            0x00000040u
+#define CTL2_CALLOUT_EXTRA               0x00000080u
+#define CTL2_ALLVECTOR                   0x00000100u
 
 #define CTL2_NL_SET                      0x40000000u  /* Informational */
 #define CTL2_BSR_SET                     0x80000000u  /* Informational */
@@ -510,22 +528,26 @@ different things in the two cases. */
                     CTL_STARTCHAR|\
                     CTL_UTF8_INPUT)
 
-#define CTL2_ALLPD (CTL2_SUBSTITUTE_EXTENDED|\
+#define CTL2_ALLPD (CTL2_SUBSTITUTE_CALLOUT|\
+                    CTL2_SUBSTITUTE_EXTENDED|\
                     CTL2_SUBSTITUTE_OVERFLOW_LENGTH|\
                     CTL2_SUBSTITUTE_UNKNOWN_UNSET|\
-                    CTL2_SUBSTITUTE_UNSET_EMPTY)
+                    CTL2_SUBSTITUTE_UNSET_EMPTY|\
+                    CTL2_ALLVECTOR)
 
 /* 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
 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 */
-  uint32_t  jitstack;      /* Must be in same position as datctl */
+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 */
+  uint32_t  jitstack;         /* Must be in same position as datctl */
    uint8_t  replacement[REPLACE_MODSIZE];  /* So must this */
+  uint32_t  substitute_skip;  /* Must be in same position as patctl */
+  uint32_t  substitute_stop;  /* Must be in same position as patctl */
   uint32_t  jit;
   uint32_t  stackguard_test;
   uint32_t  tables_id;
@@ -540,12 +562,14 @@ typedef struct patctl {    /* Structure for pattern modifiers. */
 #define MAXCPYGET 10
 #define LENCPYGET 64
 
-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 */
-  uint32_t  jitstack;      /* Must be in same position as patctl */
+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 */
+  uint32_t  jitstack;         /* Must be in same position as patctl */
    uint8_t  replacement[REPLACE_MODSIZE];  /* So must this */
+  uint32_t  substitute_skip;  /* Must be in same position as patctl */
+  uint32_t  substitute_stop;  /* Must be in same position as patctl */
   uint32_t  startend[2];
   uint32_t  cerror[2];
   uint32_t  cfail[2];
@@ -592,6 +616,7 @@ static modstruct modlist[] = {
   { "allow_empty_class",          MOD_PAT,  MOD_OPT, PCRE2_ALLOW_EMPTY_CLASS,    PO(options) },
   { "allow_surrogate_escapes",    MOD_CTC,  MOD_OPT, PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES, CO(extra_options) },
   { "allusedtext",                MOD_PNDP, MOD_CTL, CTL_ALLUSEDTEXT,            PO(control) },
+  { "allvector",                  MOD_PND,  MOD_CTL, CTL2_ALLVECTOR,             PO(control2) },
   { "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) },
@@ -615,6 +640,7 @@ static modstruct modlist[] = {
   { "convert_glob_separator",     MOD_PAT,  MOD_CHR, 0,                          PO(convert_glob_separator) },
   { "convert_length",             MOD_PAT,  MOD_INT, 0,                          PO(convert_length) },
   { "copy",                       MOD_DAT,  MOD_NN,  DO(copy_numbers),           DO(copy_names) },
+  { "copy_matched_subject",       MOD_DAT,  MOD_OPT, PCRE2_COPY_MATCHED_SUBJECT, DO(options) },
   { "debug",                      MOD_PAT,  MOD_CTL, CTL_DEBUG,                  PO(control) },
   { "depth_limit",                MOD_CTM,  MOD_INT, 0,                          MO(depth_limit) },
   { "dfa",                        MOD_DAT,  MOD_CTL, CTL_DFA,                    DO(control) },
@@ -624,9 +650,11 @@ static modstruct modlist[] = {
   { "dotall",                     MOD_PATP, MOD_OPT, PCRE2_DOTALL,               PO(options) },
   { "dupnames",                   MOD_PATP, MOD_OPT, PCRE2_DUPNAMES,             PO(options) },
   { "endanchored",                MOD_PD,   MOD_OPT, PCRE2_ENDANCHORED,          PD(options) },
+  { "escaped_cr_is_lf",           MOD_CTC,  MOD_OPT, PCRE2_EXTRA_ESCAPED_CR_IS_LF, CO(extra_options) },
   { "expand",                     MOD_PAT,  MOD_CTL, CTL_EXPAND,                 PO(control) },
   { "extended",                   MOD_PATP, MOD_OPT, PCRE2_EXTENDED,             PO(options) },
   { "extended_more",              MOD_PATP, MOD_OPT, PCRE2_EXTENDED_MORE,        PO(options) },
+  { "extra_alt_bsux",             MOD_CTC,  MOD_OPT, PCRE2_EXTRA_ALT_BSUX,       CO(extra_options) },
   { "find_limits",                MOD_DAT,  MOD_CTL, CTL_FINDLIMITS,             DO(control) },
   { "firstline",                  MOD_PAT,  MOD_OPT, PCRE2_FIRSTLINE,            PO(options) },
   { "framesize",                  MOD_PAT,  MOD_CTL, CTL_FRAMESIZE,              PO(control) },
@@ -644,6 +672,7 @@ static modstruct modlist[] = {
   { "literal",                    MOD_PAT,  MOD_OPT, PCRE2_LITERAL,              PO(options) },
   { "locale",                     MOD_PAT,  MOD_STR, LOCALESIZE,                 PO(locale) },
   { "mark",                       MOD_PNDP, MOD_CTL, CTL_MARK,                   PO(control) },
+  { "match_invalid_utf",          MOD_PAT,  MOD_OPT, PCRE2_MATCH_INVALID_UTF,    PO(options) },
   { "match_limit",                MOD_CTM,  MOD_INT, 0,                          MO(match_limit) },
   { "match_line",                 MOD_CTC,  MOD_OPT, PCRE2_EXTRA_MATCH_LINE,     CO(extra_options) },
   { "match_unset_backref",        MOD_PAT,  MOD_OPT, PCRE2_MATCH_UNSET_BACKREF,  PO(options) },
@@ -687,8 +716,11 @@ static modstruct modlist[] = {
   { "startchar",                  MOD_PND,  MOD_CTL, CTL_STARTCHAR,              PO(control) },
   { "startoffset",                MOD_DAT,  MOD_INT, 0,                          DO(offset) },
   { "subject_literal",            MOD_PATP, MOD_CTL, CTL2_SUBJECT_LITERAL,       PO(control2) },
+  { "substitute_callout",         MOD_PND,  MOD_CTL, CTL2_SUBSTITUTE_CALLOUT,    PO(control2) },
   { "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_skip",            MOD_PND,  MOD_INT, 0,                          PO(substitute_skip) },
+  { "substitute_stop",            MOD_PND,  MOD_INT, 0,                          PO(substitute_stop) },
   { "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) },
@@ -888,6 +920,7 @@ static uint32_t forbid_utf = 0;
 static uint32_t maxlookbehind;
 static uint32_t max_oveccount;
 static uint32_t callout_count;
+static uint32_t maxcapcount;
 
 static uint16_t local_newline_default = 0;
 
@@ -1351,15 +1384,26 @@ are supported. */
   else \
     pcre2_set_parens_nest_limit_32(G(a,32),b)
 
+#define PCRE2_SET_SUBSTITUTE_CALLOUT(a,b,c) \
+  if (test_mode == PCRE8_MODE) \
+    pcre2_set_substitute_callout_8(G(a,8), \
+      (int (*)(pcre2_substitute_callout_block_8 *, void *))b,c); \
+  else if (test_mode == PCRE16_MODE) \
+    pcre2_set_substitute_callout_16(G(a,16), \
+      (int (*)(pcre2_substitute_callout_block_16 *, void *))b,c); \
+  else \
+    pcre2_set_substitute_callout_32(G(a,32), \
+      (int (*)(pcre2_substitute_callout_block_32 *, void *))b,c)
+
 #define PCRE2_SUBSTITUTE(a,b,c,d,e,f,g,h,i,j,k,l) \
   if (test_mode == PCRE8_MODE) \
-    a = pcre2_substitute_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),G(h,8), \
+    a = pcre2_substitute_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),h, \
       (PCRE2_SPTR8)i,j,(PCRE2_UCHAR8 *)k,l); \
   else if (test_mode == PCRE16_MODE) \
-    a = pcre2_substitute_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),G(h,16), \
+    a = pcre2_substitute_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h, \
       (PCRE2_SPTR16)i,j,(PCRE2_UCHAR16 *)k,l); \
   else \
-    a = pcre2_substitute_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),G(h,32), \
+    a = pcre2_substitute_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h, \
       (PCRE2_SPTR32)i,j,(PCRE2_UCHAR32 *)k,l)
 
 #define PCRE2_SUBSTRING_COPY_BYNAME(a,b,c,d,e) \
@@ -1820,14 +1864,22 @@ the three different cases. */
   else \
     G(pcre2_set_parens_nest_limit_,BITTWO)(G(a,BITTWO),b)
 
+#define PCRE2_SET_SUBSTITUTE_CALLOUT(a,b,c) \
+  if (test_mode == G(G(PCRE,BITONE),_MODE)) \
+    G(pcre2_set_substitute_callout_,BITONE)(G(a,BITONE), \
+      (int (*)(G(pcre2_substitute_callout_block_,BITONE) *, void *))b,c); \
+  else \
+    G(pcre2_set_substitute_callout_,BITTWO)(G(a,BITTWO), \
+      (int (*)(G(pcre2_substitute_callout_block_,BITTWO) *, void *))b,c)
+
 #define PCRE2_SUBSTITUTE(a,b,c,d,e,f,g,h,i,j,k,l) \
   if (test_mode == G(G(PCRE,BITONE),_MODE)) \
     a = G(pcre2_substitute_,BITONE)(G(b,BITONE),(G(PCRE2_SPTR,BITONE))c,d,e,f, \
-      G(g,BITONE),G(h,BITONE),(G(PCRE2_SPTR,BITONE))i,j, \
+      G(g,BITONE),h,(G(PCRE2_SPTR,BITONE))i,j, \
       (G(PCRE2_UCHAR,BITONE) *)k,l); \
   else \
     a = G(pcre2_substitute_,BITTWO)(G(b,BITTWO),(G(PCRE2_SPTR,BITTWO))c,d,e,f, \
-      G(g,BITTWO),G(h,BITTWO),(G(PCRE2_SPTR,BITTWO))i,j, \
+      G(g,BITTWO),h,(G(PCRE2_SPTR,BITTWO))i,j, \
       (G(PCRE2_UCHAR,BITTWO) *)k,l)
 
 #define PCRE2_SUBSTRING_COPY_BYNAME(a,b,c,d,e) \
@@ -2021,8 +2073,11 @@ the three different cases. */
 #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_SUBSTITUTE_CALLOUT(a,b,c) \
+  pcre2_set_substitute_callout_8(G(a,8), \
+    (int (*)(pcre2_substitute_callout_block_8 *, void *))b,c)
 #define PCRE2_SUBSTITUTE(a,b,c,d,e,f,g,h,i,j,k,l) \
-  a = pcre2_substitute_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),G(h,8), \
+  a = pcre2_substitute_8(G(b,8),(PCRE2_SPTR8)c,d,e,f,G(g,8),h, \
     (PCRE2_SPTR8)i,j,(PCRE2_UCHAR8 *)k,l)
 #define PCRE2_SUBSTRING_COPY_BYNAME(a,b,c,d,e) \
   a = pcre2_substring_copy_byname_8(G(b,8),G(c,8),(PCRE2_UCHAR8 *)d,e)
@@ -2125,8 +2180,11 @@ the three different cases. */
 #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_SUBSTITUTE_CALLOUT(a,b,c) \
+  pcre2_set_substitute_callout_16(G(a,16), \
+    (int (*)(pcre2_substitute_callout_block_16 *, void *))b,c)
 #define PCRE2_SUBSTITUTE(a,b,c,d,e,f,g,h,i,j,k,l) \
-  a = pcre2_substitute_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),G(h,16), \
+  a = pcre2_substitute_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h, \
     (PCRE2_SPTR16)i,j,(PCRE2_UCHAR16 *)k,l)
 #define PCRE2_SUBSTRING_COPY_BYNAME(a,b,c,d,e) \
   a = pcre2_substring_copy_byname_16(G(b,16),G(c,16),(PCRE2_UCHAR16 *)d,e)
@@ -2217,7 +2275,7 @@ the three different cases. */
 #define PCRE2_SERIALIZE_GET_NUMBER_OF_CODES(r,a) \
   r = pcre2_serialize_get_number_of_codes_32(a)
 #define PCRE2_SET_CALLOUT(a,b,c) \
-  pcre2_set_callout_32(G(a,32),(int (*)(pcre2_callout_block_32 *, void *))b,c);
+  pcre2_set_callout_32(G(a,32),(int (*)(pcre2_callout_block_32 *, void *))b,c)
 #define PCRE2_SET_CHARACTER_TABLES(a,b) pcre2_set_character_tables_32(G(a,32),b)
 #define PCRE2_SET_COMPILE_RECURSION_GUARD(a,b,c) \
   pcre2_set_compile_recursion_guard_32(G(a,32),b,c)
@@ -2229,8 +2287,11 @@ the three different cases. */
 #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_SUBSTITUTE_CALLOUT(a,b,c) \
+  pcre2_set_substitute_callout_32(G(a,32), \
+    (int (*)(pcre2_substitute_callout_block_32 *, void *))b,c)
 #define PCRE2_SUBSTITUTE(a,b,c,d,e,f,g,h,i,j,k,l) \
-  a = pcre2_substitute_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),G(h,32), \
+  a = pcre2_substitute_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h, \
     (PCRE2_SPTR32)i,j,(PCRE2_UCHAR32 *)k,l)
 #define PCRE2_SUBSTRING_COPY_BYNAME(a,b,c,d,e) \
   a = pcre2_substring_copy_byname_32(G(b,32),G(c,32),(PCRE2_UCHAR32 *)d,e)
@@ -2998,13 +3059,14 @@ return yield;
 
 
 
-#ifdef SUPPORT_PCRE2_8
 /*************************************************
 *       Convert character value to UTF-8         *
 *************************************************/
 
 /* This function takes an integer value in the range 0 - 0x7fffffff
-and encodes it as a UTF-8 character in 0 to 6 bytes.
+and encodes it as a UTF-8 character in 0 to 6 bytes. It is needed even when the
+8-bit library is not supported, to generate UTF-8 output for non-ASCII
+characters.
 
 Arguments:
   cvalue     the character value
@@ -3030,7 +3092,6 @@ for (j = i; j > 0; j--)
 *utf8bytes = utf8_table2[i] | cvalue;
 return i + 1;
 }
-#endif  /* SUPPORT_PCRE2_8 */
 
 
 
@@ -3210,6 +3271,11 @@ return 0;
 
 
 
+/* This function is no longer used. Keep it around for a while, just in case it
+needs to be re-instated. */
+
+#ifdef NEVERNEVERNEVER
+
 /*************************************************
 *         Move back by so many characters        *
 *************************************************/
@@ -3254,6 +3320,7 @@ else  /* 16-bit mode */
   return pp - (PCRE2_SPTR16)subject;
   }
 }
+#endif  /* NEVERNEVERNEVER */
 
 
 
@@ -4018,12 +4085,13 @@ Returns:      nothing
 static void
 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%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%s%s%s%s%s%s%s%s%s%s",
   before,
   ((controls & CTL_AFTERTEXT) != 0)? " aftertext" : "",
   ((controls & CTL_ALLAFTERTEXT) != 0)? " allaftertext" : "",
   ((controls & CTL_ALLCAPTURES) != 0)? " allcaptures" : "",
   ((controls & CTL_ALLUSEDTEXT) != 0)? " allusedtext" : "",
+  ((controls2 & CTL2_ALLVECTOR) != 0)? " allvector" : "",
   ((controls & CTL_ALTGLOBAL) != 0)? " altglobal" : "",
   ((controls & CTL_BINCODE) != 0)? " bincode" : "",
   ((controls2 & CTL2_BSR_SET) != 0)? " bsr" : "",
@@ -4053,6 +4121,7 @@ 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
   ((controls & CTL_PUSHCOPY) != 0)? " pushcopy" : "",
   ((controls & CTL_PUSHTABLESCOPY) != 0)? " pushtablescopy" : "",
   ((controls & CTL_STARTCHAR) != 0)? " startchar" : "",
+  ((controls2 & CTL2_SUBSTITUTE_CALLOUT) != 0)? " substitute_callout" : "",
   ((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" : "",
@@ -4082,7 +4151,7 @@ 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%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%s%s%s%s",
   before,
   ((options & PCRE2_ALT_BSUX) != 0)? " alt_bsux" : "",
   ((options & PCRE2_ALT_CIRCUMFLEX) != 0)? " alt_circumflex" : "",
@@ -4099,6 +4168,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%s%s%
   ((options & PCRE2_EXTENDED_MORE) != 0)? " extended_more" : "",
   ((options & PCRE2_FIRSTLINE) != 0)? " firstline" : "",
   ((options & PCRE2_LITERAL) != 0)? " literal" : "",
+  ((options & PCRE2_MATCH_INVALID_UTF) != 0)? " match_invalid_utf" : "",
   ((options & PCRE2_MATCH_UNSET_BACKREF) != 0)? " match_unset_backref" : "",
   ((options & PCRE2_MULTILINE) != 0)? " multiline" : "",
   ((options & PCRE2_NEVER_BACKSLASH_C) != 0)? " never_backslash_c" : "",
@@ -4136,12 +4206,14 @@ show_compile_extra_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",
+else fprintf(outfile, "%s%s%s%s%s%s%s%s",
   before,
   ((options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) != 0)? " allow_surrogate_escapes" : "",
   ((options & PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL) != 0)? " bad_escape_is_literal" : "",
+  ((options & PCRE2_EXTRA_ALT_BSUX) != 0)? " extra_alt_bsux" : "",
   ((options & PCRE2_EXTRA_MATCH_WORD) != 0)? " match_word" : "",
   ((options & PCRE2_EXTRA_MATCH_LINE) != 0)? " match_line" : "",
+  ((options & PCRE2_EXTRA_ESCAPED_CR_IS_LF) != 0)? " escaped_cr_is_lf" : "",
   after);
 }
 
@@ -4157,11 +4229,13 @@ else fprintf(outfile, "%s%s%s%s%s%s",
 static void
 show_match_options(uint32_t options)
 {
-fprintf(outfile, "%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",
   ((options & PCRE2_ANCHORED) != 0)? " anchored" : "",
+  ((options & PCRE2_COPY_MATCHED_SUBJECT) != 0)? " copy_matched_subject" : "",
   ((options & PCRE2_DFA_RESTART) != 0)? " dfa_restart" : "",
   ((options & PCRE2_DFA_SHORTEST) != 0)? " dfa_shortest" : "",
   ((options & PCRE2_ENDANCHORED) != 0)? " endanchored" : "",
+  ((options & PCRE2_NO_JIT) != 0)? " no_jit" : "",
   ((options & PCRE2_NO_UTF_CHECK) != 0)? " no_utf_check" : "",
   ((options & PCRE2_NOTBOL) != 0)? " notbol" : "",
   ((options & PCRE2_NOTEMPTY) != 0)? " notempty" : "",
@@ -4318,6 +4392,7 @@ static int
 show_pattern_info(void)
 {
 uint32_t compile_options, overall_options, extra_options;
+BOOL utf = (FLD(compiled_code, overall_options) & PCRE2_UTF) != 0;
 
 if ((pat_patctl.control & (CTL_BINCODE|CTL_FULLBINCODE)) != 0)
   {
@@ -4407,7 +4482,7 @@ if ((pat_patctl.control & CTL_INFO) != 0)
       != 0)
     return PR_ABEND;
 
-  fprintf(outfile, "Capturing subpattern count = %d\n", capture_count);
+  fprintf(outfile, "Capture group count = %d\n", capture_count);
 
   if (backrefmax > 0)
     fprintf(outfile, "Max back reference = %d\n", backrefmax);
@@ -4426,14 +4501,60 @@ if ((pat_patctl.control & CTL_INFO) != 0)
 
   if (namecount > 0)
     {
-    fprintf(outfile, "Named capturing subpatterns:\n");
+    fprintf(outfile, "Named capture groups:\n");
     for (; namecount > 0; namecount--)
       {
       int imm2_size = test_mode == PCRE8_MODE ? 2 : 1;
       uint32_t length = (uint32_t)STRLEN(nametable + imm2_size);
       fprintf(outfile, "  ");
-      PCHARSV(nametable, imm2_size, length, FALSE, outfile);
+
+      /* In UTF mode the name may be a UTF string containing non-ASCII
+      letters and digits. We must output it as a UTF-8 string. In non-UTF mode,
+      use the normal string printing functions, which use escapes for all
+      non-ASCII characters. */
+
+      if (utf)
+        {
+#ifdef SUPPORT_PCRE2_32
+        if (test_mode == PCRE32_MODE)
+          {
+          PCRE2_SPTR32 nameptr = (PCRE2_SPTR32)nametable + imm2_size;
+          while (*nameptr != 0)
+            {
+            uint8_t u8buff[6];
+            int len = ord2utf8(*nameptr++, u8buff);
+            fprintf(outfile, "%.*s", len, u8buff);
+            }
+          }
+#endif
+#ifdef SUPPORT_PCRE2_16
+        if (test_mode == PCRE16_MODE)
+          {
+          PCRE2_SPTR16 nameptr = (PCRE2_SPTR16)nametable + imm2_size;
+          while (*nameptr != 0)
+            {
+            int len;
+            uint8_t u8buff[6];
+            uint32_t c = *nameptr++ & 0xffff;
+            if (c >= 0xD800 && c < 0xDC00)
+              c = ((c & 0x3ff) << 10) + (*nameptr++ & 0x3ff) + 0x10000;
+            len = ord2utf8(c, u8buff);
+            fprintf(outfile, "%.*s", len, u8buff);
+            }
+          }
+#endif
+#ifdef SUPPORT_PCRE2_8
+        if (test_mode == PCRE8_MODE)
+          fprintf(outfile, "%s", (PCRE2_SPTR8)nametable + imm2_size);
+#endif
+        }
+      else  /* Not UTF mode */
+        {
+        PCHARSV(nametable, imm2_size, length, FALSE, outfile);
+        }
+
       while (length++ < nameentrysize - imm2_size) putc(' ', outfile);
+
 #ifdef SUPPORT_PCRE2_32
       if (test_mode == PCRE32_MODE)
         fprintf(outfile, "%3d\n", (int)(((PCRE2_SPTR32)nametable)[0]));
@@ -4447,6 +4568,7 @@ if ((pat_patctl.control & CTL_INFO) != 0)
         fprintf(outfile, "%3d\n", (int)(
         ((((PCRE2_SPTR8)nametable)[0]) << 8) | ((PCRE2_SPTR8)nametable)[1]));
 #endif
+
       nametable = (void*)((PCRE2_SPTR8)nametable + nameentrysize * code_unit_size);
       }
     }
@@ -4553,7 +4675,7 @@ if ((pat_patctl.control & CTL_INFO) != 0)
     fprintf(outfile, "Starting code units: ");
     for (i = 0; i < 256; i++)
       {
-      if ((start_bits[i/8] & (1<<(i&7))) != 0)
+      if ((start_bits[i/8] & (1u << (i&7))) != 0)
         {
         if (c > 75)
           {
@@ -4590,7 +4712,8 @@ if ((pat_patctl.control & CTL_INFO) != 0)
       }
     }
 
-  fprintf(outfile, "Subject length lower bound = %d\n", minlength);
+  if ((FLD(compiled_code, overall_options) & PCRE2_NO_START_OPTIMIZE) == 0)
+    fprintf(outfile, "Subject length lower bound = %d\n", minlength);
 
   if (pat_patctl.jit != 0 && (pat_patctl.control & CTL_JITVERIFY) != 0)
     {
@@ -4761,7 +4884,7 @@ switch(cmd)
   case CMD_PATTERN:
   (void)decode_modifiers(argptr, CTX_DEFPAT, &def_patctl, NULL);
   if (def_patctl.jit == 0 && (def_patctl.control & CTL_JITVERIFY) != 0)
-    def_patctl.jit = 7;
+    def_patctl.jit = JIT_DEFAULT;
   break;
 
   /* Set default subject modifiers */
@@ -5008,7 +5131,11 @@ patlen = p - buffer - 2;
 /* Look for modifiers and options after the final delimiter. */
 
 if (!decode_modifiers(p, CTX_PAT, &pat_patctl, NULL)) return PR_SKIP;
-utf = (pat_patctl.options & PCRE2_UTF) != 0;
+
+/* Note that the match_invalid_utf option also sets utf when passed to
+pcre2_compile(). */
+
+utf = (pat_patctl.options & (PCRE2_UTF|PCRE2_MATCH_INVALID_UTF)) != 0;
 
 /* The utf8_input modifier is not allowed in 8-bit mode, and is mutually
 exclusive with the utf modifier. */
@@ -5055,7 +5182,7 @@ specified. */
 
 if (pat_patctl.jit == 0 &&
     (pat_patctl.control & (CTL_JITVERIFY|CTL_JITFAST)) != 0)
-  pat_patctl.jit = 7;
+  pat_patctl.jit = JIT_DEFAULT;
 
 /* Now copy the pattern to pbuffer8 for use in 8-bit testing and for reflecting
 in callouts. Convert from hex if requested (literal strings in quotes may be
@@ -5638,6 +5765,7 @@ if (TEST(compiled_code, !=, NULL) && pat_patctl.jit != 0)
     {
     int i;
     clock_t time_taken = 0;
+
     for (i = 0; i < timeit; i++)
       {
       clock_t start_time;
@@ -5646,7 +5774,7 @@ if (TEST(compiled_code, !=, NULL) && pat_patctl.jit != 0)
         pat_patctl.options|use_forbid_utf, &errorcode, &erroroffset,
         use_pat_context);
       start_time = clock();
-      PCRE2_JIT_COMPILE(jitrc,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;
@@ -5717,6 +5845,11 @@ if (forbid_utf != 0)
 if (pattern_info(PCRE2_INFO_MAXLOOKBEHIND, &maxlookbehind, FALSE) != 0)
   return PR_ABEND;
 
+/* Remember the number of captures. */
+
+if (pattern_info(PCRE2_INFO_CAPTURECOUNT, &maxcapcount, FALSE) < 0)
+  return PR_ABEND;
+
 /* If an explicit newline modifier was given, set the information flag in the
 pattern so that it is preserved over push/pop. */
 
@@ -5886,6 +6019,58 @@ return capcount;
 
 
 
+/*************************************************
+*        Substitute callout function             *
+*************************************************/
+
+/* Called from pcre2_substitute() when the substitute_callout modifier is set.
+Print out the data that is passed back. The substitute callout block is
+identical for all code unit widths, so we just pick one.
+
+Arguments:
+  scb         pointer to substitute callout block
+  data_ptr    callout data
+
+Returns:      nothing
+*/
+
+static int
+substitute_callout_function(pcre2_substitute_callout_block_8 *scb,
+  void *data_ptr)
+{
+int yield = 0;
+BOOL utf = (FLD(compiled_code, overall_options) & PCRE2_UTF) != 0;
+(void)data_ptr;   /* Not used */
+
+fprintf(outfile, "%2d(%d) Old %" SIZ_FORM " %" SIZ_FORM " \"",
+  scb->subscount, scb->oveccount,
+  SIZ_CAST scb->ovector[0], SIZ_CAST scb->ovector[1]);
+
+PCHARSV(scb->input, scb->ovector[0], scb->ovector[1] - scb->ovector[0],
+  utf, outfile);
+
+fprintf(outfile, "\" New %" SIZ_FORM " %" SIZ_FORM " \"",
+  SIZ_CAST scb->output_offsets[0], SIZ_CAST scb->output_offsets[1]);
+
+PCHARSV(scb->output, scb->output_offsets[0],
+  scb->output_offsets[1] - scb->output_offsets[0], utf, outfile);
+
+if (scb->subscount == dat_datctl.substitute_stop)
+  {
+  yield = -1;
+  fprintf(outfile, " STOPPED");
+  }
+else if (scb->subscount == dat_datctl.substitute_skip)
+  {
+  yield = +1;
+  fprintf(outfile, " SKIPPED");
+  }
+
+fprintf(outfile, "\"\n");
+return yield;
+}
+
+
 /*************************************************
 *              Callout function                  *
 *************************************************/
@@ -5897,8 +6082,11 @@ callout block for different code unit widths are that the pointers to the
 subject, the most recent MARK, and a callout argument string point to strings
 of the appropriate width. Casts can be used to deal with this.
 
-Argument:  a pointer to a callout block
-Return:
+Arguments:
+  cb                a pointer to a callout block
+  callout_data_ptr  the provided callout data
+
+Returns:            0 or 1 or an error, as determined by settings
 */
 
 static int
@@ -6317,6 +6505,42 @@ return TRUE;
 
 
 
+/*************************************************
+*            Show an entire ovector              *
+*************************************************/
+
+/* This function is called after partial matching or match failure, when the
+"allvector" modifier is set. It is a means of checking the contents of the
+entire ovector, to ensure no modification of fields that should be unchanged.
+
+Arguments:
+  ovector      points to the ovector
+  oveccount    number of pairs
+
+Returns:       nothing
+*/
+
+static void
+show_ovector(PCRE2_SIZE *ovector, uint32_t oveccount)
+{
+uint32_t i;
+for (i = 0; i < 2*oveccount; i += 2)
+  {
+  PCRE2_SIZE start = ovector[i];
+  PCRE2_SIZE end = ovector[i+1];
+
+  fprintf(outfile, "%2d: ", i/2);
+  if (start == PCRE2_UNSET && end == PCRE2_UNSET)
+    fprintf(outfile, "<unset>\n");
+  else if (start == JUNK_OFFSET && end == JUNK_OFFSET)
+    fprintf(outfile, "<unchanged>\n");
+  else
+    fprintf(outfile, "%ld %ld\n", (unsigned long int)start,
+      (unsigned long int)end);
+  }
+}
+
+
 /*************************************************
 *               Process a data line              *
 *************************************************/
@@ -6342,7 +6566,10 @@ size_t needlen;
 void *use_dat_context;
 BOOL utf;
 BOOL subject_literal;
+
+PCRE2_SIZE *ovector;
 PCRE2_SIZE ovecsave[3];
+uint32_t oveccount;
 
 #ifdef SUPPORT_PCRE2_8
 uint8_t *q8 = NULL;
@@ -6369,6 +6596,11 @@ dat_datctl.control2 |= (pat_patctl.control2 & CTL2_ALLPD);
 strcpy((char *)dat_datctl.replacement, (char *)pat_patctl.replacement);
 if (dat_datctl.jitstack == 0) dat_datctl.jitstack = pat_patctl.jitstack;
 
+if (dat_datctl.substitute_skip == 0)
+    dat_datctl.substitute_skip = pat_patctl.substitute_skip;
+if (dat_datctl.substitute_stop == 0)
+    dat_datctl.substitute_stop = pat_patctl.substitute_stop;
+
 /* Initialize for scanning the data line. */
 
 #ifdef SUPPORT_PCRE2_8
@@ -6651,7 +6883,7 @@ while ((c = *p++) != 0)
         fprintf(outfile, "** Truncation will probably give the wrong "
           "result.\n");
         }
-      *q8++ = c;
+      *q8++ = (uint8_t)c;
       }
     }
 #endif
@@ -6685,7 +6917,7 @@ while ((c = *p++) != 0)
           "result.\n");
         }
 
-      *q16++ = c;
+      *q16++ = (uint16_t)c;
       }
     }
 #endif
@@ -6708,6 +6940,11 @@ arg_ulen = ulen;                          /* Value to use in match arg */
 if (p[-1] != 0 && !decode_modifiers(p, CTX_DAT, NULL, &dat_datctl))
   return PR_OK;
 
+/* Setting substitute_{skip,fail} implies a substitute callout. */
+
+if (dat_datctl.substitute_skip != 0 || dat_datctl.substitute_stop != 0)
+  dat_datctl.control2 |= CTL2_SUBSTITUTE_CALLOUT;
+
 /* Check for mutually exclusive modifiers. At present, these are all in the
 first control word. */
 
@@ -6722,11 +6959,25 @@ for (k = 0; k < sizeof(exclusive_dat_controls)/sizeof(uint32_t); k++)
     }
   }
 
-if (pat_patctl.replacement[0] != 0 &&
-    (dat_datctl.control & CTL_NULLCONTEXT) != 0)
+if (pat_patctl.replacement[0] != 0)
   {
-  fprintf(outfile, "** Replacement text is not supported with null_context.\n");
-  return PR_OK;
+  if ((dat_datctl.control2 & CTL2_SUBSTITUTE_CALLOUT) != 0 &&
+      (dat_datctl.control & CTL_NULLCONTEXT) != 0)
+    {
+    fprintf(outfile, "** Replacement callouts are not supported with null_context.\n");
+    return PR_OK;
+    }
+
+  if ((dat_datctl.control & CTL_ALLCAPTURES) != 0)
+    fprintf(outfile, "** Ignored with replacement text: allcaptures\n");
+  }
+
+/* Warn for modifiers that are ignored for DFA. */
+
+if ((dat_datctl.control & CTL_DFA) != 0)
+  {
+  if ((dat_datctl.control & CTL_ALLCAPTURES) != 0)
+    fprintf(outfile, "** Ignored after DFA matching: allcaptures\n");
   }
 
 /* We now have the subject in dbuffer, with len containing the byte length, and
@@ -6955,6 +7206,9 @@ if (CASTVAR(void *, match_data) == NULL)
   return PR_OK;
   }
 
+ovector = FLD(match_data, ovector);
+PCRE2_GET_OVECTOR_COUNT(oveccount, match_data);
+
 /* Replacement processing is ignored for DFA matching. */
 
 if (dat_datctl.replacement[0] != 0 && (dat_datctl.control & CTL_DFA) != 0)
@@ -6974,7 +7228,7 @@ if (dat_datctl.replacement[0] != 0)
   uint8_t rbuffer[REPLACE_BUFFSIZE];
   uint8_t nbuffer[REPLACE_BUFFSIZE];
   uint32_t xoptions;
-  PCRE2_SIZE rlen, nsize, erroroffset;
+  PCRE2_SIZE j, rlen, nsize, erroroffset;
   BOOL badutf = FALSE;
 
 #ifdef SUPPORT_PCRE2_8
@@ -6987,6 +7241,11 @@ if (dat_datctl.replacement[0] != 0)
   uint32_t *r32 = NULL;
 #endif
 
+  /* Fill the ovector with junk to detect elements that do not get set
+  when they should be (relevant only when "allvector" is specified). */
+
+  for (j = 0; j < 2*oveccount; j++) ovector[j] = JUNK_OFFSET;
+
   if (timeitm)
     fprintf(outfile, "** Timing is not supported with replace: ignored\n");
 
@@ -7089,8 +7348,18 @@ if (dat_datctl.replacement[0] != 0)
     rlen = PCRE2_ZERO_TERMINATED;
   else
     rlen = (CASTVAR(uint8_t *, r) - rbuffer)/code_unit_size;
+
+  if ((dat_datctl.control2 & CTL2_SUBSTITUTE_CALLOUT) != 0)
+    {
+    PCRE2_SET_SUBSTITUTE_CALLOUT(dat_context, substitute_callout_function, NULL);
+    }
+  else
+    {
+    PCRE2_SET_SUBSTITUTE_CALLOUT(dat_context, NULL, NULL);  /* No callout */
+    }
+
   PCRE2_SUBSTITUTE(rc, compiled_code, pp, arg_ulen, dat_datctl.offset,
-    dat_datctl.options|xoptions, match_data, dat_context,
+    dat_datctl.options|xoptions, match_data, use_dat_context,
     rbuffer, rlen, nbuffer, &nsize);
 
   if (rc < 0)
@@ -7112,6 +7381,12 @@ if (dat_datctl.replacement[0] != 0)
 
   fprintf(outfile, "\n");
   show_memory = FALSE;
+
+  /* Show final ovector contents if requested. */
+
+  if ((dat_datctl.control2 & CTL2_ALLVECTOR) != 0)
+    show_ovector(ovector, oveccount);
+
   return PR_OK;
   }   /* End of substitution handling */
 
@@ -7125,14 +7400,11 @@ for (gmatched = 0;; gmatched++)
   {
   PCRE2_SIZE j;
   int capcount;
-  PCRE2_SIZE *ovector;
-
-  ovector = FLD(match_data, ovector);
 
   /* Fill the ovector with junk to detect elements that do not get set
   when they should be. */
 
-  for (j = 0; j < 2*dat_datctl.oveccount; j++) ovector[j] = JUNK_OFFSET;
+  for (j = 0; j < 2*oveccount; j++) ovector[j] = JUNK_OFFSET;
 
   /* When matching is via pcre2_match(), we will detect the use of JIT via the
   stack callback function. */
@@ -7280,12 +7552,8 @@ for (gmatched = 0;; gmatched++)
   if (capcount >= 0)
     {
     int i;
-    uint32_t oveccount;
-
-    /* This is a check against a lunatic return value. */
 
-    PCRE2_GET_OVECTOR_COUNT(oveccount, match_data);
-    if (capcount > (int)oveccount)
+    if (capcount > (int)oveccount)   /* Check for lunatic return value */
       {
       fprintf(outfile,
         "** PCRE2 error: returned count %d is too big for ovector count %d\n",
@@ -7298,6 +7566,25 @@ for (gmatched = 0;; gmatched++)
         }
       }
 
+    /* If PCRE2_COPY_MATCHED_SUBJECT was set, check that things are as they
+    should be, but not for fast JIT, where it isn't supported. */
+
+    if ((dat_datctl.options & PCRE2_COPY_MATCHED_SUBJECT) != 0 &&
+        (pat_patctl.control & CTL_JITFAST) == 0)
+      {
+      if ((FLD(match_data, flags) & PCRE2_MD_COPIED_SUBJECT) == 0)
+        fprintf(outfile,
+          "** PCRE2 error: flag not set after copy_matched_subject\n");
+
+      if (CASTFLD(void *, match_data, subject) == pp)
+        fprintf(outfile,
+          "** PCRE2 error: copy_matched_subject has not copied\n");
+
+      if (memcmp(CASTFLD(void *, match_data, subject), pp, ulen) != 0)
+        fprintf(outfile,
+          "** PCRE2 error: copy_matched_subject mismatch\n");
+      }
+
     /* If this is not the first time round a global loop, check that the
     returned string has changed. If it has not, check for an empty string match
     at different starting offset from the previous match. This is a failed test
@@ -7325,24 +7612,18 @@ for (gmatched = 0;; gmatched++)
     /* "allcaptures" requests showing of all captures in the pattern, to check
     unset ones at the end. It may be set on the pattern or the data. Implement
     by setting capcount to the maximum. This is not relevant for DFA matching,
-    so ignore it. */
+    so ignore it (warning given above). */
 
-    if ((dat_datctl.control & CTL_ALLCAPTURES) != 0)
+    if ((dat_datctl.control & (CTL_ALLCAPTURES|CTL_DFA)) == CTL_ALLCAPTURES)
       {
-      uint32_t maxcapcount;
-      if ((dat_datctl.control & CTL_DFA) != 0)
-        {
-        fprintf(outfile, "** Ignored after DFA matching: allcaptures\n");
-        }
-      else
-        {
-        if (pattern_info(PCRE2_INFO_CAPTURECOUNT, &maxcapcount, FALSE) < 0)
-          return PR_SKIP;
-        capcount = maxcapcount + 1;   /* Allow for full match */
-        if (capcount > (int)oveccount) capcount = oveccount;
-        }
+      capcount = maxcapcount + 1;   /* Allow for full match */
+      if (capcount > (int)oveccount) capcount = oveccount;
       }
 
+    /* "allvector" request showing the entire ovector. */
+
+    if ((dat_datctl.control2 & CTL2_ALLVECTOR) != 0) capcount = oveccount;
+
     /* Output the captured substrings. Note that, for the matched string,
     the use of \K in an assertion can make the start later than the end. */
 
@@ -7364,19 +7645,26 @@ for (gmatched = 0;; gmatched++)
 
       /* Check for an unset group */
 
-      if (start == PCRE2_UNSET)
+      if (start == PCRE2_UNSET && end == PCRE2_UNSET)
         {
         fprintf(outfile, "<unset>\n");
         continue;
         }
 
       /* Check for silly offsets, in particular, values that have not been
-      set when they should have been. */
+      set when they should have been. However, if we are past the end of the
+      captures for this pattern ("allvector" causes this), or if we are DFA
+      matching, it isn't an error if the entry is unchanged. */
 
       if (start > ulen || end > ulen)
         {
-        fprintf(outfile, "ERROR: bad value(s) for offset(s): 0x%lx 0x%lx\n",
-          (unsigned long int)start, (unsigned long int)end);
+        if (((dat_datctl.control & CTL_DFA) != 0 ||
+              i >= (int)(2*maxcapcount + 2)) &&
+            start == JUNK_OFFSET && end == JUNK_OFFSET)
+          fprintf(outfile, "<unchanged>\n");
+        else
+          fprintf(outfile, "ERROR: bad value(s) for offset(s): 0x%lx 0x%lx\n",
+            (unsigned long int)start, (unsigned long int)end);
         continue;
         }
 
@@ -7481,14 +7769,22 @@ for (gmatched = 0;; gmatched++)
     }    /* End of handling a successful match */
 
   /* There was a partial match. The value of ovector[0] is the bumpalong point,
-  that is, startchar, not any \K point that might have been passed. */
+  that is, startchar, not any \K point that might have been passed. When JIT is
+  not in use, "allusedtext" may be set, in which case we indicate the leftmost
+  consulted character. */
 
   else if (capcount == PCRE2_ERROR_PARTIAL)
     {
-    PCRE2_SIZE poffset;
+    PCRE2_SIZE leftchar;
     int backlength;
     int rubriclength = 0;
 
+    if ((dat_datctl.control & CTL_ALLUSEDTEXT) != 0)
+      {
+      leftchar = FLD(match_data, leftchar);
+      }
+    else leftchar = ovector[0];
+
     fprintf(outfile, "Partial match");
     if ((dat_datctl.control & CTL_MARK) != 0 &&
          TESTFLD(match_data, mark, !=, NULL))
@@ -7501,8 +7797,7 @@ for (gmatched = 0;; gmatched++)
     fprintf(outfile, ": ");
     rubriclength += 15;
 
-    poffset = backchars(pp, ovector[0], maxlookbehind, utf);
-    PCHARS(backlength, pp, poffset, ovector[0] - poffset, utf, outfile);
+    PCHARS(backlength, pp, leftchar, ovector[0] - leftchar, utf, outfile);
     PCHARSV(pp, ovector[0], ulen - ovector[0], utf, outfile);
 
     if ((pat_patctl.control & CTL_JITVERIFY) != 0 && jit_was_used)
@@ -7517,10 +7812,19 @@ for (gmatched = 0;; gmatched++)
       fprintf(outfile, "\n");
       }
 
+    if (ulen != ovector[1])
+      fprintf(outfile, "** ovector[1] is not equal to the subject length: "
+        "%ld != %ld\n", (unsigned long int)ovector[1], (unsigned long int)ulen);
+
     /* Process copy/get strings */
 
     if (!copy_and_get(utf, 1)) return PR_ABEND;
 
+    /* "allvector" outputs the entire vector */
+
+    if ((dat_datctl.control2 & CTL2_ALLVECTOR) != 0)
+      show_ovector(ovector, oveccount);
+
     break;  /* Out of the /g loop */
     }       /* End of handling partial match */
 
@@ -7590,6 +7894,11 @@ for (gmatched = 0;; gmatched++)
         if ((pat_patctl.control & CTL_JITVERIFY) != 0 && jit_was_used)
           fprintf(outfile, " (JIT)");
         fprintf(outfile, "\n");
+
+        /* "allvector" outputs the entire vector */
+
+        if ((dat_datctl.control2 & CTL2_ALLVECTOR) != 0)
+          show_ovector(ovector, oveccount);
         }
       break;
 
@@ -7771,7 +8080,7 @@ Returns:     nothing
 static void
 print_newline_config(uint32_t optval, BOOL isc)
 {
-if (!isc) printf("  Newline sequence is ");
+if (!isc) printf("  Default newline sequence is ");
 if (optval < sizeof(newlines)/sizeof(char *))
   printf("%s\n", newlines[optval]);
 else
@@ -7827,6 +8136,7 @@ printf("  -error <n,m,..>  show messages for error numbers, then exit\n");
 printf("  -help         show usage information\n");
 printf("  -i            set default pattern modifier 'info'\n");
 printf("  -jit          set default pattern modifier 'jit'\n");
+printf("  -jitfast      set default pattern modifier 'jitfast'\n");
 printf("  -jitverify    set default pattern modifier 'jitverify'\n");
 printf("  -LM           list pattern and subject modifiers, then exit\n");
 printf("  -q            quiet: do not output PCRE2 version number at start\n");
@@ -7901,9 +8211,13 @@ if (arg != NULL && arg[0] != CHAR_MINUS)
     break;
     }
 
-/* For VMS, return the value by setting a symbol, for certain values only. */
+/* For VMS, return the value by setting a symbol, for certain values only. This
+is contributed code which the PCRE2 developers have no means of testing. */
 
 #ifdef __VMS
+
+/* This is the original code provided by the first VMS contributor. */
+#ifdef NEVER
   if (copytlist[i].type == CONF_FIX || coptlist[i].type == CONF_INT)
     {
     char ucname[16];
@@ -7913,6 +8227,22 @@ if (arg != NULL && arg[0] != CHAR_MINUS)
     }
 #endif
 
+/* This is the new code, provided by a second VMS contributor. */
+
+  if (coptlist[i].type == CONF_FIX || coptlist[i].type == CONF_INT)
+    {
+    char nam_buf[22], val_buf[4];
+    $DESCRIPTOR(nam, nam_buf);
+    $DESCRIPTOR(val, val_buf);
+
+    strcpy(nam_buf, coptlist[i].name);
+    nam.dsc$w_length = strlen(nam_buf);
+    sprintf(val_buf, "%d", yield);
+    val.dsc$w_length = strlen(val_buf);
+    lib$set_symbol(&nam, &val);
+    }
+#endif  /* __VMS */
+
   return yield;
   }
 
@@ -7971,11 +8301,20 @@ printf("  Internal link size = %d\n", optval);
 (void)PCRE2_CONFIG(PCRE2_CONFIG_PARENSLIMIT, &optval);
 printf("  Parentheses nest limit = %d\n", optval);
 (void)PCRE2_CONFIG(PCRE2_CONFIG_HEAPLIMIT, &optval);
-printf("  Default heap limit = %d\n", optval);
+printf("  Default heap limit = %d kibibytes\n", optval);
 (void)PCRE2_CONFIG(PCRE2_CONFIG_MATCHLIMIT, &optval);
 printf("  Default match limit = %d\n", optval);
 (void)PCRE2_CONFIG(PCRE2_CONFIG_DEPTHLIMIT, &optval);
 printf("  Default depth limit = %d\n", optval);
+
+#if defined SUPPORT_LIBREADLINE
+printf("  pcre2test has libreadline support\n");
+#elif defined SUPPORT_LIBEDIT
+printf("  pcre2test has libedit support\n");
+#else
+printf("  pcre2test has neither libreadline nor libedit support\n");
+#endif
+
 return 0;
 }
 
@@ -8312,13 +8651,15 @@ while (argc > 1 && argv[op][0] == '-' && argv[op][1] != 0)
   else if (strcmp(arg, "-d") == 0)   def_patctl.control |= CTL_DEBUG;
   else if (strcmp(arg, "-dfa") == 0) def_datctl.control |= CTL_DFA;
   else if (strcmp(arg, "-i") == 0)   def_patctl.control |= CTL_INFO;
-  else if (strcmp(arg, "-jit") == 0 || strcmp(arg, "-jitverify") == 0)
+  else if (strcmp(arg, "-jit") == 0 || strcmp(arg, "-jitverify") == 0 ||
+           strcmp(arg, "-jitfast") == 0)
     {
-    if (arg[4] != 0) def_patctl.control |= CTL_JITVERIFY;
-    def_patctl.jit = 7;  /* full & partial */
+    if (arg[4] == 'v') def_patctl.control |= CTL_JITVERIFY;
+      else if (arg[4] == 'f') def_patctl.control |= CTL_JITFAST;
+    def_patctl.jit = JIT_DEFAULT;  /* full & partial */
 #ifndef SUPPORT_JIT
     fprintf(stderr, "** Warning: JIT support is not available: "
-                    "-jit[verify] calls functions that do nothing.\n");
+                    "-jit[fast|verify] calls functions that do nothing.\n");
 #endif
     }
 
@@ -8331,6 +8672,11 @@ while (argc > 1 && argv[op][0] == '-' && argv[op][1] != 0)
     showtotaltimes = arg[1] == 'T';
     if (argc > 2 && (uli = strtoul(argv[op+1], &endptr, 10), *endptr == 0))
       {
+      if (uli == 0)
+        {
+        fprintf(stderr, "** Argument for %s must not be zero\n", arg);
+        exit(1);
+        }
       if (U32OVERFLOW(uli))
         {
         fprintf(stderr, "** Argument for %s is too big\n", arg);
@@ -8488,8 +8834,8 @@ least 128 code units, because it is used for retrieving error messages. */
   }  /* End of -error handling */
 
 /* Initialize things that cannot be done until we know which test mode we are
-running in. Exercise the general context copying function, which is not
-otherwise used. */
+running in. Exercise the general context copying and match data size functions,
+which are not otherwise used. */
 
 code_unit_size = test_mode/8;
 max_oveccount = DEFAULT_OVECCOUNT;
@@ -8511,7 +8857,9 @@ max_oveccount = DEFAULT_OVECCOUNT;
   (void)G(pcre2_set_compile_extra_options_,BITS)(G(pat_context,BITS), 0); \
   (void)G(pcre2_set_max_pattern_length_,BITS)(G(pat_context,BITS), 0); \
   (void)G(pcre2_set_offset_limit_,BITS)(G(dat_context,BITS), 0); \
-  (void)G(pcre2_set_recursion_memory_management_,BITS)(G(dat_context,BITS), my_malloc, my_free, NULL)
+  (void)G(pcre2_set_recursion_memory_management_,BITS)(G(dat_context,BITS), my_malloc, my_free, NULL); \
+  (void)G(pcre2_get_match_data_size_,BITS)(G(match_data,BITS))
+
 
 /* Call the appropriate functions for the current mode, and exercise some
 functions that are not otherwise called. */
index f5703e8e7f29a1c5f39c1702c5b127f9ab02525a..acba9da4be4d8a6e365287235d2a4320e999f257 100644 (file)
 #define SLJIT_MEMCPY(dest, src, len) memcpy(dest, src, len)
 #endif
 
+#ifndef SLJIT_MEMMOVE
+#define SLJIT_MEMMOVE(dest, src, len) memmove(dest, src, len)
+#endif
+
 #ifndef SLJIT_ZEROMEM
 #define SLJIT_ZEROMEM(dest, len) memset(dest, 0, len)
 #endif
@@ -530,7 +534,7 @@ typedef double sljit_f64;
 #endif /* !SLJIT_FUNC */
 
 #ifndef SLJIT_INDIRECT_CALL
-#if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN)) \
+#if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (!defined _CALL_ELF || _CALL_ELF == 1)) \
        || ((defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) && defined _AIX)
 /* It seems certain ppc compilers use an indirect addressing for functions
    which makes things complicated. */
index 7c18578618cfa7c16e01bb5a44baae54af02e000..92ddb94914382984dd9ddb65a361f86f9570a722 100644 (file)
@@ -94,28 +94,88 @@ static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size)
 
 #else
 
+#ifdef __APPLE__
+/* Configures TARGET_OS_OSX when appropriate */
+#include <TargetConditionals.h>
+
+#if TARGET_OS_OSX && defined(MAP_JIT)
+#include <sys/utsname.h>
+#endif /* TARGET_OS_OSX && MAP_JIT */
+
+#ifdef MAP_JIT
+
+static SLJIT_INLINE int get_map_jit_flag()
+{
+#if TARGET_OS_OSX
+       /* On macOS systems, returns MAP_JIT if it is defined _and_ we're running on a version
+          of macOS where it's OK to have more than one JIT block. On non-macOS systems, returns
+          MAP_JIT if it is defined. */
+       static int map_jit_flag = -1;
+
+       /* The following code is thread safe because multiple initialization
+          sets map_jit_flag to the same value and the code has no side-effects.
+          Changing the kernel version witout system restart is (very) unlikely. */
+       if (map_jit_flag == -1) {
+               struct utsname name;
+
+               map_jit_flag = 0;
+               uname(&name);
+
+               /* Kernel version for 10.14.0 (Mojave) */
+               if (atoi(name.release) >= 18) {
+                       /* Only use MAP_JIT if a hardened runtime is used, because MAP_JIT is incompatible with fork(). */
+                       void *ptr = mmap(NULL, getpagesize(), PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+
+                       if (ptr == MAP_FAILED) {
+                               map_jit_flag = MAP_JIT;
+                       } else {
+                               munmap(ptr, getpagesize());
+                       }
+               }
+       }
+
+       return map_jit_flag;
+#else /* !TARGET_OS_OSX */
+       return MAP_JIT;
+#endif /* TARGET_OS_OSX */
+}
+
+#endif /* MAP_JIT */
+
+#endif /* __APPLE__ */
+
 static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
 {
        void *retval;
+       const int prot = PROT_READ | PROT_WRITE | PROT_EXEC;
 
 #ifdef MAP_ANON
 
        int flags = MAP_PRIVATE | MAP_ANON;
 
 #ifdef MAP_JIT
-       flags |= MAP_JIT;
+       flags |= get_map_jit_flag();
 #endif
 
-       retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, -1, 0);
-#else
+       retval = mmap(NULL, size, prot, flags, -1, 0);
+#else /* !MAP_ANON */
        if (dev_zero < 0) {
                if (open_dev_zero())
                        return NULL;
        }
-       retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, dev_zero, 0);
-#endif
+       retval = mmap(NULL, size, prot, MAP_PRIVATE, dev_zero, 0);
+#endif /* MAP_ANON */
+
+       if (retval == MAP_FAILED)
+               retval = NULL;
+       else {
+               if (mprotect(retval, size, prot) < 0) {
+                       munmap(retval, size);
+                       retval = NULL;
+               }
+       }
 
-       return (retval != MAP_FAILED) ? retval : NULL;
+       return retval;
 }
 
 static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size)
index 5bdddc10cff96bda1262b26f3112c5cb9ab2a7e8..9bab0c3ec66baafad5258d2cab14c18d54976317 100644 (file)
 #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
 #      define PATCH_MD         0x10
 #endif
+#      define TYPE_SHIFT       13
 #endif
 
 #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
 #      define IS_CALL          0x010
 #      define IS_BIT26_COND    0x020
 #      define IS_BIT16_COND    0x040
+#      define IS_BIT23_COND    0x080
 
-#      define IS_COND          (IS_BIT26_COND | IS_BIT16_COND)
+#      define IS_COND          (IS_BIT26_COND | IS_BIT16_COND | IS_BIT23_COND)
 
-#      define PATCH_B          0x080
-#      define PATCH_J          0x100
+#      define PATCH_B          0x100
+#      define PATCH_J          0x200
 
 #if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
-#      define PATCH_ABS32      0x200
-#      define PATCH_ABS48      0x400
+#      define PATCH_ABS32      0x400
+#      define PATCH_ABS48      0x800
 #endif
 
        /* instruction types */
@@ -520,6 +522,12 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw
        }
 }
 
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_put_label(struct sljit_put_label *put_label, struct sljit_label *label)
+{
+       if (SLJIT_LIKELY(!!put_label))
+               put_label->label = label;
+}
+
 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_current_flags(struct sljit_compiler *compiler, sljit_s32 current_flags)
 {
        SLJIT_UNUSED_ARG(compiler);
@@ -619,6 +627,30 @@ static SLJIT_INLINE sljit_s32 get_arg_count(sljit_s32 arg_types)
        return arg_count;
 }
 
+#if !(defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
+
+static SLJIT_INLINE sljit_uw compute_next_addr(struct sljit_label *label, struct sljit_jump *jump,
+       struct sljit_const *const_, struct sljit_put_label *put_label)
+{
+       sljit_uw result = ~(sljit_uw)0;
+
+       if (label)
+               result = label->size;
+
+       if (jump && jump->addr < result)
+               result = jump->addr;
+
+       if (const_ && const_->addr < result)
+               result = const_->addr;
+
+       if (put_label && put_label->addr < result)
+               result = put_label->addr;
+
+       return result;
+}
+
+#endif /* !SLJIT_CONFIG_X86 */
+
 static SLJIT_INLINE void set_emit_enter(struct sljit_compiler *compiler,
        sljit_s32 options, sljit_s32 args, sljit_s32 scratches, sljit_s32 saveds,
        sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size)
@@ -686,6 +718,19 @@ static SLJIT_INLINE void set_const(struct sljit_const *const_, struct sljit_comp
        compiler->last_const = const_;
 }
 
+static SLJIT_INLINE void set_put_label(struct sljit_put_label *put_label, struct sljit_compiler *compiler, sljit_uw offset)
+{
+       put_label->next = NULL;
+       put_label->label = NULL;
+       put_label->addr = compiler->size - offset;
+       put_label->flags = 0;
+       if (compiler->last_put_label)
+               compiler->last_put_label->next = put_label;
+       else
+               compiler->put_labels = put_label;
+       compiler->last_put_label = put_label;
+}
+
 #define ADDRESSING_DEPENDS_ON(exp, reg) \
        (((exp) & SLJIT_MEM) && (((exp) & REG_MASK) == reg || OFFS_REG(exp) == reg))
 
@@ -1904,6 +1949,21 @@ static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_const(struct sljit_compil
        CHECK_RETURN_OK;
 }
 
+static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
+       FUNCTION_CHECK_DST(dst, dstw, 0);
+#endif
+#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
+       if (SLJIT_UNLIKELY(!!compiler->verbose)) {
+               fprintf(compiler->verbose, "  put_label ");
+               sljit_verbose_param(compiler, dst, dstw);
+               fprintf(compiler->verbose, "\n");
+       }
+#endif
+       CHECK_RETURN_OK;
+}
+
 #endif /* SLJIT_ARGUMENT_CHECKS || SLJIT_VERBOSE */
 
 #define SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw) \
@@ -2580,6 +2640,14 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
        return NULL;
 }
 
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+       SLJIT_UNUSED_ARG(compiler);
+       SLJIT_UNUSED_ARG(dst);
+       SLJIT_UNUSED_ARG(dstw);
+       return NULL;
+}
+
 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
 {
        SLJIT_UNUSED_ARG(addr);
@@ -2596,4 +2664,4 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
        SLJIT_UNREACHABLE();
 }
 
-#endif
+#endif /* !SLJIT_CONFIG_UNSUPPORTED */
index e71890cf7bcc90202e14cd5975877949fd311708..836d25cf71a5386a8a96ae2f5d53072d97d77d77 100644 (file)
@@ -348,13 +348,20 @@ struct sljit_label {
 struct sljit_jump {
        struct sljit_jump *next;
        sljit_uw addr;
-       sljit_sw flags;
+       sljit_uw flags;
        union {
                sljit_uw target;
-               struct sljit_labellabel;
+               struct sljit_label *label;
        } u;
 };
 
+struct sljit_put_label {
+       struct sljit_put_label *next;
+       struct sljit_label *label;
+       sljit_uw addr;
+       sljit_uw flags;
+};
+
 struct sljit_const {
        struct sljit_const *next;
        sljit_uw addr;
@@ -366,10 +373,12 @@ struct sljit_compiler {
 
        struct sljit_label *labels;
        struct sljit_jump *jumps;
+       struct sljit_put_label *put_labels;
        struct sljit_const *consts;
        struct sljit_label *last_label;
        struct sljit_jump *last_jump;
        struct sljit_const *last_const;
+       struct sljit_put_label *last_put_label;
 
        void *allocator_data;
        struct sljit_memory_fragment *buf;
@@ -1314,10 +1323,17 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem(struct sljit_compiler *compil
    Flags: - (may destroy flags) */
 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset);
 
-/* The constant can be changed runtime (see: sljit_set_const)
+/* Store a value that can be changed runtime (see: sljit_get_const_addr / sljit_set_const)
    Flags: - (does not modify flags) */
 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value);
 
+/* Store the value of a label (see: sljit_set_put_label)
+   Flags: - (does not modify flags) */
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw);
+
+/* Set the value stored by put_label to this label. */
+SLJIT_API_FUNC_ATTRIBUTE void sljit_set_put_label(struct sljit_put_label *put_label, struct sljit_label *label);
+
 /* After the code generation the address for label, jump and const instructions
    are computed. Since these structures are freed by sljit_free_compiler, the
    addresses must be preserved by the user program elsewere. */
index 6d61eed9a7db005aab0a256882f260ee0f95a160..71f7bcdadbef8dd40c8cd6a60df9d778e7bd1b53 100644 (file)
@@ -583,8 +583,9 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        sljit_uw *buf_end;
        sljit_uw size;
        sljit_uw word_count;
+       sljit_uw next_addr;
        sljit_sw executable_offset;
-       sljit_sw jump_addr;
+       sljit_sw addr;
 #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
        sljit_uw cpool_size;
        sljit_uw cpool_skip_alignment;
@@ -597,6 +598,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        struct sljit_label *label;
        struct sljit_jump *jump;
        struct sljit_const *const_;
+       struct sljit_put_label *put_label;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_generate_code(compiler));
@@ -625,11 +627,13 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
 
        code_ptr = code;
        word_count = 0;
+       next_addr = 1;
        executable_offset = SLJIT_EXEC_OFFSET(code);
 
        label = compiler->labels;
        jump = compiler->jumps;
        const_ = compiler->consts;
+       put_label = compiler->put_labels;
 
        if (label && label->size == 0) {
                label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code, executable_offset);
@@ -669,35 +673,45 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                        else if ((*buf_ptr & 0xff000000) != PUSH_POOL) {
 #endif
                                *code_ptr = *buf_ptr++;
+                               if (next_addr == word_count) {
+                                       SLJIT_ASSERT(!label || label->size >= word_count);
+                                       SLJIT_ASSERT(!jump || jump->addr >= word_count);
+                                       SLJIT_ASSERT(!const_ || const_->addr >= word_count);
+                                       SLJIT_ASSERT(!put_label || put_label->addr >= word_count);
+
                                /* These structures are ordered by their address. */
-                               SLJIT_ASSERT(!label || label->size >= word_count);
-                               SLJIT_ASSERT(!jump || jump->addr >= word_count);
-                               SLJIT_ASSERT(!const_ || const_->addr >= word_count);
-                               if (jump && jump->addr == word_count) {
+                                       if (jump && jump->addr == word_count) {
 #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
-                                       if (detect_jump_type(jump, code_ptr, code, executable_offset))
-                                               code_ptr--;
-                                       jump->addr = (sljit_uw)code_ptr;
+                                               if (detect_jump_type(jump, code_ptr, code, executable_offset))
+                                                       code_ptr--;
+                                               jump->addr = (sljit_uw)code_ptr;
 #else
-                                       jump->addr = (sljit_uw)(code_ptr - 2);
-                                       if (detect_jump_type(jump, code_ptr, code, executable_offset))
-                                               code_ptr -= 2;
+                                               jump->addr = (sljit_uw)(code_ptr - 2);
+                                               if (detect_jump_type(jump, code_ptr, code, executable_offset))
+                                                       code_ptr -= 2;
 #endif
-                                       jump = jump->next;
-                               }
-                               if (label && label->size == word_count) {
-                                       /* code_ptr can be affected above. */
-                                       label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr + 1, executable_offset);
-                                       label->size = (code_ptr + 1) - code;
-                                       label = label->next;
-                               }
-                               if (const_ && const_->addr == word_count) {
+                                               jump = jump->next;
+                                       }
+                                       if (label && label->size == word_count) {
+                                               /* code_ptr can be affected above. */
+                                               label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr + 1, executable_offset);
+                                               label->size = (code_ptr + 1) - code;
+                                               label = label->next;
+                                       }
+                                       if (const_ && const_->addr == word_count) {
 #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
-                                       const_->addr = (sljit_uw)code_ptr;
+                                               const_->addr = (sljit_uw)code_ptr;
 #else
-                                       const_->addr = (sljit_uw)(code_ptr - 1);
+                                               const_->addr = (sljit_uw)(code_ptr - 1);
 #endif
-                                       const_ = const_->next;
+                                               const_ = const_->next;
+                                       }
+                                       if (put_label && put_label->addr == word_count) {
+                                               SLJIT_ASSERT(put_label->label);
+                                               put_label->addr = (sljit_uw)code_ptr;
+                                               put_label = put_label->next;
+                                       }
+                                       next_addr = compute_next_addr(label, jump, const_, put_label);
                                }
                                code_ptr++;
 #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
@@ -725,6 +739,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        SLJIT_ASSERT(!label);
        SLJIT_ASSERT(!jump);
        SLJIT_ASSERT(!const_);
+       SLJIT_ASSERT(!put_label);
 
 #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
        SLJIT_ASSERT(cpool_size == 0);
@@ -755,15 +770,15 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                buf_ptr = (sljit_uw *)jump->addr;
 
                if (jump->flags & PATCH_B) {
-                       jump_addr = (sljit_sw)SLJIT_ADD_EXEC_OFFSET(buf_ptr + 2, executable_offset);
+                       addr = (sljit_sw)SLJIT_ADD_EXEC_OFFSET(buf_ptr + 2, executable_offset);
                        if (!(jump->flags & JUMP_ADDR)) {
                                SLJIT_ASSERT(jump->flags & JUMP_LABEL);
-                               SLJIT_ASSERT(((sljit_sw)jump->u.label->addr - jump_addr) <= 0x01ffffff && ((sljit_sw)jump->u.label->addr - jump_addr) >= -0x02000000);
-                               *buf_ptr |= (((sljit_sw)jump->u.label->addr - jump_addr) >> 2) & 0x00ffffff;
+                               SLJIT_ASSERT(((sljit_sw)jump->u.label->addr - addr) <= 0x01ffffff && ((sljit_sw)jump->u.label->addr - addr) >= -0x02000000);
+                               *buf_ptr |= (((sljit_sw)jump->u.label->addr - addr) >> 2) & 0x00ffffff;
                        }
                        else {
-                               SLJIT_ASSERT(((sljit_sw)jump->u.target - jump_addr) <= 0x01ffffff && ((sljit_sw)jump->u.target - jump_addr) >= -0x02000000);
-                               *buf_ptr |= (((sljit_sw)jump->u.target - jump_addr) >> 2) & 0x00ffffff;
+                               SLJIT_ASSERT(((sljit_sw)jump->u.target - addr) <= 0x01ffffff && ((sljit_sw)jump->u.target - addr) >= -0x02000000);
+                               *buf_ptr |= (((sljit_sw)jump->u.target - addr) >> 2) & 0x00ffffff;
                        }
                }
                else if (jump->flags & SLJIT_REWRITABLE_JUMP) {
@@ -813,6 +828,22 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        }
 #endif
 
+       put_label = compiler->put_labels;
+       while (put_label) {
+               addr = put_label->label->addr;
+               buf_ptr = (sljit_uw*)put_label->addr;
+
+#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
+               SLJIT_ASSERT((buf_ptr[0] & 0xffff0000) == 0xe59f0000);
+               buf_ptr[((buf_ptr[0] & 0xfff) >> 2) + 2] = addr;
+#else
+               SLJIT_ASSERT((buf_ptr[-1] & 0xfff00000) == MOVW && (buf_ptr[0] & 0xfff00000) == MOVT);
+               buf_ptr[-1] |= ((addr << 4) & 0xf0000) | (addr & 0xfff);
+               buf_ptr[0] |= ((addr >> 12) & 0xf0000) | ((addr >> 16) & 0xfff);
+#endif
+               put_label = put_label->next;
+       }
+
        SLJIT_ASSERT(code_ptr - code <= (sljit_s32)size);
 
        compiler->error = SLJIT_ERR_COMPILED;
@@ -2639,28 +2670,55 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem(struct sljit_compiler *compile
 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
 {
        struct sljit_const *const_;
-       sljit_s32 reg;
+       sljit_s32 dst_r;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value));
        ADJUST_LOCAL_OFFSET(dst, dstw);
 
+       dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG2;
+
+#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
+       PTR_FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, dst_r, TMP_PC, 0), init_value));
+       compiler->patches++;
+#else
+       PTR_FAIL_IF(emit_imm(compiler, dst_r, init_value));
+#endif
+
        const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const));
        PTR_FAIL_IF(!const_);
+       set_const(const_, compiler);
 
-       reg = SLOW_IS_REG(dst) ? dst : TMP_REG2;
+       if (dst & SLJIT_MEM)
+               PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG2, dst, dstw, TMP_REG1));
+       return const_;
+}
+
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+       struct sljit_put_label *put_label;
+       sljit_s32 dst_r;
+
+       CHECK_ERROR_PTR();
+       CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw));
+       ADJUST_LOCAL_OFFSET(dst, dstw);
+
+       dst_r = SLOW_IS_REG(dst) ? dst : TMP_REG2;
 
 #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
-       PTR_FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, reg, TMP_PC, 0), init_value));
+       PTR_FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, dst_r, TMP_PC, 0), 0));
        compiler->patches++;
 #else
-       PTR_FAIL_IF(emit_imm(compiler, reg, init_value));
+       PTR_FAIL_IF(emit_imm(compiler, dst_r, 0));
 #endif
-       set_const(const_, compiler);
+
+       put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label));
+       PTR_FAIL_IF(!put_label);
+       set_put_label(put_label, compiler, 0);
 
        if (dst & SLJIT_MEM)
                PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG2, dst, dstw, TMP_REG1));
-       return const_;
+       return put_label;
 }
 
 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
index 27af7414877acc612ebbfb5bc49467625bf8ae08..e15b3451e802200e4bd2271fb62349e41b9edb04 100644 (file)
@@ -51,7 +51,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
        0, 0, 1, 2, 3, 4, 5, 6, 7
 };
 
-#define W_OP (1 << 31)
+#define W_OP (1u << 31)
 #define RD(rd) (reg_map[rd])
 #define RT(rt) (reg_map[rt])
 #define RN(rn) (reg_map[rn] << 5)
@@ -161,7 +161,7 @@ static SLJIT_INLINE void modify_imm64_const(sljit_ins* inst, sljit_uw new_imm)
        inst[3] = MOVK | dst | ((new_imm >> 48) << 5) | (3 << 21);
 }
 
-static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset)
+static SLJIT_INLINE sljit_sw detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset)
 {
        sljit_sw diff;
        sljit_uw target_addr;
@@ -196,14 +196,14 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_in
                return 4;
        }
 
-       if (target_addr <= 0xffffffffl) {
+       if (target_addr < 0x100000000l) {
                if (jump->flags & IS_COND)
                        code_ptr[-5] -= (2 << 5);
                code_ptr[-2] = code_ptr[0];
                return 2;
        }
 
-       if (target_addr <= 0xffffffffffffl) {
+       if (target_addr < 0x1000000000000l) {
                if (jump->flags & IS_COND)
                        code_ptr[-5] -= (1 << 5);
                jump->flags |= PATCH_ABS48;
@@ -215,6 +215,22 @@ static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_in
        return 0;
 }
 
+static SLJIT_INLINE sljit_sw put_label_get_length(struct sljit_put_label *put_label, sljit_uw max_label)
+{
+       if (max_label < 0x100000000l) {
+               put_label->flags = 0;
+               return 2;
+       }
+
+       if (max_label < 0x1000000000000l) {
+               put_label->flags = 1;
+               return 1;
+       }
+
+       put_label->flags = 2;
+       return 0;
+}
+
 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler)
 {
        struct sljit_memory_fragment *buf;
@@ -223,6 +239,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        sljit_ins *buf_ptr;
        sljit_ins *buf_end;
        sljit_uw word_count;
+       sljit_uw next_addr;
        sljit_sw executable_offset;
        sljit_uw addr;
        sljit_s32 dst;
@@ -230,6 +247,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        struct sljit_label *label;
        struct sljit_jump *jump;
        struct sljit_const *const_;
+       struct sljit_put_label *put_label;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_generate_code(compiler));
@@ -241,34 +259,47 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
 
        code_ptr = code;
        word_count = 0;
+       next_addr = 0;
        executable_offset = SLJIT_EXEC_OFFSET(code);
 
        label = compiler->labels;
        jump = compiler->jumps;
        const_ = compiler->consts;
+       put_label = compiler->put_labels;
 
        do {
                buf_ptr = (sljit_ins*)buf->memory;
                buf_end = buf_ptr + (buf->used_size >> 2);
                do {
                        *code_ptr = *buf_ptr++;
-                       /* These structures are ordered by their address. */
-                       SLJIT_ASSERT(!label || label->size >= word_count);
-                       SLJIT_ASSERT(!jump || jump->addr >= word_count);
-                       SLJIT_ASSERT(!const_ || const_->addr >= word_count);
-                       if (label && label->size == word_count) {
-                               label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
-                               label->size = code_ptr - code;
-                               label = label->next;
-                       }
-                       if (jump && jump->addr == word_count) {
-                                       jump->addr = (sljit_uw)(code_ptr - 4);
-                                       code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset);
-                                       jump = jump->next;
-                       }
-                       if (const_ && const_->addr == word_count) {
-                               const_->addr = (sljit_uw)code_ptr;
-                               const_ = const_->next;
+                       if (next_addr == word_count) {
+                               SLJIT_ASSERT(!label || label->size >= word_count);
+                               SLJIT_ASSERT(!jump || jump->addr >= word_count);
+                               SLJIT_ASSERT(!const_ || const_->addr >= word_count);
+                               SLJIT_ASSERT(!put_label || put_label->addr >= word_count);
+
+                               /* These structures are ordered by their address. */
+                               if (label && label->size == word_count) {
+                                       label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+                                       label->size = code_ptr - code;
+                                       label = label->next;
+                               }
+                               if (jump && jump->addr == word_count) {
+                                               jump->addr = (sljit_uw)(code_ptr - 4);
+                                               code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset);
+                                               jump = jump->next;
+                               }
+                               if (const_ && const_->addr == word_count) {
+                                       const_->addr = (sljit_uw)code_ptr;
+                                       const_ = const_->next;
+                               }
+                               if (put_label && put_label->addr == word_count) {
+                                       SLJIT_ASSERT(put_label->label);
+                                       put_label->addr = (sljit_uw)(code_ptr - 3);
+                                       code_ptr -= put_label_get_length(put_label, (sljit_uw)(SLJIT_ADD_EXEC_OFFSET(code, executable_offset) + put_label->label->size));
+                                       put_label = put_label->next;
+                               }
+                               next_addr = compute_next_addr(label, jump, const_, put_label);
                        }
                        code_ptr ++;
                        word_count ++;
@@ -286,6 +317,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        SLJIT_ASSERT(!label);
        SLJIT_ASSERT(!jump);
        SLJIT_ASSERT(!const_);
+       SLJIT_ASSERT(!put_label);
        SLJIT_ASSERT(code_ptr - code <= (sljit_sw)compiler->size);
 
        jump = compiler->jumps;
@@ -323,6 +355,23 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                jump = jump->next;
        }
 
+       put_label = compiler->put_labels;
+       while (put_label) {
+               addr = put_label->label->addr;
+               buf_ptr = (sljit_ins *)put_label->addr;
+
+               buf_ptr[0] |= (addr & 0xffff) << 5;
+               buf_ptr[1] |= ((addr >> 16) & 0xffff) << 5;
+
+               if (put_label->flags >= 1)
+                       buf_ptr[2] |= ((addr >> 32) & 0xffff) << 5;
+
+               if (put_label->flags >= 2)
+                       buf_ptr[3] |= ((addr >> 48) & 0xffff) << 5;
+
+               put_label = put_label->next;
+       }
+
        compiler->error = SLJIT_ERR_COMPILED;
        compiler->executable_offset = executable_offset;
        compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins);
@@ -560,7 +609,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
        /* dst must be register, TMP_REG1
           arg1 must be register, TMP_REG1, imm
           arg2 must be register, TMP_REG2, imm */
-       sljit_ins inv_bits = (flags & INT_OP) ? (1 << 31) : 0;
+       sljit_ins inv_bits = (flags & INT_OP) ? W_OP : 0;
        sljit_ins inst_bits;
        sljit_s32 op = (flags & 0xffff);
        sljit_s32 reg;
@@ -710,7 +759,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
                return push_inst(compiler, ORR | RD(dst) | RN(TMP_ZERO) | RM(arg2));
        case SLJIT_MOV_U8:
                SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
-               return push_inst(compiler, (UBFM ^ (1 << 31)) | RD(dst) | RN(arg2) | (7 << 10));
+               return push_inst(compiler, (UBFM ^ W_OP) | RD(dst) | RN(arg2) | (7 << 10));
        case SLJIT_MOV_S8:
                SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
                if (!(flags & INT_OP))
@@ -718,7 +767,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
                return push_inst(compiler, (SBFM ^ inv_bits) | RD(dst) | RN(arg2) | (7 << 10));
        case SLJIT_MOV_U16:
                SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
-               return push_inst(compiler, (UBFM ^ (1 << 31)) | RD(dst) | RN(arg2) | (15 << 10));
+               return push_inst(compiler, (UBFM ^ W_OP) | RD(dst) | RN(arg2) | (15 << 10));
        case SLJIT_MOV_S16:
                SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
                if (!(flags & INT_OP))
@@ -728,7 +777,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
                SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
                if ((flags & INT_OP) && dst == arg2)
                        return SLJIT_SUCCESS;
-               return push_inst(compiler, (ORR ^ (1 << 31)) | RD(dst) | RN(TMP_ZERO) | RM(arg2));
+               return push_inst(compiler, (ORR ^ W_OP) | RD(dst) | RN(TMP_ZERO) | RM(arg2));
        case SLJIT_MOV_S32:
                SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
                if ((flags & INT_OP) && dst == arg2)
@@ -1080,7 +1129,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
 
 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op)
 {
-       sljit_ins inv_bits = (op & SLJIT_I32_OP) ? (1 << 31) : 0;
+       sljit_ins inv_bits = (op & SLJIT_I32_OP) ? W_OP : 0;
 
        CHECK_ERROR();
        CHECK(check_sljit_emit_op0(compiler, op));
@@ -1360,7 +1409,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
        sljit_ins inv_bits = (op & SLJIT_F32_OP) ? (1 << 22) : 0;
 
        if (GET_OPCODE(op) == SLJIT_CONV_S32_FROM_F64)
-               inv_bits |= (1 << 31);
+               inv_bits |= W_OP;
 
        if (src & SLJIT_MEM) {
                emit_fop_mem(compiler, (op & SLJIT_F32_OP) ? INT_SIZE : WORD_SIZE, TMP_FREG1, src, srcw);
@@ -1382,7 +1431,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_f64_from_sw(struct sljit_comp
        sljit_ins inv_bits = (op & SLJIT_F32_OP) ? (1 << 22) : 0;
 
        if (GET_OPCODE(op) == SLJIT_CONV_F64_FROM_S32)
-               inv_bits |= (1 << 31);
+               inv_bits |= W_OP;
 
        if (src & SLJIT_MEM) {
                emit_op_mem(compiler, ((GET_OPCODE(op) == SLJIT_CONV_F64_FROM_S32) ? INT_SIZE : WORD_SIZE), TMP_REG1, src, srcw, TMP_REG1);
@@ -1662,7 +1711,7 @@ static SLJIT_INLINE struct sljit_jump* emit_cmp_to0(struct sljit_compiler *compi
        sljit_s32 src, sljit_sw srcw)
 {
        struct sljit_jump *jump;
-       sljit_ins inv_bits = (type & SLJIT_I32_OP) ? (1 << 31) : 0;
+       sljit_ins inv_bits = (type & SLJIT_I32_OP) ? W_OP : 0;
 
        SLJIT_ASSERT((type & 0xff) == SLJIT_EQUAL || (type & 0xff) == SLJIT_NOT_EQUAL);
        ADJUST_LOCAL_OFFSET(src, srcw);
@@ -1787,7 +1836,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil
        sljit_s32 dst_reg,
        sljit_s32 src, sljit_sw srcw)
 {
-       sljit_ins inv_bits = (dst_reg & SLJIT_I32_OP) ? (1 << 31) : 0;
+       sljit_ins inv_bits = (dst_reg & SLJIT_I32_OP) ? W_OP : 0;
        sljit_ins cc;
 
        CHECK_ERROR();
@@ -1947,6 +1996,28 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
        return const_;
 }
 
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+       struct sljit_put_label *put_label;
+       sljit_s32 dst_r;
+
+       CHECK_ERROR_PTR();
+       CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw));
+       ADJUST_LOCAL_OFFSET(dst, dstw);
+
+       dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
+       PTR_FAIL_IF(emit_imm64_const(compiler, dst_r, 0));
+
+       put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label));
+       PTR_FAIL_IF(!put_label);
+       set_put_label(put_label, compiler, 1);
+
+       if (dst & SLJIT_MEM)
+               PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, dst_r, dst, dstw, TMP_REG2));
+
+       return put_label;
+}
+
 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
 {
        sljit_ins* inst = (sljit_ins*)addr;
index d7024b6d7d4175032679cd02442f987d7f26b6c1..cdfe4a4d24a93790b0739287d62171341d8883e9 100644 (file)
@@ -365,11 +365,13 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        sljit_u16 *buf_ptr;
        sljit_u16 *buf_end;
        sljit_uw half_count;
+       sljit_uw next_addr;
        sljit_sw executable_offset;
 
        struct sljit_label *label;
        struct sljit_jump *jump;
        struct sljit_const *const_;
+       struct sljit_put_label *put_label;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_generate_code(compiler));
@@ -381,34 +383,46 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
 
        code_ptr = code;
        half_count = 0;
+       next_addr = 0;
        executable_offset = SLJIT_EXEC_OFFSET(code);
 
        label = compiler->labels;
        jump = compiler->jumps;
        const_ = compiler->consts;
+       put_label = compiler->put_labels;
 
        do {
                buf_ptr = (sljit_u16*)buf->memory;
                buf_end = buf_ptr + (buf->used_size >> 1);
                do {
                        *code_ptr = *buf_ptr++;
-                       /* These structures are ordered by their address. */
-                       SLJIT_ASSERT(!label || label->size >= half_count);
-                       SLJIT_ASSERT(!jump || jump->addr >= half_count);
-                       SLJIT_ASSERT(!const_ || const_->addr >= half_count);
-                       if (label && label->size == half_count) {
-                               label->addr = ((sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset)) | 0x1;
-                               label->size = code_ptr - code;
-                               label = label->next;
-                       }
-                       if (jump && jump->addr == half_count) {
-                                       jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8);
-                                       code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset);
-                                       jump = jump->next;
-                       }
-                       if (const_ && const_->addr == half_count) {
-                               const_->addr = (sljit_uw)code_ptr;
-                               const_ = const_->next;
+                       if (next_addr == half_count) {
+                               SLJIT_ASSERT(!label || label->size >= half_count);
+                               SLJIT_ASSERT(!jump || jump->addr >= half_count);
+                               SLJIT_ASSERT(!const_ || const_->addr >= half_count);
+                               SLJIT_ASSERT(!put_label || put_label->addr >= half_count);
+
+                               /* These structures are ordered by their address. */
+                               if (label && label->size == half_count) {
+                                       label->addr = ((sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset)) | 0x1;
+                                       label->size = code_ptr - code;
+                                       label = label->next;
+                               }
+                               if (jump && jump->addr == half_count) {
+                                               jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8);
+                                               code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset);
+                                               jump = jump->next;
+                               }
+                               if (const_ && const_->addr == half_count) {
+                                       const_->addr = (sljit_uw)code_ptr;
+                                       const_ = const_->next;
+                               }
+                               if (put_label && put_label->addr == half_count) {
+                                       SLJIT_ASSERT(put_label->label);
+                                       put_label->addr = (sljit_uw)code_ptr;
+                                       put_label = put_label->next;
+                               }
+                               next_addr = compute_next_addr(label, jump, const_, put_label);
                        }
                        code_ptr ++;
                        half_count ++;
@@ -426,6 +440,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        SLJIT_ASSERT(!label);
        SLJIT_ASSERT(!jump);
        SLJIT_ASSERT(!const_);
+       SLJIT_ASSERT(!put_label);
        SLJIT_ASSERT(code_ptr - code <= (sljit_sw)compiler->size);
 
        jump = compiler->jumps;
@@ -434,6 +449,12 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                jump = jump->next;
        }
 
+       put_label = compiler->put_labels;
+       while (put_label) {
+               modify_imm32_const((sljit_u16 *)put_label->addr, put_label->label->addr);
+               put_label = put_label->next;
+       }
+
        compiler->error = SLJIT_ERR_COMPILED;
        compiler->executable_offset = executable_offset;
        compiler->executable_size = (code_ptr - code) * sizeof(sljit_u16);
@@ -2311,6 +2332,27 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
        return const_;
 }
 
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+       struct sljit_put_label *put_label;
+       sljit_s32 dst_r;
+
+       CHECK_ERROR_PTR();
+       CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw));
+       ADJUST_LOCAL_OFFSET(dst, dstw);
+
+       put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label));
+       PTR_FAIL_IF(!put_label);
+       set_put_label(put_label, compiler, 0);
+
+       dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;
+       PTR_FAIL_IF(emit_imm32_const(compiler, dst_r, 0));
+
+       if (dst & SLJIT_MEM)
+               PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE | STORE, dst_r, dst, dstw, TMP_REG2));
+       return put_label;
+}
+
 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
 {
        sljit_u16 *inst = (sljit_u16*)addr;
index 094c9923bcdfe04f741251482d3c3b09cbf9a1fd..16dec052fe75fe7e345f197b245875f203101a54 100644 (file)
@@ -368,16 +368,21 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
                SLJIT_ASSERT(!(flags & SRC2_IMM));
 
                if (GET_FLAG_TYPE(op) != SLJIT_MUL_OVERFLOW) {
-#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) || (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
                        return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst));
-#else
+#else /* !SLJIT_MIPS_R1 && !SLJIT_MIPS_R6 */
                        FAIL_IF(push_inst(compiler, MULT | S(src1) | T(src2), MOVABLE_INS));
                        return push_inst(compiler, MFLO | D(dst), DR(dst));
-#endif
+#endif /* SLJIT_MIPS_R1 || SLJIT_MIPS_R6 */
                }
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+               FAIL_IF(push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst)));
+               FAIL_IF(push_inst(compiler, MUH | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
+#else /* !SLJIT_MIPS_R6 */
                FAIL_IF(push_inst(compiler, MULT | S(src1) | T(src2), MOVABLE_INS));
                FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG));
                FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst)));
+#endif /* SLJIT_MIPS_R6 */
                FAIL_IF(push_inst(compiler, SRA | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG));
                return push_inst(compiler, SUBU | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG);
 
@@ -420,6 +425,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_ta
 {
        sljit_ins *inst = (sljit_ins *)addr;
 
+       SLJIT_ASSERT((inst[0] & 0xffe00000) == LUI && (inst[1] & 0xfc000000) == ORI);
        inst[0] = (inst[0] & 0xffff0000) | ((new_target >> 16) & 0xffff);
        inst[1] = (inst[1] & 0xffff0000) | (new_target & 0xffff);
        inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
@@ -430,6 +436,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
 {
        sljit_ins *inst = (sljit_ins *)addr;
 
+       SLJIT_ASSERT((inst[0] & 0xffe00000) == LUI && (inst[1] & 0xfc000000) == ORI);
        inst[0] = (inst[0] & 0xffff0000) | ((new_constant >> 16) & 0xffff);
        inst[1] = (inst[1] & 0xffff0000) | (new_constant & 0xffff);
        inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
index f841aef5ddcaa3d268df38cd69aae08f416a443d..a6a2bcc0c9aa29d0b6bf1325e2796cc9ff48b748 100644 (file)
@@ -459,19 +459,26 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
                SLJIT_ASSERT(!(flags & SRC2_IMM));
 
                if (GET_FLAG_TYPE(op) != SLJIT_MUL_OVERFLOW) {
-#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+                       return push_inst(compiler, SELECT_OP(DMUL, MUL) | S(src1) | T(src2) | D(dst), DR(dst));
+#elif (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
                        if (op & SLJIT_I32_OP)
                                return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst));
                        FAIL_IF(push_inst(compiler, DMULT | S(src1) | T(src2), MOVABLE_INS));
                        return push_inst(compiler, MFLO | D(dst), DR(dst));
-#else
+#else /* !SLJIT_MIPS_R6 && !SLJIT_MIPS_R1 */
                        FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS));
                        return push_inst(compiler, MFLO | D(dst), DR(dst));
-#endif
+#endif /* SLJIT_MIPS_R6 */
                }
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+               FAIL_IF(push_inst(compiler, SELECT_OP(DMUL, MUL) | S(src1) | T(src2) | D(dst), DR(dst)));
+               FAIL_IF(push_inst(compiler, SELECT_OP(DMUH, MUH) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
+#else /* !SLJIT_MIPS_R6 */
                FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS));
                FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG));
                FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst)));
+#endif /* SLJIT_MIPS_R6 */
                FAIL_IF(push_inst(compiler, SELECT_OP(DSRA32, SRA) | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG));
                return push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG);
 
index 894e21304bbbcde2ec62c5f7cc3e032e4c1a3a25..7d1d08749693cf697bf1b671b74646ad68328c23 100644 (file)
 /* Latest MIPS architecture. */
 /* Automatically detect SLJIT_MIPS_R1 */
 
+#if (defined __mips_isa_rev) && (__mips_isa_rev >= 6)
+#define SLJIT_MIPS_R6 1
+#endif
+
 SLJIT_API_FUNC_ATTRIBUTE const char* sljit_get_platform_name(void)
 {
-#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+
+#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
+       return "MIPS32-R6" SLJIT_CPUINFO;
+#else /* !SLJIT_CONFIG_MIPS_32 */
+       return "MIPS64-R6" SLJIT_CPUINFO;
+#endif /* SLJIT_CONFIG_MIPS_32 */
+
+#elif (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+
 #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
        return "MIPS32-R1" SLJIT_CPUINFO;
-#else
+#else /* !SLJIT_CONFIG_MIPS_32 */
        return "MIPS64-R1" SLJIT_CPUINFO;
-#endif
+#endif /* SLJIT_CONFIG_MIPS_32 */
+
 #else /* SLJIT_MIPS_R1 */
        return "MIPS III" SLJIT_CPUINFO;
-#endif
+#endif /* SLJIT_MIPS_R6 */
 }
 
 /* Length of an instruction word
@@ -62,6 +76,7 @@ typedef sljit_u32 sljit_ins;
 
 #define TMP_FREG1      (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1)
 #define TMP_FREG2      (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2)
+#define TMP_FREG3      (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3)
 
 static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
        0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 4, 25, 31
@@ -69,14 +84,14 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
 
 #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
 
-static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
-       0, 0, 14, 2, 4, 6, 8, 12, 10
+static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 4] = {
+       0, 0, 14, 2, 4, 6, 8, 12, 10, 16
 };
 
 #else
 
-static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
-       0, 0, 13, 14, 15, 16, 17, 12, 18
+static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 4] = {
+       0, 0, 13, 14, 15, 16, 17, 12, 18, 10
 };
 
 #endif
@@ -102,6 +117,11 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
 #define FR(dr)         (freg_map[dr])
 #define HI(opcode)     ((opcode) << 26)
 #define LO(opcode)     (opcode)
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+/* CMP.cond.fmt */
+/* S = (20 << 21) D = (21 << 21) */
+#define CMP_FMT_S      (20 << 21)
+#endif /* SLJIT_MIPS_R6 */
 /* S = (16 << 21) D = (17 << 21) */
 #define FMT_S          (16 << 21)
 #define FMT_D          (17 << 21)
@@ -114,8 +134,13 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
 #define ANDI           (HI(12))
 #define B              (HI(4))
 #define BAL            (HI(1) | (17 << 16))
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+#define BC1EQZ         (HI(17) | (9 << 21) | FT(TMP_FREG3))
+#define BC1NEZ         (HI(17) | (13 << 21) | FT(TMP_FREG3))
+#else /* !SLJIT_MIPS_R6 */
 #define BC1F           (HI(17) | (8 << 21))
 #define BC1T           (HI(17) | (8 << 21) | (1 << 16))
+#endif /* SLJIT_MIPS_R6 */
 #define BEQ            (HI(4))
 #define BGEZ           (HI(1) | (1 << 16))
 #define BGTZ           (HI(7))
@@ -124,20 +149,42 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
 #define BNE            (HI(5))
 #define BREAK          (HI(0) | LO(13))
 #define CFC1           (HI(17) | (2 << 21))
-#define C_UN_S         (HI(17) | FMT_S | LO(49))
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+#define C_UEQ_S                (HI(17) | CMP_FMT_S | LO(3))
+#define C_ULE_S                (HI(17) | CMP_FMT_S | LO(7))
+#define C_ULT_S                (HI(17) | CMP_FMT_S | LO(5))
+#define C_UN_S         (HI(17) | CMP_FMT_S | LO(1))
+#define C_FD           (FD(TMP_FREG3))
+#else /* !SLJIT_MIPS_R6 */
 #define C_UEQ_S                (HI(17) | FMT_S | LO(51))
 #define C_ULE_S                (HI(17) | FMT_S | LO(55))
 #define C_ULT_S                (HI(17) | FMT_S | LO(53))
+#define C_UN_S         (HI(17) | FMT_S | LO(49))
+#define C_FD           (0)
+#endif /* SLJIT_MIPS_R6 */
 #define CVT_S_S                (HI(17) | FMT_S | LO(32))
 #define DADDIU         (HI(25))
 #define DADDU          (HI(0) | LO(45))
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+#define DDIV           (HI(0) | (2 << 6) | LO(30))
+#define DDIVU          (HI(0) | (2 << 6) | LO(31))
+#define DMOD           (HI(0) | (3 << 6) | LO(30))
+#define DMODU          (HI(0) | (3 << 6) | LO(31))
+#define DIV            (HI(0) | (2 << 6) | LO(26))
+#define DIVU           (HI(0) | (2 << 6) | LO(27))
+#define DMUH           (HI(0) | (3 << 6) | LO(28))
+#define DMUHU          (HI(0) | (3 << 6) | LO(29))
+#define DMUL           (HI(0) | (2 << 6) | LO(28))
+#define DMULU          (HI(0) | (2 << 6) | LO(29))
+#else /* !SLJIT_MIPS_R6 */
 #define DDIV           (HI(0) | LO(30))
 #define DDIVU          (HI(0) | LO(31))
 #define DIV            (HI(0) | LO(26))
 #define DIVU           (HI(0) | LO(27))
-#define DIV_S          (HI(17) | FMT_S | LO(3))
 #define DMULT          (HI(0) | LO(28))
 #define DMULTU         (HI(0) | LO(29))
+#endif /* SLJIT_MIPS_R6 */
+#define DIV_S          (HI(17) | FMT_S | LO(3))
 #define DSLL           (HI(0) | LO(56))
 #define DSLL32         (HI(0) | LO(60))
 #define DSLLV          (HI(0) | LO(20))
@@ -151,18 +198,34 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
 #define J              (HI(2))
 #define JAL            (HI(3))
 #define JALR           (HI(0) | LO(9))
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+#define JR             (HI(0) | LO(9))
+#else /* !SLJIT_MIPS_R6 */
 #define JR             (HI(0) | LO(8))
+#endif /* SLJIT_MIPS_R6 */
 #define LD             (HI(55))
 #define LUI            (HI(15))
 #define LW             (HI(35))
 #define MFC1           (HI(17))
+#if !(defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
 #define MFHI           (HI(0) | LO(16))
 #define MFLO           (HI(0) | LO(18))
+#else /* SLJIT_MIPS_R6 */
+#define MOD            (HI(0) | (3 << 6) | LO(26))
+#define MODU           (HI(0) | (3 << 6) | LO(27))
+#endif /* !SLJIT_MIPS_R6 */
 #define MOV_S          (HI(17) | FMT_S | LO(6))
 #define MTC1           (HI(17) | (4 << 21))
-#define MUL_S          (HI(17) | FMT_S | LO(2))
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+#define MUH            (HI(0) | (3 << 6) | LO(24))
+#define MUHU           (HI(0) | (3 << 6) | LO(25))
+#define MUL            (HI(0) | (2 << 6) | LO(24))
+#define MULU           (HI(0) | (2 << 6) | LO(25))
+#else /* !SLJIT_MIPS_R6 */
 #define MULT           (HI(0) | LO(24))
 #define MULTU          (HI(0) | LO(25))
+#endif /* SLJIT_MIPS_R6 */
+#define MUL_S          (HI(17) | FMT_S | LO(2))
 #define NEG_S          (HI(17) | FMT_S | LO(7))
 #define NOP            (HI(0) | LO(0))
 #define NOR            (HI(0) | LO(39))
@@ -188,14 +251,18 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
 #define XOR            (HI(0) | LO(38))
 #define XORI           (HI(14))
 
-#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
+#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) || (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
 #define CLZ            (HI(28) | LO(32))
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+#define DCLZ           (LO(18))
+#else /* !SLJIT_MIPS_R6 */
 #define DCLZ           (HI(28) | LO(36))
 #define MOVF           (HI(0) | (0 << 16) | LO(1))
 #define MOVN           (HI(0) | LO(11))
 #define MOVT           (HI(0) | (1 << 16) | LO(1))
 #define MOVZ           (HI(0) | LO(10))
 #define MUL            (HI(28) | LO(2))
+#endif /* SLJIT_MIPS_R6 */
 #define PREF           (HI(51))
 #define PREFX          (HI(19) | LO(15))
 #define SEB            (HI(31) | (16 << 6) | LO(32))
@@ -234,7 +301,13 @@ static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins, sljit
 
 static SLJIT_INLINE sljit_ins invert_branch(sljit_s32 flags)
 {
-       return (flags & IS_BIT26_COND) ? (1 << 26) : (1 << 16);
+       if (flags & IS_BIT26_COND)
+               return (1 << 26);
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+       if (flags & IS_BIT23_COND)
+               return (1 << 23);
+#endif /* SLJIT_MIPS_R6 */
+       return (1 << 16);
 }
 
 static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset)
@@ -376,6 +449,55 @@ static __attribute__ ((noinline)) void sljit_cache_flush(void* code, void* code_
 }
 #endif
 
+#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
+
+static SLJIT_INLINE sljit_sw put_label_get_length(struct sljit_put_label *put_label, sljit_uw max_label)
+{
+       if (max_label < 0x80000000l) {
+               put_label->flags = 0;
+               return 1;
+       }
+
+       if (max_label < 0x800000000000l) {
+               put_label->flags = 1;
+               return 3;
+       }
+
+       put_label->flags = 2;
+       return 5;
+}
+
+static SLJIT_INLINE void put_label_set(struct sljit_put_label *put_label)
+{
+       sljit_uw addr = put_label->label->addr;
+       sljit_ins *inst = (sljit_ins *)put_label->addr;
+       sljit_s32 reg = *inst;
+
+       if (put_label->flags == 0) {
+               SLJIT_ASSERT(addr < 0x80000000l);
+               inst[0] = LUI | T(reg) | IMM(addr >> 16);
+       }
+       else if (put_label->flags == 1) {
+               SLJIT_ASSERT(addr < 0x800000000000l);
+               inst[0] = LUI | T(reg) | IMM(addr >> 32);
+               inst[1] = ORI | S(reg) | T(reg) | IMM((addr >> 16) & 0xffff);
+               inst[2] = DSLL | T(reg) | D(reg) | SH_IMM(16);
+               inst += 2;
+       }
+       else {
+               inst[0] = LUI | T(reg) | IMM(addr >> 48);
+               inst[1] = ORI | S(reg) | T(reg) | IMM((addr >> 32) & 0xffff);
+               inst[2] = DSLL | T(reg) | D(reg) | SH_IMM(16);
+               inst[3] = ORI | S(reg) | T(reg) | IMM((addr >> 16) & 0xffff);
+               inst[4] = DSLL | T(reg) | D(reg) | SH_IMM(16);
+               inst += 4;
+       }
+
+       inst[1] = ORI | S(reg) | T(reg) | IMM(addr & 0xffff);
+}
+
+#endif
+
 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler)
 {
        struct sljit_memory_fragment *buf;
@@ -384,12 +506,14 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        sljit_ins *buf_ptr;
        sljit_ins *buf_end;
        sljit_uw word_count;
+       sljit_uw next_addr;
        sljit_sw executable_offset;
        sljit_uw addr;
 
        struct sljit_label *label;
        struct sljit_jump *jump;
        struct sljit_const *const_;
+       struct sljit_put_label *put_label;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_generate_code(compiler));
@@ -401,39 +525,54 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
 
        code_ptr = code;
        word_count = 0;
+       next_addr = 0;
        executable_offset = SLJIT_EXEC_OFFSET(code);
 
        label = compiler->labels;
        jump = compiler->jumps;
        const_ = compiler->consts;
+       put_label = compiler->put_labels;
 
        do {
                buf_ptr = (sljit_ins*)buf->memory;
                buf_end = buf_ptr + (buf->used_size >> 2);
                do {
                        *code_ptr = *buf_ptr++;
-                       SLJIT_ASSERT(!label || label->size >= word_count);
-                       SLJIT_ASSERT(!jump || jump->addr >= word_count);
-                       SLJIT_ASSERT(!const_ || const_->addr >= word_count);
-                       /* These structures are ordered by their address. */
-                       if (label && label->size == word_count) {
-                               label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
-                               label->size = code_ptr - code;
-                               label = label->next;
-                       }
-                       if (jump && jump->addr == word_count) {
+                       if (next_addr == word_count) {
+                               SLJIT_ASSERT(!label || label->size >= word_count);
+                               SLJIT_ASSERT(!jump || jump->addr >= word_count);
+                               SLJIT_ASSERT(!const_ || const_->addr >= word_count);
+                               SLJIT_ASSERT(!put_label || put_label->addr >= word_count);
+
+                               /* These structures are ordered by their address. */
+                               if (label && label->size == word_count) {
+                                       label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+                                       label->size = code_ptr - code;
+                                       label = label->next;
+                               }
+                               if (jump && jump->addr == word_count) {
 #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
-                               jump->addr = (sljit_uw)(code_ptr - 3);
+                                       jump->addr = (sljit_uw)(code_ptr - 3);
 #else
-                               jump->addr = (sljit_uw)(code_ptr - 7);
+                                       jump->addr = (sljit_uw)(code_ptr - 7);
 #endif
-                               code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset);
-                               jump = jump->next;
-                       }
-                       if (const_ && const_->addr == word_count) {
-                               /* Just recording the address. */
-                               const_->addr = (sljit_uw)code_ptr;
-                               const_ = const_->next;
+                                       code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset);
+                                       jump = jump->next;
+                               }
+                               if (const_ && const_->addr == word_count) {
+                                       const_->addr = (sljit_uw)code_ptr;
+                                       const_ = const_->next;
+                               }
+                               if (put_label && put_label->addr == word_count) {
+                                       SLJIT_ASSERT(put_label->label);
+                                       put_label->addr = (sljit_uw)code_ptr;
+#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
+                                       code_ptr += put_label_get_length(put_label, (sljit_uw)(SLJIT_ADD_EXEC_OFFSET(code, executable_offset) + put_label->label->size));
+                                       word_count += 5;
+#endif
+                                       put_label = put_label->next;
+                               }
+                               next_addr = compute_next_addr(label, jump, const_, put_label);
                        }
                        code_ptr ++;
                        word_count ++;
@@ -451,6 +590,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        SLJIT_ASSERT(!label);
        SLJIT_ASSERT(!jump);
        SLJIT_ASSERT(!const_);
+       SLJIT_ASSERT(!put_label);
        SLJIT_ASSERT(code_ptr - code <= (sljit_sw)compiler->size);
 
        jump = compiler->jumps;
@@ -498,6 +638,21 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                jump = jump->next;
        }
 
+       put_label = compiler->put_labels;
+       while (put_label) {
+#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
+               addr = put_label->label->addr;
+               buf_ptr = (sljit_ins *)put_label->addr;
+
+               SLJIT_ASSERT((buf_ptr[0] & 0xffe00000) == LUI && (buf_ptr[1] & 0xfc000000) == ORI);
+               buf_ptr[0] |= (addr >> 16) & 0xffff;
+               buf_ptr[1] |= addr & 0xffff;
+#else
+               put_label_set(put_label);
+#endif
+               put_label = put_label->next;
+       }
+
        compiler->error = SLJIT_ERR_COMPILED;
        compiler->executable_offset = executable_offset;
        compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins);
@@ -1075,34 +1230,62 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
                return push_inst(compiler, NOP, UNMOVABLE_INS);
        case SLJIT_LMUL_UW:
        case SLJIT_LMUL_SW:
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
+               FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMULU : DMUL) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
+               FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMUHU : DMUH) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
+#else /* !SLJIT_CONFIG_MIPS_64 */
+               FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MULU : MUL) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
+               FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MUHU : MUH) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
+#endif /* SLJIT_CONFIG_MIPS_64 */
+               FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | TA(0) | D(SLJIT_R0), DR(SLJIT_R0)));
+               return push_inst(compiler, ADDU_W | S(TMP_REG1) | TA(0) | D(SLJIT_R1), DR(SLJIT_R1));
+#else /* !SLJIT_MIPS_R6 */
 #if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
                FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMULTU : DMULT) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
-#else
+#else /* !SLJIT_CONFIG_MIPS_64 */
                FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MULTU : MULT) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
-#endif
+#endif /* SLJIT_CONFIG_MIPS_64 */
                FAIL_IF(push_inst(compiler, MFLO | D(SLJIT_R0), DR(SLJIT_R0)));
                return push_inst(compiler, MFHI | D(SLJIT_R1), DR(SLJIT_R1));
+#endif /* SLJIT_MIPS_R6 */
        case SLJIT_DIVMOD_UW:
        case SLJIT_DIVMOD_SW:
        case SLJIT_DIV_UW:
        case SLJIT_DIV_SW:
                SLJIT_COMPILE_ASSERT((SLJIT_DIVMOD_UW & 0x2) == 0 && SLJIT_DIV_UW - 0x2 == SLJIT_DIVMOD_UW, bad_div_opcode_assignments);
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
+               if (int_op) {
+                       FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
+                       FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? MODU : MOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
+               }
+               else {
+                       FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DDIVU : DDIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
+                       FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DMODU : DMOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
+               }
+#else /* !SLJIT_CONFIG_MIPS_64 */
+               FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
+               FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? MODU : MOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
+#endif /* SLJIT_CONFIG_MIPS_64 */
+               FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | TA(0) | D(SLJIT_R0), DR(SLJIT_R0)));
+               return (op >= SLJIT_DIV_UW) ? SLJIT_SUCCESS : push_inst(compiler, ADDU_W | S(TMP_REG1) | TA(0) | D(SLJIT_R1), DR(SLJIT_R1));
+#else /* !SLJIT_MIPS_R6 */
 #if !(defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
                FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS));
                FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS));
-#endif
-
+#endif /* !SLJIT_MIPS_R1 */
 #if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
                if (int_op)
                        FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
                else
                        FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DDIVU : DDIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
-#else
+#else /* !SLJIT_CONFIG_MIPS_64 */
                FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
-#endif
-
+#endif /* SLJIT_CONFIG_MIPS_64 */
                FAIL_IF(push_inst(compiler, MFLO | D(SLJIT_R0), DR(SLJIT_R0)));
                return (op >= SLJIT_DIV_UW) ? SLJIT_SUCCESS : push_inst(compiler, MFHI | D(SLJIT_R1), DR(SLJIT_R1));
+#endif /* SLJIT_MIPS_R6 */
        }
 
        return SLJIT_SUCCESS;
@@ -1408,8 +1591,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compile
                inst = C_UN_S;
                break;
        }
-
-       return push_inst(compiler, inst | FMT(op) | FT(src2) | FS(src1), UNMOVABLE_INS);
+       return push_inst(compiler, inst | FMT(op) | FT(src2) | FS(src1) | C_FD, UNMOVABLE_INS);
 }
 
 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op,
@@ -1608,16 +1790,30 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compi
        flags = IS_BIT26_COND; \
        delay_check = src;
 
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+
+#define BR_T() \
+       inst = BC1NEZ; \
+       flags = IS_BIT23_COND; \
+       delay_check = FCSR_FCC;
+#define BR_F() \
+       inst = BC1EQZ; \
+       flags = IS_BIT23_COND; \
+       delay_check = FCSR_FCC;
+
+#else /* !SLJIT_MIPS_R6 */
+
 #define BR_T() \
        inst = BC1T | JUMP_LENGTH; \
        flags = IS_BIT16_COND; \
        delay_check = FCSR_FCC;
-
 #define BR_F() \
        inst = BC1F | JUMP_LENGTH; \
        flags = IS_BIT16_COND; \
        delay_check = FCSR_FCC;
 
+#endif /* SLJIT_MIPS_R6 */
+
 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_s32 type)
 {
        struct sljit_jump *jump;
@@ -1927,7 +2123,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
        case SLJIT_GREATER_EQUAL_F64:
        case SLJIT_UNORDERED_F64:
        case SLJIT_ORDERED_F64:
+#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
+               FAIL_IF(push_inst(compiler, MFC1 | TA(dst_ar) | FS(TMP_FREG3), dst_ar));
+#else /* !SLJIT_MIPS_R6 */
                FAIL_IF(push_inst(compiler, CFC1 | TA(dst_ar) | DA(FCSR_REG), dst_ar));
+#endif /* SLJIT_MIPS_R6 */
                FAIL_IF(push_inst(compiler, SRL | TA(dst_ar) | DA(dst_ar) | SH_IMM(23), dst_ar));
                FAIL_IF(push_inst(compiler, ANDI | SA(dst_ar) | TA(dst_ar) | IMM(1), dst_ar));
                src_ar = dst_ar;
@@ -2039,7 +2239,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil
 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
 {
        struct sljit_const *const_;
-       sljit_s32 reg;
+       sljit_s32 dst_r;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value));
@@ -2049,11 +2249,38 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
        PTR_FAIL_IF(!const_);
        set_const(const_, compiler);
 
-       reg = FAST_IS_REG(dst) ? dst : TMP_REG2;
-
-       PTR_FAIL_IF(emit_const(compiler, reg, init_value));
+       dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
+       PTR_FAIL_IF(emit_const(compiler, dst_r, init_value));
 
        if (dst & SLJIT_MEM)
                PTR_FAIL_IF(emit_op(compiler, SLJIT_MOV, WORD_DATA, dst, dstw, TMP_REG1, 0, TMP_REG2, 0));
+
        return const_;
 }
+
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+       struct sljit_put_label *put_label;
+       sljit_s32 dst_r;
+
+       CHECK_ERROR_PTR();
+       CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw));
+       ADJUST_LOCAL_OFFSET(dst, dstw);
+
+       put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label));
+       PTR_FAIL_IF(!put_label);
+       set_put_label(put_label, compiler, 0);
+
+       dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
+#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
+       PTR_FAIL_IF(emit_const(compiler, dst_r, 0));
+#else
+       PTR_FAIL_IF(push_inst(compiler, dst_r, UNMOVABLE_INS));
+       compiler->size += 5;
+#endif
+
+       if (dst & SLJIT_MEM)
+               PTR_FAIL_IF(emit_op(compiler, SLJIT_MOV, WORD_DATA, dst, dstw, TMP_REG1, 0, TMP_REG2, 0));
+
+       return put_label;
+}
index fc185f784754c917cd2454c87e6c910fca6d1cce..3ce741153f850234cb554cfda7f6ada00971f590 100644 (file)
@@ -259,6 +259,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_ta
 {
        sljit_ins *inst = (sljit_ins *)addr;
 
+       SLJIT_ASSERT((inst[0] & 0xfc1f0000) == ADDIS && (inst[1] & 0xfc000000) == ORI);
        inst[0] = (inst[0] & 0xffff0000) | ((new_target >> 16) & 0xffff);
        inst[1] = (inst[1] & 0xffff0000) | (new_target & 0xffff);
        inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
@@ -269,6 +270,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
 {
        sljit_ins *inst = (sljit_ins *)addr;
 
+       SLJIT_ASSERT((inst[0] & 0xfc1f0000) == ADDIS && (inst[1] & 0xfc000000) == ORI);
        inst[0] = (inst[0] & 0xffff0000) | ((new_constant >> 16) & 0xffff);
        inst[1] = (inst[1] & 0xffff0000) | (new_constant & 0xffff);
        inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
index 706b2ba20b59ee37b9924d14158bc9d6d0d3b606..3b73021cc8c6b1e52295ab2121e71ddc8f95e06d 100644 (file)
@@ -35,9 +35,6 @@
 #error "Must implement count leading zeroes"
 #endif
 
-#define RLDI(dst, src, sh, mb, type) \
-       (HI(30) | S(src) | A(dst) | ((type) << 2) | (((sh) & 0x1f) << 11) | (((sh) & 0x20) >> 4) | (((mb) & 0x1f) << 6) | ((mb) & 0x20))
-
 #define PUSH_RLDICR(reg, shift) \
        push_inst(compiler, RLDI(reg, reg, 63 - shift, shift, 1))
 
index 5ef4ac96c4a1e0577059077879c0413559330031..e8275143153d09affc641c12bfbc7b1cec2c2efe 100644 (file)
@@ -42,7 +42,7 @@ typedef sljit_u32 sljit_ins;
 #include <sys/cache.h>
 #endif
 
-#if (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
+#if (defined _CALL_ELF && _CALL_ELF == 2)
 #define SLJIT_PASS_ENTRY_ADDR_TO_CALL 1
 #endif
 
@@ -231,6 +231,9 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
 #define SIMM_MIN       (-0x8000)
 #define UIMM_MAX       (0xffff)
 
+#define RLDI(dst, src, sh, mb, type) \
+       (HI(30) | S(src) | A(dst) | ((type) << 2) | (((sh) & 0x1f) << 11) | (((sh) & 0x20) >> 4) | (((mb) & 0x1f) << 6) | ((mb) & 0x20))
+
 #if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL)
 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_function_context(void** func_ptr, struct sljit_function_context* context, sljit_sw addr, void* func)
 {
@@ -324,6 +327,55 @@ keep_address:
        return 0;
 }
 
+#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
+
+static SLJIT_INLINE sljit_sw put_label_get_length(struct sljit_put_label *put_label, sljit_uw max_label)
+{
+       if (max_label < 0x100000000l) {
+               put_label->flags = 0;
+               return 1;
+       }
+
+       if (max_label < 0x1000000000000l) {
+               put_label->flags = 1;
+               return 3;
+       }
+
+       put_label->flags = 2;
+       return 4;
+}
+
+static SLJIT_INLINE void put_label_set(struct sljit_put_label *put_label)
+{
+       sljit_uw addr = put_label->label->addr;
+       sljit_ins *inst = (sljit_ins *)put_label->addr;
+       sljit_s32 reg = *inst;
+
+       if (put_label->flags == 0) {
+               SLJIT_ASSERT(addr < 0x100000000l);
+               inst[0] = ORIS | S(TMP_ZERO) | A(reg) | IMM(addr >> 16);
+       }
+       else {
+               if (put_label->flags == 1) {
+                       SLJIT_ASSERT(addr < 0x1000000000000l);
+                       inst[0] = ORI | S(TMP_ZERO) | A(reg) | IMM(addr >> 32);
+               }
+               else {
+                       inst[0] = ORIS | S(TMP_ZERO) | A(reg) | IMM(addr >> 48);
+                       inst[1] = ORI | S(reg) | A(reg) | IMM((addr >> 32) & 0xffff);
+                       inst ++;
+               }
+
+               inst[1] = RLDI(reg, reg, 32, 31, 1);
+               inst[2] = ORIS | S(reg) | A(reg) | IMM((addr >> 16) & 0xffff);
+               inst += 2;
+       }
+
+       inst[1] = ORI | S(reg) | A(reg) | IMM(addr & 0xffff);
+}
+
+#endif
+
 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler)
 {
        struct sljit_memory_fragment *buf;
@@ -332,12 +384,14 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        sljit_ins *buf_ptr;
        sljit_ins *buf_end;
        sljit_uw word_count;
+       sljit_uw next_addr;
        sljit_sw executable_offset;
        sljit_uw addr;
 
        struct sljit_label *label;
        struct sljit_jump *jump;
        struct sljit_const *const_;
+       struct sljit_put_label *put_label;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_generate_code(compiler));
@@ -356,71 +410,87 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
 
        code_ptr = code;
        word_count = 0;
+       next_addr = 0;
        executable_offset = SLJIT_EXEC_OFFSET(code);
 
        label = compiler->labels;
        jump = compiler->jumps;
        const_ = compiler->consts;
+       put_label = compiler->put_labels;
 
        do {
                buf_ptr = (sljit_ins*)buf->memory;
                buf_end = buf_ptr + (buf->used_size >> 2);
                do {
                        *code_ptr = *buf_ptr++;
-                       SLJIT_ASSERT(!label || label->size >= word_count);
-                       SLJIT_ASSERT(!jump || jump->addr >= word_count);
-                       SLJIT_ASSERT(!const_ || const_->addr >= word_count);
-                       /* These structures are ordered by their address. */
-                       if (label && label->size == word_count) {
-                               /* Just recording the address. */
-                               label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
-                               label->size = code_ptr - code;
-                               label = label->next;
-                       }
-                       if (jump && jump->addr == word_count) {
+                       if (next_addr == word_count) {
+                               SLJIT_ASSERT(!label || label->size >= word_count);
+                               SLJIT_ASSERT(!jump || jump->addr >= word_count);
+                               SLJIT_ASSERT(!const_ || const_->addr >= word_count);
+                               SLJIT_ASSERT(!put_label || put_label->addr >= word_count);
+
+                               /* These structures are ordered by their address. */
+                               if (label && label->size == word_count) {
+                                       /* Just recording the address. */
+                                       label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+                                       label->size = code_ptr - code;
+                                       label = label->next;
+                               }
+                               if (jump && jump->addr == word_count) {
 #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
-                               jump->addr = (sljit_uw)(code_ptr - 3);
+                                       jump->addr = (sljit_uw)(code_ptr - 3);
 #else
-                               jump->addr = (sljit_uw)(code_ptr - 6);
+                                       jump->addr = (sljit_uw)(code_ptr - 6);
 #endif
-                               if (detect_jump_type(jump, code_ptr, code, executable_offset)) {
+                                       if (detect_jump_type(jump, code_ptr, code, executable_offset)) {
 #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
-                                       code_ptr[-3] = code_ptr[0];
-                                       code_ptr -= 3;
-#else
-                                       if (jump->flags & PATCH_ABS32) {
+                                               code_ptr[-3] = code_ptr[0];
                                                code_ptr -= 3;
-                                               code_ptr[-1] = code_ptr[2];
-                                               code_ptr[0] = code_ptr[3];
-                                       }
-                                       else if (jump->flags & PATCH_ABS48) {
-                                               code_ptr--;
-                                               code_ptr[-1] = code_ptr[0];
-                                               code_ptr[0] = code_ptr[1];
-                                               /* rldicr rX,rX,32,31 -> rX,rX,16,47 */
-                                               SLJIT_ASSERT((code_ptr[-3] & 0xfc00ffff) == 0x780007c6);
-                                               code_ptr[-3] ^= 0x8422;
-                                               /* oris -> ori */
-                                               code_ptr[-2] ^= 0x4000000;
-                                       }
-                                       else {
-                                               code_ptr[-6] = code_ptr[0];
-                                               code_ptr -= 6;
-                                       }
+#else
+                                               if (jump->flags & PATCH_ABS32) {
+                                                       code_ptr -= 3;
+                                                       code_ptr[-1] = code_ptr[2];
+                                                       code_ptr[0] = code_ptr[3];
+                                               }
+                                               else if (jump->flags & PATCH_ABS48) {
+                                                       code_ptr--;
+                                                       code_ptr[-1] = code_ptr[0];
+                                                       code_ptr[0] = code_ptr[1];
+                                                       /* rldicr rX,rX,32,31 -> rX,rX,16,47 */
+                                                       SLJIT_ASSERT((code_ptr[-3] & 0xfc00ffff) == 0x780007c6);
+                                                       code_ptr[-3] ^= 0x8422;
+                                                       /* oris -> ori */
+                                                       code_ptr[-2] ^= 0x4000000;
+                                               }
+                                               else {
+                                                       code_ptr[-6] = code_ptr[0];
+                                                       code_ptr -= 6;
+                                               }
 #endif
-                                       if (jump->flags & REMOVE_COND) {
-                                               code_ptr[0] = BCx | (2 << 2) | ((code_ptr[0] ^ (8 << 21)) & 0x03ff0001);
-                                               code_ptr++;
-                                               jump->addr += sizeof(sljit_ins);
-                                               code_ptr[0] = Bx;
-                                               jump->flags -= IS_COND;
+                                               if (jump->flags & REMOVE_COND) {
+                                                       code_ptr[0] = BCx | (2 << 2) | ((code_ptr[0] ^ (8 << 21)) & 0x03ff0001);
+                                                       code_ptr++;
+                                                       jump->addr += sizeof(sljit_ins);
+                                                       code_ptr[0] = Bx;
+                                                       jump->flags -= IS_COND;
+                                               }
                                        }
+                                       jump = jump->next;
                                }
-                               jump = jump->next;
-                       }
-                       if (const_ && const_->addr == word_count) {
-                               const_->addr = (sljit_uw)code_ptr;
-                               const_ = const_->next;
+                               if (const_ && const_->addr == word_count) {
+                                       const_->addr = (sljit_uw)code_ptr;
+                                       const_ = const_->next;
+                               }
+                               if (put_label && put_label->addr == word_count) {
+                                       SLJIT_ASSERT(put_label->label);
+                                       put_label->addr = (sljit_uw)code_ptr;
+#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
+                                       code_ptr += put_label_get_length(put_label, (sljit_uw)(SLJIT_ADD_EXEC_OFFSET(code, executable_offset) + put_label->label->size));
+                                       word_count += 4;
+#endif
+                                       put_label = put_label->next;
+                               }
+                               next_addr = compute_next_addr(label, jump, const_, put_label);
                        }
                        code_ptr ++;
                        word_count ++;
@@ -438,6 +508,8 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        SLJIT_ASSERT(!label);
        SLJIT_ASSERT(!jump);
        SLJIT_ASSERT(!const_);
+       SLJIT_ASSERT(!put_label);
+
 #if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL)
        SLJIT_ASSERT(code_ptr - code <= (sljit_sw)compiler->size - (sizeof(struct sljit_function_context) / sizeof(sljit_ins)));
 #else
@@ -503,6 +575,21 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                jump = jump->next;
        }
 
+       put_label = compiler->put_labels;
+       while (put_label) {
+#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
+               addr = put_label->label->addr;
+               buf_ptr = (sljit_ins *)put_label->addr;
+
+               SLJIT_ASSERT((buf_ptr[0] & 0xfc1f0000) == ADDIS && (buf_ptr[1] & 0xfc000000) == ORI);
+               buf_ptr[0] |= (addr >> 16) & 0xffff;
+               buf_ptr[1] |= addr & 0xffff;
+#else
+               put_label_set(put_label);
+#endif
+               put_label = put_label->next;
+       }
+
        compiler->error = SLJIT_ERR_COMPILED;
        compiler->executable_offset = executable_offset;
        compiler->executable_size = (code_ptr - code) * sizeof(sljit_ins);
@@ -2261,7 +2348,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem(struct sljit_compiler *compil
 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
 {
        struct sljit_const *const_;
-       sljit_s32 reg;
+       sljit_s32 dst_r;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value));
@@ -2271,11 +2358,38 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
        PTR_FAIL_IF(!const_);
        set_const(const_, compiler);
 
-       reg = FAST_IS_REG(dst) ? dst : TMP_REG2;
-
-       PTR_FAIL_IF(emit_const(compiler, reg, init_value));
+       dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
+       PTR_FAIL_IF(emit_const(compiler, dst_r, init_value));
 
        if (dst & SLJIT_MEM)
                PTR_FAIL_IF(emit_op(compiler, SLJIT_MOV, WORD_DATA, dst, dstw, TMP_REG1, 0, TMP_REG2, 0));
+
        return const_;
 }
+
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+       struct sljit_put_label *put_label;
+       sljit_s32 dst_r;
+
+       CHECK_ERROR_PTR();
+       CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw));
+       ADJUST_LOCAL_OFFSET(dst, dstw);
+
+       put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label));
+       PTR_FAIL_IF(!put_label);
+       set_put_label(put_label, compiler, 0);
+
+       dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
+#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
+       PTR_FAIL_IF(emit_const(compiler, dst_r, 0));
+#else
+       PTR_FAIL_IF(push_inst(compiler, dst_r));
+       compiler->size += 4;
+#endif
+
+       if (dst & SLJIT_MEM)
+               PTR_FAIL_IF(emit_op(compiler, SLJIT_MOV, WORD_DATA, dst, dstw, TMP_REG1, 0, TMP_REG2, 0));
+
+       return put_label;
+}
index 0671b130cc6d934d1311719e7bfe51f756acb630..8079fad8df84b702221b57c114d7ae260b2db44b 100644 (file)
@@ -267,6 +267,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_ta
 {
        sljit_ins *inst = (sljit_ins *)addr;
 
+       SLJIT_ASSERT(((inst[0] & 0xc1c00000) == 0x01000000) && ((inst[1] & 0xc1f82000) == 0x80102000));
        inst[0] = (inst[0] & 0xffc00000) | ((new_target >> 10) & 0x3fffff);
        inst[1] = (inst[1] & 0xfffffc00) | (new_target & 0x3ff);
        inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
@@ -277,6 +278,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
 {
        sljit_ins *inst = (sljit_ins *)addr;
 
+       SLJIT_ASSERT(((inst[0] & 0xc1c00000) == 0x01000000) && ((inst[1] & 0xc1f82000) == 0x80102000));
        inst[0] = (inst[0] & 0xffc00000) | ((new_constant >> 10) & 0x3fffff);
        inst[1] = (inst[1] & 0xfffffc00) | (new_constant & 0x3ff);
        inst = (sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
index 669ecd8152849507aa500b84b0ee6b1ce1d17c7a..bfa4ecede2f84258e41e24b9b82ddd55c505b354 100644 (file)
@@ -298,12 +298,14 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        sljit_ins *buf_ptr;
        sljit_ins *buf_end;
        sljit_uw word_count;
+       sljit_uw next_addr;
        sljit_sw executable_offset;
        sljit_uw addr;
 
        struct sljit_label *label;
        struct sljit_jump *jump;
        struct sljit_const *const_;
+       struct sljit_put_label *put_label;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_generate_code(compiler));
@@ -315,40 +317,52 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
 
        code_ptr = code;
        word_count = 0;
+       next_addr = 0;
        executable_offset = SLJIT_EXEC_OFFSET(code);
 
        label = compiler->labels;
        jump = compiler->jumps;
        const_ = compiler->consts;
+       put_label = compiler->put_labels;
 
        do {
                buf_ptr = (sljit_ins*)buf->memory;
                buf_end = buf_ptr + (buf->used_size >> 2);
                do {
                        *code_ptr = *buf_ptr++;
-                       SLJIT_ASSERT(!label || label->size >= word_count);
-                       SLJIT_ASSERT(!jump || jump->addr >= word_count);
-                       SLJIT_ASSERT(!const_ || const_->addr >= word_count);
-                       /* These structures are ordered by their address. */
-                       if (label && label->size == word_count) {
-                               /* Just recording the address. */
-                               label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
-                               label->size = code_ptr - code;
-                               label = label->next;
-                       }
-                       if (jump && jump->addr == word_count) {
+                       if (next_addr == word_count) {
+                               SLJIT_ASSERT(!label || label->size >= word_count);
+                               SLJIT_ASSERT(!jump || jump->addr >= word_count);
+                               SLJIT_ASSERT(!const_ || const_->addr >= word_count);
+                               SLJIT_ASSERT(!put_label || put_label->addr >= word_count);
+
+                               /* These structures are ordered by their address. */
+                               if (label && label->size == word_count) {
+                                       /* Just recording the address. */
+                                       label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+                                       label->size = code_ptr - code;
+                                       label = label->next;
+                               }
+                               if (jump && jump->addr == word_count) {
 #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
-                               jump->addr = (sljit_uw)(code_ptr - 3);
+                                       jump->addr = (sljit_uw)(code_ptr - 3);
 #else
-                               jump->addr = (sljit_uw)(code_ptr - 6);
+                                       jump->addr = (sljit_uw)(code_ptr - 6);
 #endif
-                               code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset);
-                               jump = jump->next;
-                       }
-                       if (const_ && const_->addr == word_count) {
-                               /* Just recording the address. */
-                               const_->addr = (sljit_uw)code_ptr;
-                               const_ = const_->next;
+                                       code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset);
+                                       jump = jump->next;
+                               }
+                               if (const_ && const_->addr == word_count) {
+                                       /* Just recording the address. */
+                                       const_->addr = (sljit_uw)code_ptr;
+                                       const_ = const_->next;
+                               }
+                               if (put_label && put_label->addr == word_count) {
+                                       SLJIT_ASSERT(put_label->label);
+                                       put_label->addr = (sljit_uw)code_ptr;
+                                       put_label = put_label->next;
+                               }
+                               next_addr = compute_next_addr(label, jump, const_, put_label);
                        }
                        code_ptr ++;
                        word_count ++;
@@ -366,6 +380,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        SLJIT_ASSERT(!label);
        SLJIT_ASSERT(!jump);
        SLJIT_ASSERT(!const_);
+       SLJIT_ASSERT(!put_label);
        SLJIT_ASSERT(code_ptr - code <= (sljit_s32)compiler->size);
 
        jump = compiler->jumps;
@@ -389,8 +404,9 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
 
                        /* Set the fields of immediate loads. */
 #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
-                       buf_ptr[0] = (buf_ptr[0] & 0xffc00000) | ((addr >> 10) & 0x3fffff);
-                       buf_ptr[1] = (buf_ptr[1] & 0xfffffc00) | (addr & 0x3ff);
+                       SLJIT_ASSERT(((buf_ptr[0] & 0xc1cfffff) == 0x01000000) && ((buf_ptr[1] & 0xc1f83fff) == 0x80102000));
+                       buf_ptr[0] |= (addr >> 10) & 0x3fffff;
+                       buf_ptr[1] |= addr & 0x3ff;
 #else
 #error "Implementation required"
 #endif
@@ -398,6 +414,20 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                jump = jump->next;
        }
 
+       put_label = compiler->put_labels;
+       while (put_label) {
+               addr = put_label->label->addr;
+               buf_ptr = (sljit_ins *)put_label->addr;
+
+#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
+               SLJIT_ASSERT(((buf_ptr[0] & 0xc1cfffff) == 0x01000000) && ((buf_ptr[1] & 0xc1f83fff) == 0x80102000));
+               buf_ptr[0] |= (addr >> 10) & 0x3fffff;
+               buf_ptr[1] |= addr & 0x3ff;
+#else
+#error "Implementation required"
+#endif
+               put_label = put_label->next;
+       }
 
        compiler->error = SLJIT_ERR_COMPILED;
        compiler->executable_offset = executable_offset;
@@ -1465,8 +1495,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil
 
 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value)
 {
-       sljit_s32 reg;
        struct sljit_const *const_;
+       sljit_s32 dst_r;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value));
@@ -1476,11 +1506,31 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
        PTR_FAIL_IF(!const_);
        set_const(const_, compiler);
 
-       reg = FAST_IS_REG(dst) ? dst : TMP_REG2;
-
-       PTR_FAIL_IF(emit_const(compiler, reg, init_value));
+       dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
+       PTR_FAIL_IF(emit_const(compiler, dst_r, init_value));
 
        if (dst & SLJIT_MEM)
                PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw));
        return const_;
 }
+
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+       struct sljit_put_label *put_label;
+       sljit_s32 dst_r;
+
+       CHECK_ERROR_PTR();
+       CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw));
+       ADJUST_LOCAL_OFFSET(dst, dstw);
+
+       put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label));
+       PTR_FAIL_IF(!put_label);
+       set_put_label(put_label, compiler, 0);
+
+       dst_r = FAST_IS_REG(dst) ? dst : TMP_REG2;
+       PTR_FAIL_IF(emit_const(compiler, dst_r, 0));
+
+       if (dst & SLJIT_MEM)
+               PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw));
+       return put_label;
+}
index 074e64b9f2bb6b63bc5cd6307d85ae5f3f6a598c..34a3a3d940247ab513b8a2d2c283b1edd823b16a 100644 (file)
@@ -38,8 +38,10 @@ static sljit_s32 emit_do_imm(struct sljit_compiler *compiler, sljit_u8 opcode, s
        return SLJIT_SUCCESS;
 }
 
-static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_s32 type, sljit_sw executable_offset)
+static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_sw executable_offset)
 {
+       sljit_s32 type = jump->flags >> TYPE_SHIFT;
+
        if (type == SLJIT_JUMP) {
                *code_ptr++ = JMP_i32;
                jump->addr++;
index 8506565614422a3ccd982b561fdd849286cfde13..5758711954047bef243de23c85beb060b60eca7c 100644 (file)
@@ -39,8 +39,10 @@ static sljit_s32 emit_load_imm64(struct sljit_compiler *compiler, sljit_s32 reg,
        return SLJIT_SUCCESS;
 }
 
-static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_s32 type)
+static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr)
 {
+       sljit_s32 type = jump->flags >> TYPE_SHIFT;
+
        int short_addr = !(jump->flags & SLJIT_REWRITABLE_JUMP) && !(jump->flags & JUMP_LABEL) && (jump->u.target <= 0xffffffff);
 
        /* The relative jump below specialized for this case. */
@@ -72,6 +74,56 @@ static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_
        return code_ptr;
 }
 
+static sljit_u8* generate_put_label_code(struct sljit_put_label *put_label, sljit_u8 *code_ptr, sljit_uw max_label)
+{
+       if (max_label > HALFWORD_MAX) {
+               put_label->addr -= put_label->flags;
+               put_label->flags = PATCH_MD;
+               return code_ptr;
+       }
+
+       if (put_label->flags == 0) {
+               /* Destination is register. */
+               code_ptr = (sljit_u8*)put_label->addr - 2 - sizeof(sljit_uw);
+
+               SLJIT_ASSERT((code_ptr[0] & 0xf8) == REX_W);
+               SLJIT_ASSERT((code_ptr[1] & 0xf8) == MOV_r_i32);
+
+               if ((code_ptr[0] & 0x07) != 0) {
+                       code_ptr[0] = (sljit_u8)(code_ptr[0] & ~0x08);
+                       code_ptr += 2 + sizeof(sljit_s32);
+               }
+               else {
+                       code_ptr[0] = code_ptr[1];
+                       code_ptr += 1 + sizeof(sljit_s32);
+               }
+
+               put_label->addr = (sljit_uw)code_ptr;
+               return code_ptr;
+       }
+
+       code_ptr -= put_label->flags + (2 + sizeof(sljit_uw));
+       SLJIT_MEMMOVE(code_ptr, code_ptr + (2 + sizeof(sljit_uw)), put_label->flags);
+
+       SLJIT_ASSERT((code_ptr[0] & 0xf8) == REX_W);
+
+       if ((code_ptr[1] & 0xf8) == MOV_r_i32) {
+               code_ptr += 2 + sizeof(sljit_uw);
+               SLJIT_ASSERT((code_ptr[0] & 0xf8) == REX_W);
+       }
+
+       SLJIT_ASSERT(code_ptr[1] == MOV_rm_r);
+
+       code_ptr[0] = (sljit_u8)(code_ptr[0] & ~0x4);
+       code_ptr[1] = MOV_rm_i32;
+       code_ptr[2] = (sljit_u8)(code_ptr[2] & ~(0x7 << 3));
+
+       code_ptr = (sljit_u8*)(put_label->addr - (2 + sizeof(sljit_uw)) + sizeof(sljit_s32));
+       put_label->addr = (sljit_uw)code_ptr;
+       put_label->flags = 0;
+       return code_ptr;
+}
+
 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler,
        sljit_s32 options, sljit_s32 arg_types, sljit_s32 scratches, sljit_s32 saveds,
        sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size)
index 6f02ee3e8b4e61cd8bdf0cce6d159ad03647fc54..6296da538225191d6d24bab3d8a7e904b14e829a 100644 (file)
@@ -428,13 +428,15 @@ static sljit_u8 get_jump_code(sljit_s32 type)
 }
 
 #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
-static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_s32 type, sljit_sw executable_offset);
+static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_sw executable_offset);
 #else
-static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_s32 type);
+static sljit_u8* generate_far_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr);
+static sljit_u8* generate_put_label_code(struct sljit_put_label *put_label, sljit_u8 *code_ptr, sljit_uw max_label);
 #endif
 
-static sljit_u8* generate_near_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_u8 *code, sljit_s32 type, sljit_sw executable_offset)
+static sljit_u8* generate_near_jump_code(struct sljit_jump *jump, sljit_u8 *code_ptr, sljit_u8 *code, sljit_sw executable_offset)
 {
+       sljit_s32 type = jump->flags >> TYPE_SHIFT;
        sljit_s32 short_jump;
        sljit_uw label_addr;
 
@@ -447,7 +449,7 @@ static sljit_u8* generate_near_jump_code(struct sljit_jump *jump, sljit_u8 *code
 
 #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
        if ((sljit_sw)(label_addr - (jump->addr + 1)) > HALFWORD_MAX || (sljit_sw)(label_addr - (jump->addr + 1)) < HALFWORD_MIN)
-               return generate_far_jump_code(jump, code_ptr, type);
+               return generate_far_jump_code(jump, code_ptr);
 #endif
 
        if (type == SLJIT_JUMP) {
@@ -497,6 +499,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        struct sljit_label *label;
        struct sljit_jump *jump;
        struct sljit_const *const_;
+       struct sljit_put_label *put_label;
 
        CHECK_ERROR_PTR();
        CHECK_PTR(check_sljit_generate_code(compiler));
@@ -511,6 +514,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        label = compiler->labels;
        jump = compiler->jumps;
        const_ = compiler->consts;
+       put_label = compiler->put_labels;
        executable_offset = SLJIT_EXEC_OFFSET(code);
 
        do {
@@ -525,27 +529,38 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                                buf_ptr += len;
                        }
                        else {
-                               if (*buf_ptr >= 2) {
+                               switch (*buf_ptr) {
+                               case 0:
+                                       label->addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
+                                       label->size = code_ptr - code;
+                                       label = label->next;
+                                       break;
+                               case 1:
                                        jump->addr = (sljit_uw)code_ptr;
                                        if (!(jump->flags & SLJIT_REWRITABLE_JUMP))
-                                               code_ptr = generate_near_jump_code(jump, code_ptr, code, *buf_ptr - 2, executable_offset);
+                                               code_ptr = generate_near_jump_code(jump, code_ptr, code, executable_offset);
                                        else {
 #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
-                                               code_ptr = generate_far_jump_code(jump, code_ptr, *buf_ptr - 2, executable_offset);
+                                               code_ptr = generate_far_jump_code(jump, code_ptr, executable_offset);
 #else
-                                               code_ptr = generate_far_jump_code(jump, code_ptr, *buf_ptr - 2);
+                                               code_ptr = generate_far_jump_code(jump, code_ptr);
 #endif
                                        }
                                        jump = jump->next;
-                               }
-                               else if (*buf_ptr == 0) {
-                                       label->addr = ((sljit_uw)code_ptr) + executable_offset;
-                                       label->size = code_ptr - code;
-                                       label = label->next;
-                               }
-                               else { /* *buf_ptr is 1 */
+                                       break;
+                               case 2:
                                        const_->addr = ((sljit_uw)code_ptr) - sizeof(sljit_sw);
                                        const_ = const_->next;
+                                       break;
+                               default:
+                                       SLJIT_ASSERT(*buf_ptr == 3);
+                                       SLJIT_ASSERT(put_label->label);
+                                       put_label->addr = (sljit_uw)code_ptr;
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+                                       code_ptr = generate_put_label_code(put_label, code_ptr, (sljit_uw)(SLJIT_ADD_EXEC_OFFSET(code, executable_offset) + put_label->label->size));
+#endif
+                                       put_label = put_label->next;
+                                       break;
                                }
                                buf_ptr++;
                        }
@@ -557,6 +572,8 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
        SLJIT_ASSERT(!label);
        SLJIT_ASSERT(!jump);
        SLJIT_ASSERT(!const_);
+       SLJIT_ASSERT(!put_label);
+       SLJIT_ASSERT(code_ptr <= code + compiler->size);
 
        jump = compiler->jumps;
        while (jump) {
@@ -591,8 +608,24 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil
                jump = jump->next;
        }
 
-       /* Some space may be wasted because of short jumps. */
-       SLJIT_ASSERT(code_ptr <= code + compiler->size);
+       put_label = compiler->put_labels;
+       while (put_label) {
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
+               sljit_unaligned_store_sw((void*)(put_label->addr - sizeof(sljit_sw)), (sljit_sw)put_label->label->addr);
+#else
+               if (put_label->flags & PATCH_MD) {
+                       SLJIT_ASSERT(put_label->label->addr > HALFWORD_MAX);
+                       sljit_unaligned_store_sw((void*)(put_label->addr - sizeof(sljit_sw)), (sljit_sw)put_label->label->addr);
+               }
+               else {
+                       SLJIT_ASSERT(put_label->label->addr <= HALFWORD_MAX);
+                       sljit_unaligned_store_s32((void*)(put_label->addr - sizeof(sljit_s32)), (sljit_s32)put_label->label->addr);
+               }
+#endif
+
+               put_label = put_label->next;
+       }
+
        compiler->error = SLJIT_ERR_COMPILED;
        compiler->executable_offset = executable_offset;
        compiler->executable_size = code_ptr - code;
@@ -2481,7 +2514,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
 
        jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
        PTR_FAIL_IF_NULL(jump);
-       set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP);
+       set_jump(jump, compiler, (type & SLJIT_REWRITABLE_JUMP) | ((type & 0xff) << TYPE_SHIFT));
        type &= 0xff;
 
        /* Worst case size. */
@@ -2495,7 +2528,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compile
        PTR_FAIL_IF_NULL(inst);
 
        *inst++ = 0;
-       *inst++ = type + 2;
+       *inst++ = 1;
        return jump;
 }
 
@@ -2513,7 +2546,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
        if (src == SLJIT_IMM) {
                jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
                FAIL_IF_NULL(jump);
-               set_jump(jump, compiler, JUMP_ADDR);
+               set_jump(jump, compiler, JUMP_ADDR | (type << TYPE_SHIFT));
                jump->u.target = srcw;
 
                /* Worst case size. */
@@ -2527,7 +2560,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compi
                FAIL_IF_NULL(inst);
 
                *inst++ = 0;
-               *inst++ = type + 2;
+               *inst++ = 1;
        }
        else {
 #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
@@ -2831,7 +2864,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
        PTR_FAIL_IF(!inst);
 
        *inst++ = 0;
-       *inst++ = 1;
+       *inst++ = 2;
 
 #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
        if (dst & SLJIT_MEM)
@@ -2842,6 +2875,54 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compi
        return const_;
 }
 
+SLJIT_API_FUNC_ATTRIBUTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
+{
+       struct sljit_put_label *put_label;
+       sljit_u8 *inst;
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+       sljit_s32 reg;
+       sljit_uw start_size;
+#endif
+
+       CHECK_ERROR_PTR();
+       CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw));
+       ADJUST_LOCAL_OFFSET(dst, dstw);
+
+       CHECK_EXTRA_REGS(dst, dstw, (void)0);
+
+       put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label));
+       PTR_FAIL_IF(!put_label);
+       set_put_label(put_label, compiler, 0);
+
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+       compiler->mode32 = 0;
+       reg = FAST_IS_REG(dst) ? dst : TMP_REG1;
+
+       if (emit_load_imm64(compiler, reg, 0))
+               return NULL;
+#else
+       if (emit_mov(compiler, dst, dstw, SLJIT_IMM, 0))
+               return NULL;
+#endif
+
+#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+       if (dst & SLJIT_MEM) {
+               start_size = compiler->size;
+               if (emit_mov(compiler, dst, dstw, TMP_REG1, 0))
+                       return NULL;
+               put_label->flags = compiler->size - start_size;
+       }
+#endif
+
+       inst = (sljit_u8*)ensure_buf(compiler, 2);
+       PTR_FAIL_IF(!inst);
+
+       *inst++ = 0;
+       *inst++ = 3;
+
+       return put_label;
+}
+
 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
 {
        SLJIT_UNUSED_ARG(executable_offset);
index 5c2a83893281a4406c0590965018cd0accad3f9b..857492a174811450e0db613429a4c04a51e38261 100644 (file)
@@ -154,7 +154,13 @@ SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_release_lock(void)
 #include "windows.h"
 #else
 /* Provides mmap function. */
+#include <sys/types.h>
 #include <sys/mman.h>
+#ifndef MAP_ANON
+#ifdef MAP_ANONYMOUS
+#define MAP_ANON MAP_ANONYMOUS
+#endif
+#endif
 /* For detecting the page size. */
 #include <unistd.h>
 
index 0218a01f616eb7265619df4f87151d56be9ebaf1..b8521a482e2b79eaf6fbd7db6725d78091b47299 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
 #
 # 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
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
 # 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/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -140,7 +140,7 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 2bd69bef42f54123ed070f343793a4e858cbb1c7..a9297e195e3806334d9af9fb1103e8f07bb97738 100644 (file)
@@ -949,3 +949,10 @@ RC=0
 ---------------------------- Test 126 -----------------------------
 ABC\0XYZ
 RC=0
+---------------------------- Test 127 -----------------------------
+pattern
+RC=0
+---------------------------- Test 128 -----------------------------
+pcre2grep: Requested group 1 cannot be captured.
+pcre2grep: Use --om-capture to increase the size of the capture vector.
+RC=2
index aaed6ae3b01f54e8165d3eda0fcd601483ec421e..1bac20b7f8d74009fbe142959a01f3f0cb0c6eed 100644 (file)
@@ -18,3 +18,14 @@ RC=0
 22:6,2
 22:8,2
 RC=0
+---------------------------- Test U4 ------------------------------
+pcre2grep: pcre2_match() gave error -22 while matching this text:
+
+Aá\80\80\80CDâ\80\80Z
+
+UTF-8 error: isolated byte with 0x80 bit set at offset 4
+
+RC=1
+---------------------------- Test U5 ------------------------------
+CD Z
+RC=0
diff --git a/testdata/grepoutputCN b/testdata/grepoutputCN
new file mode 100644 (file)
index 0000000..5217b5a
--- /dev/null
@@ -0,0 +1,30 @@
+The quick brown
+This time it jumps and jumps and jumps.
+This line contains \E and (regex) *meta* [characters].
+The word is cat in this line
+The caterpillar sat on the mat
+The snowcat is not an animal
+The quick brown
+This time it jumps and jumps and jumps.
+This line contains \E and (regex) *meta* [characters].
+The word is cat in this line
+The caterpillar sat on the mat
+The snowcat is not an animal
+0:T
+The quick brown
+0:T
+This time it jumps and jumps and jumps.
+0:T
+This line contains \E and (regex) *meta* [characters].
+0:T
+The word is cat in this line
+0:T
+The caterpillar sat on the mat
+0:T
+The snowcat is not an animal
+T
+T
+T
+T
+T
+T
index d8615ee3ea6d7d1f0c050980c6ef0532cbf3011a..f5159d677a557d45d8592caa873b2cac4e459124 100644 (file)
@@ -1,6 +1,6 @@
 # This set of tests is for features that are compatible with all versions of
 # Perl >= 5.10, in non-UTF mode. It should run clean for the 8-bit, 16-bit, and
-# 32-bit PCRE libraries, and also using the perltest.pl script.
+# 32-bit PCRE libraries, and also using the perltest.sh script.
     
 #forbid_utf
 #newline_default lf any anycrlf
@@ -6263,4 +6263,127 @@ ef) x/x,mark
     aBCDEF
     AbCDe f
 
+/(*pla:foo).{6}/
+    abcfoobarxyz
+\= Expect no match
+    abcfooba
+
+/(*positive_lookahead:foo).{6}/
+    abcfoobarxyz
+    
+/(?(*pla:foo).{6}|a..)/
+    foobarbaz
+    abcfoobar       
+
+/(?(*positive_lookahead:foo).{6}|a..)/
+    foobarbaz
+    abcfoobar       
+    
+/(*plb:foo)bar/
+    abcfoobar
+\= Expect no match
+    abcbarfoo     
+
+/(*positive_lookbehind:foo)bar/
+    abcfoobar
+\= Expect no match
+    abcbarfoo
+    
+/(?(*plb:foo)bar|baz)/
+    abcfoobar
+    bazfoobar
+    abcbazfoobar
+    foobazfoobar    
+/(?(*positive_lookbehind:foo)bar|baz)/
+    abcfoobar
+    bazfoobar
+    abcbazfoobar
+    foobazfoobar    
+/(*nlb:foo)bar/
+    abcbarfoo     
+\= Expect no match
+    abcfoobar
+
+/(*negative_lookbehind:foo)bar/
+    abcbarfoo     
+\= Expect no match
+    abcfoobar
+    
+/(?(*nlb:foo)bar|baz)/
+    abcfoobaz 
+    abcbarbaz 
+\= Expect no match
+    abcfoobar
+/(?(*negative_lookbehind:foo)bar|baz)/
+    abcfoobaz 
+    abcbarbaz 
+\= Expect no match
+    abcfoobar
+/(*atomic:a+)\w/
+    aaab
+\= Expect no match
+    aaaa      
+
+/   (?<word> \w+ )*    \.   /xi
+    pokus.
+    
+/(?(DEFINE) (?<word> \w+ ) ) (?&word)*   \./xi
+    pokus.
+
+/(?(DEFINE) (?<word> \w+ ) ) ( (?&word)* )   \./xi 
+    pokus.
+
+/(?&word)*  (?(DEFINE) (?<word> \w+ ) )  \./xi
+    pokus.
+
+/(?&word)*  \. (?<word> \w+ )/xi
+    pokus.hokus
+
+/a(?(?=(*:2)b).)/mark
+    abc
+    acb     
+
+/a(?(?!(*:2)b).)/mark
+    acb
+    abc     
+
+/(?:a|ab){1}+c/
+\= Expect no match
+    abc
+
+/(a|ab){1}+c/
+    abc
+    
+/(a+){1}+a/
+\= Expect no match
+    aaaa
+
+/(?(DEFINE)(a|ab))(?1){1}+c/
+    abc    
+
+/(?:a|(?=b)|.)*\z/
+    abc
+    
+/(?:a|(?=b)|.)*/
+    abc 
+    
+/(?<=a(*SKIP)x)|c/
+    abcd
+    
+/(?<=a(*SKIP)x)|d/
+    abcd
+/(?<=(?=.(?<=x)))/aftertext
+    abx
+
+/(?<=(?=(?<=a)))b/
+    ab
+
+/^(?<A>a)(?(<A>)b)((?<=b).*)$/
+    abc
+
 # End of testinput1 
index 93d2560c3126d5936d28228589bc33aa87c16dc0..38137095a93678d23cca3ef53f580027f7bf4329 100644 (file)
@@ -1,7 +1,7 @@
 # This set of tests is for UTF-8 support and Unicode property support, with
 # relevance only for the 8-bit library.
 
-# The next 4 patterns have UTF-8 errors
+# The next 5 patterns have UTF-8 errors
 
 /[Ã]/utf
 
@@ -11,6 +11,8 @@
 
 /Ã\82\82\82\82\82\82\82\82Ã/utf
 
+/Ã\82\82\82\82\82\82\82\82Ã/match_invalid_utf
+
 # Now test subjects
 
 /badutf/utf
     \x{100}
 \= Expect no match
     aaa
+    
+# Offsets are different in 8-bit mode. 
+
+/(?<=abc)(|def)/g,utf,replace=<$0>,substitute_callout
+    123abcáyzabcdef789abcሴqr
+    
+# Check name length with non-ASCII characters 
+
+/(?'ABáC678901234567890123456789012'...)/utf
+
+/(?'ABáC6789012345678901234567890123'...)/utf
+
+/(?'ABZC6789012345678901234567890123'...)/utf
+
+/(?(n/utf
+
+/(?(á/utf
+
+# Invalid UTF-8 tests
+
+/.../g,match_invalid_utf
+    abcd\x80wxzy\x80pqrs
+    abcd\x{80}wxzy\x80pqrs
+
+/abc/match_invalid_utf
+    ab\x80ab\=ph
+\= Expect no match
+    ab\x80cdef\=ph
+
+/ab$/match_invalid_utf
+    ab\x80cdeab
+\= Expect no match
+    ab\x80cde
+
+/.../g,match_invalid_utf
+    abcd\x{80}wxzy\x80pqrs
+
+/(?<=x)../g,match_invalid_utf
+    abcd\x{80}wxzy\x80pqrs
+    abcd\x{80}wxzy\x80xpqrs
+    
+/X$/match_invalid_utf
+\= Expect no match
+    X\xc4
+    
+/(?<=..)X/match_invalid_utf,aftertext
+    AB\x80AQXYZ
+    AB\x80AQXYZ\=offset=5
+    AB\x80\x80AXYZXC\=offset=5
+\= Expect no match
+    AB\x80XYZ
+    AB\x80XYZ\=offset=3 
+    AB\xfeXYZ
+    AB\xffXYZ\=offset=3 
+    AB\x80AXYZ
+    AB\x80AXYZ\=offset=4
+    AB\x80\x80AXYZ\=offset=5
+
+/.../match_invalid_utf
+    AB\xc4CCC
+\= Expect no match
+    A\x{d800}B
+    A\x{110000}B
+    A\xc4B  
+
+/\bX/match_invalid_utf
+    A\x80X
+
+/\BX/match_invalid_utf
+\= Expect no match
+    A\x80X
+    
+/(?<=...)X/match_invalid_utf
+    AAA\x80BBBXYZ 
+\= Expect no match
+    AAA\x80BXYZ 
+    AAA\x80BBXYZ 
+
+# -------------------------------------
+
+/(*UTF)(?=\x{123})/I
+
+/[\x{c1}\x{e1}]X[\x{145}\x{146}]/I,utf
+
+/[󿾟,]/BI,utf
+
+/[\x{fff4}-\x{ffff8}]/I,utf
+
+/[\x{fff4}-\x{afff8}\x{10ffff}]/I,utf
+
+/[\xff\x{ffff}]/I,utf
+
+/[\xff\x{ff}]/I,utf
+
+/[\xff\x{ff}]/I
+
+/[Ss]/I
+
+/[Ss]/I,utf
+
+/(?:\x{ff}|\x{3000})/I,utf
+
+/x/utf
+    abxyz
+    \x80\=startchar
+    abc\x80\=startchar
+    abc\x80\=startchar,offset=3
 
 # End of testinput10
index b0ab9098fd42db9ad82f90b288958e64f00f7f48..bed00a53f2fc49971b99f70af68fd7fa6f65cb49 100644 (file)
     \x{100}
 \= Expect no match
     aaa
+    
+# Offsets are different in 8-bit mode. 
+
+/(?<=abc)(|def)/g,utf,replace=<$0>,substitute_callout
+    123abcáyzabcdef789abcሴqr
+    
+# A few script run tests in non-UTF mode (but they need Unicode support)
+
+/^(*script_run:.{4})/
+    \x{3041}\x{30a1}\x{3007}\x{3007}   Hiragana Katakana Han Han
+    \x{30a1}\x{3041}\x{3007}\x{3007}   Katakana Hiragana Han Han
+    \x{1100}\x{2e80}\x{2e80}\x{1101}   Hangul Han Han Hangul
+/^(*sr:.*)/utf,allow_surrogate_escapes
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+    \x{d800}\x{dfff}                   Surrogates (Unknown) \=no_utf_check
+
+/(?(n/utf
+
+/(?(á/utf
+
+# Invalid UTF-16/32 tests.
+
+/.../g,match_invalid_utf
+    abcd\x{df00}wxzy\x{df00}pqrs
+    abcd\x{80}wxzy\x{df00}pqrs
+
+/abc/match_invalid_utf
+    ab\x{df00}ab\=ph
+\= Expect no match
+    ab\x{df00}cdef\=ph
+
+/ab$/match_invalid_utf
+    ab\x{df00}cdeab
+\= Expect no match
+    ab\x{df00}cde
+
+/.../g,match_invalid_utf
+    abcd\x{80}wxzy\x{df00}pqrs
+
+/(?<=x)../g,match_invalid_utf
+    abcd\x{80}wxzy\x{df00}pqrs
+    abcd\x{80}wxzy\x{df00}xpqrs
+
+/X$/match_invalid_utf
+\= Expect no match
+    X\x{df00}
+    
+/(?<=..)X/match_invalid_utf,aftertext
+    AB\x{df00}AQXYZ
+    AB\x{df00}AQXYZ\=offset=5
+    AB\x{df00}\x{df00}AXYZXC\=offset=5
+\= Expect no match
+    AB\x{df00}XYZ
+    AB\x{df00}XYZ\=offset=3 
+    AB\x{df00}AXYZ
+    AB\x{df00}AXYZ\=offset=4
+    AB\x{df00}\x{df00}AXYZ\=offset=5
+
+/.../match_invalid_utf
+\= Expect no match
+    A\x{d800}B
+    A\x{110000}B 
+
+# ---------------------------------------------------- 
+
+/(*UTF)(?=\x{123})/I
+
+/[\x{c1}\x{e1}]X[\x{145}\x{146}]/I,utf
+
+/[\xff\x{ffff}]/I,utf
+
+/[\xff\x{ff}]/I,utf
+
+/[\xff\x{ff}]/I
+
+/[Ss]/I
+
+/[Ss]/I,utf
+
+/(?:\x{ff}|\x{3000})/I,utf
 
 # End of testinput12
index 2ef6672a08362cfc1bde844e4667ec723289fa78..5dd689793907d4c96022a7bcf46cf9b177295e0c 100644 (file)
 /^(?>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
 
@@ -86,9 +86,9 @@
     aaaaaaaaaaaaaz
 \= Expect limit exceeded
     aaaaaaaaaaaaaz\=depth_limit=10
-    
-# These three have infinitely nested recursions. 
-    
+
+# These three have infinitely nested recursions.
+
 /((?2))((?1))/
     abc
 
 
 /(?(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  
+    a\=allusedtext
 
 /abc\Kxyz/
     abcxyz\=allusedtext
 
 /abc(?=abcde)(?=ab)/allusedtext
     abcabcdefg
-    
+
+#subject allusedtext
+
+/(?<=abc)123/
+    xyzabc123pqr
+    xyzabc12\=ps
+    xyzabc12\=ph
+
+/\babc\b/
+    +++abc+++
+    +++ab\=ps
+    +++ab\=ph
+
+/(?<=abc)def/
+    abc\=ph
+
+/(?<=123)(*MARK:xx)abc/mark
+    xxxx123a\=ph
+    xxxx123a\=ps
+
+/(?<=(?<=a)b)c.*/I
+    abc\=ph
+\= Expect no match
+    xbc\=ph
+
+/(?<=ab)c.*/I
+    abc\=ph
+\= Expect no match
+    xbc\=ph
+
+/abc(?<=bc)def/
+    xxxabcd\=ph
+
+/(?<=ab)cdef/
+    xxabcd\=ph
+
+/(?<=(?<=(?<=a)b)c)./I
+    123abcXYZ
+
+/(?<=ab(cd(?<=...)))./I
+    abcdX
+
+/(?<=ab((?<=...)cd))./I
+    ZabcdX
+
+/(?<=((?<=(?<=ab).))(?1)(?1))./I
+    abxZ
+
+#subject
+# -------------------------------------------------------------------
+
 # These tests provoke recursion loops, which give a different error message
 # when JIT is used.
 
 
 /(a|(?R))/I
     abcd
-    defg 
+    defg
 
 /(ab|(bc|(de|(?R))))/I
     abcd
-    fghi 
+    fghi
 
 /(ab|(bc|(de|(?1))))/I
     abcd
-    fghi 
+    fghi
 
 /x(ab|(bc|(de|(?1)x)x)x)/I
     xab123
-    xfghi 
+    xfghi
 
 /(?!\w)(?R)/
     abcd
-    =abc 
+    =abc
 
 /(?=\w)(?R)/
-    =abc 
+    =abc
     abcd
 
 /(?<!\w)(?R)/
 
 /(a+|(?R)b)/
     aaa
-    bbb 
+    bbb
 
 /[^\xff]((?1))/BI
     abcd
-    
-# These tests don't behave the same with JIT 
+
+# 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
 
-# This test breaks the JIT stack limit 
+# This test breaks the JIT stack limit
 
 /(|]+){2,2452}/
     (|]+){2,2452}
 /(*LIMIT_HEAP=21)\[(a)]{60}/expand
     \[a]{60}
 
+/b(?<!ax)(?!cx)/allusedtext
+    abc
+    abcz
+
 # End of testinput15
index 094415182995981994408c59581896311fc44d8b..65bbbb9483144b1121bc745c799faffda5fb3a32 100644 (file)
 # ---- 
 
 /[aC]/mg,firstline,newline=lf
-match\nmatch
+    match\nmatch
 
 /[aCz]/mg,firstline,newline=lf
-match\nmatch
+    match\nmatch
 
 # End of testinput17
index fc94b35fcedb1c56f2d5b45a1a16d6cc4a7aa065..655e519793ea374462108b92358a622dcf58205c 100644 (file)
 /^a*A\d/IBi
     aaaA5
     aaaa5
+    a5 
 
 /(a*|b*)[cd]/I
 
 \= Expect no match
     cat
 
-/(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/(\3)(\1)(a)/allow_empty_class,match_unset_backref,dupnames
     cat
 
 /TA]/
     The ACTA] comes
 
-/TA]/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/TA]/allow_empty_class,match_unset_backref,dupnames
     The ACTA] comes
 
 /(?2)[]a()b](abc)/
 
 /a[^]b/
 
-/a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[]b/allow_empty_class,match_unset_backref,dupnames
 \= Expect no match
     ab
 
-/a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[]+b/allow_empty_class,match_unset_backref,dupnames
 \= Expect no match
     ab
 
-/a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[]*+b/allow_empty_class,match_unset_backref,dupnames
 \= Expect no match
     ab
 
-/a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[^]b/allow_empty_class,match_unset_backref,dupnames
     aXb
     a\nb
 \= Expect no match
     ab
 
-/a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[^]+b/allow_empty_class,match_unset_backref,dupnames
     aXb
     a\nX\nXb
 \= Expect no match
     xxxxabcde\=ps
     xxxxabcde\=ph
 
-/(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/(\3)(\1)(a)/allow_empty_class,match_unset_backref,dupnames
     cat
 
-/(\3)(\1)(a)/I,alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/(\3)(\1)(a)/I,allow_empty_class,match_unset_backref,dupnames
     cat
 
 /(\3)(\1)(a)/I
     aU0041z
 \= Expect no match
     aAz
+    
+/^\u{7a}/alt_bsux
+    u{7a}
+\= Expect no match
+    zoo 
+
+/^\u{7a}/extra_alt_bsux
+    zoo 
 
 /(?(?=c)c|d)++Y/B
 
@@ -4576,7 +4585,7 @@ B)x/alt_verbnames,mark
 
 /abcd/null_context
     abcd\=null_context
-\= Expect error
+\= Expect error - not allowed together
     abcd\=null_context,find_limits
     abcd\=allusedtext,startchar
 
@@ -5304,10 +5313,22 @@ a)"xI
 
 /\N{\c/IB,bad_escape_is_literal
 
-/[\j\x{z}\o\gA-\Nb-\g]/B,bad_escape_is_literal
+/[\j\x{z}\o\gAb\g]/B,bad_escape_is_literal
 
 /[Q-\N]/B,bad_escape_is_literal
 
+/[\s-_]/bad_escape_is_literal
+
+/[_-\s]/bad_escape_is_literal
+
+/[\B\R\X]/B
+
+/[\B\R\X]/B,bad_escape_is_literal
+
+/[A-\BP-\RV-\X]/B
+
+/[A-\BP-\RV-\X]/B,bad_escape_is_literal
+
 # ----------------------------------------------------------------------
 
 /a\b(c/literal
@@ -5505,4 +5526,250 @@ a)"xI
     bbc
     xbc 
 
+/a(b)c|xyz/g,allvector,replace=<$0>
+    abcdefabcpqr\=ovector=4
+    abxyz\=ovector=4
+    abcdefxyz\=ovector=4
+    
+/a(b)c|xyz/allvector
+    abcdef\=ovector=4
+    abxyz\=ovector=4
+
+/a(b)c|xyz/g,replace=<$0>,substitute_callout
+    abcdefabcpqr
+    abxyzpqrabcxyz
+    12abc34xyz99abc55\=substitute_stop=2
+    12abc34xyz99abc55\=substitute_skip=1
+    12abc34xyz99abc55\=substitute_skip=2
+
+/a(b)c|xyz/g,replace=<$0>
+    abcdefabcpqr
+    abxyzpqrabcxyz
+    12abc34xyz\=substitute_stop=2
+    12abc34xyz\=substitute_skip=1
+
+/a(b)c|xyz/replace=<$0>
+    abcdefabcpqr
+    12abc34xyz\=substitute_skip=1
+    12abc34xyz\=substitute_stop=1
+
+/abc\rdef/
+    abc\ndef
+
+/abc\rdef\x{0d}xyz/escaped_cr_is_lf
+    abc\ndef\rxyz
+\= Expect no match     
+    abc\ndef\nxyz
+
+/(?(*ACCEPT)xxx)/
+
+/(?(*atomic:xx)xxx)/
+
+/(?(*script_run:xxx)zzz)/
+
+/foobar/
+    the foobar thing\=copy_matched_subject
+    the foobar thing\=copy_matched_subject,zero_terminate
+
+/foobar/g
+    the foobar thing foobar again\=copy_matched_subject
+
+/(*:XX)^abc/I
+
+/(*COMMIT:XX)^abc/I
+
+/(*ACCEPT:XX)^abc/I
+
+/abc/replace=xyz
+    abc\=null_context
+
+/abc/replace=xyz,substitute_callout
+    abc 
+\= Expect error message
+    abc\=null_context
+
+/\[()]{65535}()/expand
+
+/\[()]{65535}(?<A>)/expand
+
+/a(?:(*ACCEPT))??bc/
+    abc
+    axy
+
+/a(*ACCEPT)??bc/
+    abc
+    axy
+
+/a(*ACCEPT:XX)??bc/mark
+    abc
+    axy
+
+/(*:\)?/
+
+/(*:\Q \E){5}/alt_verbnames
+
+/(?=abc)/I
+
+/(?|(X)|(XY))\1abc/I
+
+/(?|(a)|(bcde))(c)\2/I
+
+/(?|(a)|(bcde))(c)\1/I
+
+/(?|(?'A'a)|(?'A'bcde))(?'B'c)\k'B'(?'A')/I,dupnames
+
+/(?|(?'A'a)|(?'A'bcde))(?'B'c)\k'A'(?'A')/I,dupnames
+
+/((a|)+)+Z/I
+
+/((?=a))[abcd]/I
+
+/A(?:(*ACCEPT))?B/info
+
+/(A(*ACCEPT)??B)C/
+    ABC
+    AXY 
+
+/(?<=(?<=a)b)c.*/I
+    abc\=ph
+\= Expect no match
+    xbc\=ph
+
+/(?<=ab)c.*/I
+    abc\=ph
+\= Expect no match
+    xbc\=ph
+
+/(?<=a(?<=a|a)c)/I
+
+/(?<=a(?<=a|ba)c)/I
+
+/(?<=(?<=a)b)(?<!abcd)/I
+
+/(?<=(?<=a)b)(?<!abcd)(?<=(?<=a)bcde)/I
+
+# Addition overflow
+/( {32742} {42})(?<!\1{65481})/
+
+# Multiplication overflow
+/(X{65535})(?<=\1{32770})/
+
+# ---- Non-atomic assertion tests ----
+
+# Expect error: not allowed as a condition
+/(?(*napla:xx)bc)/
+
+/\A(*pla:.*\b(\w++))(?>.*?\b\1\b){3}/
+    word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
+
+/\A(*napla:.*\b(\w++))(?>.*?\b\1\b){3}/
+    word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
+
+/(*plb:(.)..|(.)...)(\1|\2)/
+    abcdb\=offset=4 
+    abcda\=offset=4 
+
+/(*naplb:(.)..|(.)...)(\1|\2)/
+    abcdb\=offset=4 
+    abcda\=offset=4 
+    
+/(*non_atomic_positive_lookahead:ab)/B
+/(*non_atomic_positive_lookbehind:ab)/B 
+
+/(*pla:ab+)/B
+
+/(*napla:ab+)/B
+
+/(*napla:)+/
+
+/(*naplb:)+/
+
+/(*napla:^x|^y)/I
+
+/(*napla:abc|abd)/I
+
+/(*napla:a|(.)(*ACCEPT)zz)\1../
+    abcd
+    
+/(*napla:a(*ACCEPT)zz|(.))\1../
+    abcd
+    
+/(*napla:a|(*COMMIT)(.))\1\1/
+    aabc
+\= Expect no match     
+    abbc   
+
+/(*napla:a|(.))\1\1/
+    aabc
+    abbc   
+
+# ----
+
+# Expect error (recursion => not fixed length)
+/(\2)((?=(?<=\1)))/
+
+/c*+(?<=[bc])/
+    abc\=ph
+    ab\=ph
+    abc\=ps
+    ab\=ps
+
+/c++(?<=[bc])/
+    abc\=ph
+    ab\=ph
+
+/(?<=(?=.(?<=x)))/
+    abx
+    ab\=ph
+    bxyz 
+    xyz
+    
+/\z/
+   abc\=ph
+   abc\=ps 
+   
+/\Z/
+   abc\=ph
+   abc\=ps 
+   abc\n\=ph
+   abc\n\=ps
+
+/(?![ab]).*/
+    ab\=ph
+
+/c*+/
+    ab\=ph,offset=2
+
+/\A\s*(a|(?:[^`]{28500}){4})/I
+    a
+
+/\A\s*((?:[^`]{28500}){4})/I
+
+/\A\s*((?:[^`]{28500}){4}|a)/I
+    a
+
+/(?<A>a)(?(<A>)b)((?<=b).*)/B
+
+/(?(1)b)((?<=b).*)/B
+
+/(?(R1)b)((?<=b).*)/B
+
+/(?(DEFINE)b)((?<=b).*)/B
+
+/(?(VERSION=10.4)b)((?<=b).*)/B
+
+/[aA]b[cC]/IB
+
+/[cc]abcd/I
+
+/[Cc]abcd/I
+
+/[c]abcd/I
+
+/(?:c|C)abcd/I
+
+/(a)?a/I
+    manm
+
 # End of testinput2
index a27b6afc35d61614439e5d21b8685308ab8dcb94..087183579fa27651bdc59f6fb0126af473eb6b08 100644 (file)
 
 /[^\x{100}-\x{ffff}]*[\x80-\xff]/i,utf
     \x{99}\x{99}\x{99}
+    
+# Script run tests
+
+/^(*script_run:.{4})/utf
+    abcd                               Latin x4
+    \x{2e80}\x{2fa1d}\x{3041}\x{30a1}  Han Han Hiragana Katakana
+    \x{3041}\x{30a1}\x{3007}\x{3007}   Hiragana Katakana Han Han
+    \x{30a1}\x{3041}\x{3007}\x{3007}   Katakana Hiragana Han Han
+    \x{1100}\x{2e80}\x{2e80}\x{1101}   Hangul Han Han Hangul
+    \x{2e80}\x{3105}\x{2e80}\x{3105}   Han Bopomofo Han Bopomofo
+    \x{02ea}\x{2e80}\x{2e80}\x{3105}   Bopomofo-Sk Han Han Bopomofo
+    \x{3105}\x{2e80}\x{2e80}\x{3105}   Bopomofo Han Han Bopomofo
+    \x{0300}cd!                        Inherited Latin Latin Common
+    \x{0391}12\x{03a9}                 Greek Common-digits Greek 
+    \x{0400}12\x{fe2f}                 Cyrillic Common-digits Cyrillic
+    \x{0531}12\x{fb17}                 Armenian Common-digits Armenian
+    \x{0591}12\x{fb4f}                 Hebrew Common-digits Hebrew
+    \x{0600}12\x{1eef1}                Arabic Common-digits Arabic
+    \x{0600}\x{0660}\x{0669}\x{1eef1}  Arabic Arabic-digits Arabic
+    \x{0700}12\x{086a}                 Syriac Common-digits Syriac
+    \x{1200}12\x{ab2e}                 Ethiopic Common-digits Ethiopic
+    \x{1680}12\x{169c}                 Ogham Common-digits Ogham
+    \x{3041}12\x{3041}                 Hiragana Common-digits Hiragana
+    \x{0980}\x{09e6}\x{09e7}\x{0993}   Bengali Bengali-digits Bengali
+    !cde                               Common Latin Latin Latin
+    A..B                               Latin Common Common Latin 
+    0abc                               Ascii-digit Latin Latin Latin
+    1\x{0700}\x{0700}\x{0700}          Ascii-digit Syriac x 3
+    \x{1A80}\x{1A80}\x{1a40}\x{1a41}   Tai Tham Hora digits, letters
+\= Expect no match
+    a\x{370}bcd                        Latin Greek Latin Latin
+    \x{1100}\x{02ea}\x{02ea}\x{02ea}   Hangul Bopomofo x3
+    \x{02ea}\x{02ea}\x{02ea}\x{1100}   Bopomofo x3 Hangul
+    \x{1100}\x{2e80}\x{3041}\x{1101}   Hangul Han Hiragana Hangul
+    \x{0391}\x{09e6}\x{09e7}\x{03a9}   Greek Bengali digits Greek 
+    \x{0600}7\x{0669}\x{1eef1}         Arabic ascii-digit Arabic-digit Arabic
+    \x{0600}\x{0669}7\x{1eef1}         Arabic Arabic-digit ascii-digit Arabic
+    A5\x{ff19}B                        Latin Common-ascii/notascii-digits Latin 
+    \x{0300}cd\x{0391}                 Inherited Latin Latin Greek
+    !cd\x{0391}                        Common Latin Latin Greek
+    \x{1A80}\x{1A90}\x{1a40}\x{1a41}   Tai Tham Hora digit, Tham digit, letters
+    A\x{1d7ce}\x{1d7ff}B               Common fancy-common-2-sets-digits Common
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+    
+/^(*sr:.{4}|..)/utf
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+
+/^(*atomic_script_run:.{4}|..)/utf
+\= Expect no match
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+
+/^(*asr:.*)/utf
+\= Expect no match
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+
+/^(?>(*sr:.*))/utf
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+
+/^(*sr:.*)/utf
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+    \x{10fffd}\x{10fffd}\x{10fffd}     Private use (Unknown)
+
+/^(*sr:\x{2e80}*)/utf
+    \x{2e80}\x{2e80}\x{3105}           Han Han Bopomofo
+
+/^(*sr:\x{2e80}*)\x{2e80}/utf
+    \x{2e80}\x{2e80}\x{3105}           Han Han Bopomofo
+    
+/^(*sr:.*)Test/utf
+    Test script run on an empty string
+
+/^(*sr:(.{2})){2}/utf
+    \x{0600}7\x{0669}\x{1eef1}         Arabic ascii-digit Arabic-digit Arabic
+    \x{1A80}\x{1A80}\x{1a40}\x{1a41}   Tai Tham Hora digits, letters
+    \x{1A80}\x{1a40}\x{1A90}\x{1a41}   Tai Tham Hora digit, letter, Tham digit, letter
+\= Expect no match
+    \x{1100}\x{2e80}\x{3041}\x{1101}   Hangul Han Hiragana Hangul
+    
+/^(*sr:\S*)/utf
+    \x{1cf4}\x{20f0}\x{900}\x{11305}   [Dev,Gran,Kan] [Dev,Gran,Lat] Dev Gran
+    \x{1cf4}\x{20f0}\x{11305}\x{900}   [Dev,Gran,Kan] [Dev,Gran,Lat] Gran Dev
+    \x{1cf4}\x{20f0}\x{900}ABC         [Dev,Gran,Kan] [Dev,Gran,Lat] Dev Lat
+    \x{1cf4}\x{20f0}ABC                [Dev,Gran,Kan] [Dev,Gran,Lat] Lat
+    \x{20f0}ABC                        [Dev,Gran,Lat] Lat
+    XYZ\x{20f0}ABC                     Lat [Dev,Gran,Lat] Lat
+    \x{a36}\x{a33}\x{900}              [Dev,...] [Dev,...] Dev  
+    \x{3001}\x{2e80}\x{3041}\x{30a1}   [Bopo, Han, etc] Han Hira Kata
+    \x{3001}\x{30a1}\x{2e80}\x{3041}   [Bopo, Han, etc] Kata Han Hira
+    \x{3001}\x{3105}\x{2e80}\x{1101}   [Bopo, Han, etc] Bopomofo Han Hangul
+    \x{3105}\x{3001}\x{2e80}\x{1101}   Bopomofo [Bopo, Han, etc] Han Hangul
+    \x{3031}\x{3041}\x{30a1}\x{2e80}   [Hira Kata] Hira Kata Han
+    \x{060c}\x{06d4}\x{0600}\x{10d00}\x{0700}  [Arab Rohg Syrc Thaa] [Arab Rohg] Arab Rohg Syrc
+    \x{060c}\x{06d4}\x{0700}\x{0600}\x{10d00}  [Arab Rohg Syrc Thaa] [Arab Rohg] Syrc Arab Rohg
+    \x{2e80}\x{3041}\x{3001}\x{3031}\x{2e80}   Han Hira [Bopo, Han, etc] [Hira Kata] Han
+
+/(?<!)(*sr:)/
+
+/(?<!X(*sr:B)C)/
+
+/(?<=abc(?=X(*sr:BCY)Z)XBCYZ)./
+    abcXBCYZ!
+
+/(?<=abc(?=X(*sr:BXY)CCC)XBXYCCC)./
+   abcXBXYCCC!
+
+/^(*sr:\S*)/utf
+    \x{10d00}\x{10d00}\x{06d4}     Rohingya Rohingya Arabic-full-stop
+    \x{06d4}\x{10d00}\x{10d00}     Arabic-full-stop Rohingya Rohingya
+    \x{10d00}\x{10d00}\x{0363}     Rohingya Rohingya Inherited-extend-Latin
+    \x{0363}\x{10d00}\x{10d00}     Inherited-extend-Latin Rohingya Rohingya
+    AB\x{0363}                     Latin Latin Inherited-extend-Latin
+    \x{0363}AB                     Inherited-extend-Latin Latin Latin
+    AB\x{1cf7}                     Latin Latin Common-extended-Beng
+    \x{1cf7}AB                     Common-extend-Beng Latin Latin
+    \x{1cf7}\x{0993}               Common-extend-Beng Bengali
+    A\x{1abe}BC                    Test enclosing mark
+    \x{0370}\x{1abe}\x{0371}       Which can occur with any script (Greek here)
+    \x{3001}\x{adf9}\x{3001}       [.. Hangul ..] Hangul [.. Hangul ..]
+    \x{3400}\x{3001}XXX            Han [Han etc.]
+    \x{3400}\x{1cd5}               Han [Bengali Devanagari]
+    \x{ac01}\x{3400}               Hangul [.. Hangul ..]
+    \x{ac01}\x{1cd5}               Hangul [Bengali Devanagari]
+    \x{102e0}\x{06d4}\x{1ee4d}     [Arabic Coptic] [Arab Rohingya] Arabic
+    \x{102e0}\x{06d4}\x{2cc9}      [Arabic Coptic] [Arab Rohingya] Coptic
+    \x{102e0}\x{06d4}\x{10d30}     [Arabic Coptic] [Arab Rohingya] Rohingya
+    
+# Test loop breaking for empty string match
+
+/^(*sr:A|)*BCD/utf
+    AABCD
+    ABCD
+    BCD 
+    
+# The use of (*ACCEPT) breaks script run checking 
+
+/^(*sr:.*(*ACCEPT)ZZ)/utf
+    \x{1100}\x{2e80}\x{3041}\x{1101}   Hangul Han Hiragana Hangul
+
+# ------- 
+
+# Test group names containing non-ASCII letters and digits
+
+/(?'ABáC'...)\g{ABáC}/utf
+    abcabcdefg
+
+/(?'XʰABC'...)/utf
+    xyzpq
+
+/(?'XאABC'...)/utf
+    12345
+
+/(?'XᾈABC'...)/utf
+    %^&*(...
+
+/(?'𐨐ABC'...)/utf
+    abcde
+
+/^(?'אABC'...)(?&אABC)(?P=אABC)/utf
+    123123123456
+
+/^(?'אABC'...)(?&אABC)/utf
+    123123123456
+
+/\X*/
+    \xF3aaa\xE4\xEA\xEB\xFEa
+
+/Я/i,utf
+    \x{42f} 
+    \x{44f} 
+
+/(?=Я)/i,utf
+    \x{42f} 
+    \x{44f} 
 
 # End of testinput4
index 687de321fa82f340a4f8d4486d3a9fc05a928bf4..d90b66d965124912f18e78d79d06efa7610501aa 100644 (file)
 
 /[[:a\x{100}b:]]/utf
 
-/a[^]b/utf,alt_bsux,allow_empty_class,match_unset_backref
+/a[^]b/utf,allow_empty_class,match_unset_backref
     a\x{1234}b
     a\nb
 \= Expect no match
     ab
 
-/a[^]+b/utf,alt_bsux,allow_empty_class,match_unset_backref
+/a[^]+b/utf,allow_empty_class,match_unset_backref
     aXb
     a\nX\nX\x{1234}b
 \= Expect no match
 
 /\ud800/utf,alt_bsux,allow_empty_class,match_unset_backref
 
+/^\u{0000000000010ffff}/utf,extra_alt_bsux
+    \x{10ffff}
+
+/\u/utf,alt_bsux
+    \\u
+
 /^a+[a\x{200}]/B,utf
     aa
 
 
 /(*: A‎B
C)abc/x,utf,mark,alt_verbnames
     abc
+    
+# Script run tests: auto-possessification
+
+/^(*sr:.*)/B,utf 
+    paypаl.com   A classic example of why script run checks are a good thing
+
+/^(*sr:.*(*ACCEPT))/utf 
+    paypаl.com   But *ACCEPT breaks things
+
+/^(*sr:\x{2e80}*)/B,utf
+
+/^(*sr:\x{2e80}*)\x{2e80}/B,utf
+
+/(?<!)(*sr:)/B
+
+/(?<=abc(?=X(*sr:BXY)CCC)XBXYCCC)./B
+   abcXBXYCCC!
+
+# Some script run patterns are broken in Perl 5.28.0. These can be moved into
+# test 4 when a mended version of Perl is released.
+
+/^(*sr:.{4})/utf
+    \x{0980}12\x{0993}     Bengali Common-digits Bengali
+    \x{0780}12\x{07b1}     Thaana Common-digits Thaana
+    \x{0e01}12\x{0e5b}     Thai Common-digits Thai
+    \x{1780}12\x{19ff}     Khmer Common-digits Khmer
+    \x{0904}12\x{0939}     Devanagari Common-digits Devanagari
+    A\x{ff10}\x{ff19}B     Latin Common-notascii-digits Latin 
+    A\x{1d7ce}\x{1d7cf}B   Latin fancy-common-digits Latin
+    
+# These ones involve non-ASCII but nevertheless Common digits. As of October
+# 2018 even blead Perl wasn't handling all of these - but is going to. 
+
+/^(*sr:.{4})/utf
+    A\x{ff10}\x{ff19}B     Latin Common-notascii-digits Latin 
+    \x{ff10}\x{ff19}..     Common-notascii-digits Common Common
+    A\x{ff10}BC            Latin Common-notascii-digit Latin Latin
+    A\x{1d7ce}\x{1d7cf}B   Latin fancy-common-digits Latin
+    \x{1d7ce}\x{1d7cf},,   fancy-common-digits Common Common
+    A\x{1d7ce}BC           Latin fancy-common-digit Latin Latin
+    
+# Some Unicode 12.1.0 new script characters
+
+/\p{Elymaic}\p{Nandinagari}\p{Nyiakeng_Puachue_Hmong}\p{Wancho}/utf
+    \x{10fe5}\x{119AC}\x{1E10E}\x{1E2D1} 
+
+# ------- 
+
+# Test reference and errors in non-ASCII characters in group names
+
+/(?'𑠅ABC'...)/I,utf
+   abcde\=copy=𑠅ABC
+
+# Bad ones
+
+/(?'AB၌C'...)\g{AB၌C}/utf
+
+/(?'٠ABC'...)/utf
+
+/(?'²ABC'...)/utf
+
+/(?'X²ABC'...)/utf
+
+# -------
+
+/\p{Any}*xyz/I
 
 # End of testinput5
index f7dedb21d8d445514eb5bf43f6f4636d22a5f783..0ca0d23c4dba218a16a784ea2f415dcffe9063cb 100644 (file)
    def\=dfa_restart
    
 /(?<=foo)bar/
-   foob\=ps,offset=2
+   foob\=ps,offset=2,allusedtext
    foobar...\=ps,dfa_restart,offset=4
    foobar\=offset=2
 \= Expect no match
 /abc\K123/
     xyzabc123pqr
     
-/(?<=abc)123/
+/(?<=abc)123/allusedtext
     xyzabc123pqr 
     xyzabc12\=ps
     xyzabc12\=ph
 
-/\babc\b/
+/\babc\b/allusedtext
     +++abc+++
     +++ab\=ps
     +++ab\=ph
 /^(?(?!a(*SKIP)b))/
     ac
 
-/(?<=abc)def/
+/(?<=abc)def/allusedtext
     abc\=ph
 
 /abc$/
 \= Expect no match
     \na
     
+/foobar/
+    the foobar thing\=copy_matched_subject
+    the foobar thing\=copy_matched_subject,zero_terminate
+
+/foobar/g
+    the foobar thing foobar again\=copy_matched_subject
+
+/(?(VERSION>=0)^B0W)/
+    B0W-W0W
+\= Expect no match
+    0
+
+/(?(VERSION>=1000)^B0W|W0W)/
+    B0W-W0W
+\= Expect no match
+    0
+
+/(?<=pqr)abc(?=xyz)/
+    123pqrabcxy\=ps,allusedtext
+    123pqrabcxyz\=ps,allusedtext
+
+/(?>a+b)/
+    aaaa\=ps
+    aaaab\=ps
+    
+/(abc)(?1)/
+    abca\=ps
+    abcabc\=ps
+
+/(?(?=abc).*|Z)/
+    ab\=ps
+    abcxyz\=ps
+
+/(abc)++x/
+    abcab\=ps
+    abc\=ps 
+    ab\=ps
+    abcx  
+
+/\z/
+    abc\=ph 
+    abc\=ps 
+   
+/\Z/
+    abc\=ph 
+    abc\=ps 
+    abc\n\=ph
+    abc\n\=ps
+
+/c*+(?<=[bc])/
+    abc\=ph
+    ab\=ph
+    abc\=ps
+    ab\=ps
+
+/c++(?<=[bc])/
+    abc\=ph
+    ab\=ph
+
+/(?<=(?=.(?<=x)))/
+    abx
+    ab\=ph
+    bxyz 
+    xyz
+
+/(?![ab]).*/
+    ab\=ph
+
+/c*+/
+    ab\=ph,offset=2
+
 # End of testinput6
index 2627454f9298cf943ffa622e2ea8a5bb19a9d386..550631db6c9b8cc1ee35a09eeb39df40334d4582 100644 (file)
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+
 # End of testinput8
index 77b9ff00ccfaf7a304fb41d41ebbf83d9277f6bb..ad2175bc412a4c70a5ef570708e336cd3613ec2f 100644 (file)
@@ -1,6 +1,6 @@
 # This set of tests is for features that are compatible with all versions of
 # Perl >= 5.10, in non-UTF mode. It should run clean for the 8-bit, 16-bit, and
-# 32-bit PCRE libraries, and also using the perltest.pl script.
+# 32-bit PCRE libraries, and also using the perltest.sh script.
     
 #forbid_utf
 #newline_default lf any anycrlf
@@ -9929,4 +9929,187 @@ No match
     AbCDe f
 No match
 
+/(*pla:foo).{6}/
+    abcfoobarxyz
+ 0: foobar
+\= Expect no match
+    abcfooba
+No match
+
+/(*positive_lookahead:foo).{6}/
+    abcfoobarxyz
+ 0: foobar
+    
+/(?(*pla:foo).{6}|a..)/
+    foobarbaz
+ 0: foobar
+    abcfoobar       
+ 0: abc
+
+/(?(*positive_lookahead:foo).{6}|a..)/
+    foobarbaz
+ 0: foobar
+    abcfoobar       
+ 0: abc
+    
+/(*plb:foo)bar/
+    abcfoobar
+ 0: bar
+\= Expect no match
+    abcbarfoo     
+No match
+
+/(*positive_lookbehind:foo)bar/
+    abcfoobar
+ 0: bar
+\= Expect no match
+    abcbarfoo
+No match
+    
+/(?(*plb:foo)bar|baz)/
+    abcfoobar
+ 0: bar
+    bazfoobar
+ 0: baz
+    abcbazfoobar
+ 0: baz
+    foobazfoobar    
+ 0: bar
+/(?(*positive_lookbehind:foo)bar|baz)/
+    abcfoobar
+ 0: bar
+    bazfoobar
+ 0: baz
+    abcbazfoobar
+ 0: baz
+    foobazfoobar    
+ 0: bar
+/(*nlb:foo)bar/
+    abcbarfoo     
+ 0: bar
+\= Expect no match
+    abcfoobar
+No match
+
+/(*negative_lookbehind:foo)bar/
+    abcbarfoo     
+ 0: bar
+\= Expect no match
+    abcfoobar
+No match
+    
+/(?(*nlb:foo)bar|baz)/
+    abcfoobaz 
+ 0: baz
+    abcbarbaz 
+ 0: bar
+\= Expect no match
+    abcfoobar
+No match
+/(?(*negative_lookbehind:foo)bar|baz)/
+    abcfoobaz 
+ 0: baz
+    abcbarbaz 
+ 0: bar
+\= Expect no match
+    abcfoobar
+No match
+/(*atomic:a+)\w/
+    aaab
+ 0: aaab
+\= Expect no match
+    aaaa      
+No match
+
+/   (?<word> \w+ )*    \.   /xi
+    pokus.
+ 0: pokus.
+ 1: pokus
+    
+/(?(DEFINE) (?<word> \w+ ) ) (?&word)*   \./xi
+    pokus.
+ 0: pokus.
+
+/(?(DEFINE) (?<word> \w+ ) ) ( (?&word)* )   \./xi 
+    pokus.
+ 0: pokus.
+ 1: <unset>
+ 2: pokus
+
+/(?&word)*  (?(DEFINE) (?<word> \w+ ) )  \./xi
+    pokus.
+ 0: pokus.
+
+/(?&word)*  \. (?<word> \w+ )/xi
+    pokus.hokus
+ 0: pokus.hokus
+ 1: hokus
+
+/a(?(?=(*:2)b).)/mark
+    abc
+ 0: ab
+MK: 2
+    acb     
+ 0: a
+
+/a(?(?!(*:2)b).)/mark
+    acb
+ 0: ac
+    abc     
+ 0: a
+MK: 2
+
+/(?:a|ab){1}+c/
+\= Expect no match
+    abc
+No match
+
+/(a|ab){1}+c/
+    abc
+No match
+    
+/(a+){1}+a/
+\= Expect no match
+    aaaa
+No match
+
+/(?(DEFINE)(a|ab))(?1){1}+c/
+    abc    
+No match
+
+/(?:a|(?=b)|.)*\z/
+    abc
+ 0: abc
+    
+/(?:a|(?=b)|.)*/
+    abc 
+ 0: a
+    
+/(?<=a(*SKIP)x)|c/
+    abcd
+No match
+    
+/(?<=a(*SKIP)x)|d/
+    abcd
+ 0: d
+/(?<=(?=.(?<=x)))/aftertext
+    abx
+ 0: 
+ 0+ x
+
+/(?<=(?=(?<=a)))b/
+    ab
+ 0: b
+
+/^(?<A>a)(?(<A>)b)((?<=b).*)$/
+    abc
+ 0: abc
+ 1: a
+ 2: c
+
 # End of testinput1 
index 9660fc5ae860753cacd5fb5355c3a2747f01d467..775c2ab6e5267fddf5b99fe70fb284f7a946433e 100644 (file)
@@ -1,7 +1,7 @@
 # This set of tests is for UTF-8 support and Unicode property support, with
 # relevance only for the 8-bit library.
 
-# The next 4 patterns have UTF-8 errors
+# The next 5 patterns have UTF-8 errors
 
 /[Ã]/utf
 Failed: error -8 at offset 1: UTF-8 error: byte 2 top bits not 0x80
@@ -15,6 +15,9 @@ 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
 
+/Ã\82\82\82\82\82\82\82\82Ã/match_invalid_utf
+Failed: error -22 at offset 2: UTF-8 error: isolated byte with 0x80 bit set
+
 # Now test subjects
 
 /badutf/utf
@@ -248,7 +251,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc4
 Last code unit = \x80
@@ -261,7 +264,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xe1
 Last code unit = \x80
@@ -274,7 +277,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xf0
 Last code unit = \x80
@@ -287,7 +290,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xf4
 Last code unit = \x80
@@ -300,7 +303,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xf4
 Last code unit = \xbf
@@ -313,7 +316,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc3
 Last code unit = \xbf
@@ -326,7 +329,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc4
 Last code unit = \x80
@@ -339,7 +342,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc2
 Last code unit = \x80
@@ -352,7 +355,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc3
 Last code unit = \xbf
@@ -365,7 +368,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xed
 Last code unit = \xb4
@@ -380,7 +383,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xe6
 Last code unit = \x9e
@@ -395,7 +398,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc2
 Last code unit = \x80
@@ -408,7 +411,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc2
 Last code unit = \x84
@@ -421,7 +424,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc4
 Last code unit = \x84
@@ -434,7 +437,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xe0
 Last code unit = \xa1
@@ -447,7 +450,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xf0
 Last code unit = \xab
@@ -460,7 +463,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -495,7 +498,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc4
 Last code unit = \x80
@@ -514,7 +517,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: x \xc4 
 Subject length lower bound = 1
@@ -531,7 +534,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: a x \xc4 
 Subject length lower bound = 1
@@ -548,7 +551,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: a x \xc4 
 Subject length lower bound = 1
@@ -566,7 +569,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: x \xc4 
 Subject length lower bound = 1
@@ -578,7 +581,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc4
 Last code unit = \x80
@@ -592,7 +595,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'a'
 Last code unit = \x80
@@ -606,7 +609,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'a'
 Last code unit = \x81
@@ -619,7 +622,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /[\x{100}]/IB,utf
@@ -629,7 +632,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc4
 Last code unit = \x80
@@ -648,7 +651,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc3
 Last code unit = \xbf
@@ -663,7 +666,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
 
@@ -678,14 +681,14 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 First code unit = \xc4
 Last code unit = 'z'
 Subject length lower bound = 7
 
 /\777/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc7
 Last code unit = \xbf
@@ -703,7 +706,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc4
 Last code unit = \x80
@@ -717,7 +720,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc4
 Last code unit = 'X'
@@ -761,7 +764,7 @@ No match
  0: \x{1234}
 
 /(*CRLF)(*UTF)(*BSR_UNICODE)a\Rb/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: utf
 \R matches any Unicode newline
@@ -771,7 +774,7 @@ Last code unit = 'b'
 Subject length lower bound = 3
 
 /\h/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x20 \xc2 \xe1 \xe2 \xe3 
 Subject length lower bound = 1
@@ -795,7 +798,7 @@ Subject length lower bound = 1
  0: \x{3000}
 
 /\v/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \xc2 \xe2 
 Subject length lower bound = 1
@@ -813,7 +816,7 @@ Subject length lower bound = 1
  0: \x{2028}
 
 /\h*A/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x20 A \xc2 \xe1 \xe2 \xe3 
 Last code unit = 'A'
@@ -822,21 +825,21 @@ Subject length lower bound = 1
  0: A
 
 /\v+A/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \xc2 \xe2 
 Last code unit = 'A'
 Subject length lower bound = 2
 
 /\s?xxx\s/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 x 
 Last code unit = 'x'
 Subject length lower bound = 4
 
 /\sxxx\s/I,utf,tables=2
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 \xc2 
 Last code unit = 'x'
@@ -847,7 +850,7 @@ Subject length lower bound = 5
  0: \x{a0}xxx\x{85}
 
 /\S \S/I,utf,tables=2
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f 
   \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e 
@@ -883,25 +886,25 @@ Error -36 (bad UTF-8 offset)
 No match
 
 /\x{1234}+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xe1 
 Subject length lower bound = 1
 
 /\x{1234}+?/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xe1 
 Subject length lower bound = 1
 
 /\x{1234}++/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xe1 
 Subject length lower bound = 1
 
 /\x{1234}{2}/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xe1 
 Subject length lower bound = 2
@@ -913,7 +916,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
 
@@ -925,14 +928,14 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'X'
 Last code unit = \x80
 Subject length lower bound = 2
 
 /\R/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \xc2 \xe2 
 Subject length lower bound = 1
@@ -944,7 +947,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xc7
 Last code unit = \xbf
@@ -1105,7 +1108,7 @@ Failed: error 174 at offset 0: using UTF is disabled by the application
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = 'A' (caseless)
 Subject length lower bound = 5
@@ -1117,7 +1120,7 @@ Subject length lower bound = 5
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = \xb0
@@ -1130,7 +1133,7 @@ Subject length lower bound = 5
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = \xb0
@@ -1143,14 +1146,14 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = 'A' (caseless)
 Last code unit = 'B' (caseless)
 Subject length lower bound = 3
 
 /\x{401}\x{420}\x{421}\x{422}\x{423}\x{424}\x{425}\x{426}\x{427}\x{428}\x{429}\x{42a}\x{42b}\x{42c}\x{42d}\x{42e}\x{42f}/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xd0 \xd1 
 Subject length lower bound = 17
@@ -1176,17 +1179,17 @@ Subject length lower bound = 17
 ------------------------------------------------------------------
 
 /\h/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x20 \xa0 
 Subject length lower bound = 1
 
 /\v/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x0a \x0b \x0c \x0d \x85 
 Subject length lower bound = 1
 
 /\R/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x0a \x0b \x0c \x0d \x85 
 Subject length lower bound = 1
 
@@ -1199,7 +1202,7 @@ Subject length lower bound = 1
 ------------------------------------------------------------------
 
 /\x{212a}+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: K k \xe2 
 Subject length lower bound = 1
@@ -1207,7 +1210,7 @@ Subject length lower bound = 1
  0: KKkk\x{212a}
 
 /s+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: S s \xc5 
 Subject length lower bound = 1
@@ -1222,7 +1225,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: A \xc4 
 Last code unit = 'A'
@@ -1239,7 +1242,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: 0 1 2 3 4 5 6 7 8 9 \xc4 
 Subject length lower bound = 1
@@ -1251,13 +1254,9 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
-Starting code units: Z \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd 
-  \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc 
-  \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb 
-  \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa 
-  \xfb \xfc \xfd \xfe \xff 
+Starting code units: Z \xc4 
 Subject length lower bound = 1
     Z\x{100}
  0: Z
@@ -1273,13 +1272,9 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
-Starting code units: z { | } ~ \x7f \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 
-  \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 
-  \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 
-  \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 
-  \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff 
+Starting code units: z { | } ~ \x7f \xc2 \xc3 \xc4 
 Subject length lower bound = 1
 
 /[z\Qa-d]Ā\E]/IB,utf
@@ -1289,13 +1284,9 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
-Starting code units: - ] a d z \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc 
-  \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb 
-  \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea 
-  \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 
-  \xfa \xfb \xfc \xfd \xfe \xff 
+Starting code units: - ] a d z \xc4 
 Subject length lower bound = 1
     \x{100}
  0: \x{100}
@@ -1314,13 +1305,9 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
-Starting code units: a b \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd 
-  \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc 
-  \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb 
-  \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa 
-  \xfb \xfc \xfd \xfe \xff 
+Starting code units: a b \xc4 
 Last code unit = 'z'
 Subject length lower bound = 7
 
@@ -1332,7 +1319,7 @@ Subject length lower bound = 7
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 \xc4 
 Subject length lower bound = 1
@@ -1345,7 +1332,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: 0 1 2 3 4 5 6 7 8 9 \xc4 
 Subject length lower bound = 1
@@ -1358,7 +1345,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 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 
@@ -1373,7 +1360,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -1395,7 +1382,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f 
   \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e 
@@ -1416,7 +1403,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -1435,13 +1422,9 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
-Starting code units: \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce 
-  \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd 
-  \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec 
-  \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb 
-  \xfc \xfd \xfe \xff 
+Starting code units: \xc4 
 Subject length lower bound = 1
     \x{104}
  0: \x{104}
@@ -1462,13 +1445,9 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
-Starting code units: Z z { | } ~ \x7f \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 
-  \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 
-  \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 
-  \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 
-  \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff 
+Starting code units: Z z { | } ~ \x7f \xc2 \xc3 \xc4 \xc5 \xce \xe1 \xe2 
 Subject length lower bound = 1
     Z
  0: Z
@@ -1503,13 +1482,9 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
-Starting code units: Z z { | } ~ \x7f \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 
-  \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 
-  \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 
-  \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 
-  \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff 
+Starting code units: Z z { | } ~ \x7f \xc2 \xc3 \xc4 \xc5 \xce \xe1 \xe2 
 Subject length lower bound = 1
 
 /\x{3a3}B/IBi,utf
@@ -1520,7 +1495,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xce \xcf 
 Last code unit = 'B' (caseless)
@@ -1531,7 +1506,7 @@ Subject length lower bound = 2
 Failed: error -3: UTF-8 error: 1 byte missing at end
 
 /(?<=(a)(?-1))x/I,utf
-Capturing subpattern count = 1
+Capture group count = 1
 Max lookbehind = 2
 Options: utf
 First code unit = 'x'
@@ -1579,7 +1554,7 @@ Failed: error 176 at offset 259: name is too long in (*MARK), (*PRUNE), (*SKIP),
 # but subjects containing them must not be UTF-checked.
 
 /\x{d800}/I,utf,allow_surrogate_escapes
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Extra options: allow_surrogate_escapes
 First code unit = \xed
@@ -1602,7 +1577,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: utf
 Overall options: anchored utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
@@ -1625,5 +1600,217 @@ Subject length lower bound = 1
 \= Expect no match
     aaa
 No match
+    
+# Offsets are different in 8-bit mode. 
+
+/(?<=abc)(|def)/g,utf,replace=<$0>,substitute_callout
+    123abcáyzabcdef789abcሴqr
+ 1(2) Old 6 6 "" New 6 8 "<>"
+ 2(2) Old 13 13 "" New 15 17 "<>"
+ 3(2) Old 13 16 "def" New 17 22 "<def>"
+ 4(2) Old 22 22 "" New 28 30 "<>"
+ 4: 123abc<>\x{e1}yzabc<><def>789abc<>\x{1234}qr
+    
+# Check name length with non-ASCII characters 
+
+/(?'ABáC678901234567890123456789012'...)/utf
+
+/(?'ABáC6789012345678901234567890123'...)/utf
+Failed: error 148 at offset 36: subpattern name is too long (maximum 32 code units)
+
+/(?'ABZC6789012345678901234567890123'...)/utf
+
+/(?(n/utf
+Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
+
+/(?(á/utf
+Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator?)
+
+# Invalid UTF-8 tests
+
+/.../g,match_invalid_utf
+    abcd\x80wxzy\x80pqrs
+ 0: abc
+ 0: wxz
+ 0: pqr
+    abcd\x{80}wxzy\x80pqrs
+ 0: abc
+ 0: d\x{80}w
+ 0: xzy
+ 0: pqr
+
+/abc/match_invalid_utf
+    ab\x80ab\=ph
+Partial match: ab
+\= Expect no match
+    ab\x80cdef\=ph
+No match
+
+/ab$/match_invalid_utf
+    ab\x80cdeab
+ 0: ab
+\= Expect no match
+    ab\x80cde
+No match
+
+/.../g,match_invalid_utf
+    abcd\x{80}wxzy\x80pqrs
+ 0: abc
+ 0: d\x{80}w
+ 0: xzy
+ 0: pqr
+
+/(?<=x)../g,match_invalid_utf
+    abcd\x{80}wxzy\x80pqrs
+ 0: zy
+    abcd\x{80}wxzy\x80xpqrs
+ 0: zy
+ 0: pq
+    
+/X$/match_invalid_utf
+\= Expect no match
+    X\xc4
+No match
+    
+/(?<=..)X/match_invalid_utf,aftertext
+    AB\x80AQXYZ
+ 0: X
+ 0+ YZ
+    AB\x80AQXYZ\=offset=5
+ 0: X
+ 0+ YZ
+    AB\x80\x80AXYZXC\=offset=5
+ 0: X
+ 0+ C
+\= Expect no match
+    AB\x80XYZ
+No match
+    AB\x80XYZ\=offset=3 
+No match
+    AB\xfeXYZ
+No match
+    AB\xffXYZ\=offset=3 
+No match
+    AB\x80AXYZ
+No match
+    AB\x80AXYZ\=offset=4
+No match
+    AB\x80\x80AXYZ\=offset=5
+No match
+
+/.../match_invalid_utf
+    AB\xc4CCC
+ 0: CCC
+\= Expect no match
+    A\x{d800}B
+No match
+    A\x{110000}B
+No match
+    A\xc4B  
+No match
+
+/\bX/match_invalid_utf
+    A\x80X
+ 0: X
+
+/\BX/match_invalid_utf
+\= Expect no match
+    A\x80X
+No match
+    
+/(?<=...)X/match_invalid_utf
+    AAA\x80BBBXYZ 
+ 0: X
+\= Expect no match
+    AAA\x80BXYZ 
+No match
+    AAA\x80BBXYZ 
+No match
+
+# -------------------------------------
+
+/(*UTF)(?=\x{123})/I
+Capture group count = 0
+May match empty string
+Compile options: <none>
+Overall options: utf
+First code unit = \xc4
+Last code unit = \xa3
+Subject length lower bound = 1
+
+/[\x{c1}\x{e1}]X[\x{145}\x{146}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xc3 
+Last code unit = 'X'
+Subject length lower bound = 3
+
+/[󿾟,]/BI,utf
+------------------------------------------------------------------
+        Bra
+        [,\x{fff9f}]
+        Ket
+        End
+------------------------------------------------------------------
+Capture group count = 0
+Options: utf
+Starting code units: , \xf3 
+Subject length lower bound = 1
+
+/[\x{fff4}-\x{ffff8}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xef \xf0 \xf1 \xf2 \xf3 
+Subject length lower bound = 1
+
+/[\x{fff4}-\x{afff8}\x{10ffff}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xef \xf0 \xf1 \xf2 \xf4 
+Subject length lower bound = 1
+
+/[\xff\x{ffff}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xc3 \xef 
+Subject length lower bound = 1
+
+/[\xff\x{ff}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xc3 
+Subject length lower bound = 1
+
+/[\xff\x{ff}]/I
+Capture group count = 0
+Starting code units: \xff 
+Subject length lower bound = 1
+
+/[Ss]/I
+Capture group count = 0
+First code unit = 'S' (caseless)
+Subject length lower bound = 1
+
+/[Ss]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: S s 
+Subject length lower bound = 1
+
+/(?:\x{ff}|\x{3000})/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xc3 \xe3 
+Subject length lower bound = 1
+
+/x/utf
+    abxyz
+ 0: x
+    \x80\=startchar
+Failed: error -22: UTF-8 error: isolated byte with 0x80 bit set at offset 0
+    abc\x80\=startchar
+Failed: error -22: UTF-8 error: isolated byte with 0x80 bit set at offset 3
+    abc\x80\=startchar,offset=3
+Error -36 (bad UTF-8 offset)
 
 # End of testinput10
index e22581d693e3d43cd0666d60f62511da513036ea..78bf7fbfa7ab323f8ccda702db1e2f4d5d4aa390 100644 (file)
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
   
 /\x{100}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \x{100}
 Subject length lower bound = 1
 
@@ -215,7 +215,7 @@ Subject length lower bound = 1
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
 \)  )*                       # optional trailing comment
 /Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 Options: extended
 Starting code units: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8 
@@ -260,7 +260,7 @@ Subject length lower bound = 3
 ------------------------------------------------------------------
 
 /\h+/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x20 \xa0 \xff 
 Subject length lower bound = 1
     \x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000}
@@ -275,7 +275,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x20 \xa0 \xff 
 Subject length lower bound = 1
     \x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000}
@@ -284,7 +284,7 @@ Subject length lower bound = 1
  0: \x{200a}\xa0\x{2000}
 
 /\H+/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
     \x{1680}\x{180e}\x{167f}\x{1681}\x{180d}\x{180f}
  0: \x{167f}\x{1681}\x{180d}\x{180f}
@@ -306,7 +306,7 @@ Subject length lower bound = 1
  0: \x9f\xa1\x{2fff}\x{3001}
 
 /\v+/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
     \x{2027}\x{2030}\x{2028}\x{2029}
@@ -321,7 +321,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
     \x{2027}\x{2030}\x{2028}\x{2029}
@@ -330,7 +330,7 @@ Subject length lower bound = 1
  0: \x85\x0a\x0b\x0c\x0d
 
 /\V+/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
     \x{2028}\x{2029}\x{2027}\x{2030}
  0: \x{2027}\x{2030}
@@ -344,7 +344,7 @@ Subject length lower bound = 1
  0: \x09\x0e\x84\x86
 
 /\R+/I,bsr=unicode
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
@@ -354,7 +354,7 @@ Subject length lower bound = 1
  0: \x85\x0a\x0b\x0c\x0d
 
 /\x{d800}\x{d7ff}\x{dc00}\x{dc00}\x{dcff}\x{dd00}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \x{d800}
 Last code unit = \x{dd00}
 Subject length lower bound = 6
@@ -600,7 +600,7 @@ Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b 
   \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a 
   \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 
@@ -624,7 +624,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0e 
   \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d 
   \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > 
index d8a909fc429bb0f7878be7b85b688accc0ba35a1..4b00384f886805f147707d759f1cc13d59ad97a8 100644 (file)
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
   
 /\x{100}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \x{100}
 Subject length lower bound = 1
 
@@ -215,7 +215,7 @@ Subject length lower bound = 1
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
 \)  )*                       # optional trailing comment
 /Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 Options: extended
 Starting code units: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8 
@@ -260,7 +260,7 @@ Subject length lower bound = 3
 ------------------------------------------------------------------
 
 /\h+/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x20 \xa0 \xff 
 Subject length lower bound = 1
     \x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000}
@@ -275,7 +275,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x20 \xa0 \xff 
 Subject length lower bound = 1
     \x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000}
@@ -284,7 +284,7 @@ Subject length lower bound = 1
  0: \x{200a}\xa0\x{2000}
 
 /\H+/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
     \x{1680}\x{180e}\x{167f}\x{1681}\x{180d}\x{180f}
  0: \x{167f}\x{1681}\x{180d}\x{180f}
@@ -306,7 +306,7 @@ Subject length lower bound = 1
  0: \x9f\xa1\x{2fff}\x{3001}
 
 /\v+/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
     \x{2027}\x{2030}\x{2028}\x{2029}
@@ -321,7 +321,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
     \x{2027}\x{2030}\x{2028}\x{2029}
@@ -330,7 +330,7 @@ Subject length lower bound = 1
  0: \x85\x0a\x0b\x0c\x0d
 
 /\V+/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
     \x{2028}\x{2029}\x{2027}\x{2030}
  0: \x{2027}\x{2030}
@@ -344,7 +344,7 @@ Subject length lower bound = 1
  0: \x09\x0e\x84\x86
 
 /\R+/I,bsr=unicode
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
@@ -354,7 +354,7 @@ Subject length lower bound = 1
  0: \x85\x0a\x0b\x0c\x0d
 
 /\x{d800}\x{d7ff}\x{dc00}\x{dc00}\x{dcff}\x{dd00}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \x{d800}
 Last code unit = \x{dd00}
 Subject length lower bound = 6
@@ -558,19 +558,19 @@ Failed: error 134 at offset 12: character code point value in \x{} or \o{} is to
 Failed: error 134 at offset 14: character code point value in \x{} or \o{} is too large
 
 /\x{7fffffff}\x{7fffffff}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \x{7fffffff}
 Last code unit = \x{7fffffff}
 Subject length lower bound = 2
 
 /\x{80000000}\x{80000000}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \x{80000000}
 Last code unit = \x{80000000}
 Subject length lower bound = 2
 
 /\x{ffffffff}\x{ffffffff}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \x{ffffffff}
 Last code unit = \x{ffffffff}
 Subject length lower bound = 2
@@ -588,7 +588,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 First code unit = \x{400000}
 Last code unit = \x{800000}
@@ -603,7 +603,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b 
   \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a 
   \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 
@@ -627,7 +627,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0e 
   \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d 
   \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > 
index 52dbe74b04f22f0c2d8c3eb66e52ebcc2429e569..3006bc1bf5e69aa8a8a4987d17380ccd66c6e040 100644 (file)
@@ -18,7 +18,7 @@
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{ffff}
 Subject length lower bound = 1
@@ -30,7 +30,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d800}
 Last code unit = \x{dc00}
@@ -43,7 +43,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Subject length lower bound = 1
@@ -55,7 +55,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{1000}
 Subject length lower bound = 1
@@ -67,7 +67,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d800}
 Last code unit = \x{dc00}
@@ -80,7 +80,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{dbc0}
 Last code unit = \x{dc00}
@@ -93,7 +93,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{dbff}
 Last code unit = \x{dfff}
@@ -106,7 +106,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xff
 Subject length lower bound = 1
@@ -118,7 +118,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Subject length lower bound = 1
@@ -130,7 +130,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x80
 Subject length lower bound = 1
@@ -142,7 +142,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xff
 Subject length lower bound = 1
@@ -154,7 +154,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d55c}
 Last code unit = \x{c5b4}
@@ -169,7 +169,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{65e5}
 Last code unit = \x{8a9e}
@@ -184,7 +184,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x80
 Subject length lower bound = 1
@@ -196,7 +196,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x84
 Subject length lower bound = 1
@@ -208,7 +208,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{104}
 Subject length lower bound = 1
@@ -220,7 +220,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{861}
 Subject length lower bound = 1
@@ -232,7 +232,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d844}
 Last code unit = \x{deab}
@@ -245,7 +245,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -281,7 +281,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Last code unit = \x{100}
@@ -300,7 +300,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: x \xff 
 Subject length lower bound = 1
@@ -317,7 +317,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: a x \xff 
 Subject length lower bound = 1
@@ -334,7 +334,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: a x \xff 
 Subject length lower bound = 1
@@ -352,7 +352,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: x \xff 
 Subject length lower bound = 1
@@ -364,7 +364,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Subject length lower bound = 1
@@ -377,7 +377,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'a'
 Last code unit = \x{100}
@@ -391,7 +391,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'a'
 Last code unit = \x{101}
@@ -404,7 +404,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /[\x{100}]/IB,utf
@@ -414,7 +414,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Subject length lower bound = 1
@@ -432,7 +432,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xff
 Subject length lower bound = 1
@@ -446,7 +446,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
 
@@ -461,14 +461,14 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 First code unit = \x{100}
 Last code unit = 'z'
 Subject length lower bound = 7
 
 /\777/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{1ff}
 Subject length lower bound = 1
@@ -485,7 +485,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Last code unit = \x{200}
@@ -499,7 +499,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Last code unit = 'X'
@@ -547,7 +547,7 @@ Failed: error -24: UTF-16 error: missing low surrogate at end at offset 2
  0: \x{11234}
 
 /(*UTF)\x{11234}/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: utf
 First code unit = \x{d804}
@@ -565,7 +565,7 @@ Failed: error 160 at offset 5: (*VERB) not recognized or malformed
   abcd\x{11234}pqr
 
 /(*CRLF)(*UTF16)(*BSR_UNICODE)a\Rb/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: utf
 \R matches any Unicode newline
@@ -575,10 +575,10 @@ Last code unit = 'b'
 Subject length lower bound = 3
 
 /(*CRLF)(*UTF32)(*BSR_UNICODE)a\Rb/I
-Failed: error 160 at offset 12: (*VERB) not recognized or malformed
+Failed: error 160 at offset 14: (*VERB) not recognized or malformed
 
 /\h/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x20 \xa0 \xff 
 Subject length lower bound = 1
@@ -602,7 +602,7 @@ Subject length lower bound = 1
  0: \x{3000}
 
 /\v/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
@@ -620,7 +620,7 @@ Subject length lower bound = 1
  0: \x{2028}
 
 /\h*A/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x20 A \xa0 \xff 
 Last code unit = 'A'
@@ -631,7 +631,7 @@ Subject length lower bound = 1
  0: \x{2000}A
 
 /\R*A/I,bsr=unicode,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches any Unicode newline
 Starting code units: \x0a \x0b \x0c \x0d A \x85 \xff 
@@ -643,21 +643,21 @@ Subject length lower bound = 1
  0: \x{2028}A
 
 /\v+A/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Last code unit = 'A'
 Subject length lower bound = 2
 
 /\s?xxx\s/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 x 
 Last code unit = 'x'
 Subject length lower bound = 4
 
 /\sxxx\s/I,utf,tables=2
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 \x85 \xa0 
 Last code unit = 'x'
@@ -668,7 +668,7 @@ Subject length lower bound = 5
  0: \x{a0}xxx\x{85}
 
 /\S \S/I,utf,tables=2
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f 
   \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e 
@@ -708,25 +708,25 @@ Failed: error -33: bad offset value
 Failed: error -33: bad offset value
 
 /\x{1234}+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{1234}
 Subject length lower bound = 1
 
 /\x{1234}+?/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{1234}
 Subject length lower bound = 1
 
 /\x{1234}++/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{1234}
 Subject length lower bound = 1
 
 /\x{1234}{2}/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{1234}
 Last code unit = \x{1234}
@@ -739,7 +739,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
 
@@ -751,14 +751,14 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'X'
 Last code unit = \x{200}
 Subject length lower bound = 2
 
 /\R/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
@@ -936,7 +936,7 @@ Failed: error 174 at offset 0: using UTF is disabled by the application
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = 'A' (caseless)
 Last code unit = \x{1fb0} (caseless)
@@ -949,7 +949,7 @@ Subject length lower bound = 5
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = \x{1fb0}
@@ -962,7 +962,7 @@ Subject length lower bound = 5
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = \x{1fb0}
@@ -975,14 +975,14 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = 'A' (caseless)
 Last code unit = \x{1fb0} (caseless)
 Subject length lower bound = 3
 
 /\x{401}\x{420}\x{421}\x{422}\x{423}\x{424}\x{425}\x{426}\x{427}\x{428}\x{429}\x{42a}\x{42b}\x{42c}\x{42d}\x{42e}\x{42f}/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{401} (caseless)
 Last code unit = \x{42f} (caseless)
@@ -1017,7 +1017,7 @@ Subject length lower bound = 17
 ------------------------------------------------------------------
 
 /\x{212a}+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: K k \xff 
 Subject length lower bound = 1
@@ -1025,7 +1025,7 @@ Subject length lower bound = 1
  0: KKkk\x{212a}
 
 /s+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: S s \xff 
 Subject length lower bound = 1
@@ -1048,7 +1048,7 @@ Failed: error 134 at offset 10: character code point value in \x{} or \o{} is to
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: A \xff 
 Last code unit = 'A'
@@ -1065,7 +1065,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: 0 1 2 3 4 5 6 7 8 9 \xff 
 Subject length lower bound = 1
@@ -1077,7 +1077,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: Z \xff 
 Subject length lower bound = 1
@@ -1095,7 +1095,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 
   \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 
@@ -1115,7 +1115,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: - ] a d z \xff 
 Subject length lower bound = 1
@@ -1136,7 +1136,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: a b \xff 
 Last code unit = 'z'
@@ -1150,7 +1150,7 @@ Subject length lower bound = 7
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 \xff 
 Subject length lower bound = 1
@@ -1163,7 +1163,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: 0 1 2 3 4 5 6 7 8 9 \xff 
 Subject length lower bound = 1
@@ -1176,7 +1176,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 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 
@@ -1191,7 +1191,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -1217,7 +1217,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f 
   \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e 
@@ -1243,7 +1243,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -1266,7 +1266,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xff 
 Subject length lower bound = 1
@@ -1289,7 +1289,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: Z z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 
   \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 
@@ -1335,7 +1335,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: Z z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 
   \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 
@@ -1357,7 +1357,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xff 
 Last code unit = 'B' (caseless)
@@ -1443,7 +1443,7 @@ Failed: error 191 at offset 0: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowe
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: utf
 Overall options: anchored utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
@@ -1470,5 +1470,162 @@ Subject length lower bound = 1
 \= Expect no match
     aaa
 No match
+    
+# Offsets are different in 8-bit mode. 
+
+/(?<=abc)(|def)/g,utf,replace=<$0>,substitute_callout
+    123abcáyzabcdef789abcሴqr
+ 1(2) Old 6 6 "" New 6 8 "<>"
+ 2(2) Old 12 12 "" New 14 16 "<>"
+ 3(2) Old 12 15 "def" New 16 21 "<def>"
+ 4(2) Old 21 21 "" New 27 29 "<>"
+ 4: 123abc<>\x{e1}yzabc<><def>789abc<>\x{1234}qr
+    
+# A few script run tests in non-UTF mode (but they need Unicode support)
+
+/^(*script_run:.{4})/
+    \x{3041}\x{30a1}\x{3007}\x{3007}   Hiragana Katakana Han Han
+ 0: \x{3041}\x{30a1}\x{3007}\x{3007}
+    \x{30a1}\x{3041}\x{3007}\x{3007}   Katakana Hiragana Han Han
+ 0: \x{30a1}\x{3041}\x{3007}\x{3007}
+    \x{1100}\x{2e80}\x{2e80}\x{1101}   Hangul Han Han Hangul
+ 0: \x{1100}\x{2e80}\x{2e80}\x{1101}
+/^(*sr:.*)/utf,allow_surrogate_escapes
+Failed: error 191 at offset 0: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowed in UTF-16 mode
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+    \x{d800}\x{dfff}                   Surrogates (Unknown) \=no_utf_check
+
+/(?(n/utf
+Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
+
+/(?(á/utf
+Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
+
+# Invalid UTF-16/32 tests.
+
+/.../g,match_invalid_utf
+    abcd\x{df00}wxzy\x{df00}pqrs
+ 0: abc
+ 0: wxz
+ 0: pqr
+    abcd\x{80}wxzy\x{df00}pqrs
+ 0: abc
+ 0: d\x{80}w
+ 0: xzy
+ 0: pqr
+
+/abc/match_invalid_utf
+    ab\x{df00}ab\=ph
+Partial match: ab
+\= Expect no match
+    ab\x{df00}cdef\=ph
+No match
+
+/ab$/match_invalid_utf
+    ab\x{df00}cdeab
+ 0: ab
+\= Expect no match
+    ab\x{df00}cde
+No match
+
+/.../g,match_invalid_utf
+    abcd\x{80}wxzy\x{df00}pqrs
+ 0: abc
+ 0: d\x{80}w
+ 0: xzy
+ 0: pqr
+
+/(?<=x)../g,match_invalid_utf
+    abcd\x{80}wxzy\x{df00}pqrs
+ 0: zy
+    abcd\x{80}wxzy\x{df00}xpqrs
+ 0: zy
+ 0: pq
+
+/X$/match_invalid_utf
+\= Expect no match
+    X\x{df00}
+No match
+    
+/(?<=..)X/match_invalid_utf,aftertext
+    AB\x{df00}AQXYZ
+ 0: X
+ 0+ YZ
+    AB\x{df00}AQXYZ\=offset=5
+ 0: X
+ 0+ YZ
+    AB\x{df00}\x{df00}AXYZXC\=offset=5
+ 0: X
+ 0+ C
+\= Expect no match
+    AB\x{df00}XYZ
+No match
+    AB\x{df00}XYZ\=offset=3 
+No match
+    AB\x{df00}AXYZ
+No match
+    AB\x{df00}AXYZ\=offset=4
+No match
+    AB\x{df00}\x{df00}AXYZ\=offset=5
+No match
+
+/.../match_invalid_utf
+\= Expect no match
+    A\x{d800}B
+No match
+    A\x{110000}B 
+** Failed: character \x{110000} is greater than 0x10ffff and so cannot be converted to UTF-16
+
+# ---------------------------------------------------- 
+
+/(*UTF)(?=\x{123})/I
+Capture group count = 0
+May match empty string
+Compile options: <none>
+Overall options: utf
+First code unit = \x{123}
+Subject length lower bound = 1
+
+/[\x{c1}\x{e1}]X[\x{145}\x{146}]/I,utf
+Capture group count = 0
+Options: utf
+First code unit = \xc1 (caseless)
+Last code unit = \x{145} (caseless)
+Subject length lower bound = 3
+
+/[\xff\x{ffff}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xff 
+Subject length lower bound = 1
+
+/[\xff\x{ff}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xff 
+Subject length lower bound = 1
+
+/[\xff\x{ff}]/I
+Capture group count = 0
+Starting code units: \xff 
+Subject length lower bound = 1
+
+/[Ss]/I
+Capture group count = 0
+Starting code units: S s 
+Subject length lower bound = 1
+
+/[Ss]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: S s 
+Subject length lower bound = 1
+
+/(?:\x{ff}|\x{3000})/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xff 
+Subject length lower bound = 1
 
 # End of testinput12
index 38ff92dca4fa5b8358ebec6b445d3d59ebf43f96..ad240e2daee1b41e227449a020a0def74296bf38 100644 (file)
@@ -18,7 +18,7 @@
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{ffff}
 Subject length lower bound = 1
@@ -30,7 +30,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{10000}
 Subject length lower bound = 1
@@ -42,7 +42,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Subject length lower bound = 1
@@ -54,7 +54,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{1000}
 Subject length lower bound = 1
@@ -66,7 +66,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{10000}
 Subject length lower bound = 1
@@ -78,7 +78,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100000}
 Subject length lower bound = 1
@@ -90,7 +90,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{10ffff}
 Subject length lower bound = 1
@@ -102,7 +102,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xff
 Subject length lower bound = 1
@@ -114,7 +114,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Subject length lower bound = 1
@@ -126,7 +126,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x80
 Subject length lower bound = 1
@@ -138,7 +138,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xff
 Subject length lower bound = 1
@@ -150,7 +150,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d55c}
 Last code unit = \x{c5b4}
@@ -165,7 +165,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{65e5}
 Last code unit = \x{8a9e}
@@ -180,7 +180,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x80
 Subject length lower bound = 1
@@ -192,7 +192,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x84
 Subject length lower bound = 1
@@ -204,7 +204,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{104}
 Subject length lower bound = 1
@@ -216,7 +216,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{861}
 Subject length lower bound = 1
@@ -228,7 +228,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{212ab}
 Subject length lower bound = 1
@@ -240,7 +240,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -276,7 +276,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Last code unit = \x{100}
@@ -295,7 +295,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: x \xff 
 Subject length lower bound = 1
@@ -312,7 +312,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: a x \xff 
 Subject length lower bound = 1
@@ -329,7 +329,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: a x \xff 
 Subject length lower bound = 1
@@ -347,7 +347,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: x \xff 
 Subject length lower bound = 1
@@ -359,7 +359,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Subject length lower bound = 1
@@ -372,7 +372,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'a'
 Last code unit = \x{100}
@@ -386,7 +386,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'a'
 Last code unit = \x{101}
@@ -399,7 +399,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /[\x{100}]/IB,utf
@@ -409,7 +409,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Subject length lower bound = 1
@@ -427,7 +427,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xff
 Subject length lower bound = 1
@@ -441,7 +441,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
 
@@ -456,14 +456,14 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 First code unit = \x{100}
 Last code unit = 'z'
 Subject length lower bound = 7
 
 /\777/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{1ff}
 Subject length lower bound = 1
@@ -480,7 +480,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Last code unit = \x{200}
@@ -494,7 +494,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{100}
 Last code unit = 'X'
@@ -538,11 +538,11 @@ No match
 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
+Failed: error 160 at offset 7: (*VERB) not recognized or malformed
   abcd\x{11234}pqr
 
 /(*UTF)\x{11234}/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: utf
 First code unit = \x{11234}
@@ -559,10 +559,10 @@ Failed: error 160 at offset 5: (*VERB) not recognized or malformed
   abcd\x{11234}pqr
 
 /(*CRLF)(*UTF16)(*BSR_UNICODE)a\Rb/I
-Failed: error 160 at offset 12: (*VERB) not recognized or malformed
+Failed: error 160 at offset 14: (*VERB) not recognized or malformed
 
 /(*CRLF)(*UTF32)(*BSR_UNICODE)a\Rb/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: utf
 \R matches any Unicode newline
@@ -572,7 +572,7 @@ Last code unit = 'b'
 Subject length lower bound = 3
 
 /\h/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x20 \xa0 \xff 
 Subject length lower bound = 1
@@ -596,7 +596,7 @@ Subject length lower bound = 1
  0: \x{3000}
 
 /\v/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
@@ -614,7 +614,7 @@ Subject length lower bound = 1
  0: \x{2028}
 
 /\h*A/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x20 A \xa0 \xff 
 Last code unit = 'A'
@@ -625,7 +625,7 @@ Subject length lower bound = 1
  0: \x{2000}A
 
 /\R*A/I,bsr=unicode,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches any Unicode newline
 Starting code units: \x0a \x0b \x0c \x0d A \x85 \xff 
@@ -637,21 +637,21 @@ Subject length lower bound = 1
  0: \x{2028}A
 
 /\v+A/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Last code unit = 'A'
 Subject length lower bound = 2
 
 /\s?xxx\s/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 x 
 Last code unit = 'x'
 Subject length lower bound = 4
 
 /\sxxx\s/I,utf,tables=2
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 \x85 \xa0 
 Last code unit = 'x'
@@ -662,7 +662,7 @@ Subject length lower bound = 5
  0: \x{a0}xxx\x{85}
 
 /\S \S/I,utf,tables=2
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f 
   \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e 
@@ -702,25 +702,25 @@ Failed: error -33: bad offset value
 Failed: error -33: bad offset value
 
 /\x{1234}+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{1234}
 Subject length lower bound = 1
 
 /\x{1234}+?/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{1234}
 Subject length lower bound = 1
 
 /\x{1234}++/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{1234}
 Subject length lower bound = 1
 
 /\x{1234}{2}/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{1234}
 Last code unit = \x{1234}
@@ -733,7 +733,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
 
@@ -745,14 +745,14 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'X'
 Last code unit = \x{200}
 Subject length lower bound = 2
 
 /\R/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x0a \x0b \x0c \x0d \x85 \xff 
 Subject length lower bound = 1
@@ -930,7 +930,7 @@ Failed: error 174 at offset 0: using UTF is disabled by the application
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = 'A' (caseless)
 Last code unit = \x{1fb0} (caseless)
@@ -943,7 +943,7 @@ Subject length lower bound = 5
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = \x{1fb0}
@@ -956,7 +956,7 @@ Subject length lower bound = 5
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = \x{1fb0}
@@ -969,14 +969,14 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = 'A' (caseless)
 Last code unit = \x{1fb0} (caseless)
 Subject length lower bound = 3
 
 /\x{401}\x{420}\x{421}\x{422}\x{423}\x{424}\x{425}\x{426}\x{427}\x{428}\x{429}\x{42a}\x{42b}\x{42c}\x{42d}\x{42e}\x{42f}/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = \x{401} (caseless)
 Last code unit = \x{42f} (caseless)
@@ -1011,7 +1011,7 @@ Subject length lower bound = 17
 ------------------------------------------------------------------
 
 /\x{212a}+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: K k \xff 
 Subject length lower bound = 1
@@ -1019,7 +1019,7 @@ Subject length lower bound = 1
  0: KKkk\x{212a}
 
 /s+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: S s \xff 
 Subject length lower bound = 1
@@ -1042,7 +1042,7 @@ Failed: error 134 at offset 10: character code point value in \x{} or \o{} is to
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: A \xff 
 Last code unit = 'A'
@@ -1059,7 +1059,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: 0 1 2 3 4 5 6 7 8 9 \xff 
 Subject length lower bound = 1
@@ -1071,7 +1071,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: Z \xff 
 Subject length lower bound = 1
@@ -1089,7 +1089,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 
   \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 
@@ -1109,7 +1109,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: - ] a d z \xff 
 Subject length lower bound = 1
@@ -1130,7 +1130,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Starting code units: a b \xff 
 Last code unit = 'z'
@@ -1144,7 +1144,7 @@ Subject length lower bound = 7
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 \xff 
 Subject length lower bound = 1
@@ -1157,7 +1157,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: 0 1 2 3 4 5 6 7 8 9 \xff 
 Subject length lower bound = 1
@@ -1170,7 +1170,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 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 
@@ -1185,7 +1185,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -1211,7 +1211,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f 
   \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e 
@@ -1237,7 +1237,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
@@ -1260,7 +1260,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xff 
 Subject length lower bound = 1
@@ -1283,7 +1283,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: Z z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 
   \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 
@@ -1329,7 +1329,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: Z z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 
   \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 
@@ -1351,7 +1351,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Starting code units: \xff 
 Last code unit = 'B' (caseless)
@@ -1418,7 +1418,7 @@ No match
 # errors in 16-bit mode.
 
 /\x{d800}/I,utf,allow_surrogate_escapes
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Extra options: allow_surrogate_escapes
 First code unit = \x{d800}
@@ -1440,7 +1440,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: utf
 Overall options: anchored utf
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
@@ -1467,5 +1467,163 @@ Subject length lower bound = 1
 \= Expect no match
     aaa
 No match
+    
+# Offsets are different in 8-bit mode. 
+
+/(?<=abc)(|def)/g,utf,replace=<$0>,substitute_callout
+    123abcáyzabcdef789abcሴqr
+ 1(2) Old 6 6 "" New 6 8 "<>"
+ 2(2) Old 12 12 "" New 14 16 "<>"
+ 3(2) Old 12 15 "def" New 16 21 "<def>"
+ 4(2) Old 21 21 "" New 27 29 "<>"
+ 4: 123abc<>\x{e1}yzabc<><def>789abc<>\x{1234}qr
+    
+# A few script run tests in non-UTF mode (but they need Unicode support)
+
+/^(*script_run:.{4})/
+    \x{3041}\x{30a1}\x{3007}\x{3007}   Hiragana Katakana Han Han
+ 0: \x{3041}\x{30a1}\x{3007}\x{3007}
+    \x{30a1}\x{3041}\x{3007}\x{3007}   Katakana Hiragana Han Han
+ 0: \x{30a1}\x{3041}\x{3007}\x{3007}
+    \x{1100}\x{2e80}\x{2e80}\x{1101}   Hangul Han Han Hangul
+ 0: \x{1100}\x{2e80}\x{2e80}\x{1101}
+/^(*sr:.*)/utf,allow_surrogate_escapes
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+ 0: \x{2e80}\x{3105}\x{2e80}
+    \x{d800}\x{dfff}                   Surrogates (Unknown) \=no_utf_check
+ 0: \x{d800}
+
+/(?(n/utf
+Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
+
+/(?(á/utf
+Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
+
+# Invalid UTF-16/32 tests.
+
+/.../g,match_invalid_utf
+    abcd\x{df00}wxzy\x{df00}pqrs
+ 0: abc
+ 0: wxz
+ 0: pqr
+    abcd\x{80}wxzy\x{df00}pqrs
+ 0: abc
+ 0: d\x{80}w
+ 0: xzy
+ 0: pqr
+
+/abc/match_invalid_utf
+    ab\x{df00}ab\=ph
+Partial match: ab
+\= Expect no match
+    ab\x{df00}cdef\=ph
+No match
+
+/ab$/match_invalid_utf
+    ab\x{df00}cdeab
+ 0: ab
+\= Expect no match
+    ab\x{df00}cde
+No match
+
+/.../g,match_invalid_utf
+    abcd\x{80}wxzy\x{df00}pqrs
+ 0: abc
+ 0: d\x{80}w
+ 0: xzy
+ 0: pqr
+
+/(?<=x)../g,match_invalid_utf
+    abcd\x{80}wxzy\x{df00}pqrs
+ 0: zy
+    abcd\x{80}wxzy\x{df00}xpqrs
+ 0: zy
+ 0: pq
+
+/X$/match_invalid_utf
+\= Expect no match
+    X\x{df00}
+No match
+    
+/(?<=..)X/match_invalid_utf,aftertext
+    AB\x{df00}AQXYZ
+ 0: X
+ 0+ YZ
+    AB\x{df00}AQXYZ\=offset=5
+ 0: X
+ 0+ YZ
+    AB\x{df00}\x{df00}AXYZXC\=offset=5
+ 0: X
+ 0+ C
+\= Expect no match
+    AB\x{df00}XYZ
+No match
+    AB\x{df00}XYZ\=offset=3 
+No match
+    AB\x{df00}AXYZ
+No match
+    AB\x{df00}AXYZ\=offset=4
+No match
+    AB\x{df00}\x{df00}AXYZ\=offset=5
+No match
+
+/.../match_invalid_utf
+\= Expect no match
+    A\x{d800}B
+No match
+    A\x{110000}B 
+No match
+
+# ---------------------------------------------------- 
+
+/(*UTF)(?=\x{123})/I
+Capture group count = 0
+May match empty string
+Compile options: <none>
+Overall options: utf
+First code unit = \x{123}
+Subject length lower bound = 1
+
+/[\x{c1}\x{e1}]X[\x{145}\x{146}]/I,utf
+Capture group count = 0
+Options: utf
+First code unit = \xc1 (caseless)
+Last code unit = \x{145} (caseless)
+Subject length lower bound = 3
+
+/[\xff\x{ffff}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xff 
+Subject length lower bound = 1
+
+/[\xff\x{ff}]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xff 
+Subject length lower bound = 1
+
+/[\xff\x{ff}]/I
+Capture group count = 0
+Starting code units: \xff 
+Subject length lower bound = 1
+
+/[Ss]/I
+Capture group count = 0
+Starting code units: S s 
+Subject length lower bound = 1
+
+/[Ss]/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: S s 
+Subject length lower bound = 1
+
+/(?:\x{ff}|\x{3000})/I,utf
+Capture group count = 0
+Options: utf
+Starting code units: \xff 
+Subject length lower bound = 1
 
 # End of testinput12
index d09e781c627ad823dd0b92e79af4cc5def982d35..9154e5f95cd489c16c85a9b7406cf26558592494 100644 (file)
@@ -7,7 +7,7 @@
 # (2) Other tests that must not be run with JIT.
 
 /(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a z 
 Last code unit = 'z'
 Subject length lower bound = 2
@@ -24,7 +24,7 @@ Minimum depth limit = 30
 No match
 
 !((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
    /* this is a C style comment */\=find_limits
@@ -45,7 +45,7 @@ Minimum heap limit = 0
 Minimum match limit = 12
 Minimum depth limit = 3
  0: aaaaaaaaa
-    
+
 /(a)(?1)++/
     aa\=find_limits
 Minimum heap limit = 0
@@ -66,7 +66,7 @@ Minimum heap limit = 0
 Minimum match limit = 24
 Minimum depth limit = 3
  0: abbbbbbbbbbbbbbbbbbbbba
-    
+
 /a(?:.(*THEN))*?a/ims
     abbbbbbbbbbbbbbbbbbbbba\=find_limits
 Minimum heap limit = 0
@@ -117,7 +117,7 @@ Failed: error 160 at offset 17: (*VERB) not recognized or malformed
 Failed: error 160 at offset 24: (*VERB) not recognized or malformed
 
 /(*LIMIT_DEPTH=4294967280)abc/I
-Capturing subpattern count = 0
+Capture group count = 0
 Depth limit = 4294967280
 First code unit = 'a'
 Last code unit = 'c'
@@ -137,7 +137,7 @@ Failed: error -47: match limit exceeded
 Failed: error -53: matching depth limit exceeded
 
 /(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Match limit = 3000
 Starting code units: a z 
 Last code unit = 'z'
@@ -150,7 +150,7 @@ Failed: error -47: match limit exceeded
 Failed: error -47: match limit exceeded
 
 /(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Match limit = 3000
 Starting code units: a z 
 Last code unit = 'z'
@@ -160,7 +160,7 @@ Subject length lower bound = 2
 Failed: error -47: match limit exceeded
 
 /(*LIMIT_MATCH=60000)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Match limit = 60000
 Starting code units: a z 
 Last code unit = 'z'
@@ -173,7 +173,7 @@ No match
 Failed: error -47: match limit exceeded
 
 /(*LIMIT_DEPTH=10)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Depth limit = 10
 Starting code units: a z 
 Last code unit = 'z'
@@ -186,7 +186,7 @@ Failed: error -53: matching depth limit exceeded
 Failed: error -53: matching depth limit exceeded
 
 /(*LIMIT_DEPTH=10)(*LIMIT_DEPTH=1000)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Depth limit = 1000
 Starting code units: a z 
 Last code unit = 'z'
@@ -196,7 +196,7 @@ Subject length lower bound = 2
 No match
 
 /(*LIMIT_DEPTH=1000)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Depth limit = 1000
 Starting code units: a z 
 Last code unit = 'z'
@@ -207,9 +207,9 @@ No match
 \= Expect limit exceeded
     aaaaaaaaaaaaaz\=depth_limit=10
 Failed: error -53: matching depth limit exceeded
-    
-# These three have infinitely nested recursions. 
-    
+
+# These three have infinitely nested recursions.
+
 /((?2))((?1))/
     abc
 Failed: error -52: nested recursion at the same subject position
@@ -221,7 +221,7 @@ 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.
 
@@ -233,7 +233,7 @@ Failed: error -52: nested recursion at the same subject position
  0: abcxyz
        >>>
  0+ xyzpqr
-    
+
 /(?<=pqr)abc(?=xyz)/allusedtext
     xyzpqrabcxyzpqr
  0: pqrabcxyz
@@ -242,12 +242,12 @@ Failed: error -52: nested recursion at the same subject position
  0: pqrabcxyz
     <<<   >>>
  0+ xyzpqr
-    
+
 /a\b/
     a.\=allusedtext
  0: a.
      >
-    a\=allusedtext  
+    a\=allusedtext
  0: a
 
 /abc\Kxyz/
@@ -264,65 +264,173 @@ Failed: error -52: nested recursion at the same subject position
     abcabcdefg
  0: abcabcde
        >>>>>
-    
+
+#subject allusedtext
+
+/(?<=abc)123/
+    xyzabc123pqr
+ 0: abc123
+    <<<   
+    xyzabc12\=ps
+Partial match: abc12
+               <<<
+    xyzabc12\=ph
+Partial match: abc12
+               <<<
+
+/\babc\b/
+    +++abc+++
+ 0: +abc+
+    <   >
+    +++ab\=ps
+Partial match: +ab
+               <
+    +++ab\=ph
+Partial match: +ab
+               <
+
+/(?<=abc)def/
+    abc\=ph
+Partial match: abc
+               <<<
+
+/(?<=123)(*MARK:xx)abc/mark
+    xxxx123a\=ph
+Partial match, mark=xx: 123a
+                        <<<
+    xxxx123a\=ps
+Partial match, mark=xx: 123a
+                        <<<
+
+/(?<=(?<=a)b)c.*/I
+Capture group count = 0
+Max lookbehind = 1
+First code unit = 'c'
+Subject length lower bound = 1
+    abc\=ph
+Partial match: abc
+               <<
+\= Expect no match
+    xbc\=ph
+No match
+
+/(?<=ab)c.*/I
+Capture group count = 0
+Max lookbehind = 2
+First code unit = 'c'
+Subject length lower bound = 1
+    abc\=ph
+Partial match: abc
+               <<
+\= Expect no match
+    xbc\=ph
+No match
+
+/abc(?<=bc)def/
+    xxxabcd\=ph
+Partial match: abcd
+
+/(?<=ab)cdef/
+    xxabcd\=ph
+Partial match: abcd
+               <<
+
+/(?<=(?<=(?<=a)b)c)./I
+Capture group count = 0
+Max lookbehind = 1
+Subject length lower bound = 1
+    123abcXYZ
+ 0: abcX
+    <<< 
+
+/(?<=ab(cd(?<=...)))./I
+Capture group count = 1
+Max lookbehind = 4
+Subject length lower bound = 1
+    abcdX
+ 0: abcdX
+    <<<< 
+ 1: cd
+
+/(?<=ab((?<=...)cd))./I
+Capture group count = 1
+Max lookbehind = 4
+Subject length lower bound = 1
+    ZabcdX
+ 0: ZabcdX
+    <<<<< 
+ 1: cd
+
+/(?<=((?<=(?<=ab).))(?1)(?1))./I
+Capture group count = 1
+Max lookbehind = 2
+Subject length lower bound = 1
+    abxZ
+ 0: abxZ
+    <<< 
+ 1: 
+
+#subject
+# -------------------------------------------------------------------
+
 # These tests provoke recursion loops, which give a different error message
 # when JIT is used.
 
 /(?R)/I
-Capturing subpattern count = 0
+Capture group 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
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
     abcd
  0: a
  1: a
-    defg 
+    defg
 Failed: error -52: nested recursion at the same subject position
 
 /(ab|(bc|(de|(?R))))/I
-Capturing subpattern count = 3
+Capture group count = 3
 May match empty string
 Subject length lower bound = 0
     abcd
  0: ab
  1: ab
-    fghi 
+    fghi
 Failed: error -52: nested recursion at the same subject position
 
 /(ab|(bc|(de|(?1))))/I
-Capturing subpattern count = 3
+Capture group count = 3
 May match empty string
 Subject length lower bound = 0
     abcd
  0: ab
  1: ab
-    fghi 
+    fghi
 Failed: error -52: nested recursion at the same subject position
 
 /x(ab|(bc|(de|(?1)x)x)x)/I
-Capturing subpattern count = 3
+Capture group count = 3
 First code unit = 'x'
 Subject length lower bound = 3
     xab123
  0: xab
  1: ab
-    xfghi 
+    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 
+    =abc
 Failed: error -52: nested recursion at the same subject position
 
 /(?=\w)(?R)/
-    =abc 
+    =abc
 Failed: error -52: nested recursion at the same subject position
     abcd
 Failed: error -52: nested recursion at the same subject position
@@ -339,7 +447,7 @@ Failed: error -52: nested recursion at the same subject position
     aaa
  0: aaa
  1: aaa
-    bbb 
+    bbb
 Failed: error -52: nested recursion at the same subject position
 
 /[^\xff]((?1))/BI
@@ -352,12 +460,12 @@ Failed: error -52: nested recursion at the same subject position
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group 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 
+
+# These tests don't behave the same with JIT
 
 /\w+(?C1)/BI,no_auto_possess
 ------------------------------------------------------------------
@@ -367,7 +475,7 @@ Failed: error -52: nested recursion at the same subject position
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group 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 
@@ -390,7 +498,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group 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 
@@ -406,7 +514,7 @@ Subject length lower bound = 1
   1   ^^    End of pattern
 No match
 
-# This test breaks the JIT stack limit 
+# This test breaks the JIT stack limit
 
 /(|]+){2,2452}/
     (|]+){2,2452}
@@ -417,4 +525,12 @@ No match
     \[a]{60}
 Failed: error -63: heap limit exceeded
 
+/b(?<!ax)(?!cx)/allusedtext
+    abc
+ 0: abc
+    < >
+    abcz
+ 0: abcz
+    < >>
+
 # End of testinput15
index 616567b5fb9c8f7fe61491ee9ccf92a546b4217c..78d43bdaabfc5e2c917cd54db8893f6105f48e8e 100644 (file)
@@ -3,14 +3,14 @@
 # are different without JIT.
 
 /abc/I,jit,jitverify
-Capturing subpattern count = 0
+Capture group count = 0
 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
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
 
index acf00e09b25f78c33390cd1d89c48c99be4fe458..b66cfa3263dfbdd45cdffdb9919f8e89997bb707 100644 (file)
@@ -6,7 +6,7 @@
 # JIT does not support this pattern (callout at start of condition).
 
 /(?(?C1)(?=a)a)/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
 JIT compilation was not successful (no more memory)
@@ -14,7 +14,7 @@ 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
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
 JIT compilation was not successful (no more memory)
@@ -26,7 +26,7 @@ JIT compilation was not successful (no more memory)
 Failed: error -46: JIT stack limit reached
 
 /abcd/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'd'
 Subject length lower bound = 4
@@ -38,7 +38,7 @@ JIT compilation was successful
 No match (JIT)
 
 /(*NO_JIT)abcd/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'd'
 Subject length lower bound = 4
@@ -174,7 +174,7 @@ Partial match: ab (JIT)
 No match (JIT)
 
 /abcd/I,jit=2
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'd'
 Subject length lower bound = 4
@@ -192,7 +192,7 @@ No match, mark = m (JIT)
 # Limits tests that give different output with JIT. 
 
 /(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a z 
 Last code unit = 'z'
 Subject length lower bound = 2
@@ -207,7 +207,7 @@ Minimum match limit = 16383
 No match (JIT)
 
 !((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 JIT compilation was successful
@@ -294,7 +294,7 @@ No match (JIT)
 Failed: error -47: match limit exceeded
 
 /(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Match limit = 3000
 Starting code units: a z 
 Last code unit = 'z'
@@ -308,7 +308,7 @@ Failed: error -47: match limit exceeded
 Failed: error -47: match limit exceeded
 
 /(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Match limit = 3000
 Starting code units: a z 
 Last code unit = 'z'
@@ -319,7 +319,7 @@ JIT compilation was successful
 Failed: error -47: match limit exceeded
 
 /(*LIMIT_MATCH=60000)(a+)*zz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Match limit = 60000
 Starting code units: a z 
 Last code unit = 'z'
@@ -371,7 +371,7 @@ No match
 
 /^abc\Kdef/info,push
 ** Applies only to compile when pattern is stacked with 'push': jitverify
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -383,7 +383,7 @@ JIT compilation was successful
 
 /^abc\Kdef/info,push
 ** Applies only to compile when pattern is stacked with 'push': jitverify
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -423,7 +423,7 @@ JIT compilation was successful
 # when JIT is used.
 
 /(?R)/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
 JIT compilation was successful
@@ -431,7 +431,7 @@ JIT compilation was successful
 Failed: error -46: JIT stack limit reached
 
 /(a|(?R))/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 JIT compilation was successful
@@ -442,7 +442,7 @@ JIT compilation was successful
 Failed: error -46: JIT stack limit reached
 
 /(ab|(bc|(de|(?R))))/I
-Capturing subpattern count = 3
+Capture group count = 3
 May match empty string
 Subject length lower bound = 0
 JIT compilation was successful
@@ -453,7 +453,7 @@ JIT compilation was successful
 Failed: error -46: JIT stack limit reached
 
 /(ab|(bc|(de|(?1))))/I
-Capturing subpattern count = 3
+Capture group count = 3
 May match empty string
 Subject length lower bound = 0
 JIT compilation was successful
@@ -464,7 +464,7 @@ JIT compilation was successful
 Failed: error -46: JIT stack limit reached
 
 /x(ab|(bc|(de|(?1)x)x)x)/I
-Capturing subpattern count = 3
+Capture group count = 3
 First code unit = 'x'
 Subject length lower bound = 3
 JIT compilation was successful
@@ -511,7 +511,7 @@ Failed: error -46: JIT stack limit reached
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Subject length lower bound = 1
 JIT compilation was successful
     abcd
@@ -543,11 +543,11 @@ Failed: error -47: match limit exceeded
 # ---- 
 
 /[aC]/mg,firstline,newline=lf
-match\nmatch
+    match\nmatch
  0: a (JIT)
 
 /[aCz]/mg,firstline,newline=lf
-match\nmatch
+    match\nmatch
  0: a (JIT)
 
 # End of testinput17
index ecf0d800d485856c6660b63a2f865bbf5dcb4de0..c733c121a8a3733d8163bb00fc1181cc9f722d51 100644 (file)
  0: DE
 
 /(a)b|/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 
 /abc/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 3
@@ -69,7 +69,7 @@ No match
 No match
 
 /^abc/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -85,30 +85,30 @@ No match
 No match
 
 /a+bc/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /a*bc/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b 
 Last code unit = 'c'
 Subject length lower bound = 2
 
 /a{3}bc/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 5
 
 /(abc|a+z)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 2
 
 /^abc$/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -135,13 +135,13 @@ Failed: error 105 at offset 7: number too big in {} quantifier
 Failed: error 106 at offset 5: missing terminating ] for character class
 
 /[\B]/B
-Failed: error 107 at offset 2: invalid escape sequence in character class
+Failed: error 107 at offset 2: escape sequence is invalid in character class
 
 /[\R]/B
-Failed: error 107 at offset 2: invalid escape sequence in character class
+Failed: error 107 at offset 2: escape sequence is invalid in character class
 
 /[\X]/B
-Failed: error 107 at offset 2: invalid escape sequence in character class
+Failed: error 107 at offset 2: escape sequence is invalid in character class
 
 /[z-a]/
 Failed: error 108 at offset 3: range out of order in character class
@@ -159,19 +159,19 @@ Failed: error 118 at offset 7: missing ) after (?# comment
 Failed: error 111 at offset 2: unrecognized character after (? or (?-
 
 /.*b/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit at start or follows newline
 Last code unit = 'b'
 Subject length lower bound = 1
 
 /.*?b/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit at start or follows newline
 Last code unit = 'b'
 Subject length lower bound = 1
 
 /cat|dog|elephant/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: c d e 
 Subject length lower bound = 3
     this sentence eventually mentions a cat
@@ -180,7 +180,7 @@ Subject length lower bound = 3
  0: elephant
 
 /cat|dog|elephant/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: c d e 
 Subject length lower bound = 3
     this sentence eventually mentions a cat
@@ -189,7 +189,7 @@ Subject length lower bound = 3
  0: elephant
 
 /cat|dog|elephant/Ii
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 Starting code units: C D E c d e 
 Subject length lower bound = 3
@@ -199,12 +199,12 @@ Subject length lower bound = 3
  0: elephant
 
 /a|[bcd]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b c d 
 Subject length lower bound = 1
 
 /(a|[^\dZ])/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
   \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = > 
@@ -222,7 +222,7 @@ Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
 Subject length lower bound = 1
 
 /(a|b)*[\s]/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b 
 Subject length lower bound = 1
 
@@ -233,7 +233,7 @@ Failed: error 115 at offset 4: reference to non-existent subpattern
 Failed: error 109 at offset 4: quantifier does not follow a repeatable item
 
 /(a)(b)(c)\2/I
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 2
 First code unit = 'a'
 Last code unit = 'c'
@@ -267,7 +267,7 @@ Matched, but too many substrings
  3: c
 
 /(a)bc|(a)(b)\2/I
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 2
 First code unit = 'a'
 Subject length lower bound = 3
@@ -312,7 +312,7 @@ Matched, but too many substrings
  3: b
 
 /abc$/I,dollar_endonly
-Capturing subpattern count = 0
+Capture group count = 0
 Options: dollar_endonly
 First code unit = 'a'
 Last code unit = 'c'
@@ -329,7 +329,7 @@ No match
 Failed: error 115 at offset 16: reference to non-existent subpattern
 
 /the quick brown fox/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 't'
 Last code unit = 'x'
 Subject length lower bound = 19
@@ -339,7 +339,7 @@ Subject length lower bound = 19
  0: the quick brown fox
 
 /the quick brown fox/I,anchored
-Capturing subpattern count = 0
+Capture group count = 0
 Options: anchored
 First code unit = 't'
 Subject length lower bound = 19
@@ -353,7 +353,7 @@ No match
 Failed: error 111 at offset 4: unrecognized character after (? or (?-
 
 /^abc|def/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a d 
 Subject length lower bound = 3
     abcdef
@@ -362,7 +362,7 @@ Subject length lower bound = 3
  0: def
 
 /.*((abc)$|(def))/I
-Capturing subpattern count = 3
+Capture group count = 3
 First code unit at start or follows newline
 Subject length lower bound = 3
     defabc
@@ -382,7 +382,7 @@ Failed: error 122 at offset 0: unmatched closing parenthesis
 Failed: error 106 at offset 4: missing terminating ] for character class
 
 /[^aeiou ]{3,}/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
   \x1a \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 
@@ -402,7 +402,7 @@ Subject length lower bound = 3
  0: -pr
 
 /<.*>/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = '<'
 Last code unit = '>'
 Subject length lower bound = 2
@@ -410,7 +410,7 @@ Subject length lower bound = 2
  0: <def>ghi<klm>
 
 /<.*?>/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = '<'
 Last code unit = '>'
 Subject length lower bound = 2
@@ -418,7 +418,7 @@ Subject length lower bound = 2
  0: <def>
 
 /<.*>/I,ungreedy
-Capturing subpattern count = 0
+Capture group count = 0
 Options: ungreedy
 First code unit = '<'
 Last code unit = '>'
@@ -427,7 +427,7 @@ Subject length lower bound = 2
  0: <def>
 
 /(?U)<.*>/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = '<'
 Last code unit = '>'
 Subject length lower bound = 2
@@ -435,7 +435,7 @@ Subject length lower bound = 2
  0: <def>
 
 /<.*?>/I,ungreedy
-Capturing subpattern count = 0
+Capture group count = 0
 Options: ungreedy
 First code unit = '<'
 Last code unit = '>'
@@ -444,7 +444,7 @@ Subject length lower bound = 2
  0: <def>ghi<klm>
 
 /={3,}/I,ungreedy
-Capturing subpattern count = 0
+Capture group count = 0
 Options: ungreedy
 First code unit = '='
 Last code unit = '='
@@ -453,7 +453,7 @@ Subject length lower bound = 3
  0: ===
 
 /(?U)={3,}?/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = '='
 Last code unit = '='
 Subject length lower bound = 3
@@ -461,7 +461,7 @@ Subject length lower bound = 3
  0: ========
 
 /(?<!bar|cattle)foo/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 6
 First code unit = 'f'
 Last code unit = 'o'
@@ -485,69 +485,69 @@ Failed: error 125 at offset 5: lookbehind assertion is not fixed length
 /(?<!(foo)a\1)bar/
 
 /(?i)abc/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a' (caseless)
 Last code unit = 'c' (caseless)
 Subject length lower bound = 3
 
 /(a|(?m)a)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /(?i)^1234/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = '1'
 Subject length lower bound = 4
 
 /(^b|(?i)^d)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 Starting code units: D b d 
 Subject length lower bound = 1
 
 /(?s).*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 0
 
 /[abcd]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b c d 
 Subject length lower bound = 1
 
 /(?i)[abcd]/I
-Capturing subpattern count = 0
+Capture group count = 0
 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
+Capture group count = 1
 Starting code units: b c x y 
 Subject length lower bound = 1
 
 /(^a|^b)/Im
-Capturing subpattern count = 1
+Capture group count = 1
 Options: multiline
 First code unit at start or follows newline
 Subject length lower bound = 1
 
 /(?i)(^a|^b)/Im
-Capturing subpattern count = 1
+Capture group count = 1
 Options: multiline
 First code unit at start or follows newline
 Subject length lower bound = 1
 
 /(a)(?(1)a|b|c)/
-Failed: error 127 at offset 3: conditional group contains more than two branches
+Failed: error 127 at offset 3: conditional subpattern contains more than two branches
 
 /(?(?=a)a|b|c)/
-Failed: error 127 at offset 0: conditional group contains more than two branches
+Failed: error 127 at offset 0: conditional subpattern contains more than two branches
 
 /(?(1a)/
 Failed: error 124 at offset 4: missing closing parenthesis for condition
@@ -565,14 +565,14 @@ Failed: error 115 at offset 3: reference to non-existent subpattern
 Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
 
 /((?s)blah)\s+\1/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'b'
 Last code unit = 'h'
 Subject length lower bound = 9
 
 /((?i)blah)\s+\1/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'b' (caseless)
 Last code unit = 'h' (caseless)
@@ -587,17 +587,17 @@ Subject length lower bound = 9
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'b' (caseless)
 Subject length lower bound = 1
 
 /(a*b|(?i:c*(?-i)d))/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: C a b c d 
 Subject length lower bound = 1
 
 /a$/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
     a
@@ -611,7 +611,7 @@ No match
 No match
 
 /a$/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 First code unit = 'a'
 Subject length lower bound = 1
@@ -626,7 +626,7 @@ Subject length lower bound = 1
 No match
 
 /\Aabc/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 Compile options: multiline
 Overall options: anchored multiline
@@ -634,14 +634,14 @@ First code unit = 'a'
 Subject length lower bound = 3
 
 /^abc/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 First code unit at start or follows newline
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
-Capturing subpattern count = 5
+Capture group count = 5
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -655,25 +655,25 @@ Subject length lower bound = 3
  5: def
 
 /(?<=foo)[ab]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 3
 Starting code units: a b 
 Subject length lower bound = 1
 
 /(?<!foo)(alpha|omega)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max lookbehind = 3
 Starting code units: a o 
 Last code unit = 'a'
 Subject length lower bound = 5
 
 /(?!alphabet)[ab]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b 
 Subject length lower bound = 1
 
 /(?<=foo\n)^bar/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 4
 Contains explicit CR or LF match
 Options: multiline
@@ -690,7 +690,7 @@ No match
 No match
 
 /^(?<=foo\n)bar/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 4
 Contains explicit CR or LF match
 Options: multiline
@@ -708,7 +708,7 @@ No match
 No match
 
 /(?>^abc)/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 First code unit at start or follows newline
 Last code unit = 'c'
@@ -733,7 +733,7 @@ Failed: error 125 at offset 0: lookbehind assertion is not fixed length
 /The next three are in testinput2 because they have variable length branches/
 
 /(?<=bullock|donkey)-cart/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 7
 First code unit = '-'
 Last code unit = 't'
@@ -749,13 +749,13 @@ No match
 No match
 
 /(?<=ab(?i)x|y|z)/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 3
 May match empty string
 Subject length lower bound = 0
 
 /(?>.*)(?<=(abcd)|(xyz))/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max lookbehind = 4
 May match empty string
 Subject length lower bound = 0
@@ -768,7 +768,7 @@ Subject length lower bound = 0
  2: xyz
 
 /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 4
 First code unit = 'Z'
 Last code unit = 'Z'
@@ -796,7 +796,7 @@ No match
 No match
 
 /(?<!(foo)a)bar/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max lookbehind = 4
 First code unit = 'b'
 Last code unit = 'r'
@@ -812,11 +812,11 @@ No match
 # This one is here because Perl behaves differently; see also the following.
 
 /^(a\1?){4}$/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Compile options: <none>
 Overall options: anchored
-Starting code units: a 
+First code unit = 'a'
 Subject length lower bound = 4
 \= Expect no match
     aaaa
@@ -949,7 +949,7 @@ Failed: error 101 at offset 4: \ at end of pattern
 Failed: error 101 at offset 4: \ at end of pattern
 
 /(a)bc(d)/I
-Capturing subpattern count = 2
+Capture group count = 2
 First code unit = 'a'
 Last code unit = 'd'
 Subject length lower bound = 4
@@ -969,7 +969,7 @@ Subject length lower bound = 4
 Copy substring 5 failed (-49): unknown substring
 
 /(.{20})/I
-Capturing subpattern count = 1
+Capture group count = 1
 Subject length lower bound = 20
     abcdefghijklmnopqrstuvwxyz
  0: abcdefghijklmnopqrst
@@ -984,7 +984,7 @@ Subject length lower bound = 20
  1G abcdefghijklmnopqrst (20)
 
 /(.{15})/I
-Capturing subpattern count = 1
+Capture group count = 1
 Subject length lower bound = 15
     abcdefghijklmnopqrstuvwxyz
  0: abcdefghijklmno
@@ -996,7 +996,7 @@ Subject length lower bound = 15
  1G abcdefghijklmno (15)
 
 /(.{16})/I
-Capturing subpattern count = 1
+Capture group count = 1
 Subject length lower bound = 16
     abcdefghijklmnopqrstuvwxyz
  0: abcdefghijklmnop
@@ -1010,7 +1010,7 @@ Subject length lower bound = 16
  1L abcdefghijklmnop
 
 /^(a|(bc))de(f)/I
-Capturing subpattern count = 3
+Capture group count = 3
 Compile options: <none>
 Overall options: anchored
 Starting code units: a b 
@@ -1049,7 +1049,7 @@ Get substring 4 failed (-49): unknown substring
  0C adef (4)
 
 /^abc\00def/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -1062,7 +1062,7 @@ Subject length lower bound = 7
 /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
 )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
 )?)?)?)?)?)?)?)?)?otherword/I
-Capturing subpattern count = 8
+Capture group count = 8
 Contains explicit CR or LF match
 First code unit = 'w'
 Last code unit = 'd'
@@ -1076,7 +1076,7 @@ Subject length lower bound = 14
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit at start or follows newline
 Last code unit = 'X'
 Subject length lower bound = 1
@@ -1089,7 +1089,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: dotall
 Overall options: anchored dotall
 Last code unit = 'X'
@@ -1108,7 +1108,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit at start or follows newline
 Subject length lower bound = 1
 
@@ -1125,7 +1125,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: dotall
 Overall options: anchored dotall
 Subject length lower bound = 1
@@ -1143,7 +1143,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 1
@@ -1161,13 +1161,13 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 1
 
 /\Biss\B/I,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = 'i'
 Last code unit = 's'
@@ -1177,7 +1177,7 @@ Subject length lower bound = 3
  0+ issippi
 
 /iss/I,aftertext,altglobal
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'i'
 Last code unit = 's'
 Subject length lower bound = 3
@@ -1188,7 +1188,7 @@ Subject length lower bound = 3
  0+ ippi
 
 /\Biss\B/I,aftertext,altglobal
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = 'i'
 Last code unit = 's'
@@ -1198,7 +1198,7 @@ Subject length lower bound = 3
  0+ issippi
 
 /\Biss\B/Ig,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = 'i'
 Last code unit = 's'
@@ -1213,7 +1213,7 @@ Subject length lower bound = 3
 No match
 
 /(?<=[Ms])iss/Ig,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = 'i'
 Last code unit = 's'
@@ -1225,7 +1225,7 @@ Subject length lower bound = 3
  0+ ippi
 
 /(?<=[Ms])iss/I,aftertext,altglobal
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = 'i'
 Last code unit = 's'
@@ -1235,7 +1235,7 @@ Subject length lower bound = 3
  0+ issippi
 
 /^iss/Ig,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'i'
@@ -1245,7 +1245,7 @@ Subject length lower bound = 3
  0+ issippi
 
 /.*iss/Ig,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit at start or follows newline
 Last code unit = 's'
 Subject length lower bound = 3
@@ -1256,7 +1256,7 @@ Subject length lower bound = 3
  0+ pqr
 
 /.i./Ig,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'i'
 Subject length lower bound = 3
     Mississippi
@@ -1285,7 +1285,7 @@ Subject length lower bound = 3
  0+ souri river
 
 /^.is/Ig,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 3
@@ -1294,7 +1294,7 @@ Subject length lower bound = 3
  0+ sissippi
 
 /^ab\n/Ig,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 Compile options: <none>
 Overall options: anchored
@@ -1305,7 +1305,7 @@ Subject length lower bound = 3
  0+ ab\x0acd
 
 /^ab\n/Igm,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 Options: multiline
 First code unit at start or follows newline
@@ -1329,238 +1329,238 @@ Subject length lower bound = 3
  0+ xyz
 
 /abc/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /abc|bac/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b 
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /(abc|bac)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /(abc|(c|dc))/I
-Capturing subpattern count = 2
+Capture group count = 2
 Starting code units: a c d 
 Last code unit = 'c'
 Subject length lower bound = 1
 
 /(abc|(d|de)c)/I
-Capturing subpattern count = 2
+Capture group count = 2
 Starting code units: a d 
 Last code unit = 'c'
 Subject length lower bound = 2
 
 /a*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
 
 /a+/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
 
 /(baa|a+)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Last code unit = 'a'
 Subject length lower bound = 1
 
 /a{0,3}/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
 
 /baa{3,}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'b'
 Last code unit = 'a'
 Subject length lower bound = 5
 
 /"([^\\"]+|\\.)*"/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = '"'
 Last code unit = '"'
 Subject length lower bound = 2
 
 /(abc|ab[cd])/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 3
 
 /(a|.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Subject length lower bound = 1
 
 /a|ba|\w/I
-Capturing subpattern count = 0
+Capture group 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
 
 /abc(?=pqr)/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'r'
 Subject length lower bound = 3
 
 /...(?<=abc)/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 3
 Subject length lower bound = 3
 
 /abc(?!pqr)/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /ab./I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 3
 
 /ab[xyz]/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 3
 
 /abc*/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /ab.c*/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 3
 
 /a.c*/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 2
 
 /.c*/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /ac*/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
 
 /(a.c*|b.c*)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Subject length lower bound = 2
 
 /a.c*|aba/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 2
 
 /.+a/I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'a'
 Subject length lower bound = 2
 
 /(?=abcda)a.*/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'a'
-Subject length lower bound = 1
+Subject length lower bound = 2
 
 /(?=a)a.*/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
 
 /a(b)*/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /a\d*/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
 
 /ab\d*/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /a(\d)*/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /abcde{0,0}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'd'
 Subject length lower bound = 4
 
 /ab\d+/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 3
 
 /a(?(1)b)(.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a'
 Subject length lower bound = 2
 
 /a(?(1)bag|big)(.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a'
 Last code unit = 'g'
 Subject length lower bound = 5
 
 /a(?(1)bag|big)*(.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a'
 Subject length lower bound = 2
 
 /a(?(1)bag|big)+(.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a'
 Last code unit = 'g'
 Subject length lower bound = 5
 
 /a(?(1)b..|b..)(.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 5
 
 /ab\d{0}e/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'e'
 Subject length lower bound = 3
 
 /a?b?/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     a
@@ -1576,7 +1576,7 @@ Subject length lower bound = 0
 No match
 
 /|-/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     abcd
@@ -1590,7 +1590,7 @@ Subject length lower bound = 0
 No match
 
 /^.?abcd/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Last code unit = 'd'
@@ -1604,7 +1604,7 @@ Subject length lower bound = 4
   )*            # Zero or more contents
   \)            # Closing )
   /Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1632,7 +1632,7 @@ No match
 No match
 
 /\(  ( (?>[^()]+) | (?R) )* \) /Igx
-Capturing subpattern count = 1
+Capture group count = 1
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1647,7 +1647,7 @@ Subject length lower bound = 2
  1: z
 
 /\(  (?: (?>[^()]+) | (?R) ) \) /Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1665,7 +1665,7 @@ Subject length lower bound = 3
 No match
 
 /\(  (?: (?>[^()]+) | (?R) )? \) /Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1676,7 +1676,7 @@ Subject length lower bound = 2
  0: (fsh)
 
 /\(  ( (?>[^()]+) | (?R) )* \) /Ix
-Capturing subpattern count = 1
+Capture group count = 1
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1686,7 +1686,7 @@ Subject length lower bound = 2
  1: cd
 
 /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
-Capturing subpattern count = 2
+Capture group count = 2
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1697,7 +1697,7 @@ Subject length lower bound = 2
  2: cd
 
 /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
-Capturing subpattern count = 3
+Capture group count = 3
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1714,7 +1714,7 @@ Subject length lower bound = 2
  3: cd
 
 /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
-Capturing subpattern count = 3
+Capture group count = 3
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1731,7 +1731,7 @@ Subject length lower bound = 2
  3: cd
 
 /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
-Capturing subpattern count = 11
+Capture group count = 11
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1751,7 +1751,7 @@ Subject length lower bound = 2
 11: cd
 
 /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
-Capturing subpattern count = 3
+Capture group count = 3
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1762,7 +1762,7 @@ Subject length lower bound = 2
  2: 123
 
 /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
-Capturing subpattern count = 3
+Capture group count = 3
 Options: extended
 First code unit = '('
 Last code unit = ')'
@@ -1786,7 +1786,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 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 
@@ -1801,7 +1801,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
@@ -1826,7 +1826,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: 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 
@@ -1841,7 +1841,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
@@ -1860,7 +1860,7 @@ Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
 Subject length lower bound = 1
 
 /[_[:alpha:]]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 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
@@ -1873,7 +1873,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
@@ -1892,7 +1892,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a 
@@ -1914,7 +1914,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x09 \x20 
@@ -1928,7 +1928,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b 
@@ -1948,7 +1948,7 @@ Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b
 Subject length lower bound = 1
 
 /[\n\x0b\x0c\x0d[:blank:]]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
 Subject length lower bound = 1
@@ -1961,7 +1961,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
@@ -1977,7 +1977,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
@@ -1991,7 +1991,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : 
@@ -2007,7 +2007,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: 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 
@@ -2021,7 +2021,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 
@@ -2037,7 +2037,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ 
@@ -2052,7 +2052,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
@@ -2066,7 +2066,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: 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 
@@ -2080,7 +2080,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f 
@@ -2094,7 +2094,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 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 
@@ -2109,7 +2109,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 
@@ -2134,7 +2134,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
@@ -2161,7 +2161,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b 
@@ -2187,7 +2187,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: % 0 1 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
@@ -2202,7 +2202,7 @@ Failed: error 113 at offset 1: POSIX collating elements are not supported
 Failed: error 130 at offset 3: unknown POSIX class name
 
 /[[:upper:]]/Ii
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 Starting code units: 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 
@@ -2213,7 +2213,7 @@ Subject length lower bound = 1
  0: a
 
 /[[:lower:]]/Ii
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 Starting code units: 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 
@@ -2224,7 +2224,7 @@ Subject length lower bound = 1
  0: a
 
 /((?-i)[[:lower:]])[[:lower:]]/Ii
-Capturing subpattern count = 1
+Capture group count = 1
 Options: caseless
 Starting code units: 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 = 2
@@ -2249,10 +2249,10 @@ Failed: error 115 at offset 5: reference to non-existent subpattern
 # This one's here because of the large output vector needed
 
 /(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I
-Capturing subpattern count = 271
+Capture group count = 271
 Max back reference = 270
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
-Subject length lower bound = 0
+Subject length lower bound = 1
      1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC\=ovector=300
  0: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC
  1: 1 
@@ -2530,7 +2530,7 @@ Subject length lower bound = 0
 # This one's here because Perl does this differently and PCRE2 can't at present
 
 /(main(O)?)+/I
-Capturing subpattern count = 2
+Capture group count = 2
 First code unit = 'm'
 Last code unit = 'n'
 Subject length lower bound = 4
@@ -2545,7 +2545,7 @@ Subject length lower bound = 4
 # These are all cases where Perl does it differently (nested captures)
 
 /^(a(b)?)+$/I
-Capturing subpattern count = 2
+Capture group count = 2
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2556,7 +2556,7 @@ Subject length lower bound = 1
  2: b
 
 /^(aa(bb)?)+$/I
-Capturing subpattern count = 2
+Capture group count = 2
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2567,7 +2567,7 @@ Subject length lower bound = 2
  2: bb
 
 /^(aa|aa(bb))+$/I
-Capturing subpattern count = 2
+Capture group count = 2
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2578,7 +2578,7 @@ Subject length lower bound = 2
  2: bb
 
 /^(aa(bb)??)+$/I
-Capturing subpattern count = 2
+Capture group count = 2
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2589,7 +2589,7 @@ Subject length lower bound = 2
  2: bb
 
 /^(?:aa(bb)?)+$/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2599,7 +2599,7 @@ Subject length lower bound = 2
  1: bb
 
 /^(aa(b(b))?)+$/I
-Capturing subpattern count = 3
+Capture group count = 3
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2611,7 +2611,7 @@ Subject length lower bound = 2
  3: b
 
 /^(?:aa(b(b))?)+$/I
-Capturing subpattern count = 2
+Capture group count = 2
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2622,7 +2622,7 @@ Subject length lower bound = 2
  2: b
 
 /^(?:aa(b(?:b))?)+$/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2632,7 +2632,7 @@ Subject length lower bound = 2
  1: bb
 
 /^(?:aa(bb(?:b))?)+$/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2642,7 +2642,7 @@ Subject length lower bound = 2
  1: bbb
 
 /^(?:aa(b(?:bb))?)+$/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2652,7 +2652,7 @@ Subject length lower bound = 2
  1: bbb
 
 /^(?:aa(?:b(b))?)+$/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2662,7 +2662,7 @@ Subject length lower bound = 2
  1: b
 
 /^(?:aa(?:b(bb))?)+$/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2672,7 +2672,7 @@ Subject length lower bound = 2
  1: bb
 
 /^(aa(b(bb))?)+$/I
-Capturing subpattern count = 3
+Capture group count = 3
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2684,7 +2684,7 @@ Subject length lower bound = 2
  3: bb
 
 /^(aa(bb(bb))?)+$/I
-Capturing subpattern count = 3
+Capture group count = 3
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -2703,7 +2703,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -2715,7 +2715,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -2727,7 +2727,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
 Subject length lower bound = 1
 
@@ -2738,7 +2738,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f 
   \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e 
   \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C 
@@ -2763,7 +2763,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b' (caseless)
 Subject length lower bound = 2
@@ -2785,7 +2785,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'b' (caseless)
 Subject length lower bound = 2
@@ -2806,7 +2806,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a' (caseless)
 Last code unit = 'c' (caseless)
@@ -2820,7 +2820,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a' (caseless)
 Last code unit = 'c' (caseless)
@@ -2833,7 +2833,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = '1'
 Last code unit = '0'
 Subject length lower bound = 300
@@ -2845,7 +2845,7 @@ Subject length lower bound = 300
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = '1'
 Last code unit = '0'
 Subject length lower bound = 300
@@ -2856,7 +2856,7 @@ Subject length lower bound = 300
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     \
@@ -2869,7 +2869,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'x'
 Subject length lower bound = 1
 
@@ -2880,7 +2880,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = ' '
 Subject length lower bound = 1
 
@@ -2891,7 +2891,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
   abc
@@ -2908,7 +2908,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -2922,7 +2922,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 3
@@ -2935,7 +2935,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group 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
@@ -2950,7 +2950,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
 
@@ -2961,7 +2961,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'x'
 Subject length lower bound = 1
 
@@ -3011,12 +3011,12 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 
 /^(\w++|\s++)*$/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Compile options: <none>
 Overall options: anchored
@@ -3029,7 +3029,7 @@ Subject length lower bound = 0
 No match
 
 /(\d++)(\w)/I
-Capturing subpattern count = 2
+Capture group count = 2
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
 Subject length lower bound = 2
     12345a
@@ -3041,7 +3041,7 @@ Subject length lower bound = 2
 No match
 
 /a++b/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -3049,7 +3049,7 @@ Subject length lower bound = 2
  0: aaab
 
 /(a++b)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -3058,7 +3058,7 @@ Subject length lower bound = 2
  1: aaab
 
 /(a++)b/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -3067,7 +3067,7 @@ Subject length lower bound = 2
  1: aaa
 
 /([^()]++|\([^()]*\))+/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
   \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( * + , - . / 0 1 2 3 4 5 
@@ -3088,7 +3088,7 @@ Subject length lower bound = 1
  1: x
 
 /\(([^()]++|\([^()]+\))+\)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = '('
 Last code unit = ')'
 Subject length lower bound = 3
@@ -3123,7 +3123,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 3
@@ -3149,7 +3149,7 @@ Failed: error 109 at offset 7: quantifier does not follow a repeatable item
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'x'
 Last code unit = 'b'
 Subject length lower bound = 3
@@ -3165,7 +3165,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'x'
 Last code unit = 'b'
 Subject length lower bound = 3
@@ -3193,7 +3193,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 5
+Capture group count = 5
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -3209,7 +3209,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'x'
@@ -3228,7 +3228,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'x'
@@ -3282,7 +3282,7 @@ Failed: error 106 at offset 10: missing terminating ] for character class
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
 Subject length lower bound = 1
 
@@ -3293,7 +3293,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
 Subject length lower bound = 1
 
@@ -3304,12 +3304,12 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b c d e 
 Subject length lower bound = 1
 
 /< (?: (?(R) \d++  | [^<>]*+) | (?R)) * >/Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = '<'
 Last code unit = '>'
@@ -3338,7 +3338,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = '8'
 Last code unit = 'X'
@@ -3352,43 +3352,43 @@ Subject length lower bound = 409
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = '$'
 Last code unit = 'X'
 Subject length lower bound = 404
 
 /(.*)\d+\1/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Subject length lower bound = 1
 
 /(.*)\d+/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit at start or follows newline
 Subject length lower bound = 1
 
 /(.*)\d+\1/Is
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Options: dotall
 Subject length lower bound = 1
 
 /(.*)\d+/Is
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: dotall
 Overall options: anchored dotall
 Subject length lower bound = 1
 
 /(.*(xyz))\d+\2/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 2
 First code unit at start or follows newline
 Last code unit = 'z'
 Subject length lower bound = 7
 
 /((.*))\d+\1/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 1
 Subject length lower bound = 1
     abc123bc
@@ -3397,143 +3397,143 @@ Subject length lower bound = 1
  2: bc
 
 /a[b]/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /(?=a).*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 First code unit = 'a'
-Subject length lower bound = 0
+Subject length lower bound = 1
 
 /(?=abc).xyz/Ii
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 First code unit = 'a' (caseless)
 Last code unit = 'z' (caseless)
 Subject length lower bound = 4
 
 /(?=abc)(?i).xyz/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'z' (caseless)
 Subject length lower bound = 4
 
 /(?=a)(?=b)/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 First code unit = 'a'
-Subject length lower bound = 0
+Subject length lower bound = 1
 
 /(?=.)a/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
 
 /((?=abcda)a)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'a'
-Subject length lower bound = 1
+Subject length lower bound = 2
 
 /((?=abcda)ab)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /()a/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /(?:(?=.)|(?<!x))a/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /(?(1)ab|ac)(.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a'
 Subject length lower bound = 3
 
 /(?(1)abz|acz)(.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a'
 Last code unit = 'z'
 Subject length lower bound = 4
 
 /(?(1)abz)(.)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Subject length lower bound = 1
 
 /(?(1)abz)(1)23/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Last code unit = '3'
 Subject length lower bound = 3
 
 /(a)+/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /(a){2,3}/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'a'
 Subject length lower bound = 2
 
 /(a)*/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 
 /[a]/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
 
 /[ab]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b 
 Subject length lower bound = 1
 
 /[ab]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b 
 Subject length lower bound = 1
 
 /[^a]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /\d456/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
 Last code unit = '6'
 Subject length lower bound = 4
 
 /\d456/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
 Last code unit = '6'
 Subject length lower bound = 4
 
 /a^b/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /^a/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 First code unit at start or follows newline
 Last code unit = 'a'
@@ -3547,24 +3547,24 @@ Subject length lower bound = 1
 No match
 
 /c|abc/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a c 
 Last code unit = 'c'
 Subject length lower bound = 1
 
 /(?i)[ab]/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: A B a b 
 Subject length lower bound = 1
 
 /[ab](?i)cd/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b 
 Last code unit = 'd' (caseless)
 Subject length lower bound = 3
 
 /abc(?C)def/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'f'
 Subject length lower bound = 6
@@ -3585,7 +3585,7 @@ No match
 No match
 
 /abc(?C)de(?C1)f/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'f'
 Subject length lower bound = 6
@@ -3596,7 +3596,7 @@ Subject length lower bound = 6
  0: abcdef
 
 /(?C1)\dabc(?C2)def/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
 Last code unit = 'f'
 Subject length lower bound = 7
@@ -3613,7 +3613,7 @@ Subject length lower bound = 7
 No match
 
 /(?C1)\dabc(?C2)def/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
 Last code unit = 'f'
 Subject length lower bound = 7
@@ -3630,7 +3630,7 @@ Subject length lower bound = 7
 No match
 
 /(?C255)ab/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -3645,7 +3645,7 @@ Failed: error 182 at offset 3: unrecognized string delimiter follows (?C
 Failed: error 139 at offset 5: closing parenthesis for (?C expected
 
 /abc(?C)def/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'f'
 Subject length lower bound = 6
@@ -3655,7 +3655,7 @@ Subject length lower bound = 6
  0: abcdef
 
 /(abc)(?C)de(?C1)f/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'f'
 Subject length lower bound = 6
@@ -3687,7 +3687,7 @@ Callout 1: last capture = 1
 No match
 
 /(?C0)(abc(?C1))*/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
     abcabcabc
@@ -3715,7 +3715,7 @@ Subject length lower bound = 0
  1: abc
 
 /(\d{3}(?C))*/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
     123\=callout_capture
@@ -3750,7 +3750,7 @@ Callout 0: last capture = 1
  1: 789
 
 /((xyz)(?C)p|(?C1)xyzabc)/I
-Capturing subpattern count = 2
+Capture group count = 2
 First code unit = 'x'
 Subject length lower bound = 4
     xyzabc\=callout_capture
@@ -3766,7 +3766,7 @@ Callout 1: last capture = 0
  1: xyzabc
 
 /(X)((xyz)(?C)p|(?C1)xyzabc)/I
-Capturing subpattern count = 3
+Capture group count = 3
 First code unit = 'X'
 Last code unit = 'x'
 Subject length lower bound = 5
@@ -3786,7 +3786,7 @@ Callout 1: last capture = 1
  2: xyzabc
 
 /(?=(abc))(?C)abcdef/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'f'
 Subject length lower bound = 6
@@ -3799,7 +3799,7 @@ Callout 0: last capture = 1
  1: abc
 
 /(?!(abc)(?C1)d)(?C2)abcxyz/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'z'
 Subject length lower bound = 6
@@ -3814,7 +3814,7 @@ Callout 2: last capture = 0
  0: abcxyz
 
 /(?<=(abc)(?C))xyz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max lookbehind = 3
 First code unit = 'x'
 Last code unit = 'z'
@@ -3828,7 +3828,7 @@ Callout 0: last capture = 1
  1: abc
 
 /a(b+)(c*)(?C1)/I
-Capturing subpattern count = 2
+Capture group count = 2
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -3840,7 +3840,7 @@ Callout data = 1
 No match
 
 /a(b+?)(c*?)(?C1)/I
-Capturing subpattern count = 2
+Capture group count = 2
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -3866,25 +3866,25 @@ Callout data = 1
 No match
 
 /(?C)abc/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /(?C)^abc/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
 Subject length lower bound = 3
 
 /(?C)a|b/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b 
 Subject length lower bound = 1
 
 /a|(b)(?C)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Subject length lower bound = 1
     b
@@ -3894,7 +3894,7 @@ Subject length lower bound = 1
  1: b
 
 /x(ab|(bc|(de|(?R))))/I
-Capturing subpattern count = 3
+Capture group count = 3
 First code unit = 'x'
 Subject length lower bound = 3
     xab
@@ -3924,7 +3924,7 @@ Subject length lower bound = 3
 No match
 
 /^([^()]|\((?1)*\))*$/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Compile options: <none>
 Overall options: anchored
@@ -3943,7 +3943,7 @@ Subject length lower bound = 0
 No match
 
 /^>abc>([^()]|\((?1)*\))*<xyz<$/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = '>'
@@ -3970,7 +3970,7 @@ Subject length lower bound = 10
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -3988,13 +3988,13 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
-Capturing subpattern count = 2
+Capture group count = 2
 Compile options: <none>
 Overall options: anchored
 Starting code units: ( - 0 1 2 3 4 5 6 7 8 9 
@@ -4014,7 +4014,7 @@ Subject length lower bound = 1
 No match
 
 /^(x(y|(?1){2})z)/I
-Capturing subpattern count = 2
+Capture group count = 2
 Compile options: <none>
 Overall options: anchored
 First code unit = 'x'
@@ -4034,7 +4034,7 @@ No match
 No match
 
 /((< (?: (?(R) \d++  | [^<>]*+) | (?2)) * >))/Ix
-Capturing subpattern count = 2
+Capture group count = 2
 Options: extended
 First code unit = '<'
 Last code unit = '>'
@@ -4074,7 +4074,7 @@ Failed: error 115 at offset 3: reference to non-existent subpattern
 Failed: error 114 at offset 10: missing closing parenthesis
 
 /^(abc)def(?1)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -4084,7 +4084,7 @@ Subject length lower bound = 9
  1: abc
 
 /^(a|b|c)=(?1)+/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 Starting code units: a b c 
@@ -4100,7 +4100,7 @@ Subject length lower bound = 2
  1: a
 
 /^(a|b|c)=((?1))+/I
-Capturing subpattern count = 2
+Capture group count = 2
 Compile options: <none>
 Overall options: anchored
 Starting code units: a b c 
@@ -4134,8 +4134,8 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   longername2   2
   name1         1
 First code unit = 'a'
@@ -4168,8 +4168,8 @@ Subject length lower bound = 4
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 3
-Named capturing subpatterns:
+Capture group count = 3
+Named capture groups:
   a   3
   c   1
   d   2
@@ -4193,18 +4193,18 @@ Subject length lower bound = 4
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   a   1
 First code unit = 'a'
 Last code unit = 'd'
 Subject length lower bound = 10
 
 /^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
-Capturing subpattern count = 4
+Capture group count = 4
 Max back reference = 4
-Named capturing subpatterns:
+Named capture groups:
   four    4
   one     1
   three   3
@@ -4240,7 +4240,7 @@ Subject length lower bound = 0
 No match
 
 /((?(R)a|b))\1(?1)?/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Subject length lower bound = 2
   bb
@@ -4251,21 +4251,21 @@ Subject length lower bound = 2
  1: b
 
 /(.*)a/Is
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: dotall
 Overall options: anchored dotall
 Last code unit = 'a'
 Subject length lower bound = 1
 
 /(.*)a\1/Is
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Options: dotall
 Last code unit = 'a'
 Subject length lower bound = 1
 
 /(.*)a(b)\2/Is
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 2
 Compile options: dotall
 Overall options: anchored dotall
@@ -4273,35 +4273,35 @@ Last code unit = 'b'
 Subject length lower bound = 3
 
 /((.*)a|(.*)b)z/Is
-Capturing subpattern count = 3
+Capture group count = 3
 Compile options: dotall
 Overall options: anchored dotall
 Last code unit = 'z'
 Subject length lower bound = 2
 
 /((.*)a|(.*)b)z\1/Is
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 1
 Options: dotall
 Last code unit = 'z'
 Subject length lower bound = 3
 
 /((.*)a|(.*)b)z\2/Is
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 2
 Options: dotall
 Last code unit = 'z'
 Subject length lower bound = 2
 
 /((.*)a|(.*)b)z\3/Is
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 3
 Options: dotall
 Last code unit = 'z'
 Subject length lower bound = 2
 
 /((.*)a|^(.*)b)z\3/Is
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 3
 Compile options: dotall
 Overall options: anchored dotall
@@ -4309,21 +4309,21 @@ Last code unit = 'z'
 Subject length lower bound = 2
 
 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
-Capturing subpattern count = 31
+Capture group count = 31
 May match empty string
 Compile options: dotall
 Overall options: anchored dotall
 Subject length lower bound = 0
 
 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
-Capturing subpattern count = 31
+Capture group count = 31
 Max back reference = 31
 May match empty string
 Options: dotall
 Subject length lower bound = 0
 
 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
-Capturing subpattern count = 32
+Capture group count = 32
 Max back reference = 32
 May match empty string
 Options: dotall
@@ -4341,7 +4341,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: no_auto_capture
 First code unit = 'a'
 Last code unit = 'c'
@@ -4361,8 +4361,8 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   one   1
 Options: no_auto_capture
 First code unit = 'a'
@@ -4384,8 +4384,8 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   named   1
 Options: no_auto_capture
 First code unit = 'a'
@@ -4393,7 +4393,7 @@ Last code unit = 'c'
 Subject length lower bound = 3
 
 /(aaa(?C1)bbb|ab)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 2
@@ -4421,8 +4421,8 @@ Callout data = -1
 No match
 
 /ab(?P<one>cd)ef(?P<two>gh)/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   one   1
   two   2
 First code unit = 'a'
@@ -4461,8 +4461,8 @@ Copy substring 'three' failed (-49): unknown substring
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   Tes    1
   Test   2
 May match empty string
@@ -4478,16 +4478,16 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   Tes    2
   Test   1
 May match empty string
 Subject length lower bound = 0
 
 /(?P<Z>zz)(?P<A>aa)/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   A   2
   Z   1
 First code unit = 'z'
@@ -4511,8 +4511,8 @@ Failed: error 143 at offset 16: two named subpatterns have the same name (PCRE2_
 Failed: error 143 at offset 31: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
 
 "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
-Capturing subpattern count = 3
-Named capturing subpatterns:
+Capture group count = 3
+Named capture groups:
   elem   2
 First code unit = '['
 Last code unit = ']'
@@ -4527,8 +4527,8 @@ Subject length lower bound = 3
 No match
 
 "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
-Capturing subpattern count = 3
-Named capturing subpatterns:
+Capture group count = 3
+Named capture groups:
   elem   2
 First code unit = '['
 Last code unit = ']'
@@ -4556,7 +4556,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Subject length lower bound = 0
 
@@ -4575,7 +4575,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Subject length lower bound = 0
 
@@ -4605,7 +4605,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Subject length lower bound = 0
 
@@ -4638,7 +4638,7 @@ Subject length lower bound = 0
 ------------------------------------------------------------------
 
 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
-Capturing subpattern count = 3
+Capture group count = 3
 Options: caseless
 Last code unit = 'g' (caseless)
 Subject length lower bound = 8
@@ -4647,7 +4647,7 @@ Subject length lower bound = 8
  1: Baby Bjorn Active Carrier - With free SHIPPING!!
 
 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
-Capturing subpattern count = 3
+Capture group count = 3
 Options: caseless
 Last code unit = 'g' (caseless)
 Subject length lower bound = 8
@@ -4664,7 +4664,7 @@ Subject length lower bound = 8
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'b'
 Subject length lower bound = 1
 
@@ -4682,7 +4682,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Last code unit = 'c'
 Subject length lower bound = 1
 
@@ -4697,7 +4697,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'f'
 Subject length lower bound = 6
@@ -4719,7 +4719,7 @@ Subject length lower bound = 6
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: auto_callout
 First code unit = 'a'
 Last code unit = 'e'
@@ -4754,7 +4754,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: auto_callout
 Starting code units: a b 
 Last code unit = 'b'
@@ -4797,7 +4797,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: auto_callout
 Starting code units: a b 
 Last code unit = 'b'
@@ -4840,7 +4840,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: auto_callout
 First code unit = 'a'
 Last code unit = 'b'
@@ -4897,7 +4897,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: auto_callout
 Starting code units: a d 
 Last code unit = 'x'
@@ -4971,7 +4971,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: auto_callout
 Starting code units: a d 
 Last code unit = 'x'
@@ -5019,7 +5019,7 @@ Subject length lower bound = 4
 No match
 
 /(ab|cd){3,4}/I,auto_callout
-Capturing subpattern count = 1
+Capture group count = 1
 Options: auto_callout
 Starting code units: a c 
 Subject length lower bound = 6
@@ -5111,7 +5111,7 @@ Subject length lower bound = 6
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: auto_callout
 Starting code units: a b x 
 Subject length lower bound = 2
@@ -5161,7 +5161,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: auto_callout
 Starting code units: a b x 
 Subject length lower bound = 2
@@ -5262,7 +5262,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: auto_callout
 Starting code units: a b x 
 Last code unit = '3'
@@ -5294,7 +5294,7 @@ Subject length lower bound = 11
  1: aac
 
 /\b.*/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 May match empty string
 Subject length lower bound = 0
@@ -5302,7 +5302,7 @@ Subject length lower bound = 0
  0:  cd
 
 /\b.*/Is
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 May match empty string
 Options: dotall
@@ -5311,14 +5311,14 @@ Subject length lower bound = 0
  0:  cd
 
 /(?!.bcd).*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
   Xbcd12345
  0: bcd12345
 
 /abcde/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'e'
 Subject length lower bound = 5
@@ -5337,7 +5337,7 @@ Partial match: abc
 No match
 
 "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
-Capturing subpattern count = 3
+Capture group count = 3
 Compile options: <none>
 Overall options: anchored
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
@@ -5393,31 +5393,31 @@ No match
 No match
 
 /0{0,2}ABC/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 0 A 
 Last code unit = 'C'
 Subject length lower bound = 3
 
 /\d{3,}ABC/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
 Last code unit = 'C'
 Subject length lower bound = 6
 
 /\d*ABC/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 0 1 2 3 4 5 6 7 8 9 A 
 Last code unit = 'C'
 Subject length lower bound = 3
 
 /[abc]+DE/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b c 
 Last code unit = 'E'
 Subject length lower bound = 3
 
 /[abc]?123/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 1 a b c 
 Last code unit = '3'
 Subject length lower bound = 3
@@ -5435,7 +5435,7 @@ Partial match: c12
  0: c123
 
 /^(?:\d){3,5}X/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
@@ -5462,7 +5462,7 @@ No match
 No match
 
 "<(\w+)/?>(.)*</(\1)>"Igms
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 1
 Options: dotall multiline
 First code unit = '<'
@@ -5475,7 +5475,7 @@ Subject length lower bound = 7
  3: seite
 
 /line\nbreak/I
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 First code unit = 'l'
 Last code unit = 'k'
@@ -5486,7 +5486,7 @@ Subject length lower bound = 10
  0: line\x0abreak
 
 /line\nbreak/I,firstline
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 Options: firstline
 First code unit = 'l'
@@ -5499,7 +5499,7 @@ Subject length lower bound = 10
 No match
 
 /line\nbreak/Im,firstline
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 Options: firstline multiline
 First code unit = 'l'
@@ -5512,7 +5512,7 @@ Subject length lower bound = 10
 No match
 
 /(?i)(?-i)AbCd/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'A'
 Last code unit = 'd'
 Subject length lower bound = 4
@@ -5532,7 +5532,7 @@ Failed: error 105 at offset 9: number too big in {} quantifier
 Failed: error 105 at offset 11: number too big in {} quantifier
 
 "(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a' (caseless)
 Last code unit = 'B'
@@ -5542,9 +5542,9 @@ Subject length lower bound = 15
  1: k
 
 "(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B"I
-Capturing subpattern count = 12
+Capture group count = 12
 Max back reference = 11
-Named capturing subpatterns:
+Named capture groups:
   n0    1
   n1    2
   n10  11
@@ -5576,7 +5576,7 @@ Subject length lower bound = 15
 12: l
 
 "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
-Capturing subpattern count = 12
+Capture group count = 12
 Max back reference = 11
 First code unit = 'a'
 Last code unit = 'B'
@@ -5597,8 +5597,8 @@ Subject length lower bound = 15
 12: l
 
 "(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)"I
-Capturing subpattern count = 101
-Named capturing subpatterns:
+Capture group count = 101
+Named capture groups:
   name0     1
   name1     2
   name10   11
@@ -5722,7 +5722,7 @@ Matched, but too many substrings
 14: a
 
 "(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)"I
-Capturing subpattern count = 101
+Capture group count = 101
 First code unit = 'a'
 Last code unit = 'a'
 Subject length lower bound = 101
@@ -5745,7 +5745,7 @@ Matched, but too many substrings
 14: a
 
 /[^()]*(?:\((?R)\)[^()]*)*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     (this(and)that
@@ -5756,7 +5756,7 @@ Subject length lower bound = 0
  0: (this(and)that)stuff
 
 /[^()]*(?:\((?>(?R))\)[^()]*)*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     (this(and)that
@@ -5765,7 +5765,7 @@ Subject length lower bound = 0
  0: (this(and)that)
 
 /[^()]*(?:\((?R)\))*[^()]*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     (this(and)that
@@ -5774,7 +5774,7 @@ Subject length lower bound = 0
  0: (this(and)that)
 
 /(?:\((?R)\))*[^()]*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     (this(and)that
@@ -5785,7 +5785,7 @@ Subject length lower bound = 0
  0: ((this))
 
 /(?:\((?R)\))|[^()]*/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     (this(and)that
@@ -5798,7 +5798,7 @@ Subject length lower bound = 0
  0: ((this))
 
 /\x{0000ff}/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \xff
 Subject length lower bound = 1
 
@@ -5806,8 +5806,8 @@ Subject length lower bound = 1
 Failed: error 143 at offset 18: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
 
 /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
-Capturing subpattern count = 3
-Named capturing subpatterns:
+Capture group count = 3
+Named capture groups:
   A   2
   A   3
 Compile options: dupnames
@@ -5834,8 +5834,8 @@ Copy substring 'Z' failed (-49): unknown substring
   C a1 (2) A (non-unique)
 
 /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/I,dupnames
-Capturing subpattern count = 3
-Named capturing subpatterns:
+Capture group count = 3
+Named capture groups:
   a   1
   a   3
   b   2
@@ -5844,8 +5844,8 @@ Options: dupnames
 Subject length lower bound = 0
 
 /^(?P<A>a)(?P<A>b)/I,dupnames
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   A   1
   A   2
 Compile options: dupnames
@@ -5859,8 +5859,8 @@ Subject length lower bound = 2
   C a (1) A (non-unique)
 
 /^(?P<A>a)(?P<A>b)|cd/I,dupnames
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   A   1
   A   2
 Options: dupnames
@@ -5876,8 +5876,8 @@ Subject length lower bound = 2
 Copy substring 'A' failed (-55): requested value is not set
 
 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
-Capturing subpattern count = 4
-Named capturing subpatterns:
+Capture group count = 4
+Named capture groups:
   A   1
   A   2
   A   3
@@ -5894,8 +5894,8 @@ Subject length lower bound = 2
   C ef (2) A (non-unique)
 
 /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
-Capturing subpattern count = 3
-Named capturing subpatterns:
+Capture group count = 3
+Named capture groups:
   A   2
   A   3
 Compile options: dupnames
@@ -5922,8 +5922,8 @@ Get substring 'Z' failed (-49): unknown substring
   G a1 (2) A (non-unique)
 
 /^(?P<A>a)(?P<A>b)/I,dupnames
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   A   1
   A   2
 Compile options: dupnames
@@ -5937,8 +5937,8 @@ Subject length lower bound = 2
   G a (1) A (non-unique)
 
 /^(?P<A>a)(?P<A>b)|cd/I,dupnames
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   A   1
   A   2
 Options: dupnames
@@ -5954,8 +5954,8 @@ Subject length lower bound = 2
 Get substring 'A' failed (-55): requested value is not set
 
 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
-Capturing subpattern count = 4
-Named capturing subpatterns:
+Capture group count = 4
+Named capture groups:
   A   1
   A   2
   A   3
@@ -5972,8 +5972,8 @@ Subject length lower bound = 2
   G ef (2) A (non-unique)
 
 /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
-Capturing subpattern count = 3
-Named capturing subpatterns:
+Capture group count = 3
+Named capture groups:
   A   2
   A   3
 Compile options: <none>
@@ -6001,8 +6001,8 @@ Failed: error 143 at offset 38: two named subpatterns have the same name (PCRE2_
 # a random value.
 
 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
-Capturing subpattern count = 4
-Named capturing subpatterns:
+Capture group count = 4
+Named capture groups:
   A   1
   B   2
   B   3
@@ -6023,9 +6023,9 @@ Subject length lower bound = 6
   C d (1) C (group 4)
 
 /^(?P<A>a)?(?(A)a|b)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   A   1
 Compile options: <none>
 Overall options: anchored
@@ -6040,9 +6040,9 @@ Subject length lower bound = 1
 No match
 
 /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   ZZ   1
 Last code unit = 'X'
 Subject length lower bound = 2
@@ -6057,9 +6057,9 @@ Failed: error 124 at offset 7: missing closing parenthesis for condition
 Failed: error 115 at offset 6: reference to non-existent subpattern
 
 /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   ZZ   1
 Last code unit = 'X'
 Subject length lower bound = 3
@@ -6068,9 +6068,9 @@ Subject length lower bound = 3
  1: X
 
 /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   ZZ   1
 Last code unit = 'X'
 Subject length lower bound = 3
@@ -6079,12 +6079,12 @@ Subject length lower bound = 3
  1: X
 
 /(?P<ABC/I
-Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
+Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator?)
 
 /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   A   1
 Subject length lower bound = 2
     bXXaYYaY
@@ -6095,9 +6095,9 @@ Subject length lower bound = 2
  1: X
 
 /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
-Capturing subpattern count = 10
+Capture group count = 10
 Max back reference = 10
-Named capturing subpatterns:
+Named capture groups:
   A  10
 Subject length lower bound = 2
     bXXaYYaY
@@ -6114,7 +6114,7 @@ Subject length lower bound = 2
 10: Y
 
 /\s*,\s*/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 , 
 Last code unit = ','
 Subject length lower bound = 1
@@ -6124,7 +6124,7 @@ Subject length lower bound = 1
  0: \x0c,\x0d
 
 /^abc/Im,newline=lf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 Forced newline is LF
 First code unit at start or follows newline
@@ -6147,7 +6147,7 @@ No match
 No match
 
 /^abc/Im,newline=crlf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 Forced newline is CRLF
 First code unit at start or follows newline
@@ -6162,7 +6162,7 @@ No match
 No match
 
 /^abc/Im,newline=cr
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 Forced newline is CR
 First code unit at start or follows newline
@@ -6180,7 +6180,7 @@ No match
 ** Invalid value in 'newline=bad'
 
 /.*/I,newline=lf
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Forced newline is LF
 First code unit at start or follows newline
@@ -6193,7 +6193,7 @@ Subject length lower bound = 0
  0: abc\x0d
 
 /.*/I,newline=cr
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Forced newline is CR
 First code unit at start or follows newline
@@ -6206,7 +6206,7 @@ Subject length lower bound = 0
  0: abc
 
 /.*/I,newline=crlf
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Forced newline is CRLF
 First code unit at start or follows newline
@@ -6219,7 +6219,7 @@ Subject length lower bound = 0
  0: abc
 
 /\w+(.)(.)?def/Is
-Capturing subpattern count = 2
+Capture group count = 2
 Options: dotall
 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 
@@ -6237,8 +6237,8 @@ Subject length lower bound = 5
  2: \x0a
 
 /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   B   1
 Starting code units: 0 1 2 3 4 5 6 7 8 9 
 Last code unit = '.'
@@ -6250,7 +6250,7 @@ Subject length lower bound = 7
  ()()()()()()()()()()()()()()()()()()()()
  ()()()()()()()()()()()()()()()()()()()()
  (.(.))/Ix
-Capturing subpattern count = 102
+Capture group count = 102
 Options: extended
 Subject length lower bound = 2
     XY\=ovector=133
@@ -6359,42 +6359,42 @@ Subject length lower bound = 2
 102: Y
 
 /(a*b|(?i:c*(?-i)d))/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: C a b c d 
 Subject length lower bound = 1
 
 /()[ab]xyz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Last code unit = 'z'
 Subject length lower bound = 4
 
 /(|)[ab]xyz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Last code unit = 'z'
 Subject length lower bound = 4
 
 /(|c)[ab]xyz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b c 
 Last code unit = 'z'
 Subject length lower bound = 4
 
 /(|c?)[ab]xyz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b c 
 Last code unit = 'z'
 Subject length lower bound = 4
 
 /(d?|c?)[ab]xyz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b c d 
 Last code unit = 'z'
 Subject length lower bound = 4
 
 /(d?|c)[ab]xyz/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b c d 
 Last code unit = 'z'
 Subject length lower bound = 4
@@ -6409,7 +6409,7 @@ Subject length lower bound = 4
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: a b 
@@ -6426,7 +6426,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: a b 
@@ -6443,7 +6443,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Starting code units: a b 
@@ -6460,7 +6460,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
@@ -6482,7 +6482,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: caseless
 Overall options: anchored caseless
 Starting code units: A a 
@@ -6492,24 +6492,26 @@ Subject length lower bound = 2
  0: aaaA5
     aaaa5
  0: aaaa5
+    a5 
+ 0: a5
 
 /(a*|b*)[cd]/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b c d 
 Subject length lower bound = 1
 
 /(a+|b*)[cd]/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b c d 
 Subject length lower bound = 1
 
 /(a*|b+)[cd]/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b c d 
 Subject length lower bound = 1
 
 /(a+|b+)[cd]/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Subject length lower bound = 2
 
@@ -6521,7 +6523,7 @@ Subject length lower bound = 2
  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
  )))
 /Ix
-Capturing subpattern count = 203
+Capture group count = 203
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -7138,8 +7140,8 @@ Matched, but too many substrings
 ------------------------------------------------------------------
 
 /(?P<abc>x)(?P<xyz>y)/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   abc   1
   xyz   2
 First code unit = 'x'
@@ -7153,8 +7155,8 @@ Subject length lower bound = 2
   C y (1) xyz (group 2)
 
 /(?<abc>x)(?'xyz'y)/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   abc   1
   xyz   2
 First code unit = 'x'
@@ -7168,10 +7170,10 @@ Subject length lower bound = 2
   C y (1) xyz (group 2)
 
 /(?<abc'x)(?'xyz'y)/I
-Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator)
+Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator?)
 
 /(?<abc>x)(?'xyz>y)/I
-Failed: error 142 at offset 15: syntax error in subpattern name (missing terminator)
+Failed: error 142 at offset 15: syntax error in subpattern name (missing terminator?)
 
 /(?P'abc'x)(?P<xyz>y)/I
 Failed: error 141 at offset 3: unrecognized character after (?P
@@ -7364,9 +7366,9 @@ No match
 ------------------------------------------------------------------
 
 /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
-Capturing subpattern count = 4
+Capture group count = 4
 Max back reference = 4
-Named capturing subpatterns:
+Named capture groups:
   four    4
   one     1
   three   3
@@ -7402,7 +7404,7 @@ Subject length lower bound = 0
 No match
 
 /(?=(\w+))\1:/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 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 
@@ -7413,9 +7415,9 @@ Subject length lower bound = 2
  1: abcd
 
 /(?=(?'abc'\w+))\k<abc>:/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   abc   1
 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 
@@ -7450,7 +7452,7 @@ No match
 No match
 
 /(?(<bc))/
-Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator)
+Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator?)
 
 /(?(''))/
 Failed: error 162 at offset 4: subpattern name expected
@@ -7474,10 +7476,10 @@ Failed: error 115 at offset 4: reference to non-existent subpattern
 Failed: error 115 at offset 27: reference to non-existent subpattern
 
 /^(?(DEFINE) abc | xyz ) /x
-Failed: error 154 at offset 4: DEFINE group contains more than one branch
+Failed: error 154 at offset 4: DEFINE subpattern contains more than one branch
 
 /(?(DEFINE) abc) xyz/Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'x'
 Last code unit = 'z'
@@ -7621,8 +7623,8 @@ No match
 No match
 
 /(?&abc)X(?<abc>P)/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   abc   1
 Last code unit = 'P'
 Subject length lower bound = 3
@@ -7631,8 +7633,8 @@ Subject length lower bound = 3
  1: P
 
 /(?1)X(?<abc>P)/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   abc   1
 Last code unit = 'P'
 Subject length lower bound = 3
@@ -7933,7 +7935,7 @@ Failed: error 115 at offset 6: reference to non-existent subpattern
 No match
 
 /\g{A/
-Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator)
+Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
 
 /(?|(abc)|(xyz))/B
 ------------------------------------------------------------------
@@ -8390,10 +8392,10 @@ No match
 Failed: error 166 at offset 7: (*MARK) must have an argument
 
 /(?i:A{1,}\6666666666)/
-Failed: error 161 at offset 19: group number is too big
+Failed: error 161 at offset 19: subpattern number is too big
 
 /\g6666666666/
-Failed: error 161 at offset 7: group number is too big
+Failed: error 161 at offset 7: subpattern number is too big
 
 /[\g6666666666]/B
 ------------------------------------------------------------------
@@ -8524,7 +8526,7 @@ No match
 No match
 
 /a\Rb/I,bsr=anycrlf
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 First code unit = 'a'
 Last code unit = 'b'
@@ -8542,7 +8544,7 @@ No match
 No match
 
 /a\Rb/I,bsr=unicode
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 First code unit = 'a'
 Last code unit = 'b'
@@ -8559,7 +8561,7 @@ Subject length lower bound = 3
  0: a\x0bb
 
 /a\R?b/I,bsr=anycrlf
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 First code unit = 'a'
 Last code unit = 'b'
@@ -8577,7 +8579,7 @@ No match
 No match
 
 /a\R?b/I,bsr=unicode
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 First code unit = 'a'
 Last code unit = 'b'
@@ -8594,7 +8596,7 @@ Subject length lower bound = 2
  0: a\x0bb
 
 /a\R{2,4}b/I,bsr=anycrlf
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 First code unit = 'a'
 Last code unit = 'b'
@@ -8612,7 +8614,7 @@ No match
 No match
 
 /a\R{2,4}b/I,bsr=unicode
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 First code unit = 'a'
 Last code unit = 'b'
@@ -8632,7 +8634,7 @@ Subject length lower bound = 4
 No match
 
 /(*BSR_ANYCRLF)a\Rb/I
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 First code unit = 'a'
 Last code unit = 'b'
@@ -8643,7 +8645,7 @@ Subject length lower bound = 3
  0: a\x0db
 
 /(*BSR_UNICODE)a\Rb/I
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 First code unit = 'a'
 Last code unit = 'b'
@@ -8652,7 +8654,7 @@ Subject length lower bound = 3
  0: a\x85b
 
 /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 Forced newline is CRLF
 First code unit = 'a'
@@ -8664,7 +8666,7 @@ Subject length lower bound = 3
  0: a\x0db
 
 /(*CRLF)(*BSR_UNICODE)a\Rb/I
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 Forced newline is CRLF
 First code unit = 'a'
@@ -8674,7 +8676,7 @@ Subject length lower bound = 3
  0: a\x85b
 
 /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 Forced newline is CR
 First code unit = 'a'
@@ -8774,7 +8776,7 @@ No match
     cat
 No match
 
-/(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/(\3)(\1)(a)/allow_empty_class,match_unset_backref,dupnames
     cat
  0: a
  1: 
@@ -8785,7 +8787,7 @@ No match
     The ACTA] comes
  0: TA]
 
-/TA]/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/TA]/allow_empty_class,match_unset_backref,dupnames
     The ACTA] comes
  0: TA]
 
@@ -8833,22 +8835,22 @@ Failed: error 106 at offset 4: missing terminating ] for character class
 /a[^]b/
 Failed: error 106 at offset 5: missing terminating ] for character class
 
-/a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[]b/allow_empty_class,match_unset_backref,dupnames
 \= Expect no match
     ab
 No match
 
-/a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[]+b/allow_empty_class,match_unset_backref,dupnames
 \= Expect no match
     ab
 No match
 
-/a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[]*+b/allow_empty_class,match_unset_backref,dupnames
 \= Expect no match
     ab
 No match
 
-/a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[^]b/allow_empty_class,match_unset_backref,dupnames
     aXb
  0: aXb
     a\nb
@@ -8857,7 +8859,7 @@ No match
     ab
 No match
 
-/a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/a[^]+b/allow_empty_class,match_unset_backref,dupnames
     aXb
  0: aXb
     a\nX\nXb
@@ -8893,12 +8895,12 @@ No match
 Failed: error 109 at offset 8: quantifier does not follow a repeatable item
 
 /(abc|pqr|123){0}[xyz]/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: x y z 
 Subject length lower bound = 1
 
 /(?(?=.*b)b|^)/I,auto_callout
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: auto_callout
 Subject length lower bound = 0
@@ -8938,11 +8940,11 @@ Subject length lower bound = 0
  0: b
 
 /(?(?=b).*b|^d)/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /(?(?=.*b).*b|^d)/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /xyz/auto_callout
@@ -9369,21 +9371,17 @@ Partial match: abc12
     xyzabc123pqr
  0: 123
     xyzabc12\=ps
-Partial match: abc12
-               <<<
+Partial match: 12
     xyzabc12\=ph
-Partial match: abc12
-               <<<
+Partial match: 12
 
 /\babc\b/
     +++abc+++
  0: abc
     +++ab\=ps
-Partial match: +ab
-               <
+Partial match: ab
     +++ab\=ph
-Partial match: +ab
-               <
+Partial match: ab
 
 /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/B
 ------------------------------------------------------------------
@@ -9680,48 +9678,48 @@ Failed: error 115 at offset 8: reference to non-existent subpattern
 Failed: error 125 at offset 0: lookbehind assertion is not fixed length
 
 /(a|bc)\1/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Starting code units: a b 
 Subject length lower bound = 2
 
 /(a|bc)\1{2,3}/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Starting code units: a b 
 Subject length lower bound = 3
 
 /(a|bc)(?1)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Subject length lower bound = 2
 
 /(a|b\1)(a|b\1)/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 1
 Starting code units: a b 
 Subject length lower bound = 2
 
 /(a|b\1){2}/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Starting code units: a b 
 Subject length lower bound = 2
 
 /(a|bbbb\1)(a|bbbb\1)/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 1
 Starting code units: a b 
 Subject length lower bound = 2
 
 /(a|bbbb\1){2}/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Starting code units: a b 
 Subject length lower bound = 2
 
 /^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'F'
@@ -9729,31 +9727,31 @@ Last code unit = ':'
 Subject length lower bound = 22
 
 /<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/Iis
-Capturing subpattern count = 11
+Capture group count = 11
 Options: caseless dotall
 First code unit = '<'
 Last code unit = '>'
 Subject length lower bound = 47
 
 "(?>.*/)foo"I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'o'
 Subject length lower bound = 4
 
 /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 Last code unit = '-'
 Subject length lower bound = 8
 
 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/Ii
-Capturing subpattern count = 1
+Capture group count = 1
 Options: caseless
 Starting code units: A B C a b c 
 Subject length lower bound = 1
 
 /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: c d 
 Last code unit = 'b'
 Subject length lower bound = 41
@@ -9763,7 +9761,7 @@ Subject length lower bound = 41
  (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
                                  # quote, otherwise match up to next space
 /Iisx
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 1
 Options: caseless dotall extended
 First code unit = '<'
@@ -9779,7 +9777,7 @@ Subject length lower bound = 9
   [0-9a-f]{1,4} $             # final hex number at end of string
   (?(1)|.)                    # check that there was an empty component
   /Iix
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Compile options: caseless extended
 Overall options: anchored caseless extended
@@ -9787,8 +9785,8 @@ Last code unit = ':'
 Subject length lower bound = 2
 
 /(?|(?<a>A)|(?<a>B))/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   a   1
 Starting code units: A B 
 Subject length lower bound = 1
@@ -9807,9 +9805,9 @@ Failed: error 165 at offset 16: different names for subpatterns of the same numb
 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
     b(?<quote> (?<apostrophe>')|(?<realquote>")) )
     (?('quote')[a-z]+|[0-9]+)/Ix,dupnames
-Capturing subpattern count = 6
+Capture group count = 6
 Max back reference = 4
-Named capturing subpatterns:
+Named capture groups:
   apostrophe   2
   apostrophe   5
   quote        1
@@ -9869,9 +9867,9 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 4
+Capture group count = 4
 Max back reference = 4
-Named capturing subpatterns:
+Named capture groups:
   D   4
   D   1
 Compile options: dupnames extended
@@ -9917,9 +9915,9 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 4
+Capture group count = 4
 Max back reference = 4
-Named capturing subpatterns:
+Named capture groups:
   A   1
   A   4
 Options: dupnames extended
@@ -9971,17 +9969,17 @@ Partial match: abca
     xxxxabcde\=ph
 Partial match: abcde
 
-/(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
+/(\3)(\1)(a)/allow_empty_class,match_unset_backref,dupnames
     cat
  0: a
  1: 
  2: 
  3: a
 
-/(\3)(\1)(a)/I,alt_bsux,allow_empty_class,match_unset_backref,dupnames
-Capturing subpattern count = 3
+/(\3)(\1)(a)/I,allow_empty_class,match_unset_backref,dupnames
+Capture group count = 3
 Max back reference = 3
-Options: alt_bsux allow_empty_class dupnames match_unset_backref
+Options: allow_empty_class dupnames match_unset_backref
 Last code unit = 'a'
 Subject length lower bound = 1
     cat
@@ -9991,7 +9989,7 @@ Subject length lower bound = 1
  3: a
 
 /(\3)(\1)(a)/I
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 3
 Last code unit = 'a'
 Subject length lower bound = 3
@@ -10000,8 +9998,8 @@ Subject length lower bound = 3
 No match
 
 /i(?(DEFINE)(?<s>a))/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   s   1
 First code unit = 'i'
 Subject length lower bound = 1
@@ -10009,7 +10007,7 @@ Subject length lower bound = 1
  0: i
 
 /()i(?(1)a)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'i'
 Subject length lower bound = 1
@@ -10401,8 +10399,7 @@ No match
 
 /(?<=abc)def/
     abc\=ph
-Partial match: abc
-               <<<
+Partial match: 
 
 /abc$/
     abc
@@ -10507,7 +10504,7 @@ Failed: error 168 at offset 3: \c must be followed by a printable ASCII characte
 ------------------------------------------------------------------
 
 /(?P<abn>(?P=abn)(?<badstufxxx)/B
-Failed: error 142 at offset 29: syntax error in subpattern name (missing terminator)
+Failed: error 142 at offset 29: syntax error in subpattern name (missing terminator?)
 
 /(?P<abn>(?P=axn)xxx)/B
 Failed: error 115 at offset 12: reference to non-existent subpattern
@@ -10619,13 +10616,13 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = '4'
 Subject length lower bound = 5
 
 /([abc])++1234/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b c 
 Last code unit = '4'
 Subject length lower bound = 5
@@ -10634,153 +10631,153 @@ Subject length lower bound = 5
 Failed: error 125 at offset 0: lookbehind assertion is not fixed length
 
 /(^ab)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
 Subject length lower bound = 2
 
 /(^ab)++/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
 Subject length lower bound = 2
 
 /(^ab|^)+/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 0
 
 /(^ab|^)++/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 0
 
 /(?:^ab)/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
 Subject length lower bound = 2
 
 /(?:^ab)++/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
 Subject length lower bound = 2
 
 /(?:^ab|^)+/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 0
 
 /(?:^ab|^)++/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 0
 
 /(.*ab)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit at start or follows newline
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /(.*ab)++/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit at start or follows newline
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /(.*ab|.*)+/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 First code unit at start or follows newline
 Subject length lower bound = 0
 
 /(.*ab|.*)++/I
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 First code unit at start or follows newline
 Subject length lower bound = 0
 
 /(?:.*ab)/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit at start or follows newline
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /(?:.*ab)++/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit at start or follows newline
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /(?:.*ab|.*)+/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 First code unit at start or follows newline
 Subject length lower bound = 0
 
 /(?:.*ab|.*)++/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 First code unit at start or follows newline
 Subject length lower bound = 0
 
 /(?=a)[bcd]/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Subject length lower bound = 1
 
 /((?=a))[bcd]/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /((?=a))+[bcd]/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /((?=a))++[bcd]/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Subject length lower bound = 1
 
 /(?=a+)[bcd]/Ii
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 First code unit = 'a' (caseless)
 Subject length lower bound = 1
 
 /(?=a+?)[bcd]/Ii
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 First code unit = 'a' (caseless)
 Subject length lower bound = 1
 
 /(?=a++)[bcd]/Ii
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 First code unit = 'a' (caseless)
 Subject length lower bound = 1
 
 /(?=a{3})[bcd]/Ii
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless
 First code unit = 'a' (caseless)
 Last code unit = 'a' (caseless)
-Subject length lower bound = 1
+Subject length lower bound = 2
 
 /(abc)\1+/
 
@@ -10922,22 +10919,22 @@ Matched, but too many substrings
  3: b
 
 /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/I
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Subject length lower bound = 0
 
 /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/I
-Capturing subpattern count = 2
+Capture group count = 2
 Starting code units: a b 
 Subject length lower bound = 3
 
 /(a(?2)|b)(b(?1)|a)(?1)(?2)/I
-Capturing subpattern count = 2
+Capture group count = 2
 Starting code units: a b 
 Subject length lower bound = 4
 
 /(abc)(?1)/I
-Capturing subpattern count = 1
+Capture group count = 1
 First code unit = 'a'
 Last code unit = 'c'
 Subject length lower bound = 6
@@ -11122,7 +11119,7 @@ Matched, but too many substrings
 ------------------------------------------------------------------
         Bra
         Brazero
-        AssertB
+        Assert back
         Reverse
         CBra 1
         abc
@@ -11206,20 +11203,20 @@ Latest Mark: B
 No match
 
 /\btype\b\W*?\btext\b\W*?\bjavascript\b/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 First code unit = 't'
 Last code unit = 't'
 Subject length lower bound = 18
 
 /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 Starting code units: < o t u 
 Subject length lower bound = 8
 
 /a(*SKIP)c|b(*ACCEPT)|/I,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     a
@@ -11227,9 +11224,9 @@ Subject length lower bound = 0
  0+ 
 
 /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b x 
-Subject length lower bound = 0
+Subject length lower bound = 1
     ax
  0: x
 
@@ -11245,16 +11242,17 @@ Subject length lower bound = 0
 No match
 
 /(*ACCEPT)a/I,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
+May match empty string
 Subject length lower bound = 0
     bax
  0: 
  0+ bax
 
 /z(*ACCEPT)a/I,aftertext
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'z'
-Subject length lower bound = 0
+Subject length lower bound = 1
     baxzbx
  0: z
  0+ bx
@@ -11364,6 +11362,17 @@ No match
 \= Expect no match
     aAz
 No match
+    
+/^\u{7a}/alt_bsux
+    u{7a}
+ 0: u{7a}
+\= Expect no match
+    zoo 
+No match
+
+/^\u{7a}/extra_alt_bsux
+    zoo 
+ 0: z
 
 /(?(?=c)c|d)++Y/B
 ------------------------------------------------------------------
@@ -11755,96 +11764,96 @@ Matched, but too many substrings
 # settings of the anchored and startline bits.
 
 /(?>.*?a)(?<=ba)/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 2
 Last code unit = 'a'
 Subject length lower bound = 1
 
 /(?:.*?a)(?<=ba)/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 2
 First code unit at start or follows newline
 Last code unit = 'a'
 Subject length lower bound = 1
 
 /.*?a(*PRUNE)b/I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /.*?a(*PRUNE)b/Is
-Capturing subpattern count = 0
+Capture group count = 0
 Options: dotall
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /^a(*PRUNE)b/Is
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: dotall
 Overall options: anchored dotall
 First code unit = 'a'
 Subject length lower bound = 2
 
 /.*?a(*SKIP)b/I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /(?>.*?a)b/Is
-Capturing subpattern count = 0
+Capture group count = 0
 Options: dotall
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /(?>.*?a)b/I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'b'
 Subject length lower bound = 2
 
 /(?>^a)b/Is
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: dotall
 Overall options: anchored dotall
 First code unit = 'a'
 Subject length lower bound = 2
 
 /(?>.*?)(?<=(abcd)|(wxyz))/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max lookbehind = 4
 May match empty string
 Subject length lower bound = 0
 
 /(?>.*)(?<=(abcd)|(wxyz))/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max lookbehind = 4
 May match empty string
 Subject length lower bound = 0
 
 "(?>.*)foo"I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'o'
 Subject length lower bound = 3
 
 "(?>.*?)foo"I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'o'
 Subject length lower bound = 3
 
 /(?>^abc)/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 First code unit at start or follows newline
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /(?>.*abc)/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 Last code unit = 'c'
 Subject length lower bound = 3
 
 /(?:.*abc)/Im
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 First code unit at start or follows newline
 Last code unit = 'c'
@@ -11948,11 +11957,9 @@ Callout 2: last capture = 0
 
 /(?<=123)(*MARK:xx)abc/mark
     xxxx123a\=ph
-Partial match, mark=xx: 123a
-                        <<<
+Partial match, mark=xx: a
     xxxx123a\=ps
-Partial match, mark=xx: 123a
-                        <<<
+Partial match, mark=xx: a
 
 /123\Kabc/startchar
     xxxx123a\=ph
@@ -12057,8 +12064,8 @@ No match
  0: ba
 
 /(?|(?<n>f)|(?<n>b))/I,dupnames
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   n   1
 Options: dupnames
 Starting code units: b f 
@@ -12079,9 +12086,9 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 3
+Capture group count = 3
 Max back reference = 2
-Named capturing subpatterns:
+Named capture groups:
   a   1
   a   2
 Options: dupnames
@@ -13124,7 +13131,7 @@ Subject length lower bound = 5
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b c d 
 Last code unit = 'd'
 Subject length lower bound = 1
@@ -13137,7 +13144,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b c 
 Last code unit = 'd'
 Subject length lower bound = 2
@@ -13150,7 +13157,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b c d 
 Last code unit = 'd'
 Subject length lower bound = 1
@@ -13163,7 +13170,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b c 
 Last code unit = 'd'
 Subject length lower bound = 5
@@ -13176,7 +13183,7 @@ Subject length lower bound = 5
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: a b c d 
 Last code unit = 'd'
 Subject length lower bound = 1
@@ -13254,40 +13261,40 @@ Failed: error 108 at offset 3: range out of order in character class
 Failed: error 150 at offset 5: invalid range in character class
 
 /(?<0abc>xx)/
-Failed: error 144 at offset 3: group name must start with a non-digit
+Failed: error 144 at offset 3: subpattern name must start with a non-digit
 
 /(?&1abc)xx(?<1abc>y)/
-Failed: error 144 at offset 3: group name must start with a non-digit
+Failed: error 144 at offset 3: subpattern name must start with a non-digit
 
 /(?<ab-cd>xx)/
-Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator)
+Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator?)
 
 /(?'0abc'xx)/
-Failed: error 144 at offset 3: group name must start with a non-digit
+Failed: error 144 at offset 3: subpattern name must start with a non-digit
 
 /(?P<0abc>xx)/
-Failed: error 144 at offset 4: group name must start with a non-digit
+Failed: error 144 at offset 4: subpattern name must start with a non-digit
 
 /\k<5ghj>/
-Failed: error 144 at offset 3: group name must start with a non-digit
+Failed: error 144 at offset 3: subpattern name must start with a non-digit
 
 /\k'5ghj'/
-Failed: error 144 at offset 3: group name must start with a non-digit
+Failed: error 144 at offset 3: subpattern name must start with a non-digit
 
 /\k{2fgh}/
-Failed: error 144 at offset 3: group name must start with a non-digit
+Failed: error 144 at offset 3: subpattern name must start with a non-digit
 
 /(?P=8yuki)/
-Failed: error 144 at offset 4: group name must start with a non-digit
+Failed: error 144 at offset 4: subpattern name must start with a non-digit
 
 /\g{4df}/
 Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
 
 /(?&1abc)xx(?<1abc>y)/
-Failed: error 144 at offset 3: group name must start with a non-digit
+Failed: error 144 at offset 3: subpattern name must start with a non-digit
 
 /(?P>1abc)xx(?<1abc>y)/
-Failed: error 144 at offset 4: group name must start with a non-digit
+Failed: error 144 at offset 4: subpattern name must start with a non-digit
 
 /\g'3gh'/
 Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
@@ -13296,16 +13303,16 @@ Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed,
 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
+Failed: error 144 at offset 4: subpattern name must start with a non-digit
 
 /(?('4gh')abc)/
-Failed: error 144 at offset 4: group name must start with a non-digit
+Failed: error 144 at offset 4: subpattern name must start with a non-digit
 
 /(?(4gh)abc)/
 Failed: error 124 at offset 4: missing closing parenthesis for condition
 
 /(?(R&6yh)abc)/
-Failed: error 144 at offset 5: group name must start with a non-digit
+Failed: error 144 at offset 5: subpattern name must start with a non-digit
 
 /(((a\2)|(a*)\g<-1>))*a?/B
 ------------------------------------------------------------------
@@ -13342,7 +13349,7 @@ Failed: error 144 at offset 5: group name must start with a non-digit
         Ket
         red
         \b
-        AssertB
+        Assert back
         Reverse
         \w
         Ket
@@ -13399,7 +13406,7 @@ Failed: error 133 at offset 7: parentheses are too deeply nested (stack check)
         Once
         \s*+
         Ket
-        AssertB
+        Assert back
         Reverse
         \w
         Ket
@@ -13487,7 +13494,7 @@ No match
  0+ dab
 
 /(?(VERSION>=10.0)yes|no)/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 2
     yesno
  0: yes
@@ -13506,7 +13513,7 @@ Subject length lower bound = 2
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
     yesno
@@ -13514,7 +13521,7 @@ Subject length lower bound = 0
  0+ yesno
 
 /(?(VERSION=8)yes|no){3}/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 6
     yesnononoyes
  0: nonono
@@ -13523,9 +13530,9 @@ Subject length lower bound = 6
 No match
 
 /(?:(?<VERSION>abc)|xyz)(?(VERSION)yes|no)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   VERSION   1
 Starting code units: a x 
 Subject length lower bound = 5
@@ -13553,18 +13560,17 @@ Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION con
 Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION condition
 
 /abcd/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'a'
 Last code unit = 'd'
 Subject length lower bound = 4
 
 /abcd/I,no_start_optimize
-Capturing subpattern count = 0
+Capture group count = 0
 Options: no_start_optimize
-Subject length lower bound = 0
 
 /(|ab)*?d/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a d 
 Last code unit = 'd'
 Subject length lower bound = 1
@@ -13575,9 +13581,8 @@ Subject length lower bound = 1
  0: d
 
 /(|ab)*?d/I,no_start_optimize
-Capturing subpattern count = 1
+Capture group count = 1
 Options: no_start_optimize
-Subject length lower bound = 0
    abd
  0: abd
  1: ab
@@ -13839,21 +13844,21 @@ Copy substring 1 failed (-2): partial match
 get substring list failed (-2): partial match
 
 /^abc/info
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'a'
 Subject length lower bound = 3
 
 /^abc/info,no_dotstar_anchor
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: no_dotstar_anchor
 Overall options: anchored no_dotstar_anchor
 First code unit = 'a'
 Subject length lower bound = 3
 
 /.*\d/info,auto_callout
-Capturing subpattern count = 0
+Capture group count = 0
 Options: auto_callout
 First code unit at start or follows newline
 Subject length lower bound = 1
@@ -13868,7 +13873,7 @@ Subject length lower bound = 1
 No match
 
 /.*\d/info,no_dotstar_anchor,auto_callout
-Capturing subpattern count = 0
+Capture group count = 0
 Options: auto_callout no_dotstar_anchor
 Subject length lower bound = 1
 \= Expect no match
@@ -13889,18 +13894,18 @@ Subject length lower bound = 1
 No match
 
 /.*\d/dotall,info
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: dotall
 Overall options: anchored dotall
 Subject length lower bound = 1
 
 /.*\d/dotall,no_dotstar_anchor,info
-Capturing subpattern count = 0
+Capture group count = 0
 Options: dotall no_dotstar_anchor
 Subject length lower bound = 1
 
 /(*NO_DOTSTAR_ANCHOR)(?s).*\d/info
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: no_dotstar_anchor
 Subject length lower bound = 1
@@ -14323,7 +14328,7 @@ Failed: error 125 at offset 1: lookbehind assertion is not fixed length
  0+ 
 
 /((?2){73}(?2))((?1))/info
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Subject length lower bound = 0
 
@@ -14383,8 +14388,8 @@ Failed: error 115 at offset 2: reference to non-existent subpattern
 /(?x:((?'a')) # comment (with parentheses) and | vertical
 (?-x:#not a comment (?'b')) # this is a comment ()
 (?'c')) # not a comment (?'d')/info
-Capturing subpattern count = 5
-Named capturing subpatterns:
+Capture group count = 5
+Named capture groups:
   a   2
   b   3
   c   4
@@ -14394,8 +14399,8 @@ Last code unit = ' '
 Subject length lower bound = 32
 
 /(?|(?'a')(2)(?'b')|(?'a')(?'a')(3))/I,dupnames
-Capturing subpattern count = 3
-Named capturing subpatterns:
+Capture group count = 3
+Named capture groups:
   a   1
   a   2
   b   3
@@ -14482,7 +14487,7 @@ Failed: error 162 at offset 4: subpattern name expected
 "(?J:(?|(?'R')(\k'R')|((?'R'))))"
 
 /(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
-Failed: error 161 at offset 17: group number is too big
+Failed: error 161 at offset 17: subpattern number is too big
 
 /^(?:(?(1)x|)+)+$()/B
 ------------------------------------------------------------------
@@ -14533,8 +14538,8 @@ Failed: error 162 at offset 10: subpattern name expected
 Failed: error 162 at offset 14: subpattern name expected
 
 /((?x)(?#))#(?'abc')/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
+Capture group count = 2
+Named capture groups:
   abc   2
 First code unit = '#'
 Subject length lower bound = 1
@@ -14543,8 +14548,8 @@ Subject length lower bound = 1
 Failed: error 162 at offset 9: subpattern name expected
 
 /[[:\\](?'abc')[a:]/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   abc   1
 Starting code units: : [ \ 
 Subject length lower bound = 2
@@ -14578,16 +14583,16 @@ Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by
 Failed: error 162 at offset 16: subpattern name expected
 
 /(?(?C{\Q})(?!(?'abc')))/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
+Capture group count = 1
+Named capture groups:
   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
+Capture group count = 8
 Max back reference = 8
-Named capturing subpatterns:
+Named capture groups:
   R   7
   R   8
 Duplicate name status changes
@@ -14595,39 +14600,39 @@ Last code unit = '0'
 Subject length lower bound = 65535
 
 /(?|(aaa)|(b))\g{1}/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Starting code units: a b 
-Subject length lower bound = 0
+Subject length lower bound = 1
 
 /(?|(aaa)|(b))(?1)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Subject length lower bound = 4
 
 /(?|(aaa)|(b))/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a b 
 Subject length lower bound = 1
 
 /(?|(?'a'aaa)|(?'a'b))\k'a'/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
-Named capturing subpatterns:
+Named capture groups:
   a   1
 Starting code units: a b 
-Subject length lower bound = 0
+Subject length lower bound = 1
 
 /(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/I,dupnames
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 2
-Named capturing subpatterns:
+Named capture groups:
   a   1
   a   2
 Options: dupnames
 Starting code units: a b 
 Last code unit = 'c'
-Subject length lower bound = 0
+Subject length lower bound = 5
 
 /ab{3cd/
     ab{3cd
@@ -14673,10 +14678,10 @@ No match
  0: ab
 
 /(?(8000000000/
-Failed: error 161 at offset 8: group number is too big
+Failed: error 161 at offset 8: subpattern number is too big
 
 /((?(R8000000000)))/
-Failed: error 161 at offset 9: group number is too big
+Failed: error 161 at offset 9: subpattern number is too big
 
 /0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/
 \= Expect no match
@@ -14684,7 +14689,7 @@ Failed: error 161 at offset 9: group number is too big
 No match
 
 /(?(1)()\983040\2)/
-Failed: error 161 at offset 14: group number is too big
+Failed: error 161 at offset 14: subpattern number is too big
 
 /(*LIMIT_MATCH=)abc/
 Failed: error 160 at offset 14: (*VERB) not recognized or malformed
@@ -14800,7 +14805,7 @@ No match
 /abcd/null_context
     abcd\=null_context
  0: abcd
-\= Expect error
+\= Expect error - not allowed together
     abcd\=null_context,find_limits
 ** Not allowed together: find_limits null_context
     abcd\=allusedtext,startchar
@@ -14883,7 +14888,7 @@ Failed: error -55 at offset 3 in replacement: requested value is not set
  1: AAbbaa..AAbBaa
 
 /^(o(\1{72}{\"{\\{00000059079}\d*){74}}){19}/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 1
 Compile options: <none>
 Overall options: anchored
@@ -14892,10 +14897,10 @@ Last code unit = '}'
 Subject length lower bound = 65535
 
 /((p(?'K/
-Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
+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)
+Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator?)
 
 /abc/replace=A$3123456789Z
     abc
@@ -14905,7 +14910,7 @@ Failed: error -49 at offset 3 in replacement: unknown substring
 Failed: error 187 at offset 0: lookbehind assertion is too long
 
 /(?<!a{65535})x/I
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 65535
 First code unit = 'x'
 Subject length lower bound = 1
@@ -14919,7 +14924,7 @@ Failed: error -60: match with end before start or start moved backwards is not s
 Failed: error -60: match with end before start or start moved backwards is not supported
 
 /(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
-Failed: error 148 at offset 36: subpattern name is too long (maximum 32 characters)
+Failed: error 148 at offset 36: subpattern name is too long (maximum 32 code units)
 
 /(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/
 
@@ -14941,7 +14946,7 @@ Failed: error 188 at offset 0: pattern string is longer than the limit set by th
 ((?-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
+Capture group count = 12
 May match empty string
 Options: extended
 First code unit at start or follows newline
@@ -14952,7 +14957,7 @@ Subject length lower bound = 0
 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
 a)"xI
-Capturing subpattern count = 12
+Capture group count = 12
 Max lookbehind = 2
 May match empty string
 Options: extended
@@ -14962,7 +14967,7 @@ Subject length lower bound = 0
 ((?-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 = 13
+Capture group count = 13
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -14979,14 +14984,14 @@ Failed: error 135 at offset 9: lookbehind is too complicated
 
 /\[()]{1024}/I,expand
 Expanded: ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
-Capturing subpattern count = 1024
+Capture group 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
+Capture group count = 1
 Max back reference = 1
 First code unit = 'A'
 Last code unit = 'A'
@@ -15008,7 +15013,7 @@ Subject length lower bound = 65535
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 
@@ -15026,7 +15031,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 
@@ -15044,7 +15049,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 
@@ -15062,7 +15067,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 May match empty string
 Subject length lower bound = 0
 
@@ -15510,7 +15515,7 @@ Failed: error 150 at offset 5: invalid range in character class
 ------------------------------------------------------------------
 
 /(?=.*[A-Z])/I
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Subject length lower bound = 0
 
@@ -15592,7 +15597,7 @@ Failed: error -33: bad offset value
 # complicated to find a minimum matching length.
 
 "()X|((((((((()))))))((((())))))\2())((((((\2\2)))\2)(\22((((\2\2)2))\2)))(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z+:)Z|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z((Z*(\2(Z\':))\0)i|||||||||||||||loZ\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0nte!rnal errpr\2\\21r(2\ZZZ)+:)Z!|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZernZal ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \))\ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)))\2))))((((((\2\2))))))"I
-Capturing subpattern count = 108
+Capture group count = 108
 Max back reference = 22
 Contains explicit CR or LF match
 Subject length lower bound = 1
@@ -15626,29 +15631,29 @@ Failed: error 128 at offset 11: assertion expected after (?( or (?(?C)
 Failed: error -37: callout error code
 
 /()(\g+65534)/
-Failed: error 161 at offset 11: group number is too big
+Failed: error 161 at offset 11: subpattern number is too big
 
 /()(\g+65533)/
 Failed: error 115 at offset 10: reference to non-existent subpattern
 
 /Á\x00\x00\x00\17\9a(\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\x00k\d+\x00â\80\8e\x00\x00\x00\x00\x00\2*\x00\x00\1*.){36}int^\x00\x00\bÿÿ\x00\9a(\1{50779}?)J\w2/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 2
 First code unit = \xc1
 Last code unit = '2'
 Subject length lower bound = 65535
 
 /(a)(b)\2\1\1\1\1/I
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 2
 First code unit = 'a'
 Last code unit = 'b'
 Subject length lower bound = 7
 
 /(?<a>a)(?<b>b)\g{b}\g{a}\g{a}\g{a}\g{a}(?<a>xx)(?<b>zz)/I,dupnames
-Capturing subpattern count = 4
+Capture group count = 4
 Max back reference = 4
-Named capturing subpatterns:
+Named capture groups:
   a   1
   a   3
   b   2
@@ -15816,14 +15821,14 @@ No match
 # the start of a branch.
 
 /(?(DEFINE)(a))^bc/I
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: <none>
 Overall options: anchored
 First code unit = 'b'
 Subject length lower bound = 2
 
 /(a){0}.*bc/sI
-Capturing subpattern count = 1
+Capture group count = 1
 Compile options: dotall
 Overall options: anchored dotall
 Last code unit = 'c'
@@ -15833,7 +15838,7 @@ Subject length lower bound = 2
 # no alternative branch.
 
 /(?(VERSION>=999)yes)^bc/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 Subject length lower bound = 2
@@ -15841,12 +15846,12 @@ Subject length lower bound = 2
 # This should not be anchored.
 
 /(?(VERSION>=999)yes|no)^bc/I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'c'
 Subject length lower bound = 4
 
 /(*LIMIT_HEAP=0)xxx/I
-Capturing subpattern count = 0
+Capture group count = 0
 Heap limit = 0
 First code unit = 'x'
 Last code unit = 'x'
@@ -16122,7 +16127,7 @@ Failed: error -37: callout error code
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended_more
 Starting code units: a b c 
 Subject length lower bound = 1
@@ -16134,7 +16139,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended extended_more
 Starting code units: a b c 
 Subject length lower bound = 1
@@ -16218,22 +16223,40 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Extra options: bad_escape_is_literal
 First code unit = 'N'
 Last code unit = 'c'
 Subject length lower bound = 3
 
-/[\j\x{z}\o\gA-\Nb-\g]/B,bad_escape_is_literal
+/[\j\x{z}\o\gAb\g]/B,bad_escape_is_literal
 ------------------------------------------------------------------
         Bra
-        [A-Nb-gjoxz{}]
+        [Abgjoxz{}]
         Ket
         End
 ------------------------------------------------------------------
 
 /[Q-\N]/B,bad_escape_is_literal
-Failed: error 108 at offset 4: range out of order in character class
+Failed: error 150 at offset 5: invalid range in character class
+
+/[\s-_]/bad_escape_is_literal
+Failed: error 150 at offset 3: invalid range in character class
+
+/[_-\s]/bad_escape_is_literal
+Failed: error 150 at offset 5: invalid range in character class
+
+/[\B\R\X]/B
+Failed: error 107 at offset 2: escape sequence is invalid in character class
+
+/[\B\R\X]/B,bad_escape_is_literal
+Failed: error 107 at offset 2: escape sequence is invalid in character class
+
+/[A-\BP-\RV-\X]/B
+Failed: error 107 at offset 4: escape sequence is invalid in character class
+
+/[A-\BP-\RV-\X]/B,bad_escape_is_literal
+Failed: error 107 at offset 4: escape sequence is invalid in character class
 
 # ----------------------------------------------------------------------
 
@@ -16306,7 +16329,7 @@ Failed: error 192 at offset 0: invalid option bits with PCRE2_LITERAL
  0: (*CR)abc
 
 /cat|dog/I,match_word
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 1
 Extra options: match_word
 Starting code units: c d 
@@ -16322,7 +16345,7 @@ No match
 No match
 
 /(cat)|dog/I,match_line,literal
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: literal
 Overall options: anchored literal
 Extra options: match_line
@@ -16390,7 +16413,7 @@ Failed: error 150 at offset 3: invalid range in character class
 # Perl gets the second of these wrong, giving no match.
 
 "(?<=(a))\1?b"I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Max lookbehind = 1
 Last code unit = 'b'
@@ -16403,11 +16426,11 @@ Subject length lower bound = 1
  1: a
 
 "(?=(a))\1?b"I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'a'
 Last code unit = 'b'
-Subject length lower bound = 1
+Subject length lower bound = 2
     ab
  0: ab
  1: a
@@ -16599,7 +16622,7 @@ No match
 /(?<=(?=.){4,5}x)/B
 ------------------------------------------------------------------
         Bra
-        AssertB
+        Assert back
         Reverse
         Assert
         Any
@@ -16632,21 +16655,21 @@ Failed: error 194 at offset 3: invalid hyphen in option setting
 Failed: error 194 at offset 5: invalid hyphen in option setting
 
 /(?(?=^))b/I
-Capturing subpattern count = 0
+Capture group count = 0
 Last code unit = 'b'
 Subject length lower bound = 1
     abc
  0: b
 
 /(?(?=^)|)b/I
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = 'b'
 Subject length lower bound = 1
     abc
  0: b
 
 /(?(?=^)|^)b/I
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: <none>
 Overall options: anchored
 First code unit = 'b'
@@ -16658,7 +16681,7 @@ Subject length lower bound = 1
 No match
 
 /(?(1)^|^())/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Compile options: <none>
@@ -16666,13 +16689,13 @@ Overall options: anchored
 Subject length lower bound = 0
 
 /(?(1)^())b/I
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Last code unit = 'b'
 Subject length lower bound = 1
 
 /(?(1)^())+b/I,aftertext
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Last code unit = 'b'
 Subject length lower bound = 1
@@ -16681,7 +16704,7 @@ Subject length lower bound = 1
  0+ c
 
 /(?(1)^()|^)+b/I,aftertext
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Compile options: <none>
 Overall options: anchored
@@ -16695,7 +16718,7 @@ Subject length lower bound = 1
 No match
 
 /(?(1)^()|^)*b/I,aftertext
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 First code unit = 'b'
 Subject length lower bound = 1
@@ -16710,7 +16733,7 @@ Subject length lower bound = 1
  0+ c
 
 /(?(1)^())+b/I,aftertext
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Last code unit = 'b'
 Subject length lower bound = 1
@@ -16719,7 +16742,7 @@ Subject length lower bound = 1
  0+ c
 
 /(?(1)^a()|^a)+b/I,aftertext
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Compile options: <none>
 Overall options: anchored
@@ -16734,7 +16757,7 @@ Subject length lower bound = 2
 No match
 
 /(?(1)^|^(a))+b/I,aftertext
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Compile options: <none>
 Overall options: anchored
@@ -16749,7 +16772,7 @@ Subject length lower bound = 1
 No match
 
 /(?(1)^a()|^a)*b/I,aftertext
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 Last code unit = 'b'
 Subject length lower bound = 1
@@ -16763,6 +16786,655 @@ Subject length lower bound = 1
  0: b
  0+ c
 
+/a(b)c|xyz/g,allvector,replace=<$0>
+    abcdefabcpqr\=ovector=4
+ 2: <abc>def<abc>pqr
+ 0: 6 9
+ 1: 7 8
+ 2: <unchanged>
+ 3: <unchanged>
+    abxyz\=ovector=4
+ 1: ab<xyz>
+ 0: 2 5
+ 1: <unset>
+ 2: <unchanged>
+ 3: <unchanged>
+    abcdefxyz\=ovector=4
+ 2: <abc>def<xyz>
+ 0: 6 9
+ 1: <unset>
+ 2: <unchanged>
+ 3: <unchanged>
+    
+/a(b)c|xyz/allvector
+    abcdef\=ovector=4
+ 0: abc
+ 1: b
+ 2: <unchanged>
+ 3: <unchanged>
+    abxyz\=ovector=4
+ 0: xyz
+ 1: <unset>
+ 2: <unchanged>
+ 3: <unchanged>
+
+/a(b)c|xyz/g,replace=<$0>,substitute_callout
+    abcdefabcpqr
+ 1(2) Old 0 3 "abc" New 0 5 "<abc>"
+ 2(2) Old 6 9 "abc" New 8 13 "<abc>"
+ 2: <abc>def<abc>pqr
+    abxyzpqrabcxyz
+ 1(1) Old 2 5 "xyz" New 2 7 "<xyz>"
+ 2(2) Old 8 11 "abc" New 10 15 "<abc>"
+ 3(1) Old 11 14 "xyz" New 15 20 "<xyz>"
+ 3: ab<xyz>pqr<abc><xyz>
+    12abc34xyz99abc55\=substitute_stop=2
+ 1(2) Old 2 5 "abc" New 2 7 "<abc>"
+ 2(1) Old 7 10 "xyz" New 9 14 "<xyz> STOPPED"
+ 2: 12<abc>34xyz99abc55
+    12abc34xyz99abc55\=substitute_skip=1
+ 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
+ 2(1) Old 7 10 "xyz" New 7 12 "<xyz>"
+ 3(2) Old 12 15 "abc" New 14 19 "<abc>"
+ 3: 12abc34<xyz>99<abc>55
+    12abc34xyz99abc55\=substitute_skip=2
+ 1(2) Old 2 5 "abc" New 2 7 "<abc>"
+ 2(1) Old 7 10 "xyz" New 9 14 "<xyz> SKIPPED"
+ 3(2) Old 12 15 "abc" New 14 19 "<abc>"
+ 3: 12<abc>34xyz99<abc>55
+
+/a(b)c|xyz/g,replace=<$0>
+    abcdefabcpqr
+ 2: <abc>def<abc>pqr
+    abxyzpqrabcxyz
+ 3: ab<xyz>pqr<abc><xyz>
+    12abc34xyz\=substitute_stop=2
+ 1(2) Old 2 5 "abc" New 2 7 "<abc>"
+ 2(1) Old 7 10 "xyz" New 9 14 "<xyz> STOPPED"
+ 2: 12<abc>34xyz
+    12abc34xyz\=substitute_skip=1
+ 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
+ 2(1) Old 7 10 "xyz" New 7 12 "<xyz>"
+ 2: 12abc34<xyz>
+
+/a(b)c|xyz/replace=<$0>
+    abcdefabcpqr
+ 1: <abc>defabcpqr
+    12abc34xyz\=substitute_skip=1
+ 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
+ 1: 12abc34xyz
+    12abc34xyz\=substitute_stop=1
+ 1(2) Old 2 5 "abc" New 2 7 "<abc> STOPPED"
+ 1: 12abc34xyz
+
+/abc\rdef/
+    abc\ndef
+No match
+
+/abc\rdef\x{0d}xyz/escaped_cr_is_lf
+    abc\ndef\rxyz
+ 0: abc\x0adef\x0dxyz
+\= Expect no match     
+    abc\ndef\nxyz
+No match
+
+/(?(*ACCEPT)xxx)/
+Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
+
+/(?(*atomic:xx)xxx)/
+Failed: error 128 at offset 10: assertion expected after (?( or (?(?C)
+
+/(?(*script_run:xxx)zzz)/
+Failed: error 128 at offset 14: assertion expected after (?( or (?(?C)
+
+/foobar/
+    the foobar thing\=copy_matched_subject
+ 0: foobar
+    the foobar thing\=copy_matched_subject,zero_terminate
+ 0: foobar
+
+/foobar/g
+    the foobar thing foobar again\=copy_matched_subject
+ 0: foobar
+ 0: foobar
+
+/(*:XX)^abc/I
+Capture group count = 0
+Compile options: <none>
+Overall options: anchored
+First code unit = 'a'
+Subject length lower bound = 3
+
+/(*COMMIT:XX)^abc/I
+Capture group count = 0
+Compile options: <none>
+Overall options: anchored
+First code unit = 'a'
+Subject length lower bound = 3
+
+/(*ACCEPT:XX)^abc/I
+Capture group count = 0
+May match empty string
+Subject length lower bound = 0
+
+/abc/replace=xyz
+    abc\=null_context
+ 1: xyz
+
+/abc/replace=xyz,substitute_callout
+    abc 
+ 1(1) Old 0 3 "abc" New 0 3 "xyz"
+ 1: xyz
+\= Expect error message
+    abc\=null_context
+** Replacement callouts are not supported with null_context.
+
+/\[()]{65535}()/expand
+Failed: error 197 at offset 131071: too many capturing groups (maximum 65535)
+
+/\[()]{65535}(?<A>)/expand
+Failed: error 197 at offset 131075: too many capturing groups (maximum 65535)
+
+/a(?:(*ACCEPT))??bc/
+    abc
+ 0: abc
+    axy
+ 0: a
+
+/a(*ACCEPT)??bc/
+    abc
+ 0: abc
+    axy
+ 0: a
+
+/a(*ACCEPT:XX)??bc/mark
+    abc
+ 0: abc
+    axy
+ 0: a
+MK: XX
+
+/(*:\)?/
+Failed: error 109 at offset 5: quantifier does not follow a repeatable item
+
+/(*:\Q \E){5}/alt_verbnames
+Failed: error 109 at offset 11: quantifier does not follow a repeatable item
+
+/(?=abc)/I
+Capture group count = 0
+May match empty string
+First code unit = 'a'
+Last code unit = 'c'
+Subject length lower bound = 2
+
+/(?|(X)|(XY))\1abc/I
+Capture group count = 1
+Max back reference = 1
+First code unit = 'X'
+Last code unit = 'c'
+Subject length lower bound = 4
+
+/(?|(a)|(bcde))(c)\2/I
+Capture group count = 2
+Max back reference = 2
+Starting code units: a b 
+Last code unit = 'c'
+Subject length lower bound = 3
+
+/(?|(a)|(bcde))(c)\1/I
+Capture group count = 2
+Max back reference = 1
+Starting code units: a b 
+Last code unit = 'c'
+Subject length lower bound = 2
+
+/(?|(?'A'a)|(?'A'bcde))(?'B'c)\k'B'(?'A')/I,dupnames
+Capture group count = 3
+Max back reference = 2
+Named capture groups:
+  A   1
+  A   3
+  B   2
+Options: dupnames
+Starting code units: a b 
+Last code unit = 'c'
+Subject length lower bound = 3
+
+/(?|(?'A'a)|(?'A'bcde))(?'B'c)\k'A'(?'A')/I,dupnames
+Capture group count = 3
+Max back reference = 3
+Named capture groups:
+  A   1
+  A   3
+  B   2
+Options: dupnames
+Starting code units: a b 
+Last code unit = 'c'
+Subject length lower bound = 2
+
+/((a|)+)+Z/I
+Capture group count = 2
+Starting code units: Z a 
+Last code unit = 'Z'
+Subject length lower bound = 1
+
+/((?=a))[abcd]/I
+Capture group count = 1
+First code unit = 'a'
+Subject length lower bound = 1
+
+/A(?:(*ACCEPT))?B/info
+Capture group count = 0
+First code unit = 'A'
+Subject length lower bound = 1
+
+/(A(*ACCEPT)??B)C/
+    ABC
+ 0: ABC
+ 1: AB
+    AXY 
+ 0: A
+ 1: A
+
+/(?<=(?<=a)b)c.*/I
+Capture group count = 0
+Max lookbehind = 1
+First code unit = 'c'
+Subject length lower bound = 1
+    abc\=ph
+Partial match: c
+\= Expect no match
+    xbc\=ph
+No match
+
+/(?<=ab)c.*/I
+Capture group count = 0
+Max lookbehind = 2
+First code unit = 'c'
+Subject length lower bound = 1
+    abc\=ph
+Partial match: c
+\= Expect no match
+    xbc\=ph
+No match
+
+/(?<=a(?<=a|a)c)/I
+Capture group count = 0
+Max lookbehind = 2
+May match empty string
+Subject length lower bound = 0
+
+/(?<=a(?<=a|ba)c)/I
+Capture group count = 0
+Max lookbehind = 2
+May match empty string
+Subject length lower bound = 0
+
+/(?<=(?<=a)b)(?<!abcd)/I
+Capture group count = 0
+Max lookbehind = 4
+May match empty string
+Subject length lower bound = 0
+
+/(?<=(?<=a)b)(?<!abcd)(?<=(?<=a)bcde)/I
+Capture group count = 0
+Max lookbehind = 4
+May match empty string
+Subject length lower bound = 0
+
+# Addition overflow
+/( {32742} {42})(?<!\1{65481})/
+Failed: error 187 at offset 15: lookbehind assertion is too long
+
+# Multiplication overflow
+/(X{65535})(?<=\1{32770})/
+Failed: error 187 at offset 10: lookbehind assertion is too long
+
+# ---- Non-atomic assertion tests ----
+
+# Expect error: not allowed as a condition
+/(?(*napla:xx)bc)/
+Failed: error 198 at offset 9: atomic assertion expected after (?( or (?(?C)
+
+/\A(*pla:.*\b(\w++))(?>.*?\b\1\b){3}/
+    word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
+No match
+
+/\A(*napla:.*\b(\w++))(?>.*?\b\1\b){3}/
+    word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
+ 0: word1 word3 word1 word2 word3 word2 word2 word1 word3
+ 1: word3
+
+/(*plb:(.)..|(.)...)(\1|\2)/
+    abcdb\=offset=4 
+ 0: b
+ 1: b
+ 2: <unset>
+ 3: b
+    abcda\=offset=4 
+No match
+
+/(*naplb:(.)..|(.)...)(\1|\2)/
+    abcdb\=offset=4 
+ 0: b
+ 1: b
+ 2: <unset>
+ 3: b
+    abcda\=offset=4 
+ 0: a
+ 1: <unset>
+ 2: a
+ 3: a
+    
+/(*non_atomic_positive_lookahead:ab)/B
+------------------------------------------------------------------
+        Bra
+        Non-atomic assert
+        ab
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+/(*non_atomic_positive_lookbehind:ab)/B 
+------------------------------------------------------------------
+        Bra
+        Non-atomic assert back
+        Reverse
+        ab
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/(*pla:ab+)/B
+------------------------------------------------------------------
+        Bra
+        Assert
+        a
+        b++
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/(*napla:ab+)/B
+------------------------------------------------------------------
+        Bra
+        Non-atomic assert
+        a
+        b+
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/(*napla:)+/
+
+/(*naplb:)+/
+
+/(*napla:^x|^y)/I
+Capture group count = 0
+May match empty string
+Compile options: <none>
+Overall options: anchored
+Starting code units: x y 
+Subject length lower bound = 1
+
+/(*napla:abc|abd)/I
+Capture group count = 0
+May match empty string
+First code unit = 'a'
+Subject length lower bound = 1
+
+/(*napla:a|(.)(*ACCEPT)zz)\1../
+    abcd
+ 0: abc
+ 1: a
+    
+/(*napla:a(*ACCEPT)zz|(.))\1../
+    abcd
+ 0: bcd
+ 1: b
+    
+/(*napla:a|(*COMMIT)(.))\1\1/
+    aabc
+ 0: aa
+ 1: a
+\= Expect no match     
+    abbc   
+No match
+
+/(*napla:a|(.))\1\1/
+    aabc
+ 0: aa
+ 1: a
+    abbc   
+ 0: bb
+ 1: b
+
+# ----
+
+# Expect error (recursion => not fixed length)
+/(\2)((?=(?<=\1)))/
+Failed: error 125 at offset 8: lookbehind assertion is not fixed length
+
+/c*+(?<=[bc])/
+    abc\=ph
+Partial match: c
+    ab\=ph
+Partial match: 
+    abc\=ps
+ 0: c
+    ab\=ps
+ 0: 
+
+/c++(?<=[bc])/
+    abc\=ph
+Partial match: c
+    ab\=ph
+Partial match: 
+
+/(?<=(?=.(?<=x)))/
+    abx
+ 0: 
+    ab\=ph
+Partial match: 
+    bxyz 
+ 0: 
+    xyz
+ 0: 
+    
+/\z/
+   abc\=ph
+Partial match: 
+   abc\=ps 
+ 0: 
+   
+/\Z/
+   abc\=ph
+Partial match: 
+   abc\=ps 
+ 0: 
+   abc\n\=ph
+Partial match: \x0a
+   abc\n\=ps
+ 0: 
+
+/(?![ab]).*/
+    ab\=ph
+Partial match: 
+
+/c*+/
+    ab\=ph,offset=2
+Partial match: 
+
+/\A\s*(a|(?:[^`]{28500}){4})/I
+Capture group count = 1
+Max lookbehind = 1
+Compile options: <none>
+Overall options: anchored
+Subject length lower bound = 1
+    a
+ 0: a
+ 1: a
+
+/\A\s*((?:[^`]{28500}){4})/I
+Capture group count = 1
+Max lookbehind = 1
+Compile options: <none>
+Overall options: anchored
+Subject length lower bound = 65535
+
+/\A\s*((?:[^`]{28500}){4}|a)/I
+Capture group count = 1
+Max lookbehind = 1
+Compile options: <none>
+Overall options: anchored
+Subject length lower bound = 1
+    a
+ 0: a
+ 1: a
+
+/(?<A>a)(?(<A>)b)((?<=b).*)/B
+------------------------------------------------------------------
+        Bra
+        CBra 1
+        a
+        Ket
+        Cond
+      1 Cond ref
+        b
+        Ket
+        CBra 2
+        Assert back
+        Reverse
+        b
+        Ket
+        Any*+
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/(?(1)b)((?<=b).*)/B
+------------------------------------------------------------------
+        Bra
+        Cond
+      1 Cond ref
+        b
+        Ket
+        CBra 1
+        Assert back
+        Reverse
+        b
+        Ket
+        Any*+
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/(?(R1)b)((?<=b).*)/B
+------------------------------------------------------------------
+        Bra
+        Cond
+        Cond recurse 1
+        b
+        Ket
+        CBra 1
+        Assert back
+        Reverse
+        b
+        Ket
+        Any*+
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/(?(DEFINE)b)((?<=b).*)/B
+------------------------------------------------------------------
+        Bra
+        Cond
+        Cond false
+        b
+        Ket
+        CBra 1
+        Assert back
+        Reverse
+        b
+        Ket
+        Any*+
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/(?(VERSION=10.4)b)((?<=b).*)/B
+------------------------------------------------------------------
+        Bra
+        Cond
+        Cond false
+        b
+        Ket
+        CBra 1
+        Assert back
+        Reverse
+        b
+        Ket
+        Any*+
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/[aA]b[cC]/IB
+------------------------------------------------------------------
+        Bra
+     /i a
+        b
+     /i c
+        Ket
+        End
+------------------------------------------------------------------
+Capture group count = 0
+First code unit = 'a' (caseless)
+Last code unit = 'c' (caseless)
+Subject length lower bound = 3
+
+/[cc]abcd/I
+Capture group count = 0
+First code unit = 'c'
+Last code unit = 'd'
+Subject length lower bound = 5
+
+/[Cc]abcd/I
+Capture group count = 0
+First code unit = 'C' (caseless)
+Last code unit = 'd'
+Subject length lower bound = 5
+
+/[c]abcd/I
+Capture group count = 0
+First code unit = 'c'
+Last code unit = 'd'
+Subject length lower bound = 5
+
+/(?:c|C)abcd/I
+Capture group count = 0
+First code unit = 'C' (caseless)
+Last code unit = 'd'
+Subject length lower bound = 5
+
+/(a)?a/I
+Capture group count = 1
+Starting code units: a 
+Last code unit = 'a'
+Subject length lower bound = 1
+    manm
+ 0: a
+
 # End of testinput2
 Error -70: PCRE2_ERROR_BADDATA (unknown error number)
 Error -62: bad serialized data
index d6265fdd442bedb4bc9472a79a4c8a089b8e71a8..5ce720fa1be0b2df22f1e1f549d6614d895260e1 100644 (file)
@@ -32,9 +32,9 @@
 #load testsaved2
 
 #pop info
-Capturing subpattern count = 2
+Capture group count = 2
 Max back reference = 2
-Named capturing subpatterns:
+Named capture groups:
   n   1
   n   2
 Options: dupnames
@@ -66,8 +66,8 @@ No match, mark = A
  4: A
 
 #pop info
-Capturing subpattern count = 4
-Named capturing subpatterns:
+Capture group count = 4
+Named capture groups:
   ADDR          2
   ADDRESS_PAT   4
   NAME          1
index cba132611c40d1742c3f1145340d090f5e2567fd..fbd74004ee8bc3414186c4b5d8e39dd531d261da 100644 (file)
@@ -79,7 +79,7 @@
 Failed: error 183 at offset 4: using \C is disabled by the application
 
 /ab\Cde/info
-Capturing subpattern count = 0
+Capture group count = 0
 Contains \C
 First code unit = 'a'
 Last code unit = 'e'
index df29e14de73ad9e6d48e573fd4dd7817e1ddea48..542185405a8eb2c1344d5b37cfb167fccc4d1656 100644 (file)
@@ -4,12 +4,12 @@
 # in some widths and not in others.
 
 /ab\Cde/utf,info
-Capturing subpattern count = 0
+Capture group count = 0
 Contains \C
 Options: utf
 First code unit = 'a'
 Last code unit = 'e'
-Subject length lower bound = 0
+Subject length lower bound = 2
     abXde
  0: abXde
 
index f0b7984a69927466aa0034441384810e63bba5f4..e96696a9ccca62b66f72cf6f7800dc2b015ade31 100644 (file)
@@ -4,7 +4,7 @@
 # in some widths and not in others.
 
 /ab\Cde/utf,info
-Capturing subpattern count = 0
+Capture group count = 0
 Contains \C
 Options: utf
 First code unit = 'a'
index 0a04aa81322ab308e4779bc1249fa7ec6b9cd21d..eab410eb7e6c1f44d3676ae0fae21be3170ffbde 100644 (file)
@@ -4,12 +4,12 @@
 # in some widths and not in others.
 
 /ab\Cde/utf,info
-Capturing subpattern count = 0
+Capture group count = 0
 Contains \C
 Options: utf
 First code unit = 'a'
 Last code unit = 'e'
-Subject length lower bound = 0
+Subject length lower bound = 2
     abXde
  0: abXde
 
index d9e8c5c1d7e3c20b8a50f4796a64bbb3bd8be236..801966a9893114d92bc21fa5c647fac55a89f5ed 100644 (file)
@@ -78,13 +78,13 @@ No match
  0: école
 
 /\w/I
-Capturing subpattern count = 0
+Capture group 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
 
 /\w/I,locale=fr_FR
-Capturing subpattern count = 0
+Capture group 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 
   ª µ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â 
@@ -153,7 +153,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 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 ª µ º À Á Â Ã Ä Å Æ Ç 
   È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í 
index 9b00be8b92162f6115e437e6221dafaefb06178f..d7a223ab156e132b0d1888608719f49c6945740b 100644 (file)
@@ -78,13 +78,13 @@ No match
  0: école
 
 /\w/I
-Capturing subpattern count = 0
+Capture group 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
 
 /\w/I,locale=fr_FR
-Capturing subpattern count = 0
+Capture group 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 
   ª µ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â 
@@ -153,7 +153,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 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 ª µ º À Á Â Ã Ä Å Æ Ç 
   È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í 
index b30fc5f1fff9daee59ef2e9f62a60fca2f4ebfb7..b18d441b4a223b26dc1f9d0cb8718654b223bbfd 100644 (file)
@@ -78,13 +78,13 @@ No match
  0: école
 
 /\w/I
-Capturing subpattern count = 0
+Capture group 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
 
 /\w/I,locale=fr_FR
-Capturing subpattern count = 0
+Capture group 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 
   ª µ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â 
@@ -153,7 +153,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: 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 ª µ º À Á Â Ã Ä Å Æ Ç 
   È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í 
index ba3df376c30a211d4e4d82dbb9f675fdd78b7818..2c8037b1f5fbfdf651cf6c34b956f3ad2e720254 100644 (file)
@@ -3741,5 +3741,291 @@ No match
 /[^\x{100}-\x{ffff}]*[\x80-\xff]/i,utf
     \x{99}\x{99}\x{99}
  0: \x{99}\x{99}\x{99}
+    
+# Script run tests
+
+/^(*script_run:.{4})/utf
+    abcd                               Latin x4
+ 0: abcd
+    \x{2e80}\x{2fa1d}\x{3041}\x{30a1}  Han Han Hiragana Katakana
+ 0: \x{2e80}\x{2fa1d}\x{3041}\x{30a1}
+    \x{3041}\x{30a1}\x{3007}\x{3007}   Hiragana Katakana Han Han
+ 0: \x{3041}\x{30a1}\x{3007}\x{3007}
+    \x{30a1}\x{3041}\x{3007}\x{3007}   Katakana Hiragana Han Han
+ 0: \x{30a1}\x{3041}\x{3007}\x{3007}
+    \x{1100}\x{2e80}\x{2e80}\x{1101}   Hangul Han Han Hangul
+ 0: \x{1100}\x{2e80}\x{2e80}\x{1101}
+    \x{2e80}\x{3105}\x{2e80}\x{3105}   Han Bopomofo Han Bopomofo
+ 0: \x{2e80}\x{3105}\x{2e80}\x{3105}
+    \x{02ea}\x{2e80}\x{2e80}\x{3105}   Bopomofo-Sk Han Han Bopomofo
+ 0: \x{2ea}\x{2e80}\x{2e80}\x{3105}
+    \x{3105}\x{2e80}\x{2e80}\x{3105}   Bopomofo Han Han Bopomofo
+ 0: \x{3105}\x{2e80}\x{2e80}\x{3105}
+    \x{0300}cd!                        Inherited Latin Latin Common
+ 0: \x{300}cd!
+    \x{0391}12\x{03a9}                 Greek Common-digits Greek 
+ 0: \x{391}12\x{3a9}
+    \x{0400}12\x{fe2f}                 Cyrillic Common-digits Cyrillic
+ 0: \x{400}12\x{fe2f}
+    \x{0531}12\x{fb17}                 Armenian Common-digits Armenian
+ 0: \x{531}12\x{fb17}
+    \x{0591}12\x{fb4f}                 Hebrew Common-digits Hebrew
+ 0: \x{591}12\x{fb4f}
+    \x{0600}12\x{1eef1}                Arabic Common-digits Arabic
+ 0: \x{600}12\x{1eef1}
+    \x{0600}\x{0660}\x{0669}\x{1eef1}  Arabic Arabic-digits Arabic
+ 0: \x{600}\x{660}\x{669}\x{1eef1}
+    \x{0700}12\x{086a}                 Syriac Common-digits Syriac
+ 0: \x{700}12\x{86a}
+    \x{1200}12\x{ab2e}                 Ethiopic Common-digits Ethiopic
+ 0: \x{1200}12\x{ab2e}
+    \x{1680}12\x{169c}                 Ogham Common-digits Ogham
+ 0: \x{1680}12\x{169c}
+    \x{3041}12\x{3041}                 Hiragana Common-digits Hiragana
+ 0: \x{3041}12\x{3041}
+    \x{0980}\x{09e6}\x{09e7}\x{0993}   Bengali Bengali-digits Bengali
+ 0: \x{980}\x{9e6}\x{9e7}\x{993}
+    !cde                               Common Latin Latin Latin
+ 0: !cde
+    A..B                               Latin Common Common Latin 
+ 0: A..B
+    0abc                               Ascii-digit Latin Latin Latin
+ 0: 0abc
+    1\x{0700}\x{0700}\x{0700}          Ascii-digit Syriac x 3
+ 0: 1\x{700}\x{700}\x{700}
+    \x{1A80}\x{1A80}\x{1a40}\x{1a41}   Tai Tham Hora digits, letters
+ 0: \x{1a80}\x{1a80}\x{1a40}\x{1a41}
+\= Expect no match
+    a\x{370}bcd                        Latin Greek Latin Latin
+No match
+    \x{1100}\x{02ea}\x{02ea}\x{02ea}   Hangul Bopomofo x3
+No match
+    \x{02ea}\x{02ea}\x{02ea}\x{1100}   Bopomofo x3 Hangul
+No match
+    \x{1100}\x{2e80}\x{3041}\x{1101}   Hangul Han Hiragana Hangul
+No match
+    \x{0391}\x{09e6}\x{09e7}\x{03a9}   Greek Bengali digits Greek 
+No match
+    \x{0600}7\x{0669}\x{1eef1}         Arabic ascii-digit Arabic-digit Arabic
+No match
+    \x{0600}\x{0669}7\x{1eef1}         Arabic Arabic-digit ascii-digit Arabic
+No match
+    A5\x{ff19}B                        Latin Common-ascii/notascii-digits Latin 
+No match
+    \x{0300}cd\x{0391}                 Inherited Latin Latin Greek
+No match
+    !cd\x{0391}                        Common Latin Latin Greek
+No match
+    \x{1A80}\x{1A90}\x{1a40}\x{1a41}   Tai Tham Hora digit, Tham digit, letters
+No match
+    A\x{1d7ce}\x{1d7ff}B               Common fancy-common-2-sets-digits Common
+No match
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+No match
+    
+/^(*sr:.{4}|..)/utf
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+ 0: \x{2e80}\x{3105}
+
+/^(*atomic_script_run:.{4}|..)/utf
+\= Expect no match
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+No match
+
+/^(*asr:.*)/utf
+\= Expect no match
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+No match
+
+/^(?>(*sr:.*))/utf
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+ 0: \x{2e80}\x{3105}\x{2e80}
+
+/^(*sr:.*)/utf
+    \x{2e80}\x{3105}\x{2e80}\x{30a1}   Han Bopomofo Han Katakana
+ 0: \x{2e80}\x{3105}\x{2e80}
+    \x{10fffd}\x{10fffd}\x{10fffd}     Private use (Unknown)
+ 0: \x{10fffd}
+
+/^(*sr:\x{2e80}*)/utf
+    \x{2e80}\x{2e80}\x{3105}           Han Han Bopomofo
+ 0: \x{2e80}\x{2e80}
+
+/^(*sr:\x{2e80}*)\x{2e80}/utf
+    \x{2e80}\x{2e80}\x{3105}           Han Han Bopomofo
+ 0: \x{2e80}\x{2e80}
+    
+/^(*sr:.*)Test/utf
+    Test script run on an empty string
+ 0: Test
+
+/^(*sr:(.{2})){2}/utf
+    \x{0600}7\x{0669}\x{1eef1}         Arabic ascii-digit Arabic-digit Arabic
+ 0: \x{600}7\x{669}\x{1eef1}
+ 1: \x{669}\x{1eef1}
+    \x{1A80}\x{1A80}\x{1a40}\x{1a41}   Tai Tham Hora digits, letters
+ 0: \x{1a80}\x{1a80}\x{1a40}\x{1a41}
+ 1: \x{1a40}\x{1a41}
+    \x{1A80}\x{1a40}\x{1A90}\x{1a41}   Tai Tham Hora digit, letter, Tham digit, letter
+ 0: \x{1a80}\x{1a40}\x{1a90}\x{1a41}
+ 1: \x{1a90}\x{1a41}
+\= Expect no match
+    \x{1100}\x{2e80}\x{3041}\x{1101}   Hangul Han Hiragana Hangul
+No match
+    
+/^(*sr:\S*)/utf
+    \x{1cf4}\x{20f0}\x{900}\x{11305}   [Dev,Gran,Kan] [Dev,Gran,Lat] Dev Gran
+ 0: \x{1cf4}\x{20f0}\x{900}
+    \x{1cf4}\x{20f0}\x{11305}\x{900}   [Dev,Gran,Kan] [Dev,Gran,Lat] Gran Dev
+ 0: \x{1cf4}\x{20f0}\x{11305}
+    \x{1cf4}\x{20f0}\x{900}ABC         [Dev,Gran,Kan] [Dev,Gran,Lat] Dev Lat
+ 0: \x{1cf4}\x{20f0}\x{900}
+    \x{1cf4}\x{20f0}ABC                [Dev,Gran,Kan] [Dev,Gran,Lat] Lat
+ 0: \x{1cf4}\x{20f0}
+    \x{20f0}ABC                        [Dev,Gran,Lat] Lat
+ 0: \x{20f0}ABC
+    XYZ\x{20f0}ABC                     Lat [Dev,Gran,Lat] Lat
+ 0: XYZ\x{20f0}ABC
+    \x{a36}\x{a33}\x{900}              [Dev,...] [Dev,...] Dev  
+ 0: \x{a36}\x{a33}
+    \x{3001}\x{2e80}\x{3041}\x{30a1}   [Bopo, Han, etc] Han Hira Kata
+ 0: \x{3001}\x{2e80}\x{3041}\x{30a1}
+    \x{3001}\x{30a1}\x{2e80}\x{3041}   [Bopo, Han, etc] Kata Han Hira
+ 0: \x{3001}\x{30a1}\x{2e80}\x{3041}
+    \x{3001}\x{3105}\x{2e80}\x{1101}   [Bopo, Han, etc] Bopomofo Han Hangul
+ 0: \x{3001}\x{3105}\x{2e80}
+    \x{3105}\x{3001}\x{2e80}\x{1101}   Bopomofo [Bopo, Han, etc] Han Hangul
+ 0: \x{3105}\x{3001}\x{2e80}
+    \x{3031}\x{3041}\x{30a1}\x{2e80}   [Hira Kata] Hira Kata Han
+ 0: \x{3031}\x{3041}\x{30a1}\x{2e80}
+    \x{060c}\x{06d4}\x{0600}\x{10d00}\x{0700}  [Arab Rohg Syrc Thaa] [Arab Rohg] Arab Rohg Syrc
+ 0: \x{60c}\x{6d4}\x{600}
+    \x{060c}\x{06d4}\x{0700}\x{0600}\x{10d00}  [Arab Rohg Syrc Thaa] [Arab Rohg] Syrc Arab Rohg
+ 0: \x{60c}\x{6d4}
+    \x{2e80}\x{3041}\x{3001}\x{3031}\x{2e80}   Han Hira [Bopo, Han, etc] [Hira Kata] Han
+ 0: \x{2e80}\x{3041}\x{3001}\x{3031}\x{2e80}
+
+/(?<!)(*sr:)/
+
+/(?<!X(*sr:B)C)/
+
+/(?<=abc(?=X(*sr:BCY)Z)XBCYZ)./
+    abcXBCYZ!
+ 0: !
+
+/(?<=abc(?=X(*sr:BXY)CCC)XBXYCCC)./
+   abcXBXYCCC!
+ 0: !
+
+/^(*sr:\S*)/utf
+    \x{10d00}\x{10d00}\x{06d4}     Rohingya Rohingya Arabic-full-stop
+ 0: \x{10d00}\x{10d00}\x{6d4}
+    \x{06d4}\x{10d00}\x{10d00}     Arabic-full-stop Rohingya Rohingya
+ 0: \x{6d4}\x{10d00}\x{10d00}
+    \x{10d00}\x{10d00}\x{0363}     Rohingya Rohingya Inherited-extend-Latin
+ 0: \x{10d00}\x{10d00}
+    \x{0363}\x{10d00}\x{10d00}     Inherited-extend-Latin Rohingya Rohingya
+ 0: \x{363}
+    AB\x{0363}                     Latin Latin Inherited-extend-Latin
+ 0: AB\x{363}
+    \x{0363}AB                     Inherited-extend-Latin Latin Latin
+ 0: \x{363}AB
+    AB\x{1cf7}                     Latin Latin Common-extended-Beng
+ 0: AB
+    \x{1cf7}AB                     Common-extend-Beng Latin Latin
+ 0: \x{1cf7}
+    \x{1cf7}\x{0993}               Common-extend-Beng Bengali
+ 0: \x{1cf7}\x{993}
+    A\x{1abe}BC                    Test enclosing mark
+ 0: A\x{1abe}BC
+    \x{0370}\x{1abe}\x{0371}       Which can occur with any script (Greek here)
+ 0: \x{370}\x{1abe}\x{371}
+    \x{3001}\x{adf9}\x{3001}       [.. Hangul ..] Hangul [.. Hangul ..]
+ 0: \x{3001}\x{adf9}\x{3001}
+    \x{3400}\x{3001}XXX            Han [Han etc.]
+ 0: \x{3400}\x{3001}
+    \x{3400}\x{1cd5}               Han [Bengali Devanagari]
+ 0: \x{3400}
+    \x{ac01}\x{3400}               Hangul [.. Hangul ..]
+ 0: \x{ac01}\x{3400}
+    \x{ac01}\x{1cd5}               Hangul [Bengali Devanagari]
+ 0: \x{ac01}
+    \x{102e0}\x{06d4}\x{1ee4d}     [Arabic Coptic] [Arab Rohingya] Arabic
+ 0: \x{102e0}\x{6d4}\x{1ee4d}
+    \x{102e0}\x{06d4}\x{2cc9}      [Arabic Coptic] [Arab Rohingya] Coptic
+ 0: \x{102e0}\x{6d4}
+    \x{102e0}\x{06d4}\x{10d30}     [Arabic Coptic] [Arab Rohingya] Rohingya
+ 0: \x{102e0}\x{6d4}
+    
+# Test loop breaking for empty string match
+
+/^(*sr:A|)*BCD/utf
+    AABCD
+ 0: AABCD
+    ABCD
+ 0: ABCD
+    BCD 
+ 0: BCD
+    
+# The use of (*ACCEPT) breaks script run checking 
+
+/^(*sr:.*(*ACCEPT)ZZ)/utf
+    \x{1100}\x{2e80}\x{3041}\x{1101}   Hangul Han Hiragana Hangul
+ 0: \x{1100}\x{2e80}\x{3041}\x{1101}   Hangul Han Hiragana Hangul
+
+# ------- 
+
+# Test group names containing non-ASCII letters and digits
+
+/(?'ABáC'...)\g{ABáC}/utf
+    abcabcdefg
+ 0: abcabc
+ 1: abc
+
+/(?'XʰABC'...)/utf
+    xyzpq
+ 0: xyz
+ 1: xyz
+
+/(?'XאABC'...)/utf
+    12345
+ 0: 123
+ 1: 123
+
+/(?'XᾈABC'...)/utf
+    %^&*(...
+ 0: %^&
+ 1: %^&
+
+/(?'𐨐ABC'...)/utf
+    abcde
+ 0: abc
+ 1: abc
+
+/^(?'אABC'...)(?&אABC)(?P=אABC)/utf
+    123123123456
+ 0: 123123123
+ 1: 123
+
+/^(?'אABC'...)(?&אABC)/utf
+    123123123456
+ 0: 123123
+ 1: 123
+
+/\X*/
+    \xF3aaa\xE4\xEA\xEB\xFEa
+ 0: \xf3aaa\xe4\xea\xeb\xfea
+
+/Я/i,utf
+    \x{42f} 
+ 0: \x{42f}
+    \x{44f} 
+ 0: \x{44f}
+
+/(?=Я)/i,utf
+    \x{42f} 
+ 0: 
+    \x{44f} 
+ 0: 
 
 # End of testinput4
index 51caa181564ed8c9efa442104b15aaf8a173ce5e..ecf01fb49ed6d30e64f45dcd298f953c4ca5b353 100644 (file)
@@ -147,7 +147,7 @@ Failed: error 173 at offset 9: disallowed Unicode code point (>= 0xd800 && <= 0x
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -164,7 +164,7 @@ Subject length lower bound = 4
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Last code unit = 'X'
 Subject length lower bound = 4
@@ -179,7 +179,7 @@ Subject length lower bound = 4
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 3
     \x{212ab}\x{212ab}\x{212ab}\x{861}
@@ -193,7 +193,7 @@ Subject length lower bound = 3
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: utf
 Overall options: anchored utf
 Starting code units: a b 
@@ -238,7 +238,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: utf
 Subject length lower bound = 0
@@ -251,7 +251,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'a'
 Subject length lower bound = 1
@@ -264,7 +264,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'a'
 Last code unit = 'b'
@@ -291,7 +291,7 @@ No match
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 First code unit = \xff
 Subject length lower bound = 1
     >\xff<
@@ -304,7 +304,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /[Ä-Ü]/utf
@@ -343,7 +343,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Options: utf
 Last code unit = 'z'
 Subject length lower bound = 7
@@ -363,7 +363,7 @@ Subject length lower bound = 7
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Options: utf
 Subject length lower bound = 0
@@ -394,7 +394,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Options: utf
 Subject length lower bound = 0
@@ -414,7 +414,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Options: utf
 Subject length lower bound = 0
@@ -445,7 +445,7 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 2
+Capture group count = 2
 May match empty string
 Options: utf
 Subject length lower bound = 0
@@ -471,10 +471,9 @@ Subject length lower bound = 0
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Compile options: no_start_optimize utf
 Overall options: anchored no_start_optimize utf
-Subject length lower bound = 0
 
 /()()()()()()()()()()
  ()()()()()()()()()()
@@ -713,7 +712,7 @@ No match
  0: \x{1ec5}
 
 /a\Rb/I,bsr=anycrlf,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches CR, LF, or CRLF
 First code unit = 'a'
@@ -732,7 +731,7 @@ No match
 No match
 
 /a\Rb/I,bsr=unicode,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches any Unicode newline
 First code unit = 'a'
@@ -750,7 +749,7 @@ Subject length lower bound = 3
  0: a\x{0b}b
 
 /a\R?b/I,bsr=anycrlf,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches CR, LF, or CRLF
 First code unit = 'a'
@@ -769,7 +768,7 @@ No match
 No match
 
 /a\R?b/I,bsr=unicode,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches any Unicode newline
 First code unit = 'a'
@@ -798,7 +797,7 @@ No match
 /[[:a\x{100}b:]]/utf
 Failed: error 130 at offset 3: unknown POSIX class name
 
-/a[^]b/utf,alt_bsux,allow_empty_class,match_unset_backref
+/a[^]b/utf,allow_empty_class,match_unset_backref
     a\x{1234}b
  0: a\x{1234}b
     a\nb
@@ -807,7 +806,7 @@ Failed: error 130 at offset 3: unknown POSIX class name
     ab
 No match
 
-/a[^]+b/utf,alt_bsux,allow_empty_class,match_unset_backref
+/a[^]+b/utf,allow_empty_class,match_unset_backref
     aXb
  0: aXb
     a\nX\nX\x{1234}b
@@ -1408,22 +1407,22 @@ Failed: error 168 at offset 3: \c must be followed by a printable ASCII characte
  2: \x{0d}
 
 /[^\x{1234}]+/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Subject length lower bound = 1
 
 /[^\x{1234}]+?/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Subject length lower bound = 1
 
 /[^\x{1234}]++/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Subject length lower bound = 1
 
 /[^\x{1234}]{2}/Ii,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 Subject length lower bound = 2
 
@@ -1703,7 +1702,7 @@ Partial match: \x{0d}\x{0d}
 ------------------------------------------------------------------
 
 /(?<=\x{1234}\x{1234})\bxy/I,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Max lookbehind = 2
 Options: utf
 First code unit = 'x'
@@ -1734,6 +1733,14 @@ No match
 /\ud800/utf,alt_bsux,allow_empty_class,match_unset_backref
 Failed: error 173 at offset 6: disallowed Unicode code point (>= 0xd800 && <= 0xdfff)
 
+/^\u{0000000000010ffff}/utf,extra_alt_bsux
+    \x{10ffff}
+ 0: \x{10ffff}
+
+/\u/utf,alt_bsux
+    \\u
+ 0: u
+
 /^a+[a\x{200}]/B,utf
 ------------------------------------------------------------------
         Bra
@@ -1768,7 +1775,7 @@ Failed: error 173 at offset 6: disallowed Unicode code point (>= 0xd800 && <= 0x
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /[\p{^L}]/IB
@@ -1778,7 +1785,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /[\P{L}]/IB
@@ -1788,7 +1795,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /[\P{^L}]/IB
@@ -1798,7 +1805,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /[abc\p{L}\x{0660}]/IB,utf
@@ -1808,7 +1815,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
 
@@ -1819,7 +1826,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
     1234
@@ -1832,7 +1839,7 @@ Subject length lower bound = 1
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 Subject length lower bound = 1
     1234
@@ -2998,7 +3005,7 @@ Partial match: AA
         Ket
         End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless utf
 First code unit = 'A' (caseless)
 Last code unit = 'B' (caseless)
@@ -3286,27 +3293,27 @@ No match
 /\p{Any}+\p{Any} \p{Any}+\P{Any} \p{Any}+\p{L&} \p{Any}+\p{L} \p{Any}+\p{Lu} \p{Any}+\p{Han} \p{Any}+\p{Xan} \p{Any}+\p{Xsp} \p{Any}+\p{Xps} \p{Xwd}+\p{Any} \p{Any}+\p{Xuc}/Bx,ucp
 ------------------------------------------------------------------
         Bra
-        prop Any +
-        prop Any
-        prop Any +
+        AllAny+
+        AllAny
+        AllAny+
         notprop Any
-        prop Any +
+        AllAny+
         prop L&
-        prop Any +
+        AllAny+
         prop L
-        prop Any +
+        AllAny+
         prop Lu
-        prop Any +
+        AllAny+
         prop Han
-        prop Any +
+        AllAny+
         prop Xan
-        prop Any +
+        AllAny+
         prop Xsp
-        prop Any +
+        AllAny+
         prop Xps
         prop Xwd +
-        prop Any
-        prop Any +
+        AllAny
+        AllAny+
         prop Xuc
         Ket
         End
@@ -3316,7 +3323,7 @@ No match
 ------------------------------------------------------------------
         Bra
         prop L& +
-        prop Any
+        AllAny
         prop L& +
         prop L&
         notprop L& ++
@@ -3347,7 +3354,7 @@ No match
 ------------------------------------------------------------------
         Bra
         prop N +
-        prop Any
+        AllAny
         prop N +
         prop L&
         prop N ++
@@ -3378,7 +3385,7 @@ No match
 ------------------------------------------------------------------
         Bra
         prop Lu +
-        prop Any
+        AllAny
         prop Lu +
         prop L&
         prop Lu +
@@ -3440,7 +3447,7 @@ No match
 ------------------------------------------------------------------
         Bra
         prop Xan +
-        prop Any
+        AllAny
         prop Xan +
         prop L&
         notprop Xan ++
@@ -3471,7 +3478,7 @@ No match
 ------------------------------------------------------------------
         Bra
         prop Xsp +
-        prop Any
+        AllAny
         prop Xsp ++
         prop L&
         prop Xsp ++
@@ -3500,7 +3507,7 @@ No match
 ------------------------------------------------------------------
         Bra
         prop Xwd +
-        prop Any
+        AllAny
         prop Xwd +
         prop L&
         prop Xwd +
@@ -3529,7 +3536,7 @@ No match
 ------------------------------------------------------------------
         Bra
         prop Xuc +
-        prop Any
+        AllAny
         prop Xuc +
         prop L&
         prop Xuc +
@@ -3914,7 +3921,7 @@ No match
 ------------------------------------------------------------------
 
 /^s?c/Iim,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: caseless multiline utf
 First code unit at start or follows newline
 Last code unit = 'c' (caseless)
@@ -4010,7 +4017,7 @@ MK: a\x{12345}b\x{09}(d)c
 ------------------------------------------------------------------
         Bra
         \b
-        AssertB
+        Assert back
         Reverse
         prop Xwd
         Ket
@@ -4189,7 +4196,7 @@ Failed: error 125 at offset 2: lookbehind assertion is not fixed length
 ------------------------------------------------------------------
         Bra
         ^
-        AssertB not
+        Assert back not
         Assert
         \x{10385c}
         Ket
@@ -4775,5 +4782,160 @@ Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U,
     abc
  0: abc
 MK: ABC
+    
+# Script run tests: auto-possessification
+
+/^(*sr:.*)/B,utf 
+------------------------------------------------------------------
+        Bra
+        ^
+        Script run
+        Any*
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+    paypаl.com   A classic example of why script run checks are a good thing
+ 0: payp
+
+/^(*sr:.*(*ACCEPT))/utf 
+    paypаl.com   But *ACCEPT breaks things
+ 0: payp\x{430}l.com   But *ACCEPT breaks things
+
+/^(*sr:\x{2e80}*)/B,utf
+------------------------------------------------------------------
+        Bra
+        ^
+        Script run
+        \x{2e80}*+
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/^(*sr:\x{2e80}*)\x{2e80}/B,utf
+------------------------------------------------------------------
+        Bra
+        ^
+        Script run
+        \x{2e80}*
+        Ket
+        \x{2e80}
+        Ket
+        End
+------------------------------------------------------------------
+
+/(?<!)(*sr:)/B
+------------------------------------------------------------------
+        Bra
+        Assert back not
+        Ket
+        Script run
+        Ket
+        Ket
+        End
+------------------------------------------------------------------
+
+/(?<=abc(?=X(*sr:BXY)CCC)XBXYCCC)./B
+------------------------------------------------------------------
+        Bra
+        Assert back
+        Reverse
+        abc
+        Assert
+        X
+        Script run
+        BXY
+        Ket
+        CCC
+        Ket
+        XBXYCCC
+        Ket
+        Any
+        Ket
+        End
+------------------------------------------------------------------
+   abcXBXYCCC!
+ 0: !
+
+# Some script run patterns are broken in Perl 5.28.0. These can be moved into
+# test 4 when a mended version of Perl is released.
+
+/^(*sr:.{4})/utf
+    \x{0980}12\x{0993}     Bengali Common-digits Bengali
+ 0: \x{980}12\x{993}
+    \x{0780}12\x{07b1}     Thaana Common-digits Thaana
+ 0: \x{780}12\x{7b1}
+    \x{0e01}12\x{0e5b}     Thai Common-digits Thai
+ 0: \x{e01}12\x{e5b}
+    \x{1780}12\x{19ff}     Khmer Common-digits Khmer
+ 0: \x{1780}12\x{19ff}
+    \x{0904}12\x{0939}     Devanagari Common-digits Devanagari
+ 0: \x{904}12\x{939}
+    A\x{ff10}\x{ff19}B     Latin Common-notascii-digits Latin 
+ 0: A\x{ff10}\x{ff19}B
+    A\x{1d7ce}\x{1d7cf}B   Latin fancy-common-digits Latin
+ 0: A\x{1d7ce}\x{1d7cf}B
+    
+# These ones involve non-ASCII but nevertheless Common digits. As of October
+# 2018 even blead Perl wasn't handling all of these - but is going to. 
+
+/^(*sr:.{4})/utf
+    A\x{ff10}\x{ff19}B     Latin Common-notascii-digits Latin 
+ 0: A\x{ff10}\x{ff19}B
+    \x{ff10}\x{ff19}..     Common-notascii-digits Common Common
+ 0: \x{ff10}\x{ff19}..
+    A\x{ff10}BC            Latin Common-notascii-digit Latin Latin
+ 0: A\x{ff10}BC
+    A\x{1d7ce}\x{1d7cf}B   Latin fancy-common-digits Latin
+ 0: A\x{1d7ce}\x{1d7cf}B
+    \x{1d7ce}\x{1d7cf},,   fancy-common-digits Common Common
+ 0: \x{1d7ce}\x{1d7cf},,
+    A\x{1d7ce}BC           Latin fancy-common-digit Latin Latin
+ 0: A\x{1d7ce}BC
+    
+# Some Unicode 12.1.0 new script characters
+
+/\p{Elymaic}\p{Nandinagari}\p{Nyiakeng_Puachue_Hmong}\p{Wancho}/utf
+    \x{10fe5}\x{119AC}\x{1E10E}\x{1E2D1} 
+ 0: \x{10fe5}\x{119ac}\x{1e10e}\x{1e2d1}
+
+# ------- 
+
+# Test reference and errors in non-ASCII characters in group names
+
+/(?'𑠅ABC'...)/I,utf
+Capture group count = 1
+Named capture groups:
+  𑠅ABC   1
+Options: utf
+Subject length lower bound = 3
+   abcde\=copy=𑠅ABC
+ 0: abc
+ 1: abc
+  C abc (3) 𑠅ABC (group 1)
+
+# Bad ones
+
+/(?'AB၌C'...)\g{AB၌C}/utf
+Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator?)
+
+/(?'٠ABC'...)/utf
+Failed: error 144 at offset 3: subpattern name must start with a non-digit
+
+/(?'²ABC'...)/utf
+Failed: error 162 at offset 3: subpattern name expected
+
+/(?'X²ABC'...)/utf
+Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
+
+# -------
+
+/\p{Any}*xyz/I
+Capture group count = 0
+Compile options: <none>
+Overall options: anchored
+Last code unit = 'z'
+Subject length lower bound = 3
 
 # End of testinput5
index caec833fef2431bb3b39891fc7c2ab47eb8f160b..607b572b29002225fbb48ccee0ddff9be7a71eff 100644 (file)
@@ -876,7 +876,7 @@ Partial match: abc
  0: def
    
 /(?<=foo)bar/
-   foob\=ps,offset=2
+   foob\=ps,offset=2,allusedtext
 Partial match: foob
                <<<
    foobar...\=ps,dfa_restart,offset=4
@@ -5978,7 +5978,7 @@ Partial match: 123
  0: Content-Type:xxxyyyz
 
 /^abc/Im,newline=lf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 Forced newline is LF
 First code unit at start or follows newline
@@ -6001,7 +6001,7 @@ No match
 No match
 
 /^abc/Im,newline=crlf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 Forced newline is CRLF
 First code unit at start or follows newline
@@ -6016,7 +6016,7 @@ No match
 No match
     
 /^abc/Im,newline=cr
-Capturing subpattern count = 0
+Capture group count = 0
 Options: multiline
 Forced newline is CR
 First code unit at start or follows newline
@@ -6031,7 +6031,7 @@ No match
 No match
 
 /.*/I,newline=lf
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Forced newline is LF
 First code unit at start or follows newline
@@ -6044,7 +6044,7 @@ Subject length lower bound = 0
  0: abc\x0d
 
 /.*/I,newline=cr
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Forced newline is CR
 First code unit at start or follows newline
@@ -6057,7 +6057,7 @@ Subject length lower bound = 0
  0: abc
 
 /.*/I,newline=crlf
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Forced newline is CRLF
 First code unit at start or follows newline
@@ -6070,7 +6070,7 @@ Subject length lower bound = 0
  0: abc
 
 /\w+(.)(.)?def/Is
-Capturing subpattern count = 2
+Capture group count = 2
 Options: dotall
 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 
@@ -6447,7 +6447,7 @@ No match
  0: \x0aA
 
 /a\Rb/I,bsr=anycrlf
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 First code unit = 'a'
 Last code unit = 'b'
@@ -6465,7 +6465,7 @@ No match
 No match
 
 /a\Rb/I,bsr=unicode
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 First code unit = 'a'
 Last code unit = 'b'
@@ -6482,7 +6482,7 @@ Subject length lower bound = 3
  0: a\x0bb
     
 /a\R?b/I,bsr=anycrlf
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 First code unit = 'a'
 Last code unit = 'b'
@@ -6500,7 +6500,7 @@ No match
 No match
 
 /a\R?b/I,bsr=unicode
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 First code unit = 'a'
 Last code unit = 'b'
@@ -6517,7 +6517,7 @@ Subject length lower bound = 2
  0: a\x0bb
     
 /a\R{2,4}b/I,bsr=anycrlf
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches CR, LF, or CRLF
 First code unit = 'a'
 Last code unit = 'b'
@@ -6535,7 +6535,7 @@ No match
 No match
 
 /a\R{2,4}b/I,bsr=unicode
-Capturing subpattern count = 0
+Capture group count = 0
 \R matches any Unicode newline
 First code unit = 'a'
 Last code unit = 'b'
@@ -6803,9 +6803,10 @@ Partial match: dogs
     xyzabc123pqr
 Failed: error -42: pattern contains an item that is not supported for DFA matching
     
-/(?<=abc)123/
+/(?<=abc)123/allusedtext
     xyzabc123pqr 
- 0: 123
+ 0: abc123
+    <<<   
     xyzabc12\=ps
 Partial match: abc12
                <<<
@@ -6813,9 +6814,10 @@ Partial match: abc12
 Partial match: abc12
                <<<
 
-/\babc\b/
+/\babc\b/allusedtext
     +++abc+++
- 0: abc
+ 0: +abc+
+    <   >
     +++ab\=ps
 Partial match: +ab
                <
@@ -6831,7 +6833,7 @@ Partial match: +ab
  0+ CBA
 
 /(abc|def|xyz)/I
-Capturing subpattern count = 1
+Capture group count = 1
 Starting code units: a d x 
 Subject length lower bound = 3
     terhjk;abcdaadsfe
@@ -6843,9 +6845,8 @@ Subject length lower bound = 3
 No match
 
 /(abc|def|xyz)/I,no_start_optimize
-Capturing subpattern count = 1
+Capture group count = 1
 Options: no_start_optimize
-Subject length lower bound = 0
     terhjk;abcdaadsfe
  0: abc
     the quick xyz brown fox
@@ -6933,7 +6934,7 @@ Failed: error -42: pattern contains an item that is not supported for DFA matchi
     ac
 Failed: error -42: pattern contains an item that is not supported for DFA matching
 
-/(?<=abc)def/
+/(?<=abc)def/allusedtext
     abc\=ph
 Partial match: abc
                <<<
@@ -7783,4 +7784,115 @@ No match
     \na
 No match
     
+/foobar/
+    the foobar thing\=copy_matched_subject
+ 0: foobar
+    the foobar thing\=copy_matched_subject,zero_terminate
+ 0: foobar
+
+/foobar/g
+    the foobar thing foobar again\=copy_matched_subject
+ 0: foobar
+ 0: foobar
+
+/(?(VERSION>=0)^B0W)/
+    B0W-W0W
+ 0: B0W
+\= Expect no match
+    0
+No match
+
+/(?(VERSION>=1000)^B0W|W0W)/
+    B0W-W0W
+ 0: W0W
+\= Expect no match
+    0
+No match
+
+/(?<=pqr)abc(?=xyz)/
+    123pqrabcxy\=ps,allusedtext
+Partial match: pqrabcxy
+               <<<
+    123pqrabcxyz\=ps,allusedtext
+ 0: pqrabcxyz
+    <<<   >>>
+
+/(?>a+b)/
+    aaaa\=ps
+Partial match: aaaa
+    aaaab\=ps
+ 0: aaaab
+    
+/(abc)(?1)/
+    abca\=ps
+Partial match: abca
+    abcabc\=ps
+ 0: abcabc
+
+/(?(?=abc).*|Z)/
+    ab\=ps
+Partial match: ab
+    abcxyz\=ps
+ 0: abcxyz
+
+/(abc)++x/
+    abcab\=ps
+Partial match: abcab
+    abc\=ps 
+Partial match: abc
+    ab\=ps
+Partial match: ab
+    abcx  
+ 0: abcx
+
+/\z/
+    abc\=ph 
+Partial match: 
+    abc\=ps 
+ 0: 
+   
+/\Z/
+    abc\=ph 
+Partial match: 
+    abc\=ps 
+ 0: 
+    abc\n\=ph
+Partial match: \x0a
+    abc\n\=ps
+ 0: 
+
+/c*+(?<=[bc])/
+    abc\=ph
+Partial match: c
+    ab\=ph
+Partial match: 
+    abc\=ps
+ 0: c
+    ab\=ps
+ 0: 
+
+/c++(?<=[bc])/
+    abc\=ph
+Partial match: c
+    ab\=ph
+Partial match: 
+
+/(?<=(?=.(?<=x)))/
+    abx
+ 0: 
+    ab\=ph
+Partial match: 
+    bxyz 
+ 0: 
+    xyz
+ 0: 
+
+/(?![ab]).*/
+    ab\=ph
+Partial match: 
+
+/c*+/
+    ab\=ph,offset=2
+Partial match: 
+
 # End of testinput6
index f804185169ab58d6de9d001541b5becf7eac6eba..004186e9631b8545c796aa3902a91707470ad569 100644 (file)
@@ -1030,7 +1030,7 @@ No match
 No match
      
 /a\Rb/I,bsr=anycrlf,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches CR, LF, or CRLF
 First code unit = 'a'
@@ -1049,7 +1049,7 @@ No match
 No match
 
 /a\Rb/I,bsr=unicode,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches any Unicode newline
 First code unit = 'a'
@@ -1067,7 +1067,7 @@ Subject length lower bound = 3
  0: a\x{0b}b
     
 /a\R?b/I,bsr=anycrlf,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches CR, LF, or CRLF
 First code unit = 'a'
@@ -1086,7 +1086,7 @@ No match
 No match
 
 /a\R?b/I,bsr=unicode,utf
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 \R matches any Unicode newline
 First code unit = 'a'
index 47c9e56f389ef816787fe5e5438ff26289c7db3b..ff3474bad07a926258efdb136495139d1d6ebb73 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 10
   2   2 Ket
   4     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 14
   4   4 Ket
   6     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 26
  10  10 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 22
   8   8 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d55c}
 Last code unit = \x{c5b4}
@@ -404,7 +404,7 @@ Memory allocation (code space): 22
   8   8 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{65e5}
 Last code unit = \x{8a9e}
@@ -904,7 +904,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
  79  79 Ket
  81     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -938,7 +938,7 @@ Subject length lower bound = 0
  43  43 Ket
  45     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1011,7 +1011,7 @@ No match
 133 133 Ket
 135     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1020,4 +1020,9 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+Failed: error 120 at offset 131070: regular expression is too large
+
 # End of testinput8
index 722b0e1e3d40bc37788a91431537fd9d4467e4e2..dab9fa8b7b0e834d21903a646fb6b63318d50f35 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 14
   3   3 Ket
   6     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 18
   5   5 Ket
   8     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 30
  11  11 Ket
  14     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 26
   9   9 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d55c}
 Last code unit = \x{c5b4}
@@ -404,7 +404,7 @@ Memory allocation (code space): 26
   9   9 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{65e5}
 Last code unit = \x{8a9e}
@@ -903,7 +903,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
 110 110 Ket
 113     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -937,7 +937,7 @@ Subject length lower bound = 0
  58  58 Ket
  61     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1010,7 +1010,7 @@ No match
 194 194 Ket
 197     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1019,4 +1019,8 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+
 # End of testinput8
index 722b0e1e3d40bc37788a91431537fd9d4467e4e2..dab9fa8b7b0e834d21903a646fb6b63318d50f35 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 14
   3   3 Ket
   6     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 18
   5   5 Ket
   8     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 30
  11  11 Ket
  14     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 26
   9   9 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d55c}
 Last code unit = \x{c5b4}
@@ -404,7 +404,7 @@ Memory allocation (code space): 26
   9   9 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{65e5}
 Last code unit = \x{8a9e}
@@ -903,7 +903,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
 110 110 Ket
 113     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -937,7 +937,7 @@ Subject length lower bound = 0
  58  58 Ket
  61     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1010,7 +1010,7 @@ No match
 194 194 Ket
 197     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1019,4 +1019,8 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+
 # End of testinput8
index 30667a30044a96a43ec66961669e96ffaa6b003d..7d1c931ffceee6319da0097a963c1521599c9ccf 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 20
   2   2 Ket
   4     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 28
   4   4 Ket
   6     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 52
  10  10 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 44
   8   8 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d55c}
 Last code unit = \x{c5b4}
@@ -404,7 +404,7 @@ Memory allocation (code space): 44
   8   8 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{65e5}
 Last code unit = \x{8a9e}
@@ -903,7 +903,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
  79  79 Ket
  81     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -937,7 +937,7 @@ Subject length lower bound = 0
  43  43 Ket
  45     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1010,7 +1010,7 @@ No match
 133 133 Ket
 135     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1019,4 +1019,8 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+
 # End of testinput8
index 30667a30044a96a43ec66961669e96ffaa6b003d..7d1c931ffceee6319da0097a963c1521599c9ccf 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 20
   2   2 Ket
   4     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 28
   4   4 Ket
   6     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 52
  10  10 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 44
   8   8 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d55c}
 Last code unit = \x{c5b4}
@@ -404,7 +404,7 @@ Memory allocation (code space): 44
   8   8 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{65e5}
 Last code unit = \x{8a9e}
@@ -903,7 +903,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
  79  79 Ket
  81     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -937,7 +937,7 @@ Subject length lower bound = 0
  43  43 Ket
  45     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1010,7 +1010,7 @@ No match
 133 133 Ket
 135     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1019,4 +1019,8 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+
 # End of testinput8
index 30667a30044a96a43ec66961669e96ffaa6b003d..7d1c931ffceee6319da0097a963c1521599c9ccf 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 20
   2   2 Ket
   4     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 28
   4   4 Ket
   6     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 52
  10  10 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 44
   8   8 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{d55c}
 Last code unit = \x{c5b4}
@@ -404,7 +404,7 @@ Memory allocation (code space): 44
   8   8 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \x{65e5}
 Last code unit = \x{8a9e}
@@ -903,7 +903,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
  79  79 Ket
  81     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -937,7 +937,7 @@ Subject length lower bound = 0
  43  43 Ket
  45     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1010,7 +1010,7 @@ No match
 133 133 Ket
 135     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1019,4 +1019,8 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+
 # End of testinput8
index 4b03356ec67d257125c459061ab671abd950359f..4c4e6a8c25590e1a510dbce70066940c5b7bdc47 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 7
   3   3 Ket
   6     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 9
   5   5 Ket
   8     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 18
  14  14 Ket
  17     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 19
  15  15 Ket
  18     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xed
 Last code unit = \xb4
@@ -404,7 +404,7 @@ Memory allocation (code space): 19
  15  15 Ket
  18     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xe6
 Last code unit = \x9e
@@ -904,7 +904,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
 119 119 Ket
 122     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -938,7 +938,7 @@ Subject length lower bound = 0
  61  61 Ket
  64     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1011,7 +1011,7 @@ No match
 205 205 Ket
 208     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1020,4 +1020,9 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+Failed: error 120 at offset 131070: regular expression is too large
+
 # End of testinput8
index 3d33c77df2331a5f75bd35efeabefd8971da9878..7eb5142cfcac0fbec09b60f3f0147531c188ac1f 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 9
   4   4 Ket
   8     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 11
   6   6 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 20
  15  15 Ket
  19     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 21
  16  16 Ket
  20     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xed
 Last code unit = \xb4
@@ -404,7 +404,7 @@ Memory allocation (code space): 21
  16  16 Ket
  20     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xe6
 Last code unit = \x9e
@@ -903,7 +903,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
 150 150 Ket
 154     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -937,7 +937,7 @@ Subject length lower bound = 0
  76  76 Ket
  80     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1010,7 +1010,7 @@ No match
 266 266 Ket
 270     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1019,4 +1019,8 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+
 # End of testinput8
index db04971291102ffcb981918ff0fc6a5a0b278330..4d9bcd63d9359348b66f97e0a05cd6fc78c6ba52 100644 (file)
@@ -67,7 +67,7 @@ Memory allocation (code space): 11
   5   5 Ket
  10     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 May match empty string
 Options: extended
 Subject length lower bound = 0
@@ -80,7 +80,7 @@ Memory allocation (code space): 13
   7   7 Ket
  12     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: extended
 First code unit = 'a'
 Subject length lower bound = 1
@@ -376,7 +376,7 @@ Memory allocation (code space): 22
  16  16 Ket
  21     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = 'A'
 Last code unit = '.'
@@ -390,7 +390,7 @@ Memory allocation (code space): 23
  17  17 Ket
  22     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xed
 Last code unit = \xb4
@@ -404,7 +404,7 @@ Memory allocation (code space): 23
  17  17 Ket
  22     End
 ------------------------------------------------------------------
-Capturing subpattern count = 0
+Capture group count = 0
 Options: utf
 First code unit = \xe6
 Last code unit = \x9e
@@ -903,7 +903,7 @@ Failed: error 186 at offset 12820: regular expression is too complicated
 181 181 Ket
 186     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -937,7 +937,7 @@ Subject length lower bound = 0
  91  91 Ket
  96     End
 ------------------------------------------------------------------
-Capturing subpattern count = 1
+Capture group count = 1
 Max back reference = 1
 May match empty string
 Subject length lower bound = 0
@@ -1010,7 +1010,7 @@ No match
 327 327 Ket
 332     End
 ------------------------------------------------------------------
-Capturing subpattern count = 10
+Capture group count = 10
 May match empty string
 Subject length lower bound = 0
 
@@ -1019,4 +1019,8 @@ Failed: error 114 at offset 509: missing closing parenthesis
 
 /([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
 
+#pattern -fullbincode
+
+/\[()]{65535}/expand
+
 # End of testinput8
index 6b014e58d69a0bd8af05e0772283a026651c8092..f98f276769f96036f53b434b98310efd49b72e17 100644 (file)
@@ -215,7 +215,7 @@ Failed: error 134 at offset 6: character code point value in \x{} or \o{} is too
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
 \)  )*                       # optional trailing comment
 /Ix
-Capturing subpattern count = 0
+Capture group count = 0
 Contains explicit CR or LF match
 Options: extended
 Starting code units: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8 
@@ -224,25 +224,25 @@ Starting code units: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
 Subject length lower bound = 3
 
 /\h/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x09 \x20 \xa0 
 Subject length lower bound = 1
 
 /\H/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /\v/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x0a \x0b \x0c \x0d \x85 
 Subject length lower bound = 1
 
 /\V/I
-Capturing subpattern count = 0
+Capture group count = 0
 Subject length lower bound = 1
 
 /\R/I
-Capturing subpattern count = 0
+Capture group count = 0
 Starting code units: \x0a \x0b \x0c \x0d \x85 
 Subject length lower bound = 1