summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Klose <doko@debian.org>2015-08-04 19:23:03 +0100
committerMatthias Klose <doko@debian.org>2015-08-04 19:23:03 +0100
commitf4b7aba2e8c3cb8ba30dd028cd7e60077e229f53 (patch)
tree15de7f036ce89efc19f7b61c1b8782a1683f2fa6
parent94eb1938124a3ca87c17e2520468bf85ae675e96 (diff)
parente5f50570097752e9d8d68df700473362e385bda6 (diff)
Record pcre3 (2:8.35-7.1) in archive suite sid
-rw-r--r--.pc/.quilt_patches1
-rw-r--r--.pc/.quilt_series1
-rw-r--r--.pc/.version1
-rw-r--r--.pc/Fix-silly-quantifier-size-check.patch/pcre_compile.c9484
-rw-r--r--.pc/Fix-silly-quantifier-size-check.patch/testdata/testoutput214152
-rw-r--r--.pc/PCRE6_compatible_API.patch/pcrecpp.cc922
-rw-r--r--.pc/PCRE6_compatible_API.patch/pcrecpp.h710
-rw-r--r--.pc/PCRE6_compatible_API.patch/pcretest.c5709
-rw-r--r--.pc/applied-patches9
-rw-r--r--.pc/cve-2014-8964.patch/pcre_exec.c7178
-rw-r--r--.pc/fix_find_fixedlength.patch/pcre_compile.c9481
-rw-r--r--.pc/no_jit_x32_powerpcspe.patch/sljit/sljitConfigInternal.h523
-rw-r--r--.pc/pcre_info.patch/Makefile.am894
-rw-r--r--.pc/pcre_info.patch/Makefile.in3283
-rw-r--r--.pc/pcre_info.patch/pcre_info.c0
-rw-r--r--.pc/pcregrep.1-patch/doc/pcregrep.1683
-rw-r--r--.pc/pcreposix.patch/pcreposix.h146
-rw-r--r--.pc/soname.patch/configure.ac1111
-rw-r--r--debian/changelog10
-rw-r--r--debian/control10
-rw-r--r--debian/libpcrecpp0v5.docs (renamed from debian/libpcrecpp0.docs)0
-rw-r--r--debian/libpcrecpp0v5.install (renamed from debian/libpcrecpp0.install)0
-rw-r--r--debian/libpcrecpp0v5.symbols86
-rwxr-xr-xdebian/rules2
24 files changed, 101 insertions, 54295 deletions
diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches
deleted file mode 100644
index 6857a8d..0000000
--- a/.pc/.quilt_patches
+++ /dev/null
@@ -1 +0,0 @@
-debian/patches
diff --git a/.pc/.quilt_series b/.pc/.quilt_series
deleted file mode 100644
index c206706..0000000
--- a/.pc/.quilt_series
+++ /dev/null
@@ -1 +0,0 @@
-series
diff --git a/.pc/.version b/.pc/.version
deleted file mode 100644
index 0cfbf08..0000000
--- a/.pc/.version
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/.pc/Fix-silly-quantifier-size-check.patch/pcre_compile.c b/.pc/Fix-silly-quantifier-size-check.patch/pcre_compile.c
deleted file mode 100644
index 8a5b723..0000000
--- a/.pc/Fix-silly-quantifier-size-check.patch/pcre_compile.c
+++ /dev/null
@@ -1,9484 +0,0 @@
-/*************************************************
-* 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
- Copyright (c) 1997-2014 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 external function pcre_compile(), along with
-supporting internal functions that are not used by other modules. */
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define NLBLOCK cd /* Block containing newline information */
-#define PSSTART start_pattern /* Field containing processed string start */
-#define PSEND end_pattern /* Field containing processed string end */
-
-#include "pcre_internal.h"
-
-
-/* When PCRE_DEBUG is defined, we need the pcre(16|32)_printint() function, which
-is also used by pcretest. PCRE_DEBUG is not defined when building a production
-library. We do not need to select pcre16_printint.c specially, because the
-COMPILE_PCREx macro will already be appropriately set. */
-
-#ifdef PCRE_DEBUG
-/* pcre_printint.c should not include any headers */
-#define PCRE_INCLUDED
-#include "pcre_printint.c"
-#undef PCRE_INCLUDED
-#endif
-
-
-/* Macro for setting individual bits in class bitmaps. */
-
-#define SETBIT(a,b) a[(b)/8] |= (1 << ((b)&7))
-
-/* Maximum length value to check against when making sure that the integer that
-holds the compiled pattern length does not overflow. We make it a bit less than
-INT_MAX to allow for adding in group terminating bytes, so that we don't have
-to check them every time. */
-
-#define OFLOW_MAX (INT_MAX - 20)
-
-/* Definitions to allow mutual recursion */
-
-static int
- add_list_to_class(pcre_uint8 *, pcre_uchar **, int, compile_data *,
- const pcre_uint32 *, unsigned int);
-
-static BOOL
- compile_regex(int, pcre_uchar **, const pcre_uchar **, int *, BOOL, BOOL, int, int,
- pcre_uint32 *, pcre_int32 *, pcre_uint32 *, pcre_int32 *, branch_chain *,
- compile_data *, int *);
-
-
-
-/*************************************************
-* Code parameters and static tables *
-*************************************************/
-
-/* This value specifies the size of stack workspace that is used during the
-first pre-compile phase that determines how much memory is required. The regex
-is partly compiled into this space, but the compiled parts are discarded as
-soon as they can be, so that hopefully there will never be an overrun. The code
-does, however, check for an overrun. The largest amount I've seen used is 218,
-so this number is very generous.
-
-The same workspace is used during the second, actual compile phase for
-remembering forward references to groups so that they can be filled in at the
-end. Each entry in this list occupies LINK_SIZE bytes, so even when LINK_SIZE
-is 4 there is plenty of room for most patterns. However, the memory can get
-filled up by repetitions of forward references, for example patterns like
-/(?1){0,1999}(b)/, and one user did hit the limit. The code has been changed so
-that the workspace is expanded using malloc() in this situation. The value
-below is therefore a minimum, and we put a maximum on it for safety. The
-minimum is now also defined in terms of LINK_SIZE so that the use of malloc()
-kicks in at the same number of forward references in all cases. */
-
-#define COMPILE_WORK_SIZE (2048*LINK_SIZE)
-#define COMPILE_WORK_SIZE_MAX (100*COMPILE_WORK_SIZE)
-
-/* This value determines the size of the initial vector that is used for
-remembering named groups during the pre-compile. It is allocated on the stack,
-but if it is too small, it is expanded using malloc(), in a similar way to the
-workspace. The value is the number of slots in the list. */
-
-#define NAMED_GROUP_LIST_SIZE 20
-
-/* The overrun tests check for a slightly smaller size so that they detect the
-overrun before it actually does run off the end of the data block. */
-
-#define WORK_SIZE_SAFETY_MARGIN (100)
-
-/* Private flags added to firstchar and reqchar. */
-
-#define REQ_CASELESS (1 << 0) /* Indicates caselessness */
-#define REQ_VARY (1 << 1) /* Reqchar followed non-literal item */
-/* Negative values for the firstchar and reqchar flags */
-#define REQ_UNSET (-2)
-#define REQ_NONE (-1)
-
-/* Repeated character flags. */
-
-#define UTF_LENGTH 0x10000000l /* The char contains its length. */
-
-/* Table for handling escaped characters in the range '0'-'z'. Positive returns
-are simple data values; negative values are for special things like \d and so
-on. Zero means further processing is needed (for things like \x), or the escape
-is invalid. */
-
-#ifndef EBCDIC
-
-/* This is the "normal" table for ASCII systems or for EBCDIC systems running
-in UTF-8 mode. */
-
-static const short int escapes[] = {
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- CHAR_COLON, CHAR_SEMICOLON,
- CHAR_LESS_THAN_SIGN, CHAR_EQUALS_SIGN,
- CHAR_GREATER_THAN_SIGN, CHAR_QUESTION_MARK,
- CHAR_COMMERCIAL_AT, -ESC_A,
- -ESC_B, -ESC_C,
- -ESC_D, -ESC_E,
- 0, -ESC_G,
- -ESC_H, 0,
- 0, -ESC_K,
- 0, 0,
- -ESC_N, 0,
- -ESC_P, -ESC_Q,
- -ESC_R, -ESC_S,
- 0, 0,
- -ESC_V, -ESC_W,
- -ESC_X, 0,
- -ESC_Z, CHAR_LEFT_SQUARE_BRACKET,
- CHAR_BACKSLASH, CHAR_RIGHT_SQUARE_BRACKET,
- CHAR_CIRCUMFLEX_ACCENT, CHAR_UNDERSCORE,
- CHAR_GRAVE_ACCENT, 7,
- -ESC_b, 0,
- -ESC_d, ESC_e,
- ESC_f, 0,
- -ESC_h, 0,
- 0, -ESC_k,
- 0, 0,
- ESC_n, 0,
- -ESC_p, 0,
- ESC_r, -ESC_s,
- ESC_tee, 0,
- -ESC_v, -ESC_w,
- 0, 0,
- -ESC_z
-};
-
-#else
-
-/* This is the "abnormal" table for EBCDIC systems without UTF-8 support. */
-
-static const short int escapes[] = {
-/* 48 */ 0, 0, 0, '.', '<', '(', '+', '|',
-/* 50 */ '&', 0, 0, 0, 0, 0, 0, 0,
-/* 58 */ 0, 0, '!', '$', '*', ')', ';', '~',
-/* 60 */ '-', '/', 0, 0, 0, 0, 0, 0,
-/* 68 */ 0, 0, '|', ',', '%', '_', '>', '?',
-/* 70 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* 78 */ 0, '`', ':', '#', '@', '\'', '=', '"',
-/* 80 */ 0, 7, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0,
-/* 88 */-ESC_h, 0, 0, '{', 0, 0, 0, 0,
-/* 90 */ 0, 0, -ESC_k, 'l', 0, ESC_n, 0, -ESC_p,
-/* 98 */ 0, ESC_r, 0, '}', 0, 0, 0, 0,
-/* A0 */ 0, '~', -ESC_s, ESC_tee, 0,-ESC_v, -ESC_w, 0,
-/* A8 */ 0,-ESC_z, 0, 0, 0, '[', 0, 0,
-/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* B8 */ 0, 0, 0, 0, 0, ']', '=', '-',
-/* C0 */ '{',-ESC_A, -ESC_B, -ESC_C, -ESC_D,-ESC_E, 0, -ESC_G,
-/* C8 */-ESC_H, 0, 0, 0, 0, 0, 0, 0,
-/* D0 */ '}', 0, -ESC_K, 0, 0,-ESC_N, 0, -ESC_P,
-/* D8 */-ESC_Q,-ESC_R, 0, 0, 0, 0, 0, 0,
-/* E0 */ '\\', 0, -ESC_S, 0, 0,-ESC_V, -ESC_W, -ESC_X,
-/* E8 */ 0,-ESC_Z, 0, 0, 0, 0, 0, 0,
-/* F0 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* F8 */ 0, 0, 0, 0, 0, 0, 0, 0
-};
-#endif
-
-
-/* Table of special "verbs" like (*PRUNE). This is a short table, so it is
-searched linearly. Put all the names into a single string, in order to reduce
-the number of relocations when a shared library is dynamically linked. The
-string is built from string macros so that it works in UTF-8 mode on EBCDIC
-platforms. */
-
-typedef struct verbitem {
- int len; /* Length of verb name */
- int op; /* Op when no arg, or -1 if arg mandatory */
- int op_arg; /* Op when arg present, or -1 if not allowed */
-} verbitem;
-
-static const char verbnames[] =
- "\0" /* Empty name is a shorthand for MARK */
- STRING_MARK0
- STRING_ACCEPT0
- STRING_COMMIT0
- STRING_F0
- STRING_FAIL0
- STRING_PRUNE0
- STRING_SKIP0
- STRING_THEN;
-
-static const verbitem verbs[] = {
- { 0, -1, OP_MARK },
- { 4, -1, OP_MARK },
- { 6, OP_ACCEPT, -1 },
- { 6, OP_COMMIT, -1 },
- { 1, OP_FAIL, -1 },
- { 4, OP_FAIL, -1 },
- { 5, OP_PRUNE, OP_PRUNE_ARG },
- { 4, OP_SKIP, OP_SKIP_ARG },
- { 4, OP_THEN, OP_THEN_ARG }
-};
-
-static const int verbcount = sizeof(verbs)/sizeof(verbitem);
-
-
-/* Substitutes for [[:<:]] and [[:>:]], which mean start and end of word in
-another regex library. */
-
-static const pcre_uchar sub_start_of_word[] = {
- CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
- CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w, CHAR_RIGHT_PARENTHESIS, '\0' };
-
-static const pcre_uchar sub_end_of_word[] = {
- CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
- CHAR_LESS_THAN_SIGN, CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w,
- CHAR_RIGHT_PARENTHESIS, '\0' };
-
-
-/* Tables of names of POSIX character classes and their lengths. The names are
-now all in a single string, to reduce the number of relocations when a shared
-library is dynamically loaded. The list of lengths is terminated by a zero
-length entry. The first three must be alpha, lower, upper, as this is assumed
-for handling case independence. The indices for graph, print, and punct are
-needed, so identify them. */
-
-static const char posix_names[] =
- STRING_alpha0 STRING_lower0 STRING_upper0 STRING_alnum0
- STRING_ascii0 STRING_blank0 STRING_cntrl0 STRING_digit0
- STRING_graph0 STRING_print0 STRING_punct0 STRING_space0
- STRING_word0 STRING_xdigit;
-
-static const pcre_uint8 posix_name_lengths[] = {
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 };
-
-#define PC_GRAPH 8
-#define PC_PRINT 9
-#define PC_PUNCT 10
-
-
-/* Table of class bit maps for each POSIX class. Each class is formed from a
-base map, with an optional addition or removal of another map. Then, for some
-classes, there is some additional tweaking: for [:blank:] the vertical space
-characters are removed, and for [:alpha:] and [:alnum:] the underscore
-character is removed. The triples in the table consist of the base map offset,
-second map offset or -1 if no second map, and a non-negative value for map
-addition or a negative value for map subtraction (if there are two maps). The
-absolute value of the third field has these meanings: 0 => no tweaking, 1 =>
-remove vertical space characters, 2 => remove underscore. */
-
-static const int posix_class_maps[] = {
- cbit_word, cbit_digit, -2, /* alpha */
- cbit_lower, -1, 0, /* lower */
- cbit_upper, -1, 0, /* upper */
- cbit_word, -1, 2, /* alnum - word without underscore */
- cbit_print, cbit_cntrl, 0, /* ascii */
- cbit_space, -1, 1, /* blank - a GNU extension */
- cbit_cntrl, -1, 0, /* cntrl */
- cbit_digit, -1, 0, /* digit */
- cbit_graph, -1, 0, /* graph */
- cbit_print, -1, 0, /* print */
- cbit_punct, -1, 0, /* punct */
- cbit_space, -1, 0, /* space */
- cbit_word, -1, 0, /* word - a Perl extension */
- cbit_xdigit,-1, 0 /* xdigit */
-};
-
-/* Table of substitutes for \d etc when PCRE_UCP is set. They are replaced by
-Unicode property escapes. */
-
-#ifdef SUPPORT_UCP
-static const pcre_uchar string_PNd[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_N, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pNd[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_N, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PXsp[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_s, CHAR_p, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pXsp[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_s, CHAR_p, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PXwd[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_w, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pXwd[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_w, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-
-static const pcre_uchar *substitutes[] = {
- string_PNd, /* \D */
- string_pNd, /* \d */
- string_PXsp, /* \S */ /* Xsp is Perl space, but from 8.34, Perl */
- string_pXsp, /* \s */ /* space and POSIX space are the same. */
- string_PXwd, /* \W */
- string_pXwd /* \w */
-};
-
-/* The POSIX class substitutes must be in the order of the POSIX class names,
-defined above, and there are both positive and negative cases. NULL means no
-general substitute of a Unicode property escape (\p or \P). However, for some
-POSIX classes (e.g. graph, print, punct) a special property code is compiled
-directly. */
-
-static const pcre_uchar string_pL[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pLl[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_l, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pLu[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_u, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pXan[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_a, CHAR_n, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_h[] = {
- CHAR_BACKSLASH, CHAR_h, '\0' };
-static const pcre_uchar string_pXps[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_p, CHAR_s, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PL[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PLl[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_l, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PLu[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_u, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PXan[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_a, CHAR_n, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_H[] = {
- CHAR_BACKSLASH, CHAR_H, '\0' };
-static const pcre_uchar string_PXps[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_p, CHAR_s, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-
-static const pcre_uchar *posix_substitutes[] = {
- string_pL, /* alpha */
- string_pLl, /* lower */
- string_pLu, /* upper */
- string_pXan, /* alnum */
- NULL, /* ascii */
- string_h, /* blank */
- NULL, /* cntrl */
- string_pNd, /* digit */
- NULL, /* graph */
- NULL, /* print */
- NULL, /* punct */
- string_pXps, /* space */ /* Xps is POSIX space, but from 8.34 */
- string_pXwd, /* word */ /* Perl and POSIX space are the same */
- NULL, /* xdigit */
- /* Negated cases */
- string_PL, /* ^alpha */
- string_PLl, /* ^lower */
- string_PLu, /* ^upper */
- string_PXan, /* ^alnum */
- NULL, /* ^ascii */
- string_H, /* ^blank */
- NULL, /* ^cntrl */
- string_PNd, /* ^digit */
- NULL, /* ^graph */
- NULL, /* ^print */
- NULL, /* ^punct */
- string_PXps, /* ^space */ /* Xps is POSIX space, but from 8.34 */
- string_PXwd, /* ^word */ /* Perl and POSIX space are the same */
- NULL /* ^xdigit */
-};
-#define POSIX_SUBSIZE (sizeof(posix_substitutes) / sizeof(pcre_uchar *))
-#endif
-
-#define STRING(a) # a
-#define XSTRING(s) STRING(s)
-
-/* The texts of compile-time error messages. These are "char *" because they
-are passed to the outside world. Do not ever re-use any error number, because
-they are documented. Always add a new error instead. Messages marked DEAD below
-are no longer used. This used to be a table of strings, but in order to reduce
-the number of relocations needed when a shared library is loaded dynamically,
-it is now one long string. We cannot use a table of offsets, because the
-lengths of inserts such as XSTRING(MAX_NAME_SIZE) are not known. Instead, we
-simply count through to the one we want - this isn't a performance issue
-because these strings are used only when there is a compilation error.
-
-Each substring ends with \0 to insert a null character. This includes the final
-substring, so that the whole string ends with \0\0, which can be detected when
-counting through. */
-
-static const char error_texts[] =
- "no error\0"
- "\\ at end of pattern\0"
- "\\c at end of pattern\0"
- "unrecognized character follows \\\0"
- "numbers out of order in {} quantifier\0"
- /* 5 */
- "number too big in {} quantifier\0"
- "missing terminating ] for character class\0"
- "invalid escape sequence in character class\0"
- "range out of order in character class\0"
- "nothing to repeat\0"
- /* 10 */
- "operand of unlimited repeat could match the empty string\0" /** DEAD **/
- "internal error: unexpected repeat\0"
- "unrecognized character after (? or (?-\0"
- "POSIX named classes are supported only within a class\0"
- "missing )\0"
- /* 15 */
- "reference to non-existent subpattern\0"
- "erroffset passed as NULL\0"
- "unknown option bit(s) set\0"
- "missing ) after comment\0"
- "parentheses nested too deeply\0" /** DEAD **/
- /* 20 */
- "regular expression is too large\0"
- "failed to get memory\0"
- "unmatched parentheses\0"
- "internal error: code overflow\0"
- "unrecognized character after (?<\0"
- /* 25 */
- "lookbehind assertion is not fixed length\0"
- "malformed number or name after (?(\0"
- "conditional group contains more than two branches\0"
- "assertion expected after (?(\0"
- "(?R or (?[+-]digits must be followed by )\0"
- /* 30 */
- "unknown POSIX class name\0"
- "POSIX collating elements are not supported\0"
- "this version of PCRE is compiled without UTF support\0"
- "spare error\0" /** DEAD **/
- "character value in \\x{} or \\o{} is too large\0"
- /* 35 */
- "invalid condition (?(0)\0"
- "\\C not allowed in lookbehind assertion\0"
- "PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u\0"
- "number after (?C is > 255\0"
- "closing ) for (?C expected\0"
- /* 40 */
- "recursive call could loop indefinitely\0"
- "unrecognized character after (?P\0"
- "syntax error in subpattern name (missing terminator)\0"
- "two named subpatterns have the same name\0"
- "invalid UTF-8 string\0"
- /* 45 */
- "support for \\P, \\p, and \\X has not been compiled\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"
- "too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0"
- /* 50 */
- "repeated subpattern is too long\0" /** DEAD **/
- "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"
- /* 55 */
- "repeating a DEFINE group is not allowed\0" /** DEAD **/
- "inconsistent NEWLINE options\0"
- "\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0"
- "a numbered reference must not be zero\0"
- "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)\0"
- /* 60 */
- "(*VERB) not recognized or malformed\0"
- "number is too big\0"
- "subpattern name expected\0"
- "digit expected after (?+\0"
- "] is an invalid data character in JavaScript compatibility mode\0"
- /* 65 */
- "different names for subpatterns of the same number are not allowed\0"
- "(*MARK) must have an argument\0"
- "this version of PCRE is not compiled with Unicode property support\0"
- "\\c must be followed by an ASCII character\0"
- "\\k is not followed by a braced, angle-bracketed, or quoted name\0"
- /* 70 */
- "internal error: unknown opcode in find_fixedlength()\0"
- "\\N is not supported in a class\0"
- "too many forward references\0"
- "disallowed Unicode code point (>= 0xd800 && <= 0xdfff)\0"
- "invalid UTF-16 string\0"
- /* 75 */
- "name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0"
- "character value in \\u.... sequence is too large\0"
- "invalid UTF-32 string\0"
- "setting UTF is disabled by the application\0"
- "non-hex character in \\x{} (closing brace missing?)\0"
- /* 80 */
- "non-octal character in \\o{} (closing brace missing?)\0"
- "missing opening brace after \\o\0"
- "parentheses are too deeply nested\0"
- "invalid range in character class\0"
- "group name must start with a non-digit\0"
- /* 85 */
- "parentheses are too deeply nested (stack check)\0"
- ;
-
-/* Table to identify digits and hex digits. This is used when compiling
-patterns. Note that the tables in chartables are dependent on the locale, and
-may mark arbitrary characters as digits - but the PCRE compiling code expects
-to handle only 0-9, a-z, and A-Z as digits when compiling. That is why we have
-a private table here. It costs 256 bytes, but it is a lot faster than doing
-character value tests (at least in some simple cases I timed), and in some
-applications one wants PCRE to compile efficiently as well as match
-efficiently.
-
-For convenience, we use the same bit definitions as in chartables:
-
- 0x04 decimal digit
- 0x08 hexadecimal digit
-
-Then we can use ctype_digit and ctype_xdigit in the code. */
-
-/* Using a simple comparison for decimal numbers rather than a memory read
-is much faster, and the resulting code is simpler (the compiler turns it
-into a subtraction and unsigned comparison). */
-
-#define IS_DIGIT(x) ((x) >= CHAR_0 && (x) <= CHAR_9)
-
-#ifndef EBCDIC
-
-/* This is the "normal" case, for ASCII systems, and EBCDIC systems running in
-UTF-8 mode. */
-
-static const pcre_uint8 digitab[] =
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - ' */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ( - / */
- 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 */
- 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* @ - G */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H - O */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* P - W */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* X - _ */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* ` - g */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h - o */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* p - w */
- 0x00,0x00,0x00,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 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
-
-#else
-
-/* This is the "abnormal" case, for EBCDIC systems not running in UTF-8 mode. */
-
-static const pcre_uint8 digitab[] =
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 10 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32- 39 20 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 30 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 40 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 72- | */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 50 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 88- 95 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 60 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 104- ? */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 70 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* 128- g 80 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144- p 90 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160- x A0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 B0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* { - G C0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* } - P D0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* \ - X E0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */
- 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 F0 */
- 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */
-
-static const pcre_uint8 ebcdic_chartab[] = { /* chartable partial dup */
- 0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 0- 7 */
- 0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 16- 23 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 32- 39 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */
- 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 */
- 0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80, /* 72- | */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 */
- 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, /* 88- 95 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 */
- 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80, /* 104- ? */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */
- 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* 128- g */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */
- 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* 144- p */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */
- 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* 160- x */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */
- 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 */
- 0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x80,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* { - G */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */
- 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* } - P */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */
- 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* \ - X */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */
- 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
- 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */
-#endif
-
-
-/* This table is used to check whether auto-possessification is possible
-between adjacent character-type opcodes. The left-hand (repeated) opcode is
-used to select the row, and the right-hand opcode is use to select the column.
-A value of 1 means that auto-possessification is OK. For example, the second
-value in the first row means that \D+\d can be turned into \D++\d.
-
-The Unicode property types (\P and \p) have to be present to fill out the table
-because of what their opcode values are, but the table values should always be
-zero because property types are handled separately in the code. The last four
-columns apply to items that cannot be repeated, so there is no need to have
-rows for them. Note that OP_DIGIT etc. are generated only when PCRE_UCP is
-*not* set. When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */
-
-#define APTROWS (LAST_AUTOTAB_LEFT_OP - FIRST_AUTOTAB_OP + 1)
-#define APTCOLS (LAST_AUTOTAB_RIGHT_OP - FIRST_AUTOTAB_OP + 1)
-
-static const pcre_uint8 autoposstab[APTROWS][APTCOLS] = {
-/* \D \d \S \s \W \w . .+ \C \P \p \R \H \h \V \v \X \Z \z $ $M */
- { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* \D */
- { 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1 }, /* \d */
- { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1 }, /* \S */
- { 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* \s */
- { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* \W */
- { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1 }, /* \w */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* . */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* .+ */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* \C */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \P */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \p */
- { 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 }, /* \R */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 }, /* \H */
- { 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0 }, /* \h */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0 }, /* \V */
- { 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0 }, /* \v */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } /* \X */
-};
-
-
-/* This table is used to check whether auto-possessification is possible
-between adjacent Unicode property opcodes (OP_PROP and OP_NOTPROP). The
-left-hand (repeated) opcode is used to select the row, and the right-hand
-opcode is used to select the column. The values are as follows:
-
- 0 Always return FALSE (never auto-possessify)
- 1 Character groups are distinct (possessify if both are OP_PROP)
- 2 Check character categories in the same group (general or particular)
- 3 TRUE if the two opcodes are not the same (PROP vs NOTPROP)
-
- 4 Check left general category vs right particular category
- 5 Check right general category vs left particular category
-
- 6 Left alphanum vs right general category
- 7 Left space vs right general category
- 8 Left word vs right general category
-
- 9 Right alphanum vs left general category
- 10 Right space vs left general category
- 11 Right word vs left general category
-
- 12 Left alphanum vs right particular category
- 13 Left space vs right particular category
- 14 Left word vs right particular category
-
- 15 Right alphanum vs left particular category
- 16 Right space vs left particular category
- 17 Right word vs left particular category
-*/
-
-static const pcre_uint8 propposstab[PT_TABSIZE][PT_TABSIZE] = {
-/* ANY LAMP GC PC SC ALNUM SPACE PXSPACE WORD CLIST UCNC */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_ANY */
- { 0, 3, 0, 0, 0, 3, 1, 1, 0, 0, 0 }, /* PT_LAMP */
- { 0, 0, 2, 4, 0, 9, 10, 10, 11, 0, 0 }, /* PT_GC */
- { 0, 0, 5, 2, 0, 15, 16, 16, 17, 0, 0 }, /* PT_PC */
- { 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 }, /* PT_SC */
- { 0, 3, 6, 12, 0, 3, 1, 1, 0, 0, 0 }, /* PT_ALNUM */
- { 0, 1, 7, 13, 0, 1, 3, 3, 1, 0, 0 }, /* PT_SPACE */
- { 0, 1, 7, 13, 0, 1, 3, 3, 1, 0, 0 }, /* PT_PXSPACE */
- { 0, 0, 8, 14, 0, 0, 1, 1, 3, 0, 0 }, /* PT_WORD */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_CLIST */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 } /* PT_UCNC */
-};
-
-/* This table is used to check whether auto-possessification is possible
-between adjacent Unicode property opcodes (OP_PROP and OP_NOTPROP) when one
-specifies a general category and the other specifies a particular category. The
-row is selected by the general category and the column by the particular
-category. The value is 1 if the particular category is not part of the general
-category. */
-
-static const pcre_uint8 catposstab[7][30] = {
-/* Cc Cf Cn Co Cs Ll Lm Lo Lt Lu Mc Me Mn Nd Nl No Pc Pd Pe Pf Pi Po Ps Sc Sk Sm So Zl Zp Zs */
- { 0, 0, 0, 0, 0, 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 }, /* C */
- { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* L */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* M */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* N */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }, /* P */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1 }, /* S */
- { 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, 0, 0, 0 } /* Z */
-};
-
-/* This table is used when checking ALNUM, (PX)SPACE, SPACE, and WORD against
-a general or particular category. The properties in each row are those
-that apply to the character set in question. Duplication means that a little
-unnecessary work is done when checking, but this keeps things much simpler
-because they can all use the same code. For more details see the comment where
-this table is used.
-
-Note: SPACE and PXSPACE used to be different because Perl excluded VT from
-"space", but from Perl 5.18 it's included, so both categories are treated the
-same here. */
-
-static const pcre_uint8 posspropstab[3][4] = {
- { ucp_L, ucp_N, ucp_N, ucp_Nl }, /* ALNUM, 3rd and 4th values redundant */
- { ucp_Z, ucp_Z, ucp_C, ucp_Cc }, /* SPACE and PXSPACE, 2nd value redundant */
- { ucp_L, ucp_N, ucp_P, ucp_Po } /* WORD */
-};
-
-/* This table is used when converting repeating opcodes into possessified
-versions as a result of an explicit possessive quantifier such as ++. A zero
-value means there is no possessified version - in those cases the item in
-question must be wrapped in ONCE brackets. The table is truncated at OP_CALLOUT
-because all relevant opcodes are less than that. */
-
-static const pcre_uint8 opcode_possessify[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 15 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16 - 31 */
-
- 0, /* NOTI */
- OP_POSSTAR, 0, /* STAR, MINSTAR */
- OP_POSPLUS, 0, /* PLUS, MINPLUS */
- OP_POSQUERY, 0, /* QUERY, MINQUERY */
- OP_POSUPTO, 0, /* UPTO, MINUPTO */
- 0, /* EXACT */
- 0, 0, 0, 0, /* POS{STAR,PLUS,QUERY,UPTO} */
-
- OP_POSSTARI, 0, /* STARI, MINSTARI */
- OP_POSPLUSI, 0, /* PLUSI, MINPLUSI */
- OP_POSQUERYI, 0, /* QUERYI, MINQUERYI */
- OP_POSUPTOI, 0, /* UPTOI, MINUPTOI */
- 0, /* EXACTI */
- 0, 0, 0, 0, /* POS{STARI,PLUSI,QUERYI,UPTOI} */
-
- OP_NOTPOSSTAR, 0, /* NOTSTAR, NOTMINSTAR */
- OP_NOTPOSPLUS, 0, /* NOTPLUS, NOTMINPLUS */
- OP_NOTPOSQUERY, 0, /* NOTQUERY, NOTMINQUERY */
- OP_NOTPOSUPTO, 0, /* NOTUPTO, NOTMINUPTO */
- 0, /* NOTEXACT */
- 0, 0, 0, 0, /* NOTPOS{STAR,PLUS,QUERY,UPTO} */
-
- OP_NOTPOSSTARI, 0, /* NOTSTARI, NOTMINSTARI */
- OP_NOTPOSPLUSI, 0, /* NOTPLUSI, NOTMINPLUSI */
- OP_NOTPOSQUERYI, 0, /* NOTQUERYI, NOTMINQUERYI */
- OP_NOTPOSUPTOI, 0, /* NOTUPTOI, NOTMINUPTOI */
- 0, /* NOTEXACTI */
- 0, 0, 0, 0, /* NOTPOS{STARI,PLUSI,QUERYI,UPTOI} */
-
- OP_TYPEPOSSTAR, 0, /* TYPESTAR, TYPEMINSTAR */
- OP_TYPEPOSPLUS, 0, /* TYPEPLUS, TYPEMINPLUS */
- OP_TYPEPOSQUERY, 0, /* TYPEQUERY, TYPEMINQUERY */
- OP_TYPEPOSUPTO, 0, /* TYPEUPTO, TYPEMINUPTO */
- 0, /* TYPEEXACT */
- 0, 0, 0, 0, /* TYPEPOS{STAR,PLUS,QUERY,UPTO} */
-
- OP_CRPOSSTAR, 0, /* CRSTAR, CRMINSTAR */
- OP_CRPOSPLUS, 0, /* CRPLUS, CRMINPLUS */
- OP_CRPOSQUERY, 0, /* CRQUERY, CRMINQUERY */
- OP_CRPOSRANGE, 0, /* CRRANGE, CRMINRANGE */
- 0, 0, 0, 0, /* CRPOS{STAR,PLUS,QUERY,RANGE} */
-
- 0, 0, 0, /* CLASS, NCLASS, XCLASS */
- 0, 0, /* REF, REFI */
- 0, 0, /* DNREF, DNREFI */
- 0, 0 /* RECURSE, CALLOUT */
-};
-
-
-
-/*************************************************
-* Find an error text *
-*************************************************/
-
-/* The error texts are now all in one long string, to save on relocations. As
-some of the text is of unknown length, we can't use a table of offsets.
-Instead, just count through the strings. This is not a performance issue
-because it happens only when there has been a compilation error.
-
-Argument: the error number
-Returns: pointer to the error string
-*/
-
-static const char *
-find_error_text(int n)
-{
-const char *s = error_texts;
-for (; n > 0; n--)
- {
- while (*s++ != CHAR_NULL) {};
- if (*s == CHAR_NULL) return "Error text not found (please report)";
- }
-return s;
-}
-
-
-
-/*************************************************
-* Expand the workspace *
-*************************************************/
-
-/* This function is called during the second compiling phase, if the number of
-forward references fills the existing workspace, which is originally a block on
-the stack. A larger block is obtained from malloc() unless the ultimate limit
-has been reached or the increase will be rather small.
-
-Argument: pointer to the compile data block
-Returns: 0 if all went well, else an error number
-*/
-
-static int
-expand_workspace(compile_data *cd)
-{
-pcre_uchar *newspace;
-int newsize = cd->workspace_size * 2;
-
-if (newsize > COMPILE_WORK_SIZE_MAX) newsize = COMPILE_WORK_SIZE_MAX;
-if (cd->workspace_size >= COMPILE_WORK_SIZE_MAX ||
- newsize - cd->workspace_size < WORK_SIZE_SAFETY_MARGIN)
- return ERR72;
-
-newspace = (PUBL(malloc))(IN_UCHARS(newsize));
-if (newspace == NULL) return ERR21;
-memcpy(newspace, cd->start_workspace, cd->workspace_size * sizeof(pcre_uchar));
-cd->hwm = (pcre_uchar *)newspace + (cd->hwm - cd->start_workspace);
-if (cd->workspace_size > COMPILE_WORK_SIZE)
- (PUBL(free))((void *)cd->start_workspace);
-cd->start_workspace = newspace;
-cd->workspace_size = newsize;
-return 0;
-}
-
-
-
-/*************************************************
-* Check for counted repeat *
-*************************************************/
-
-/* This function is called when a '{' is encountered in a place where it might
-start a quantifier. It looks ahead to see if it really is a quantifier or not.
-It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd}
-where the ddds are digits.
-
-Arguments:
- p pointer to the first char after '{'
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_counted_repeat(const pcre_uchar *p)
-{
-if (!IS_DIGIT(*p)) return FALSE;
-p++;
-while (IS_DIGIT(*p)) p++;
-if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE;
-
-if (*p++ != CHAR_COMMA) return FALSE;
-if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE;
-
-if (!IS_DIGIT(*p)) return FALSE;
-p++;
-while (IS_DIGIT(*p)) p++;
-
-return (*p == CHAR_RIGHT_CURLY_BRACKET);
-}
-
-
-
-/*************************************************
-* Handle escapes *
-*************************************************/
-
-/* This function is called when a \ has been encountered. It either returns a
-positive value for a simple escape such as \n, or 0 for a data character which
-will be placed in chptr. A backreference to group n is returned as negative n.
-When UTF-8 is enabled, a positive value greater than 255 may be returned in
-chptr. On entry, ptr is pointing at the \. On exit, it is on the final
-character of the escape sequence.
-
-Arguments:
- ptrptr points to the pattern position pointer
- chptr points to a returned data character
- errorcodeptr points to the errorcode variable
- bracount number of previous extracting brackets
- options the options bits
- isclass TRUE if inside a character class
-
-Returns: zero => a data character
- positive => a special escape sequence
- negative => a back reference
- on error, errorcodeptr is set
-*/
-
-static int
-check_escape(const pcre_uchar **ptrptr, pcre_uint32 *chptr, int *errorcodeptr,
- int bracount, int options, BOOL isclass)
-{
-/* PCRE_UTF16 has the same value as PCRE_UTF8. */
-BOOL utf = (options & PCRE_UTF8) != 0;
-const pcre_uchar *ptr = *ptrptr + 1;
-pcre_uint32 c;
-int escape = 0;
-int i;
-
-GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */
-ptr--; /* Set pointer back to the last byte */
-
-/* If backslash is at the end of the pattern, it's an error. */
-
-if (c == CHAR_NULL) *errorcodeptr = ERR1;
-
-/* Non-alphanumerics are literals. For digits or letters, do an initial lookup
-in a table. A non-zero result is something that can be returned immediately.
-Otherwise further processing may be required. */
-
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
-/* Not alphanumeric */
-else if (c < CHAR_0 || c > CHAR_z) {}
-else if ((i = escapes[c - CHAR_0]) != 0)
- { if (i > 0) c = (pcre_uint32)i; else escape = -i; }
-
-#else /* EBCDIC coding */
-/* Not alphanumeric */
-else if (c < CHAR_a || (!MAX_255(c) || (ebcdic_chartab[c] & 0x0E) == 0)) {}
-else if ((i = escapes[c - 0x48]) != 0) { if (i > 0) c = (pcre_uint32)i; else escape = -i; }
-#endif
-
-/* Escapes that need further processing, or are illegal. */
-
-else
- {
- const pcre_uchar *oldptr;
- BOOL braced, negated, overflow;
- int s;
-
- switch (c)
- {
- /* A number of Perl escapes are not handled by PCRE. We give an explicit
- error. */
-
- case CHAR_l:
- case CHAR_L:
- *errorcodeptr = ERR37;
- break;
-
- case CHAR_u:
- if ((options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- /* In JavaScript, \u must be followed by four hexadecimal numbers.
- Otherwise it is a lowercase u letter. */
- if (MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0
- && MAX_255(ptr[2]) && (digitab[ptr[2]] & ctype_xdigit) != 0
- && MAX_255(ptr[3]) && (digitab[ptr[3]] & ctype_xdigit) != 0
- && MAX_255(ptr[4]) && (digitab[ptr[4]] & ctype_xdigit) != 0)
- {
- c = 0;
- for (i = 0; i < 4; ++i)
- {
- register pcre_uint32 cc = *(++ptr);
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */
- c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
-#else /* EBCDIC coding */
- if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */
- c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10));
-#endif
- }
-
-#if defined COMPILE_PCRE8
- if (c > (utf ? 0x10ffffU : 0xffU))
-#elif defined COMPILE_PCRE16
- if (c > (utf ? 0x10ffffU : 0xffffU))
-#elif defined COMPILE_PCRE32
- if (utf && c > 0x10ffffU)
-#endif
- {
- *errorcodeptr = ERR76;
- }
- else if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
- }
- }
- else
- *errorcodeptr = ERR37;
- break;
-
- case CHAR_U:
- /* In JavaScript, \U is an uppercase U letter. */
- if ((options & PCRE_JAVASCRIPT_COMPAT) == 0) *errorcodeptr = ERR37;
- break;
-
- /* In a character class, \g is just a literal "g". Outside a character
- class, \g must be followed by one of a number of specific things:
-
- (1) A number, either plain or braced. If positive, it is an absolute
- backreference. If negative, it is a relative backreference. This is a Perl
- 5.10 feature.
-
- (2) Perl 5.10 also supports \g{name} as a reference to a named group. This
- is part of Perl's movement towards a unified syntax for back references. As
- this is synonymous with \k{name}, we fudge it up by pretending it really
- was \k.
-
- (3) For Oniguruma compatibility we also support \g followed by a name or a
- number either in angle brackets or in single quotes. However, these are
- (possibly recursive) subroutine calls, _not_ backreferences. Just return
- the ESC_g code (cf \k). */
-
- case CHAR_g:
- if (isclass) break;
- if (ptr[1] == CHAR_LESS_THAN_SIGN || ptr[1] == CHAR_APOSTROPHE)
- {
- escape = ESC_g;
- break;
- }
-
- /* Handle the Perl-compatible cases */
-
- if (ptr[1] == CHAR_LEFT_CURLY_BRACKET)
- {
- const pcre_uchar *p;
- for (p = ptr+2; *p != CHAR_NULL && *p != CHAR_RIGHT_CURLY_BRACKET; p++)
- if (*p != CHAR_MINUS && !IS_DIGIT(*p)) break;
- if (*p != CHAR_NULL && *p != CHAR_RIGHT_CURLY_BRACKET)
- {
- escape = ESC_k;
- break;
- }
- braced = TRUE;
- ptr++;
- }
- else braced = FALSE;
-
- if (ptr[1] == CHAR_MINUS)
- {
- negated = TRUE;
- ptr++;
- }
- else negated = FALSE;
-
- /* The integer range is limited by the machine's int representation. */
- s = 0;
- overflow = FALSE;
- while (IS_DIGIT(ptr[1]))
- {
- if (s > INT_MAX / 10 - 1) /* Integer overflow */
- {
- overflow = TRUE;
- break;
- }
- s = s * 10 + (int)(*(++ptr) - CHAR_0);
- }
- if (overflow) /* Integer overflow */
- {
- while (IS_DIGIT(ptr[1]))
- ptr++;
- *errorcodeptr = ERR61;
- break;
- }
-
- if (braced && *(++ptr) != CHAR_RIGHT_CURLY_BRACKET)
- {
- *errorcodeptr = ERR57;
- break;
- }
-
- if (s == 0)
- {
- *errorcodeptr = ERR58;
- break;
- }
-
- if (negated)
- {
- if (s > bracount)
- {
- *errorcodeptr = ERR15;
- break;
- }
- s = bracount - (s - 1);
- }
-
- escape = -s;
- break;
-
- /* The handling of escape sequences consisting of a string of digits
- starting with one that is not zero is not straightforward. Perl has changed
- over the years. Nowadays \g{} for backreferences and \o{} for octal are
- recommended to avoid the ambiguities in the old syntax.
-
- Outside a character class, the digits are read as a decimal number. If the
- number is less than 8 (used to be 10), or if there are that many previous
- extracting left brackets, then it is a back reference. Otherwise, up to
- three octal digits are read to form an escaped byte. Thus \123 is likely to
- be octal 123 (cf \0123, which is octal 012 followed by the literal 3). If
- the octal value is greater than 377, the least significant 8 bits are
- taken. \8 and \9 are treated as the literal characters 8 and 9.
-
- Inside a character class, \ followed by a digit is always either a literal
- 8 or 9 or an octal number. */
-
- case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4: case CHAR_5:
- case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9:
-
- if (!isclass)
- {
- oldptr = ptr;
- /* The integer range is limited by the machine's int representation. */
- s = (int)(c -CHAR_0);
- overflow = FALSE;
- while (IS_DIGIT(ptr[1]))
- {
- if (s > INT_MAX / 10 - 1) /* Integer overflow */
- {
- overflow = TRUE;
- break;
- }
- s = s * 10 + (int)(*(++ptr) - CHAR_0);
- }
- if (overflow) /* Integer overflow */
- {
- while (IS_DIGIT(ptr[1]))
- ptr++;
- *errorcodeptr = ERR61;
- break;
- }
- if (s < 8 || s <= bracount) /* Check for back reference */
- {
- escape = -s;
- break;
- }
- ptr = oldptr; /* Put the pointer back and fall through */
- }
-
- /* Handle a digit following \ when the number is not a back reference. If
- the first digit is 8 or 9, Perl used to generate a binary zero byte and
- then treat the digit as a following literal. At least by Perl 5.18 this
- changed so as not to insert the binary zero. */
-
- if ((c = *ptr) >= CHAR_8) break;
-
- /* Fall through with a digit less than 8 */
-
- /* \0 always starts an octal number, but we may drop through to here with a
- larger first octal digit. The original code used just to take the least
- significant 8 bits of octal numbers (I think this is what early Perls used
- to do). Nowadays we allow for larger numbers in UTF-8 mode and 16-bit mode,
- but no more than 3 octal digits. */
-
- case CHAR_0:
- c -= CHAR_0;
- while(i++ < 2 && ptr[1] >= CHAR_0 && ptr[1] <= CHAR_7)
- c = c * 8 + *(++ptr) - CHAR_0;
-#ifdef COMPILE_PCRE8
- if (!utf && c > 0xff) *errorcodeptr = ERR51;
-#endif
- break;
-
- /* \o is a relatively new Perl feature, supporting a more general way of
- specifying character codes in octal. The only supported form is \o{ddd}. */
-
- case CHAR_o:
- if (ptr[1] != CHAR_LEFT_CURLY_BRACKET) *errorcodeptr = ERR81; else
- {
- ptr += 2;
- c = 0;
- overflow = FALSE;
- while (*ptr >= CHAR_0 && *ptr <= CHAR_7)
- {
- register pcre_uint32 cc = *ptr++;
- if (c == 0 && cc == CHAR_0) continue; /* Leading zeroes */
-#ifdef COMPILE_PCRE32
- if (c >= 0x20000000l) { overflow = TRUE; break; }
-#endif
- c = (c << 3) + cc - CHAR_0 ;
-#if defined COMPILE_PCRE8
- if (c > (utf ? 0x10ffffU : 0xffU)) { overflow = TRUE; break; }
-#elif defined COMPILE_PCRE16
- if (c > (utf ? 0x10ffffU : 0xffffU)) { overflow = TRUE; break; }
-#elif defined COMPILE_PCRE32
- if (utf && c > 0x10ffffU) { overflow = TRUE; break; }
-#endif
- }
- if (overflow)
- {
- while (*ptr >= CHAR_0 && *ptr <= CHAR_7) ptr++;
- *errorcodeptr = ERR34;
- }
- else if (*ptr == CHAR_RIGHT_CURLY_BRACKET)
- {
- if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
- }
- else *errorcodeptr = ERR80;
- }
- break;
-
- /* \x is complicated. In JavaScript, \x must be followed by two hexadecimal
- numbers. Otherwise it is a lowercase x letter. */
-
- case CHAR_x:
- if ((options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- if (MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0
- && MAX_255(ptr[2]) && (digitab[ptr[2]] & ctype_xdigit) != 0)
- {
- c = 0;
- for (i = 0; i < 2; ++i)
- {
- register pcre_uint32 cc = *(++ptr);
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */
- c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
-#else /* EBCDIC coding */
- if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */
- c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10));
-#endif
- }
- }
- } /* End JavaScript handling */
-
- /* Handle \x in Perl's style. \x{ddd} is a character number which can be
- greater than 0xff in utf 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
- that, for example \x{zz} matches a binary zero. This seems crazy, so PCRE
- now gives an error. */
-
- else
- {
- if (ptr[1] == CHAR_LEFT_CURLY_BRACKET)
- {
- ptr += 2;
- c = 0;
- overflow = FALSE;
- while (MAX_255(*ptr) && (digitab[*ptr] & ctype_xdigit) != 0)
- {
- register pcre_uint32 cc = *ptr++;
- if (c == 0 && cc == CHAR_0) continue; /* Leading zeroes */
-
-#ifdef COMPILE_PCRE32
- if (c >= 0x10000000l) { overflow = TRUE; break; }
-#endif
-
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */
- c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
-#else /* EBCDIC coding */
- if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */
- c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10));
-#endif
-
-#if defined COMPILE_PCRE8
- if (c > (utf ? 0x10ffffU : 0xffU)) { overflow = TRUE; break; }
-#elif defined COMPILE_PCRE16
- if (c > (utf ? 0x10ffffU : 0xffffU)) { overflow = TRUE; break; }
-#elif defined COMPILE_PCRE32
- if (utf && c > 0x10ffffU) { overflow = TRUE; break; }
-#endif
- }
-
- if (overflow)
- {
- while (MAX_255(*ptr) && (digitab[*ptr] & ctype_xdigit) != 0) ptr++;
- *errorcodeptr = ERR34;
- }
-
- else if (*ptr == CHAR_RIGHT_CURLY_BRACKET)
- {
- if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
- }
-
- /* If the sequence of hex digits does not end with '}', give an error.
- We used just to recognize this construct and fall through to the normal
- \x handling, but nowadays Perl gives an error, which seems much more
- sensible, so we do too. */
-
- else *errorcodeptr = ERR79;
- } /* End of \x{} processing */
-
- /* Read a single-byte hex-defined char (up to two hex digits after \x) */
-
- else
- {
- c = 0;
- while (i++ < 2 && MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0)
- {
- pcre_uint32 cc; /* Some compilers don't like */
- cc = *(++ptr); /* ++ in initializers */
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */
- c = c * 16 + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
-#else /* EBCDIC coding */
- if (cc <= CHAR_z) cc += 64; /* Convert to upper case */
- c = c * 16 + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10));
-#endif
- }
- } /* End of \xdd handling */
- } /* End of Perl-style \x handling */
- break;
-
- /* For \c, a following letter is upper-cased; then the 0x40 bit is flipped.
- An error is given if the byte following \c is not an ASCII character. This
- coding is ASCII-specific, but then the whole concept of \cx is
- ASCII-specific. (However, an EBCDIC equivalent has now been added.) */
-
- case CHAR_c:
- c = *(++ptr);
- if (c == CHAR_NULL)
- {
- *errorcodeptr = ERR2;
- break;
- }
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (c > 127) /* Excludes all non-ASCII in either mode */
- {
- *errorcodeptr = ERR68;
- break;
- }
- if (c >= CHAR_a && c <= CHAR_z) c -= 32;
- c ^= 0x40;
-#else /* EBCDIC coding */
- if (c >= CHAR_a && c <= CHAR_z) c += 64;
- c ^= 0xC0;
-#endif
- break;
-
- /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any
- other alphanumeric following \ is an error if PCRE_EXTRA was set;
- otherwise, for Perl compatibility, it is a literal. This code looks a bit
- odd, but there used to be some cases other than the default, and there may
- be again in future, so I haven't "optimized" it. */
-
- default:
- if ((options & PCRE_EXTRA) != 0) switch(c)
- {
- default:
- *errorcodeptr = ERR3;
- break;
- }
- break;
- }
- }
-
-/* Perl supports \N{name} for character names, as well as plain \N for "not
-newline". PCRE does not support \N{name}. However, it does support
-quantification such as \N{2,3}. */
-
-if (escape == ESC_N && ptr[1] == CHAR_LEFT_CURLY_BRACKET &&
- !is_counted_repeat(ptr+2))
- *errorcodeptr = ERR37;
-
-/* If PCRE_UCP is set, we change the values for \d etc. */
-
-if ((options & PCRE_UCP) != 0 && escape >= ESC_D && escape <= ESC_w)
- escape += (ESC_DU - ESC_D);
-
-/* Set the pointer to the final character before returning. */
-
-*ptrptr = ptr;
-*chptr = c;
-return escape;
-}
-
-
-
-#ifdef SUPPORT_UCP
-/*************************************************
-* Handle \P and \p *
-*************************************************/
-
-/* This function is called after \P or \p has been encountered, provided that
-PCRE is compiled with support for Unicode properties. On entry, ptrptr is
-pointing at the P or p. On exit, it is pointing at the final character of the
-escape sequence.
-
-Argument:
- ptrptr points to the pattern position pointer
- negptr points to a boolean that is set TRUE for negation else FALSE
- ptypeptr points to an unsigned int that is set to the type value
- pdataptr points to an unsigned int that is set to the detailed property value
- errorcodeptr points to the error code variable
-
-Returns: TRUE if the type value was found, or FALSE for an invalid type
-*/
-
-static BOOL
-get_ucp(const pcre_uchar **ptrptr, BOOL *negptr, unsigned int *ptypeptr,
- unsigned int *pdataptr, int *errorcodeptr)
-{
-pcre_uchar c;
-int i, bot, top;
-const pcre_uchar *ptr = *ptrptr;
-pcre_uchar name[32];
-
-c = *(++ptr);
-if (c == CHAR_NULL) goto ERROR_RETURN;
-
-*negptr = FALSE;
-
-/* \P or \p can be followed by a name in {}, optionally preceded by ^ for
-negation. */
-
-if (c == CHAR_LEFT_CURLY_BRACKET)
- {
- if (ptr[1] == CHAR_CIRCUMFLEX_ACCENT)
- {
- *negptr = TRUE;
- ptr++;
- }
- for (i = 0; i < (int)(sizeof(name) / sizeof(pcre_uchar)) - 1; i++)
- {
- c = *(++ptr);
- if (c == CHAR_NULL) goto ERROR_RETURN;
- if (c == CHAR_RIGHT_CURLY_BRACKET) break;
- name[i] = c;
- }
- if (c != CHAR_RIGHT_CURLY_BRACKET) goto ERROR_RETURN;
- name[i] = 0;
- }
-
-/* Otherwise there is just one following character */
-
-else
- {
- name[0] = c;
- name[1] = 0;
- }
-
-*ptrptr = ptr;
-
-/* Search for a recognized property name using binary chop */
-
-bot = 0;
-top = PRIV(utt_size);
-
-while (bot < top)
- {
- int r;
- i = (bot + top) >> 1;
- r = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset);
- if (r == 0)
- {
- *ptypeptr = PRIV(utt)[i].type;
- *pdataptr = PRIV(utt)[i].value;
- return TRUE;
- }
- if (r > 0) bot = i + 1; else top = i;
- }
-
-*errorcodeptr = ERR47;
-*ptrptr = ptr;
-return FALSE;
-
-ERROR_RETURN:
-*errorcodeptr = ERR46;
-*ptrptr = ptr;
-return FALSE;
-}
-#endif
-
-
-
-/*************************************************
-* Read repeat counts *
-*************************************************/
-
-/* Read an item of the form {n,m} and return the values. This is called only
-after is_counted_repeat() has confirmed that a repeat-count quantifier exists,
-so the syntax is guaranteed to be correct, but we need to check the values.
-
-Arguments:
- p pointer to first char after '{'
- minp pointer to int for min
- maxp pointer to int for max
- returned as -1 if no max
- errorcodeptr points to error code variable
-
-Returns: pointer to '}' on success;
- current ptr on error, with errorcodeptr set non-zero
-*/
-
-static const pcre_uchar *
-read_repeat_counts(const pcre_uchar *p, int *minp, int *maxp, int *errorcodeptr)
-{
-int min = 0;
-int max = -1;
-
-/* Read the minimum value and do a paranoid check: a negative value indicates
-an integer overflow. */
-
-while (IS_DIGIT(*p)) min = min * 10 + (int)(*p++ - CHAR_0);
-if (min < 0 || min > 65535)
- {
- *errorcodeptr = ERR5;
- return p;
- }
-
-/* Read the maximum value if there is one, and again do a paranoid on its size.
-Also, max must not be less than min. */
-
-if (*p == CHAR_RIGHT_CURLY_BRACKET) max = min; else
- {
- if (*(++p) != CHAR_RIGHT_CURLY_BRACKET)
- {
- max = 0;
- while(IS_DIGIT(*p)) max = max * 10 + (int)(*p++ - CHAR_0);
- if (max < 0 || max > 65535)
- {
- *errorcodeptr = ERR5;
- return p;
- }
- if (max < min)
- {
- *errorcodeptr = ERR4;
- return p;
- }
- }
- }
-
-/* Fill in the required variables, and pass back the pointer to the terminating
-'}'. */
-
-*minp = min;
-*maxp = max;
-return p;
-}
-
-
-
-/*************************************************
-* Find first significant op code *
-*************************************************/
-
-/* This is called by several functions that scan a compiled expression looking
-for a fixed first character, or an anchoring op code etc. It skips over things
-that do not influence this. For some calls, it makes sense to skip negative
-forward and all backward assertions, and also the \b assertion; for others it
-does not.
-
-Arguments:
- code pointer to the start of the group
- skipassert TRUE if certain assertions are to be skipped
-
-Returns: pointer to the first significant opcode
-*/
-
-static const pcre_uchar*
-first_significant_code(const pcre_uchar *code, BOOL skipassert)
-{
-for (;;)
- {
- switch ((int)*code)
- {
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- if (!skipassert) return code;
- do code += GET(code, 1); while (*code == OP_ALT);
- code += PRIV(OP_lengths)[*code];
- break;
-
- case OP_WORD_BOUNDARY:
- case OP_NOT_WORD_BOUNDARY:
- if (!skipassert) return code;
- /* Fall through */
-
- case OP_CALLOUT:
- case OP_CREF:
- case OP_DNCREF:
- case OP_RREF:
- case OP_DNRREF:
- case OP_DEF:
- code += PRIV(OP_lengths)[*code];
- break;
-
- default:
- return code;
- }
- }
-/* Control never reaches here */
-}
-
-
-
-/*************************************************
-* Find the fixed length of a branch *
-*************************************************/
-
-/* Scan a branch and compute the fixed length of subject that will match it,
-if the length is fixed. This is needed for dealing with backward assertions.
-In UTF8 mode, the result is in characters rather than bytes. The branch is
-temporarily terminated with OP_END when this function is called.
-
-This function is called when a backward assertion is encountered, so that if it
-fails, the error message can point to the correct place in the pattern.
-However, we cannot do this when the assertion contains subroutine calls,
-because they can be forward references. We solve this by remembering this case
-and doing the check at the end; a flag specifies which mode we are running in.
-
-Arguments:
- code points to the start of the pattern (the bracket)
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- atend TRUE if called when the pattern is complete
- cd the "compile data" structure
-
-Returns: the fixed length,
- or -1 if there is no fixed length,
- or -2 if \C was encountered (in UTF-8 mode only)
- or -3 if an OP_RECURSE item was encountered and atend is FALSE
- or -4 if an unknown opcode was encountered (internal error)
-*/
-
-static int
-find_fixedlength(pcre_uchar *code, BOOL utf, BOOL atend, compile_data *cd)
-{
-int length = -1;
-
-register int branchlength = 0;
-register pcre_uchar *cc = code + 1 + LINK_SIZE;
-
-/* Scan along the opcodes for this branch. If we get to the end of the
-branch, check the length against that of the other branches. */
-
-for (;;)
- {
- int d;
- pcre_uchar *ce, *cs;
- register pcre_uchar op = *cc;
-
- switch (op)
- {
- /* We only need to continue for OP_CBRA (normal capturing bracket) and
- OP_BRA (normal non-capturing bracket) because the other variants of these
- opcodes are all concerned with unlimited repeated groups, which of course
- are not of fixed length. */
-
- case OP_CBRA:
- case OP_BRA:
- case OP_ONCE:
- case OP_ONCE_NC:
- case OP_COND:
- d = find_fixedlength(cc + ((op == OP_CBRA)? IMM2_SIZE : 0), utf, atend, cd);
- if (d < 0) return d;
- branchlength += d;
- do cc += GET(cc, 1); while (*cc == OP_ALT);
- cc += 1 + LINK_SIZE;
- break;
-
- /* 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. An ACCEPT is effectively
- an ALT. If it is END it's the end of the outer call. All can be handled by
- the same code. Note that we must not include the OP_KETRxxx opcodes here,
- because they all imply an unlimited repeat. */
-
- case OP_ALT:
- case OP_KET:
- case OP_END:
- case OP_ACCEPT:
- case OP_ASSERT_ACCEPT:
- if (length < 0) length = branchlength;
- else if (length != branchlength) return -1;
- if (*cc != OP_ALT) return length;
- cc += 1 + LINK_SIZE;
- branchlength = 0;
- break;
-
- /* A true recursion implies not fixed length, but a subroutine call may
- be OK. If the subroutine is a forward reference, we can't deal with
- it until the end of the pattern, so return -3. */
-
- case OP_RECURSE:
- if (!atend) return -3;
- cs = ce = (pcre_uchar *)cd->start_code + GET(cc, 1); /* Start subpattern */
- do ce += GET(ce, 1); while (*ce == OP_ALT); /* End subpattern */
- if (cc > cs && cc < ce) return -1; /* Recursion */
- d = find_fixedlength(cs + IMM2_SIZE, utf, atend, cd);
- if (d < 0) return d;
- branchlength += d;
- cc += 1 + LINK_SIZE;
- break;
-
- /* Skip over assertive subpatterns */
-
- case OP_ASSERT:
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- do cc += GET(cc, 1); while (*cc == OP_ALT);
- cc += PRIV(OP_lengths)[*cc];
- break;
-
- /* Skip over things that don't match chars */
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- cc += cc[1] + PRIV(OP_lengths)[*cc];
- break;
-
- case OP_CALLOUT:
- case OP_CIRC:
- case OP_CIRCM:
- case OP_CLOSE:
- case OP_COMMIT:
- case OP_CREF:
- case OP_DEF:
- case OP_DNCREF:
- case OP_DNRREF:
- case OP_DOLL:
- case OP_DOLLM:
- case OP_EOD:
- case OP_EODN:
- case OP_FAIL:
- case OP_NOT_WORD_BOUNDARY:
- case OP_PRUNE:
- case OP_REVERSE:
- case OP_RREF:
- case OP_SET_SOM:
- case OP_SKIP:
- case OP_SOD:
- case OP_SOM:
- case OP_THEN:
- case OP_WORD_BOUNDARY:
- cc += PRIV(OP_lengths)[*cc];
- break;
-
- /* Handle literal characters */
-
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- branchlength++;
- cc += 2;
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
-#endif
- break;
-
- /* Handle exact repetitions. The count is already in characters, but we
- need to skip over a multibyte character in UTF8 mode. */
-
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- branchlength += (int)GET2(cc,1);
- cc += 2 + IMM2_SIZE;
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
-#endif
- break;
-
- case OP_TYPEEXACT:
- branchlength += GET2(cc,1);
- if (cc[1 + IMM2_SIZE] == OP_PROP || cc[1 + IMM2_SIZE] == OP_NOTPROP)
- cc += 2;
- cc += 1 + IMM2_SIZE + 1;
- break;
-
- /* Handle single-char matchers */
-
- case OP_PROP:
- case OP_NOTPROP:
- cc += 2;
- /* Fall through */
-
- case OP_HSPACE:
- case OP_VSPACE:
- case OP_NOT_HSPACE:
- case OP_NOT_VSPACE:
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
- case OP_ANY:
- case OP_ALLANY:
- branchlength++;
- cc++;
- break;
-
- /* The single-byte matcher isn't allowed. This only happens in UTF-8 mode;
- otherwise \C is coded as OP_ALLANY. */
-
- case OP_ANYBYTE:
- return -2;
-
- /* Check a class for variable quantification */
-
- case OP_CLASS:
- case OP_NCLASS:
-#if defined SUPPORT_UTF || defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- case OP_XCLASS:
- /* The original code caused an unsigned overflow in 64 bit systems,
- so now we use a conditional statement. */
- if (op == OP_XCLASS)
- cc += GET(cc, 1);
- else
- cc += PRIV(OP_lengths)[OP_CLASS];
-#else
- cc += PRIV(OP_lengths)[OP_CLASS];
-#endif
-
- switch (*cc)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSPLUS:
- case OP_CRPOSQUERY:
- return -1;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- if (GET2(cc,1) != GET2(cc,1+IMM2_SIZE)) return -1;
- branchlength += (int)GET2(cc,1);
- cc += 1 + 2 * IMM2_SIZE;
- break;
-
- default:
- branchlength++;
- }
- break;
-
- /* Anything else is variable length */
-
- case OP_ANYNL:
- case OP_BRAMINZERO:
- case OP_BRAPOS:
- case OP_BRAPOSZERO:
- case OP_BRAZERO:
- case OP_CBRAPOS:
- case OP_EXTUNI:
- case OP_KETRMAX:
- case OP_KETRMIN:
- case OP_KETRPOS:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_REF:
- case OP_REFI:
- case OP_DNREF:
- case OP_DNREFI:
- case OP_SBRA:
- case OP_SBRAPOS:
- case OP_SCBRA:
- case OP_SCBRAPOS:
- case OP_SCOND:
- case OP_SKIPZERO:
- case OP_STAR:
- case OP_STARI:
- case OP_TYPEMINPLUS:
- case OP_TYPEMINQUERY:
- case OP_TYPEMINSTAR:
- case OP_TYPEMINUPTO:
- case OP_TYPEPLUS:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSUPTO:
- case OP_TYPEQUERY:
- case OP_TYPESTAR:
- case OP_TYPEUPTO:
- case OP_UPTO:
- case OP_UPTOI:
- return -1;
-
- /* Catch unrecognized opcodes so that when new ones are added they
- are not forgotten, as has happened in the past. */
-
- default:
- return -4;
- }
- }
-/* Control never gets here */
-}
-
-
-
-/*************************************************
-* Scan compiled regex for specific bracket *
-*************************************************/
-
-/* This little function scans through a compiled pattern until it finds a
-capturing bracket with the given number, or, if the number is negative, an
-instance of OP_REVERSE for a lookbehind. The function is global in the C sense
-so that it can be called from pcre_study() when finding the minimum matching
-length.
-
-Arguments:
- code points to start of expression
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- number the required bracket number or negative to find a lookbehind
-
-Returns: pointer to the opcode for the bracket, or NULL if not found
-*/
-
-const pcre_uchar *
-PRIV(find_bracket)(const pcre_uchar *code, BOOL utf, int number)
-{
-for (;;)
- {
- register pcre_uchar c = *code;
-
- if (c == OP_END) return NULL;
-
- /* XCLASS is used for classes that cannot be represented just by a bit
- map. This includes negated single high-valued characters. The length in
- the table is zero; the actual length is stored in the compiled code. */
-
- if (c == OP_XCLASS) code += GET(code, 1);
-
- /* Handle recursion */
-
- else if (c == OP_REVERSE)
- {
- if (number < 0) return (pcre_uchar *)code;
- code += PRIV(OP_lengths)[c];
- }
-
- /* Handle capturing bracket */
-
- else if (c == OP_CBRA || c == OP_SCBRA ||
- c == OP_CBRAPOS || c == OP_SCBRAPOS)
- {
- int n = (int)GET2(code, 1+LINK_SIZE);
- if (n == number) return (pcre_uchar *)code;
- code += PRIV(OP_lengths)[c];
- }
-
- /* Otherwise, we can get the item's length from the table, except that for
- repeated character types, we have to test for \p and \P, which have an extra
- two bytes of parameters, and for MARK/PRUNE/SKIP/THEN with an argument, we
- must add in its length. */
-
- else
- {
- switch(c)
- {
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- case OP_TYPEPOSUPTO:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += PRIV(OP_lengths)[c];
-
- /* In UTF-8 mode, opcodes that are followed by a character may be followed by
- a multi-byte character. The length in the table is a minimum, so we have to
- arrange to skip the extra bytes. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf) switch(c)
- {
- case OP_CHAR:
- case OP_CHARI:
- case OP_EXACT:
- case OP_EXACTI:
- case OP_UPTO:
- case OP_UPTOI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_STAR:
- case OP_STARI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_POSQUERY:
- case OP_POSQUERYI:
- if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
- break;
- }
-#else
- (void)(utf); /* Keep compiler happy by referencing function argument */
-#endif
- }
- }
-}
-
-
-
-/*************************************************
-* Scan compiled regex for recursion reference *
-*************************************************/
-
-/* This little function scans through a compiled pattern until it finds an
-instance of OP_RECURSE.
-
-Arguments:
- code points to start of expression
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
-
-Returns: pointer to the opcode for OP_RECURSE, or NULL if not found
-*/
-
-static const pcre_uchar *
-find_recurse(const pcre_uchar *code, BOOL utf)
-{
-for (;;)
- {
- register pcre_uchar c = *code;
- if (c == OP_END) return NULL;
- if (c == OP_RECURSE) return code;
-
- /* XCLASS is used for classes that cannot be represented just by a bit
- map. This includes negated single high-valued characters. The length in
- the table is zero; the actual length is stored in the compiled code. */
-
- if (c == OP_XCLASS) code += GET(code, 1);
-
- /* Otherwise, we can get the item's length from the table, except that for
- repeated character types, we have to test for \p and \P, which have an extra
- two bytes of parameters, and for MARK/PRUNE/SKIP/THEN with an argument, we
- must add in its length. */
-
- else
- {
- switch(c)
- {
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEPOSUPTO:
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += PRIV(OP_lengths)[c];
-
- /* In UTF-8 mode, opcodes that are followed by a character may be followed
- by a multi-byte character. The length in the table is a minimum, so we have
- to arrange to skip the extra bytes. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf) switch(c)
- {
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- case OP_UPTO:
- case OP_UPTOI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- case OP_STAR:
- case OP_STARI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
- break;
- }
-#else
- (void)(utf); /* Keep compiler happy by referencing function argument */
-#endif
- }
- }
-}
-
-
-
-/*************************************************
-* Scan compiled branch for non-emptiness *
-*************************************************/
-
-/* This function scans through a branch of a compiled pattern to see whether it
-can match the empty string or not. It is called from could_be_empty()
-below and from compile_branch() when checking for an unlimited repeat of a
-group that can match nothing. Note that first_significant_code() skips over
-backward and negative forward assertions when its final argument is TRUE. If we
-hit an unclosed bracket, we return "empty" - this means we've struck an inner
-bracket whose current branch will already have been scanned.
-
-Arguments:
- code points to start of search
- endcode points to where to stop
- utf TRUE if in UTF-8 / UTF-16 / UTF-32 mode
- cd contains pointers to tables etc.
- recurses chain of recurse_check to catch mutual recursion
-
-Returns: TRUE if what is matched could be empty
-*/
-
-typedef struct recurse_check {
- struct recurse_check *prev;
- const pcre_uchar *group;
-} recurse_check;
-
-static BOOL
-could_be_empty_branch(const pcre_uchar *code, const pcre_uchar *endcode,
- BOOL utf, compile_data *cd, recurse_check *recurses)
-{
-register pcre_uchar c;
-recurse_check this_recurse;
-
-for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
- code < endcode;
- code = first_significant_code(code + PRIV(OP_lengths)[c], TRUE))
- {
- const pcre_uchar *ccode;
-
- c = *code;
-
- /* Skip over forward assertions; the other assertions are skipped by
- first_significant_code() with a TRUE final argument. */
-
- if (c == OP_ASSERT)
- {
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
- }
-
- /* For a recursion/subroutine call, if its end has been reached, which
- implies a backward reference subroutine call, we can scan it. If it's a
- forward reference subroutine call, we can't. To detect forward reference
- we have to scan up the list that is kept in the workspace. This function is
- called only when doing the real compile, not during the pre-compile that
- measures the size of the compiled pattern. */
-
- if (c == OP_RECURSE)
- {
- const pcre_uchar *scode = cd->start_code + GET(code, 1);
- BOOL empty_branch;
-
- /* Test for forward reference or uncompleted reference. This is disabled
- when called to scan a completed pattern by setting cd->start_workspace to
- NULL. */
-
- if (cd->start_workspace != NULL)
- {
- const pcre_uchar *tcode;
- for (tcode = cd->start_workspace; tcode < cd->hwm; tcode += LINK_SIZE)
- if ((int)GET(tcode, 0) == (int)(code + 1 - cd->start_code)) return TRUE;
- if (GET(scode, 1) == 0) return TRUE; /* Unclosed */
- }
-
- /* If we are scanning a completed pattern, there are no forward references
- and all groups are complete. We need to detect whether this is a recursive
- call, as otherwise there will be an infinite loop. If it is a recursion,
- just skip over it. Simple recursions are easily detected. For mutual
- recursions we keep a chain on the stack. */
-
- else
- {
- recurse_check *r = recurses;
- const pcre_uchar *endgroup = scode;
-
- do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT);
- if (code >= scode && code <= endgroup) continue; /* Simple recursion */
-
- for (r = recurses; r != NULL; r = r->prev)
- if (r->group == scode) break;
- if (r != NULL) continue; /* Mutual recursion */
- }
-
- /* Completed reference; scan the referenced group, remembering it on the
- stack chain to detect mutual recursions. */
-
- empty_branch = FALSE;
- this_recurse.prev = recurses;
- this_recurse.group = scode;
-
- do
- {
- if (could_be_empty_branch(scode, endcode, utf, cd, &this_recurse))
- {
- empty_branch = TRUE;
- break;
- }
- scode += GET(scode, 1);
- }
- while (*scode == OP_ALT);
-
- if (!empty_branch) return FALSE; /* All branches are non-empty */
- continue;
- }
-
- /* Groups with zero repeats can of course be empty; skip them. */
-
- if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO ||
- c == OP_BRAPOSZERO)
- {
- code += PRIV(OP_lengths)[c];
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
- }
-
- /* A nested group that is already marked as "could be empty" can just be
- skipped. */
-
- if (c == OP_SBRA || c == OP_SBRAPOS ||
- c == OP_SCBRA || c == OP_SCBRAPOS)
- {
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
- }
-
- /* For other groups, scan the branches. */
-
- if (c == OP_BRA || c == OP_BRAPOS ||
- c == OP_CBRA || c == OP_CBRAPOS ||
- c == OP_ONCE || c == OP_ONCE_NC ||
- c == OP_COND)
- {
- BOOL empty_branch;
- if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */
-
- /* If a conditional group has only one branch, there is a second, implied,
- empty branch, so just skip over the conditional, because it could be empty.
- Otherwise, scan the individual branches of the group. */
-
- if (c == OP_COND && code[GET(code, 1)] != OP_ALT)
- code += GET(code, 1);
- else
- {
- empty_branch = FALSE;
- do
- {
- if (!empty_branch && could_be_empty_branch(code, endcode, utf, cd, NULL))
- empty_branch = TRUE;
- code += GET(code, 1);
- }
- while (*code == OP_ALT);
- if (!empty_branch) return FALSE; /* All branches are non-empty */
- }
-
- c = *code;
- continue;
- }
-
- /* Handle the other opcodes */
-
- switch (c)
- {
- /* Check for quantifiers after a class. XCLASS is used for classes that
- cannot be represented just by a bit map. This includes negated single
- high-valued characters. The length in PRIV(OP_lengths)[] is zero; the
- actual length is stored in the compiled code, so we must update "code"
- here. */
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- ccode = code += GET(code, 1);
- goto CHECK_CLASS_REPEAT;
-#endif
-
- case OP_CLASS:
- case OP_NCLASS:
- ccode = code + PRIV(OP_lengths)[OP_CLASS];
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- CHECK_CLASS_REPEAT:
-#endif
-
- switch (*ccode)
- {
- case OP_CRSTAR: /* These could be empty; continue */
- case OP_CRMINSTAR:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSQUERY:
- break;
-
- default: /* Non-repeat => class must match */
- case OP_CRPLUS: /* These repeats aren't empty */
- case OP_CRMINPLUS:
- case OP_CRPOSPLUS:
- return FALSE;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- if (GET2(ccode, 1) > 0) return FALSE; /* Minimum > 0 */
- break;
- }
- break;
-
- /* Opcodes that must match a character */
-
- case OP_ANY:
- case OP_ALLANY:
- case OP_ANYBYTE:
-
- case OP_PROP:
- case OP_NOTPROP:
- case OP_ANYNL:
-
- case OP_NOT_HSPACE:
- case OP_HSPACE:
- case OP_NOT_VSPACE:
- case OP_VSPACE:
- case OP_EXTUNI:
-
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
-
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
-
- case OP_PLUS:
- case OP_PLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
-
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
-
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
-
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
-
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEPOSPLUS:
- case OP_TYPEEXACT:
-
- return FALSE;
-
- /* These are going to continue, as they may be empty, but we have to
- fudge the length for the \p and \P cases. */
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPOSSTAR:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- /* Same for these */
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEPOSUPTO:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
- /* End of branch */
-
- case OP_KET:
- case OP_KETRMAX:
- case OP_KETRMIN:
- case OP_KETRPOS:
- case OP_ALT:
- return TRUE;
-
- /* In UTF-8 mode, STAR, MINSTAR, POSSTAR, QUERY, MINQUERY, POSQUERY, UPTO,
- MINUPTO, and POSUPTO and their caseless and negative versions may be
- followed by a multibyte character. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- case OP_STAR:
- case OP_STARI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
-
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
-
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
-
- case OP_QUERY:
- case OP_QUERYI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
-
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
-
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
-
- if (utf && HAS_EXTRALEN(code[1])) code += GET_EXTRALEN(code[1]);
- break;
-
- case OP_UPTO:
- case OP_UPTOI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
-
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
-
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
-
- if (utf && HAS_EXTRALEN(code[1 + IMM2_SIZE])) code += GET_EXTRALEN(code[1 + IMM2_SIZE]);
- break;
-#endif
-
- /* MARK, and PRUNE/SKIP/THEN with an argument must skip over the argument
- string. */
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
-
- /* None of the remaining opcodes are required to match a character. */
-
- default:
- break;
- }
- }
-
-return TRUE;
-}
-
-
-
-/*************************************************
-* Scan compiled regex for non-emptiness *
-*************************************************/
-
-/* This function is called to check for left recursive calls. We want to check
-the current branch of the current pattern to see if it could match the empty
-string. If it could, we must look outwards for branches at other levels,
-stopping when we pass beyond the bracket which is the subject of the recursion.
-This function is called only during the real compile, not during the
-pre-compile.
-
-Arguments:
- code points to start of the recursion
- endcode points to where to stop (current RECURSE item)
- bcptr points to the chain of current (unclosed) branch starts
- utf TRUE if in UTF-8 / UTF-16 / UTF-32 mode
- cd pointers to tables etc
-
-Returns: TRUE if what is matched could be empty
-*/
-
-static BOOL
-could_be_empty(const pcre_uchar *code, const pcre_uchar *endcode,
- branch_chain *bcptr, BOOL utf, compile_data *cd)
-{
-while (bcptr != NULL && bcptr->current_branch >= code)
- {
- if (!could_be_empty_branch(bcptr->current_branch, endcode, utf, cd, NULL))
- return FALSE;
- bcptr = bcptr->outer;
- }
-return TRUE;
-}
-
-
-
-/*************************************************
-* Base opcode of repeated opcodes *
-*************************************************/
-
-/* Returns the base opcode for repeated single character type opcodes. If the
-opcode is not a repeated character type, it returns with the original value.
-
-Arguments: c opcode
-Returns: base opcode for the type
-*/
-
-static pcre_uchar
-get_repeat_base(pcre_uchar c)
-{
-return (c > OP_TYPEPOSUPTO)? c :
- (c >= OP_TYPESTAR)? OP_TYPESTAR :
- (c >= OP_NOTSTARI)? OP_NOTSTARI :
- (c >= OP_NOTSTAR)? OP_NOTSTAR :
- (c >= OP_STARI)? OP_STARI :
- OP_STAR;
-}
-
-
-
-#ifdef SUPPORT_UCP
-/*************************************************
-* Check a character and a property *
-*************************************************/
-
-/* This function is called by check_auto_possessive() when a property item
-is adjacent to a fixed character.
-
-Arguments:
- c the character
- ptype the property type
- pdata the data for the type
- negated TRUE if it's a negated property (\P or \p{^)
-
-Returns: TRUE if auto-possessifying is OK
-*/
-
-static BOOL
-check_char_prop(pcre_uint32 c, unsigned int ptype, unsigned int pdata,
- BOOL negated)
-{
-const pcre_uint32 *p;
-const ucd_record *prop = GET_UCD(c);
-
-switch(ptype)
- {
- case PT_LAMP:
- return (prop->chartype == ucp_Lu ||
- prop->chartype == ucp_Ll ||
- prop->chartype == ucp_Lt) == negated;
-
- case PT_GC:
- return (pdata == PRIV(ucp_gentype)[prop->chartype]) == negated;
-
- case PT_PC:
- return (pdata == prop->chartype) == negated;
-
- case PT_SC:
- return (pdata == prop->script) == negated;
-
- /* These are specials */
-
- case PT_ALNUM:
- return (PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
- PRIV(ucp_gentype)[prop->chartype] == ucp_N) == negated;
-
- /* Perl space used to exclude VT, but from Perl 5.18 it is included, which
- means that Perl space and POSIX space are now identical. PCRE was changed
- at release 8.34. */
-
- case PT_SPACE: /* Perl space */
- case PT_PXSPACE: /* POSIX space */
- switch(c)
- {
- HSPACE_CASES:
- VSPACE_CASES:
- return negated;
-
- default:
- return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z) == negated;
- }
- break; /* Control never reaches here */
-
- case PT_WORD:
- return (PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
- PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
- c == CHAR_UNDERSCORE) == negated;
-
- case PT_CLIST:
- p = PRIV(ucd_caseless_sets) + prop->caseset;
- for (;;)
- {
- if (c < *p) return !negated;
- if (c == *p++) return negated;
- }
- break; /* Control never reaches here */
- }
-
-return FALSE;
-}
-#endif /* SUPPORT_UCP */
-
-
-
-/*************************************************
-* Fill the character property list *
-*************************************************/
-
-/* Checks whether the code points to an opcode that can take part in auto-
-possessification, and if so, fills a list with its properties.
-
-Arguments:
- code points to start of expression
- utf TRUE if in UTF-8 / UTF-16 / UTF-32 mode
- fcc points to case-flipping table
- list points to output list
- list[0] will be filled with the opcode
- list[1] will be non-zero if this opcode
- can match an empty character string
- list[2..7] depends on the opcode
-
-Returns: points to the start of the next opcode if *code is accepted
- NULL if *code is not accepted
-*/
-
-static const pcre_uchar *
-get_chr_property_list(const pcre_uchar *code, BOOL utf,
- const pcre_uint8 *fcc, pcre_uint32 *list)
-{
-pcre_uchar c = *code;
-pcre_uchar base;
-const pcre_uchar *end;
-pcre_uint32 chr;
-
-#ifdef SUPPORT_UCP
-pcre_uint32 *clist_dest;
-const pcre_uint32 *clist_src;
-#else
-utf = utf; /* Suppress "unused parameter" compiler warning */
-#endif
-
-list[0] = c;
-list[1] = FALSE;
-code++;
-
-if (c >= OP_STAR && c <= OP_TYPEPOSUPTO)
- {
- base = get_repeat_base(c);
- c -= (base - OP_STAR);
-
- if (c == OP_UPTO || c == OP_MINUPTO || c == OP_EXACT || c == OP_POSUPTO)
- code += IMM2_SIZE;
-
- list[1] = (c != OP_PLUS && c != OP_MINPLUS && c != OP_EXACT && c != OP_POSPLUS);
-
- switch(base)
- {
- case OP_STAR:
- list[0] = OP_CHAR;
- break;
-
- case OP_STARI:
- list[0] = OP_CHARI;
- break;
-
- case OP_NOTSTAR:
- list[0] = OP_NOT;
- break;
-
- case OP_NOTSTARI:
- list[0] = OP_NOTI;
- break;
-
- case OP_TYPESTAR:
- list[0] = *code;
- code++;
- break;
- }
- c = list[0];
- }
-
-switch(c)
- {
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
- case OP_ANY:
- case OP_ALLANY:
- case OP_ANYNL:
- case OP_NOT_HSPACE:
- case OP_HSPACE:
- case OP_NOT_VSPACE:
- case OP_VSPACE:
- case OP_EXTUNI:
- case OP_EODN:
- case OP_EOD:
- case OP_DOLL:
- case OP_DOLLM:
- return code;
-
- case OP_CHAR:
- case OP_NOT:
- GETCHARINCTEST(chr, code);
- list[2] = chr;
- list[3] = NOTACHAR;
- return code;
-
- case OP_CHARI:
- case OP_NOTI:
- list[0] = (c == OP_CHARI) ? OP_CHAR : OP_NOT;
- GETCHARINCTEST(chr, code);
- list[2] = chr;
-
-#ifdef SUPPORT_UCP
- if (chr < 128 || (chr < 256 && !utf))
- list[3] = fcc[chr];
- else
- list[3] = UCD_OTHERCASE(chr);
-#elif defined SUPPORT_UTF || !defined COMPILE_PCRE8
- list[3] = (chr < 256) ? fcc[chr] : chr;
-#else
- list[3] = fcc[chr];
-#endif
-
- /* The othercase might be the same value. */
-
- if (chr == list[3])
- list[3] = NOTACHAR;
- else
- list[4] = NOTACHAR;
- return code;
-
-#ifdef SUPPORT_UCP
- case OP_PROP:
- case OP_NOTPROP:
- if (code[0] != PT_CLIST)
- {
- list[2] = code[0];
- list[3] = code[1];
- return code + 2;
- }
-
- /* Convert only if we have enough space. */
-
- clist_src = PRIV(ucd_caseless_sets) + code[1];
- clist_dest = list + 2;
- code += 2;
-
- do {
- if (clist_dest >= list + 8)
- {
- /* Early return if there is not enough space. This should never
- happen, since all clists are shorter than 5 character now. */
- list[2] = code[0];
- list[3] = code[1];
- return code;
- }
- *clist_dest++ = *clist_src;
- }
- while(*clist_src++ != NOTACHAR);
-
- /* All characters are stored. The terminating NOTACHAR
- is copied form the clist itself. */
-
- list[0] = (c == OP_PROP) ? OP_CHAR : OP_NOT;
- return code;
-#endif
-
- case OP_NCLASS:
- case OP_CLASS:
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- if (c == OP_XCLASS)
- end = code + GET(code, 0) - 1;
- else
-#endif
- end = code + 32 / sizeof(pcre_uchar);
-
- switch(*end)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSQUERY:
- list[1] = TRUE;
- end++;
- break;
-
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRPOSPLUS:
- end++;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- list[1] = (GET2(end, 1) == 0);
- end += 1 + 2 * IMM2_SIZE;
- break;
- }
- list[2] = end - code;
- return end;
- }
-return NULL; /* Opcode not accepted */
-}
-
-
-
-/*************************************************
-* Scan further character sets for match *
-*************************************************/
-
-/* Checks whether the base and the current opcode have a common character, in
-which case the base cannot be possessified.
-
-Arguments:
- code points to the byte code
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- cd static compile data
- base_list the data list of the base opcode
-
-Returns: TRUE if the auto-possessification is possible
-*/
-
-static BOOL
-compare_opcodes(const pcre_uchar *code, BOOL utf, const compile_data *cd,
- const pcre_uint32 *base_list, const pcre_uchar *base_end)
-{
-pcre_uchar c;
-pcre_uint32 list[8];
-const pcre_uint32 *chr_ptr;
-const pcre_uint32 *ochr_ptr;
-const pcre_uint32 *list_ptr;
-const pcre_uchar *next_code;
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
-const pcre_uchar *xclass_flags;
-#endif
-const pcre_uint8 *class_bitset;
-const pcre_uint8 *set1, *set2, *set_end;
-pcre_uint32 chr;
-BOOL accepted, invert_bits;
-
-/* Note: the base_list[1] contains whether the current opcode has greedy
-(represented by a non-zero value) quantifier. This is a different from
-other character type lists, which stores here that the character iterator
-matches to an empty string (also represented by a non-zero value). */
-
-for(;;)
- {
- /* All operations move the code pointer forward.
- Therefore infinite recursions are not possible. */
-
- c = *code;
-
- /* Skip over callouts */
-
- if (c == OP_CALLOUT)
- {
- code += PRIV(OP_lengths)[c];
- continue;
- }
-
- if (c == OP_ALT)
- {
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- }
-
- switch(c)
- {
- case OP_END:
- case OP_KETRPOS:
- /* TRUE only in greedy case. The non-greedy case could be replaced by
- an OP_EXACT, but it is probably not worth it. (And note that OP_EXACT
- uses more memory, which we cannot get at this stage.) */
-
- return base_list[1] != 0;
-
- case OP_KET:
- /* If the bracket is capturing, and referenced by an OP_RECURSE, or
- it is an atomic sub-pattern (assert, once, etc.) the non-greedy case
- cannot be converted to a possessive form. */
-
- if (base_list[1] == 0) return FALSE;
-
- switch(*(code - GET(code, 1)))
- {
- case OP_ASSERT:
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- case OP_ONCE:
- case OP_ONCE_NC:
- /* Atomic sub-patterns and assertions can always auto-possessify their
- last iterator. */
- return TRUE;
- }
-
- code += PRIV(OP_lengths)[c];
- continue;
-
- case OP_ONCE:
- case OP_ONCE_NC:
- case OP_BRA:
- case OP_CBRA:
- next_code = code + GET(code, 1);
- code += PRIV(OP_lengths)[c];
-
- while (*next_code == OP_ALT)
- {
- if (!compare_opcodes(code, utf, cd, base_list, base_end)) return FALSE;
- code = next_code + 1 + LINK_SIZE;
- next_code += GET(next_code, 1);
- }
- continue;
-
- case OP_BRAZERO:
- case OP_BRAMINZERO:
-
- next_code = code + 1;
- if (*next_code != OP_BRA && *next_code != OP_CBRA
- && *next_code != OP_ONCE && *next_code != OP_ONCE_NC) return FALSE;
-
- do next_code += GET(next_code, 1); while (*next_code == OP_ALT);
-
- /* The bracket content will be checked by the
- OP_BRA/OP_CBRA case above. */
- next_code += 1 + LINK_SIZE;
- if (!compare_opcodes(next_code, utf, cd, base_list, base_end))
- return FALSE;
-
- code += PRIV(OP_lengths)[c];
- continue;
- }
-
- /* Check for a supported opcode, and load its properties. */
-
- code = get_chr_property_list(code, utf, cd->fcc, list);
- if (code == NULL) return FALSE; /* Unsupported */
-
- /* If either opcode is a small character list, set pointers for comparing
- characters from that list with another list, or with a property. */
-
- if (base_list[0] == OP_CHAR)
- {
- chr_ptr = base_list + 2;
- list_ptr = list;
- }
- else if (list[0] == OP_CHAR)
- {
- chr_ptr = list + 2;
- list_ptr = base_list;
- }
-
- /* Character bitsets can also be compared to certain opcodes. */
-
- else if (base_list[0] == OP_CLASS || list[0] == OP_CLASS
-#ifdef COMPILE_PCRE8
- /* In 8 bit, non-UTF mode, OP_CLASS and OP_NCLASS are the same. */
- || (!utf && (base_list[0] == OP_NCLASS || list[0] == OP_NCLASS))
-#endif
- )
- {
-#ifdef COMPILE_PCRE8
- if (base_list[0] == OP_CLASS || (!utf && base_list[0] == OP_NCLASS))
-#else
- if (base_list[0] == OP_CLASS)
-#endif
- {
- set1 = (pcre_uint8 *)(base_end - base_list[2]);
- list_ptr = list;
- }
- else
- {
- set1 = (pcre_uint8 *)(code - list[2]);
- list_ptr = base_list;
- }
-
- invert_bits = FALSE;
- switch(list_ptr[0])
- {
- case OP_CLASS:
- case OP_NCLASS:
- set2 = (pcre_uint8 *)
- ((list_ptr == list ? code : base_end) - list_ptr[2]);
- break;
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- xclass_flags = (list_ptr == list ? code : base_end) - list_ptr[2] + LINK_SIZE;
- if ((*xclass_flags & XCL_HASPROP) != 0) return FALSE;
- if ((*xclass_flags & XCL_MAP) == 0)
- {
- /* No bits are set for characters < 256. */
- if (list[1] == 0) return TRUE;
- /* Might be an empty repeat. */
- continue;
- }
- set2 = (pcre_uint8 *)(xclass_flags + 1);
- break;
-#endif
-
- case OP_NOT_DIGIT:
- invert_bits = TRUE;
- /* Fall through */
- case OP_DIGIT:
- set2 = (pcre_uint8 *)(cd->cbits + cbit_digit);
- break;
-
- case OP_NOT_WHITESPACE:
- invert_bits = TRUE;
- /* Fall through */
- case OP_WHITESPACE:
- set2 = (pcre_uint8 *)(cd->cbits + cbit_space);
- break;
-
- case OP_NOT_WORDCHAR:
- invert_bits = TRUE;
- /* Fall through */
- case OP_WORDCHAR:
- set2 = (pcre_uint8 *)(cd->cbits + cbit_word);
- break;
-
- default:
- return FALSE;
- }
-
- /* Because the sets are unaligned, we need
- to perform byte comparison here. */
- set_end = set1 + 32;
- if (invert_bits)
- {
- do
- {
- if ((*set1++ & ~(*set2++)) != 0) return FALSE;
- }
- while (set1 < set_end);
- }
- else
- {
- do
- {
- if ((*set1++ & *set2++) != 0) return FALSE;
- }
- while (set1 < set_end);
- }
-
- if (list[1] == 0) return TRUE;
- /* Might be an empty repeat. */
- continue;
- }
-
- /* Some property combinations also acceptable. Unicode property opcodes are
- processed specially; the rest can be handled with a lookup table. */
-
- else
- {
- pcre_uint32 leftop, rightop;
-
- leftop = base_list[0];
- rightop = list[0];
-
-#ifdef SUPPORT_UCP
- accepted = FALSE; /* Always set in non-unicode case. */
- if (leftop == OP_PROP || leftop == OP_NOTPROP)
- {
- if (rightop == OP_EOD)
- accepted = TRUE;
- else if (rightop == OP_PROP || rightop == OP_NOTPROP)
- {
- int n;
- const pcre_uint8 *p;
- BOOL same = leftop == rightop;
- BOOL lisprop = leftop == OP_PROP;
- BOOL risprop = rightop == OP_PROP;
- BOOL bothprop = lisprop && risprop;
-
- /* There's a table that specifies how each combination is to be
- processed:
- 0 Always return FALSE (never auto-possessify)
- 1 Character groups are distinct (possessify if both are OP_PROP)
- 2 Check character categories in the same group (general or particular)
- 3 Return TRUE if the two opcodes are not the same
- ... see comments below
- */
-
- n = propposstab[base_list[2]][list[2]];
- switch(n)
- {
- case 0: break;
- case 1: accepted = bothprop; break;
- case 2: accepted = (base_list[3] == list[3]) != same; break;
- case 3: accepted = !same; break;
-
- case 4: /* Left general category, right particular category */
- accepted = risprop && catposstab[base_list[3]][list[3]] == same;
- break;
-
- case 5: /* Right general category, left particular category */
- accepted = lisprop && catposstab[list[3]][base_list[3]] == same;
- break;
-
- /* This code is logically tricky. Think hard before fiddling with it.
- The posspropstab table has four entries per row. Each row relates to
- one of PCRE's special properties such as ALNUM or SPACE or WORD.
- Only WORD actually needs all four entries, but using repeats for the
- others means they can all use the same code below.
-
- The first two entries in each row are Unicode general categories, and
- apply always, because all the characters they include are part of the
- PCRE character set. The third and fourth entries are a general and a
- particular category, respectively, that include one or more relevant
- characters. One or the other is used, depending on whether the check
- is for a general or a particular category. However, in both cases the
- category contains more characters than the specials that are defined
- for the property being tested against. Therefore, it cannot be used
- in a NOTPROP case.
-
- Example: the row for WORD contains ucp_L, ucp_N, ucp_P, ucp_Po.
- Underscore is covered by ucp_P or ucp_Po. */
-
- case 6: /* Left alphanum vs right general category */
- case 7: /* Left space vs right general category */
- case 8: /* Left word vs right general category */
- p = posspropstab[n-6];
- accepted = risprop && lisprop ==
- (list[3] != p[0] &&
- list[3] != p[1] &&
- (list[3] != p[2] || !lisprop));
- break;
-
- case 9: /* Right alphanum vs left general category */
- case 10: /* Right space vs left general category */
- case 11: /* Right word vs left general category */
- p = posspropstab[n-9];
- accepted = lisprop && risprop ==
- (base_list[3] != p[0] &&
- base_list[3] != p[1] &&
- (base_list[3] != p[2] || !risprop));
- break;
-
- case 12: /* Left alphanum vs right particular category */
- case 13: /* Left space vs right particular category */
- case 14: /* Left word vs right particular category */
- p = posspropstab[n-12];
- accepted = risprop && lisprop ==
- (catposstab[p[0]][list[3]] &&
- catposstab[p[1]][list[3]] &&
- (list[3] != p[3] || !lisprop));
- break;
-
- case 15: /* Right alphanum vs left particular category */
- case 16: /* Right space vs left particular category */
- case 17: /* Right word vs left particular category */
- p = posspropstab[n-15];
- accepted = lisprop && risprop ==
- (catposstab[p[0]][base_list[3]] &&
- catposstab[p[1]][base_list[3]] &&
- (base_list[3] != p[3] || !risprop));
- break;
- }
- }
- }
-
- else
-#endif /* SUPPORT_UCP */
-
- accepted = leftop >= FIRST_AUTOTAB_OP && leftop <= LAST_AUTOTAB_LEFT_OP &&
- rightop >= FIRST_AUTOTAB_OP && rightop <= LAST_AUTOTAB_RIGHT_OP &&
- autoposstab[leftop - FIRST_AUTOTAB_OP][rightop - FIRST_AUTOTAB_OP];
-
- if (!accepted)
- return FALSE;
-
- if (list[1] == 0) return TRUE;
- /* Might be an empty repeat. */
- continue;
- }
-
- /* Control reaches here only if one of the items is a small character list.
- All characters are checked against the other side. */
-
- do
- {
- chr = *chr_ptr;
-
- switch(list_ptr[0])
- {
- case OP_CHAR:
- ochr_ptr = list_ptr + 2;
- do
- {
- if (chr == *ochr_ptr) return FALSE;
- ochr_ptr++;
- }
- while(*ochr_ptr != NOTACHAR);
- break;
-
- case OP_NOT:
- ochr_ptr = list_ptr + 2;
- do
- {
- if (chr == *ochr_ptr)
- break;
- ochr_ptr++;
- }
- while(*ochr_ptr != NOTACHAR);
- if (*ochr_ptr == NOTACHAR) return FALSE; /* Not found */
- break;
-
- /* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not*
- set. When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */
-
- case OP_DIGIT:
- if (chr < 256 && (cd->ctypes[chr] & ctype_digit) != 0) return FALSE;
- break;
-
- case OP_NOT_DIGIT:
- if (chr > 255 || (cd->ctypes[chr] & ctype_digit) == 0) return FALSE;
- break;
-
- case OP_WHITESPACE:
- if (chr < 256 && (cd->ctypes[chr] & ctype_space) != 0) return FALSE;
- break;
-
- case OP_NOT_WHITESPACE:
- if (chr > 255 || (cd->ctypes[chr] & ctype_space) == 0) return FALSE;
- break;
-
- case OP_WORDCHAR:
- if (chr < 255 && (cd->ctypes[chr] & ctype_word) != 0) return FALSE;
- break;
-
- case OP_NOT_WORDCHAR:
- if (chr > 255 || (cd->ctypes[chr] & ctype_word) == 0) return FALSE;
- break;
-
- case OP_HSPACE:
- switch(chr)
- {
- HSPACE_CASES: return FALSE;
- default: break;
- }
- break;
-
- case OP_NOT_HSPACE:
- switch(chr)
- {
- HSPACE_CASES: break;
- default: return FALSE;
- }
- break;
-
- case OP_ANYNL:
- case OP_VSPACE:
- switch(chr)
- {
- VSPACE_CASES: return FALSE;
- default: break;
- }
- break;
-
- case OP_NOT_VSPACE:
- switch(chr)
- {
- VSPACE_CASES: break;
- default: return FALSE;
- }
- break;
-
- case OP_DOLL:
- case OP_EODN:
- switch (chr)
- {
- case CHAR_CR:
- case CHAR_LF:
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_NEL:
-#ifndef EBCDIC
- case 0x2028:
- case 0x2029:
-#endif /* Not EBCDIC */
- return FALSE;
- }
- break;
-
- case OP_EOD: /* Can always possessify before \z */
- break;
-
-#ifdef SUPPORT_UCP
- case OP_PROP:
- case OP_NOTPROP:
- if (!check_char_prop(chr, list_ptr[2], list_ptr[3],
- list_ptr[0] == OP_NOTPROP))
- return FALSE;
- break;
-#endif
-
- case OP_NCLASS:
- if (chr > 255) return FALSE;
- /* Fall through */
-
- case OP_CLASS:
- if (chr > 255) break;
- class_bitset = (pcre_uint8 *)
- ((list_ptr == list ? code : base_end) - list_ptr[2]);
- if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE;
- break;
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- if (PRIV(xclass)(chr, (list_ptr == list ? code : base_end) -
- list_ptr[2] + LINK_SIZE, utf)) return FALSE;
- break;
-#endif
-
- default:
- return FALSE;
- }
-
- chr_ptr++;
- }
- while(*chr_ptr != NOTACHAR);
-
- /* At least one character must be matched from this opcode. */
-
- if (list[1] == 0) return TRUE;
- }
-
-/* Control never reaches here. There used to be a fail-save return FALSE; here,
-but some compilers complain about an unreachable statement. */
-
-}
-
-
-
-/*************************************************
-* Scan compiled regex for auto-possession *
-*************************************************/
-
-/* Replaces single character iterations with their possessive alternatives
-if appropriate. This function modifies the compiled opcode!
-
-Arguments:
- code points to start of the byte code
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- cd static compile data
-
-Returns: nothing
-*/
-
-static void
-auto_possessify(pcre_uchar *code, BOOL utf, const compile_data *cd)
-{
-register pcre_uchar c;
-const pcre_uchar *end;
-pcre_uchar *repeat_opcode;
-pcre_uint32 list[8];
-
-for (;;)
- {
- c = *code;
-
- if (c >= OP_STAR && c <= OP_TYPEPOSUPTO)
- {
- c -= get_repeat_base(c) - OP_STAR;
- end = (c <= OP_MINUPTO) ?
- get_chr_property_list(code, utf, cd->fcc, list) : NULL;
- list[1] = c == OP_STAR || c == OP_PLUS || c == OP_QUERY || c == OP_UPTO;
-
- if (end != NULL && compare_opcodes(end, utf, cd, list, end))
- {
- switch(c)
- {
- case OP_STAR:
- *code += OP_POSSTAR - OP_STAR;
- break;
-
- case OP_MINSTAR:
- *code += OP_POSSTAR - OP_MINSTAR;
- break;
-
- case OP_PLUS:
- *code += OP_POSPLUS - OP_PLUS;
- break;
-
- case OP_MINPLUS:
- *code += OP_POSPLUS - OP_MINPLUS;
- break;
-
- case OP_QUERY:
- *code += OP_POSQUERY - OP_QUERY;
- break;
-
- case OP_MINQUERY:
- *code += OP_POSQUERY - OP_MINQUERY;
- break;
-
- case OP_UPTO:
- *code += OP_POSUPTO - OP_UPTO;
- break;
-
- case OP_MINUPTO:
- *code += OP_POSUPTO - OP_MINUPTO;
- break;
- }
- }
- c = *code;
- }
- else if (c == OP_CLASS || c == OP_NCLASS || c == OP_XCLASS)
- {
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- if (c == OP_XCLASS)
- repeat_opcode = code + GET(code, 1);
- else
-#endif
- repeat_opcode = code + 1 + (32 / sizeof(pcre_uchar));
-
- c = *repeat_opcode;
- if (c >= OP_CRSTAR && c <= OP_CRMINRANGE)
- {
- /* end must not be NULL. */
- end = get_chr_property_list(code, utf, cd->fcc, list);
-
- list[1] = (c & 1) == 0;
-
- if (compare_opcodes(end, utf, cd, list, end))
- {
- switch (c)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- *repeat_opcode = OP_CRPOSSTAR;
- break;
-
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- *repeat_opcode = OP_CRPOSPLUS;
- break;
-
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- *repeat_opcode = OP_CRPOSQUERY;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- *repeat_opcode = OP_CRPOSRANGE;
- break;
- }
- }
- }
- c = *code;
- }
-
- switch(c)
- {
- case OP_END:
- return;
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- case OP_TYPEPOSUPTO:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- code += GET(code, 1);
- break;
-#endif
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += PRIV(OP_lengths)[c];
-
- /* In UTF-8 mode, opcodes that are followed by a character may be followed by
- a multi-byte character. The length in the table is a minimum, so we have to
- arrange to skip the extra bytes. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf) switch(c)
- {
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_STAR:
- case OP_MINSTAR:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_QUERY:
- case OP_MINQUERY:
- case OP_UPTO:
- case OP_MINUPTO:
- case OP_EXACT:
- case OP_POSSTAR:
- case OP_POSPLUS:
- case OP_POSQUERY:
- case OP_POSUPTO:
- case OP_STARI:
- case OP_MINSTARI:
- case OP_PLUSI:
- case OP_MINPLUSI:
- case OP_QUERYI:
- case OP_MINQUERYI:
- case OP_UPTOI:
- case OP_MINUPTOI:
- case OP_EXACTI:
- case OP_POSSTARI:
- case OP_POSPLUSI:
- case OP_POSQUERYI:
- case OP_POSUPTOI:
- case OP_NOTSTAR:
- case OP_NOTMINSTAR:
- case OP_NOTPLUS:
- case OP_NOTMINPLUS:
- case OP_NOTQUERY:
- case OP_NOTMINQUERY:
- case OP_NOTUPTO:
- case OP_NOTMINUPTO:
- case OP_NOTEXACT:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSUPTO:
- case OP_NOTSTARI:
- case OP_NOTMINSTARI:
- case OP_NOTPLUSI:
- case OP_NOTMINPLUSI:
- case OP_NOTQUERYI:
- case OP_NOTMINQUERYI:
- case OP_NOTUPTOI:
- case OP_NOTMINUPTOI:
- case OP_NOTEXACTI:
- case OP_NOTPOSSTARI:
- case OP_NOTPOSPLUSI:
- case OP_NOTPOSQUERYI:
- case OP_NOTPOSUPTOI:
- if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
- break;
- }
-#else
- (void)(utf); /* Keep compiler happy by referencing function argument */
-#endif
- }
-}
-
-
-
-/*************************************************
-* Check for POSIX class syntax *
-*************************************************/
-
-/* This function is called when the sequence "[:" or "[." or "[=" is
-encountered in a character class. It checks whether this is followed by a
-sequence of characters terminated by a matching ":]" or ".]" or "=]". If we
-reach an unescaped ']' without the special preceding character, return FALSE.
-
-Originally, this function only recognized a sequence of letters between the
-terminators, but it seems that Perl recognizes any sequence of characters,
-though of course unknown POSIX names are subsequently rejected. Perl gives an
-"Unknown POSIX class" error for [:f\oo:] for example, where previously PCRE
-didn't consider this to be a POSIX class. Likewise for [:1234:].
-
-The problem in trying to be exactly like Perl is in the handling of escapes. We
-have to be sure that [abc[:x\]pqr] is *not* treated as containing a POSIX
-class, but [abc[:x\]pqr:]] is (so that an error can be generated). The code
-below handles the special case of \], but does not try to do any other escape
-processing. This makes it different from Perl for cases such as [:l\ower:]
-where Perl recognizes it as the POSIX class "lower" but PCRE does not recognize
-"l\ower". This is a lesser evil than not diagnosing bad classes when Perl does,
-I think.
-
-A user pointed out that PCRE was rejecting [:a[:digit:]] whereas Perl was not.
-It seems that the appearance of a nested POSIX class supersedes an apparent
-external class. For example, [:a[:digit:]b:] matches "a", "b", ":", or
-a digit.
-
-In Perl, unescaped square brackets may also appear as part of class names. For
-example, [:a[:abc]b:] gives unknown POSIX class "[:abc]b:]". However, for
-[:a[:abc]b][b:] it gives unknown POSIX class "[:abc]b][b:]", which does not
-seem right at all. PCRE does not allow closing square brackets in POSIX class
-names.
-
-Arguments:
- ptr pointer to the initial [
- endptr where to return the end pointer
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-check_posix_syntax(const pcre_uchar *ptr, const pcre_uchar **endptr)
-{
-pcre_uchar terminator; /* Don't combine these lines; the Solaris cc */
-terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */
-for (++ptr; *ptr != CHAR_NULL; ptr++)
- {
- if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
- ptr++;
- else if (*ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE;
- else
- {
- if (*ptr == terminator && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
- {
- *endptr = ptr;
- return TRUE;
- }
- if (*ptr == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) &&
- check_posix_syntax(ptr, endptr))
- return FALSE;
- }
- }
-return FALSE;
-}
-
-
-
-
-/*************************************************
-* Check POSIX class name *
-*************************************************/
-
-/* This function is called to check the name given in a POSIX-style class entry
-such as [:alnum:].
-
-Arguments:
- ptr points to the first letter
- len the length of the name
-
-Returns: a value representing the name, or -1 if unknown
-*/
-
-static int
-check_posix_name(const pcre_uchar *ptr, int len)
-{
-const char *pn = posix_names;
-register int yield = 0;
-while (posix_name_lengths[yield] != 0)
- {
- if (len == posix_name_lengths[yield] &&
- STRNCMP_UC_C8(ptr, pn, (unsigned int)len) == 0) return yield;
- pn += posix_name_lengths[yield] + 1;
- yield++;
- }
-return -1;
-}
-
-
-/*************************************************
-* Adjust OP_RECURSE items in repeated group *
-*************************************************/
-
-/* OP_RECURSE items contain an offset from the start of the regex to the group
-that is referenced. This means that groups can be replicated for fixed
-repetition simply by copying (because the recursion is allowed to refer to
-earlier groups that are outside the current group). However, when a group is
-optional (i.e. the minimum quantifier is zero), OP_BRAZERO or OP_SKIPZERO is
-inserted before it, after it has been compiled. This means that any OP_RECURSE
-items within it that refer to the group itself or any contained groups have to
-have their offsets adjusted. That one of the jobs of this function. Before it
-is called, the partially compiled regex must be temporarily terminated with
-OP_END.
-
-This function has been extended with the possibility of forward references for
-recursions and subroutine calls. It must also check the list of such references
-for the group we are dealing with. If it finds that one of the recursions in
-the current group is on this list, it adjusts the offset in the list, not the
-value in the reference (which is a group number).
-
-Arguments:
- group points to the start of the group
- adjust the amount by which the group is to be moved
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- cd contains pointers to tables etc.
- save_hwm the hwm forward reference pointer at the start of the group
-
-Returns: nothing
-*/
-
-static void
-adjust_recurse(pcre_uchar *group, int adjust, BOOL utf, compile_data *cd,
- pcre_uchar *save_hwm)
-{
-pcre_uchar *ptr = group;
-
-while ((ptr = (pcre_uchar *)find_recurse(ptr, utf)) != NULL)
- {
- int offset;
- pcre_uchar *hc;
-
- /* See if this recursion is on the forward reference list. If so, adjust the
- reference. */
-
- for (hc = save_hwm; hc < cd->hwm; hc += LINK_SIZE)
- {
- offset = (int)GET(hc, 0);
- if (cd->start_code + offset == ptr + 1)
- {
- PUT(hc, 0, offset + adjust);
- break;
- }
- }
-
- /* Otherwise, adjust the recursion offset if it's after the start of this
- group. */
-
- if (hc >= cd->hwm)
- {
- offset = (int)GET(ptr, 1);
- if (cd->start_code + offset >= group) PUT(ptr, 1, offset + adjust);
- }
-
- ptr += 1 + LINK_SIZE;
- }
-}
-
-
-
-/*************************************************
-* Insert an automatic callout point *
-*************************************************/
-
-/* This function is called when the PCRE_AUTO_CALLOUT option is set, to insert
-callout points before each pattern item.
-
-Arguments:
- code current code pointer
- ptr current pattern pointer
- cd pointers to tables etc
-
-Returns: new code pointer
-*/
-
-static pcre_uchar *
-auto_callout(pcre_uchar *code, const pcre_uchar *ptr, compile_data *cd)
-{
-*code++ = OP_CALLOUT;
-*code++ = 255;
-PUT(code, 0, (int)(ptr - cd->start_pattern)); /* Pattern offset */
-PUT(code, LINK_SIZE, 0); /* Default length */
-return code + 2 * LINK_SIZE;
-}
-
-
-
-/*************************************************
-* Complete a callout item *
-*************************************************/
-
-/* A callout item contains the length of the next item in the pattern, which
-we can't fill in till after we have reached the relevant point. This is used
-for both automatic and manual callouts.
-
-Arguments:
- previous_callout points to previous callout item
- ptr current pattern pointer
- cd pointers to tables etc
-
-Returns: nothing
-*/
-
-static void
-complete_callout(pcre_uchar *previous_callout, const pcre_uchar *ptr, compile_data *cd)
-{
-int length = (int)(ptr - cd->start_pattern - GET(previous_callout, 2));
-PUT(previous_callout, 2 + LINK_SIZE, length);
-}
-
-
-
-#ifdef SUPPORT_UCP
-/*************************************************
-* Get othercase range *
-*************************************************/
-
-/* This function is passed the start and end of a class range, in UTF-8 mode
-with UCP support. It searches up the characters, looking for ranges of
-characters in the "other" case. Each call returns the next one, updating the
-start address. A character with multiple other cases is returned on its own
-with a special return value.
-
-Arguments:
- cptr points to starting character value; updated
- d end value
- ocptr where to put start of othercase range
- odptr where to put end of othercase range
-
-Yield: -1 when no more
- 0 when a range is returned
- >0 the CASESET offset for char with multiple other cases
- in this case, ocptr contains the original
-*/
-
-static int
-get_othercase_range(pcre_uint32 *cptr, pcre_uint32 d, pcre_uint32 *ocptr,
- pcre_uint32 *odptr)
-{
-pcre_uint32 c, othercase, next;
-unsigned int co;
-
-/* Find the first character that has an other case. If it has multiple other
-cases, return its case offset value. */
-
-for (c = *cptr; c <= d; c++)
- {
- if ((co = UCD_CASESET(c)) != 0)
- {
- *ocptr = c++; /* Character that has the set */
- *cptr = c; /* Rest of input range */
- return (int)co;
- }
- if ((othercase = UCD_OTHERCASE(c)) != c) break;
- }
-
-if (c > d) return -1; /* Reached end of range */
-
-/* Found a character that has a single other case. Search for the end of the
-range, which is either the end of the input range, or a character that has zero
-or more than one other cases. */
-
-*ocptr = othercase;
-next = othercase + 1;
-
-for (++c; c <= d; c++)
- {
- if ((co = UCD_CASESET(c)) != 0 || UCD_OTHERCASE(c) != next) break;
- next++;
- }
-
-*odptr = next - 1; /* End of othercase range */
-*cptr = c; /* Rest of input range */
-return 0;
-}
-#endif /* SUPPORT_UCP */
-
-
-
-/*************************************************
-* Add a character or range to a class *
-*************************************************/
-
-/* This function packages up the logic of adding a character or range of
-characters to a class. The character values in the arguments will be within the
-valid values for the current mode (8-bit, 16-bit, UTF, etc). This function is
-mutually recursive with the function immediately below.
-
-Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cd contains pointers to tables etc.
- start start of range character
- end end of range character
-
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
-*/
-
-static int
-add_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr, int options,
- compile_data *cd, pcre_uint32 start, pcre_uint32 end)
-{
-pcre_uint32 c;
-pcre_uint32 classbits_end = (end <= 0xff ? end : 0xff);
-int n8 = 0;
-
-/* If caseless matching is required, scan the range and process alternate
-cases. In Unicode, there are 8-bit characters that have alternate cases that
-are greater than 255 and vice-versa. Sometimes we can just extend the original
-range. */
-
-if ((options & PCRE_CASELESS) != 0)
- {
-#ifdef SUPPORT_UCP
- if ((options & PCRE_UTF8) != 0)
- {
- int rc;
- pcre_uint32 oc, od;
-
- options &= ~PCRE_CASELESS; /* Remove for recursive calls */
- c = start;
-
- while ((rc = get_othercase_range(&c, end, &oc, &od)) >= 0)
- {
- /* Handle a single character that has more than one other case. */
-
- if (rc > 0) n8 += add_list_to_class(classbits, uchardptr, options, cd,
- PRIV(ucd_caseless_sets) + rc, oc);
-
- /* Do nothing if the other case range is within the original range. */
-
- else if (oc >= start && od <= end) continue;
-
- /* Extend the original range if there is overlap, noting that if oc < c, we
- can't have od > end because a subrange is always shorter than the basic
- range. Otherwise, use a recursive call to add the additional range. */
-
- else if (oc < start && od >= start - 1) start = oc; /* Extend downwards */
- else if (od > end && oc <= end + 1) end = od; /* Extend upwards */
- else n8 += add_to_class(classbits, uchardptr, options, cd, oc, od);
- }
- }
- else
-#endif /* SUPPORT_UCP */
-
- /* Not UTF-mode, or no UCP */
-
- for (c = start; c <= classbits_end; c++)
- {
- SETBIT(classbits, cd->fcc[c]);
- n8++;
- }
- }
-
-/* Now handle the original range. Adjust the final value according to the bit
-length - this means that the same lists of (e.g.) horizontal spaces can be used
-in all cases. */
-
-#if defined COMPILE_PCRE8
-#ifdef SUPPORT_UTF
- if ((options & PCRE_UTF8) == 0)
-#endif
- if (end > 0xff) end = 0xff;
-
-#elif defined COMPILE_PCRE16
-#ifdef SUPPORT_UTF
- if ((options & PCRE_UTF16) == 0)
-#endif
- if (end > 0xffff) end = 0xffff;
-
-#endif /* COMPILE_PCRE[8|16] */
-
-/* Use the bitmap for characters < 256. Otherwise use extra data.*/
-
-for (c = start; c <= classbits_end; c++)
- {
- /* Regardless of start, c will always be <= 255. */
- SETBIT(classbits, c);
- n8++;
- }
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
-if (start <= 0xff) start = 0xff + 1;
-
-if (end >= start)
- {
- pcre_uchar *uchardata = *uchardptr;
-#ifdef SUPPORT_UTF
- if ((options & PCRE_UTF8) != 0) /* All UTFs use the same flag bit */
- {
- if (start < end)
- {
- *uchardata++ = XCL_RANGE;
- uchardata += PRIV(ord2utf)(start, uchardata);
- uchardata += PRIV(ord2utf)(end, uchardata);
- }
- else if (start == end)
- {
- *uchardata++ = XCL_SINGLE;
- uchardata += PRIV(ord2utf)(start, uchardata);
- }
- }
- else
-#endif /* SUPPORT_UTF */
-
- /* Without UTF support, character values are constrained by the bit length,
- and can only be > 256 for 16-bit and 32-bit libraries. */
-
-#ifdef COMPILE_PCRE8
- {}
-#else
- if (start < end)
- {
- *uchardata++ = XCL_RANGE;
- *uchardata++ = start;
- *uchardata++ = end;
- }
- else if (start == end)
- {
- *uchardata++ = XCL_SINGLE;
- *uchardata++ = start;
- }
-#endif
-
- *uchardptr = uchardata; /* Updata extra data pointer */
- }
-#endif /* SUPPORT_UTF || !COMPILE_PCRE8 */
-
-return n8; /* Number of 8-bit characters */
-}
-
-
-
-
-/*************************************************
-* Add a list of characters to a class *
-*************************************************/
-
-/* This function is used for adding a list of case-equivalent characters to a
-class, and also for adding a list of horizontal or vertical whitespace. If the
-list is in order (which it should be), ranges of characters are detected and
-handled appropriately. This function is mutually recursive with the function
-above.
-
-Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cd contains pointers to tables etc.
- p points to row of 32-bit values, terminated by NOTACHAR
- except character to omit; this is used when adding lists of
- case-equivalent characters to avoid including the one we
- already know about
-
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
-*/
-
-static int
-add_list_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr, int options,
- compile_data *cd, const pcre_uint32 *p, unsigned int except)
-{
-int n8 = 0;
-while (p[0] < NOTACHAR)
- {
- int n = 0;
- if (p[0] != except)
- {
- while(p[n+1] == p[0] + n + 1) n++;
- n8 += add_to_class(classbits, uchardptr, options, cd, p[0], p[n]);
- }
- p += n + 1;
- }
-return n8;
-}
-
-
-
-/*************************************************
-* Add characters not in a list to a class *
-*************************************************/
-
-/* This function is used for adding the complement of a list of horizontal or
-vertical whitespace to a class. The list must be in order.
-
-Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cd contains pointers to tables etc.
- p points to row of 32-bit values, terminated by NOTACHAR
-
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
-*/
-
-static int
-add_not_list_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr,
- int options, compile_data *cd, const pcre_uint32 *p)
-{
-BOOL utf = (options & PCRE_UTF8) != 0;
-int n8 = 0;
-if (p[0] > 0)
- n8 += add_to_class(classbits, uchardptr, options, cd, 0, p[0] - 1);
-while (p[0] < NOTACHAR)
- {
- while (p[1] == p[0] + 1) p++;
- n8 += add_to_class(classbits, uchardptr, options, cd, p[0] + 1,
- (p[1] == NOTACHAR) ? (utf ? 0x10ffffu : 0xffffffffu) : p[1] - 1);
- p++;
- }
-return n8;
-}
-
-
-
-/*************************************************
-* Compile one branch *
-*************************************************/
-
-/* Scan the pattern, compiling it into the a vector. If the options are
-changed during the branch, the pointer is used to change the external options
-bits. This function is used during the pre-compile phase when we are trying
-to find out the amount of memory needed, as well as during the real compile
-phase. The value of lengthptr distinguishes the two phases.
-
-Arguments:
- optionsptr pointer to the option bits
- codeptr points to the pointer to the current code point
- ptrptr points to the current pattern pointer
- errorcodeptr points to error code variable
- firstcharptr place to put the first required character
- firstcharflagsptr place to put the first character flags, or a negative number
- reqcharptr place to put the last required character
- reqcharflagsptr place to put the last required character flags, or a negative number
- bcptr points to current branch chain
- cond_depth conditional nesting depth
- cd contains pointers to tables etc.
- lengthptr NULL during the real compile phase
- points to length accumulator during pre-compile phase
-
-Returns: TRUE on success
- FALSE, with *errorcodeptr set non-zero on error
-*/
-
-static BOOL
-compile_branch(int *optionsptr, pcre_uchar **codeptr,
- const pcre_uchar **ptrptr, int *errorcodeptr,
- pcre_uint32 *firstcharptr, pcre_int32 *firstcharflagsptr,
- pcre_uint32 *reqcharptr, pcre_int32 *reqcharflagsptr,
- branch_chain *bcptr, int cond_depth,
- compile_data *cd, int *lengthptr)
-{
-int repeat_type, op_type;
-int repeat_min = 0, repeat_max = 0; /* To please picky compilers */
-int bravalue = 0;
-int greedy_default, greedy_non_default;
-pcre_uint32 firstchar, reqchar;
-pcre_int32 firstcharflags, reqcharflags;
-pcre_uint32 zeroreqchar, zerofirstchar;
-pcre_int32 zeroreqcharflags, zerofirstcharflags;
-pcre_int32 req_caseopt, reqvary, tempreqvary;
-int options = *optionsptr; /* May change dynamically */
-int after_manual_callout = 0;
-int length_prevgroup = 0;
-register pcre_uint32 c;
-int escape;
-register pcre_uchar *code = *codeptr;
-pcre_uchar *last_code = code;
-pcre_uchar *orig_code = code;
-pcre_uchar *tempcode;
-BOOL inescq = FALSE;
-BOOL groupsetfirstchar = FALSE;
-const pcre_uchar *ptr = *ptrptr;
-const pcre_uchar *tempptr;
-const pcre_uchar *nestptr = NULL;
-pcre_uchar *previous = NULL;
-pcre_uchar *previous_callout = NULL;
-pcre_uchar *save_hwm = NULL;
-pcre_uint8 classbits[32];
-
-/* We can fish out the UTF-8 setting once and for all into a BOOL, but we
-must not do this for other options (e.g. PCRE_EXTENDED) because they may change
-dynamically as we process the pattern. */
-
-#ifdef SUPPORT_UTF
-/* PCRE_UTF[16|32] have the same value as PCRE_UTF8. */
-BOOL utf = (options & PCRE_UTF8) != 0;
-#ifndef COMPILE_PCRE32
-pcre_uchar utf_chars[6];
-#endif
-#else
-BOOL utf = FALSE;
-#endif
-
-/* Helper variables for OP_XCLASS opcode (for characters > 255). We define
-class_uchardata always so that it can be passed to add_to_class() always,
-though it will not be used in non-UTF 8-bit cases. This avoids having to supply
-alternative calls for the different cases. */
-
-pcre_uchar *class_uchardata;
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
-BOOL xclass;
-pcre_uchar *class_uchardata_base;
-#endif
-
-#ifdef PCRE_DEBUG
-if (lengthptr != NULL) DPRINTF((">> start branch\n"));
-#endif
-
-/* Set up the default and non-default settings for greediness */
-
-greedy_default = ((options & PCRE_UNGREEDY) != 0);
-greedy_non_default = greedy_default ^ 1;
-
-/* Initialize no first byte, no required byte. REQ_UNSET means "no char
-matching encountered yet". It gets changed to REQ_NONE if we hit something that
-matches a non-fixed char first char; reqchar just remains unset if we never
-find one.
-
-When we hit a repeat whose minimum is zero, we may have to adjust these values
-to take the zero repeat into account. This is implemented by setting them to
-zerofirstbyte and zeroreqchar when such a repeat is encountered. The individual
-item types that can be repeated set these backoff variables appropriately. */
-
-firstchar = reqchar = zerofirstchar = zeroreqchar = 0;
-firstcharflags = reqcharflags = zerofirstcharflags = zeroreqcharflags = REQ_UNSET;
-
-/* The variable req_caseopt contains either the REQ_CASELESS value
-or zero, according to the current setting of the caseless flag. The
-REQ_CASELESS leaves the lower 28 bit empty. It is added into the
-firstchar or reqchar variables to record the case status of the
-value. This is used only for ASCII characters. */
-
-req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
-
-/* Switch on next character until the end of the branch */
-
-for (;; ptr++)
- {
- BOOL negate_class;
- BOOL should_flip_negation;
- BOOL possessive_quantifier;
- BOOL is_quantifier;
- BOOL is_recurse;
- BOOL reset_bracount;
- int class_has_8bitchar;
- int class_one_char;
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- BOOL xclass_has_prop;
-#endif
- int newoptions;
- int recno;
- int refsign;
- int skipbytes;
- pcre_uint32 subreqchar, subfirstchar;
- pcre_int32 subreqcharflags, subfirstcharflags;
- int terminator;
- unsigned int mclength;
- unsigned int tempbracount;
- pcre_uint32 ec;
- pcre_uchar mcbuffer[8];
-
- /* Get next character in the pattern */
-
- c = *ptr;
-
- /* If we are at the end of a nested substitution, revert to the outer level
- string. Nesting only happens one level deep. */
-
- if (c == CHAR_NULL && nestptr != NULL)
- {
- ptr = nestptr;
- nestptr = NULL;
- c = *ptr;
- }
-
- /* If we are in the pre-compile phase, accumulate the length used for the
- previous cycle of this loop. */
-
- if (lengthptr != NULL)
- {
-#ifdef PCRE_DEBUG
- if (code > cd->hwm) cd->hwm = code; /* High water info */
-#endif
- if (code > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN) /* Check for overrun */
- {
- *errorcodeptr = ERR52;
- goto FAILED;
- }
-
- /* There is at least one situation where code goes backwards: this is the
- case of a zero quantifier after a class (e.g. [ab]{0}). At compile time,
- the class is simply eliminated. However, it is created first, so we have to
- allow memory for it. Therefore, don't ever reduce the length at this point.
- */
-
- if (code < last_code) code = last_code;
-
- /* Paranoid check for integer overflow */
-
- if (OFLOW_MAX - *lengthptr < code - last_code)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
-
- *lengthptr += (int)(code - last_code);
- DPRINTF(("length=%d added %d c=%c (0x%x)\n", *lengthptr,
- (int)(code - last_code), c, c));
-
- /* If "previous" is set and it is not at the start of the work space, move
- it back to there, in order to avoid filling up the work space. Otherwise,
- if "previous" is NULL, reset the current code pointer to the start. */
-
- if (previous != NULL)
- {
- if (previous > orig_code)
- {
- memmove(orig_code, previous, IN_UCHARS(code - previous));
- code -= previous - orig_code;
- previous = orig_code;
- }
- }
- else code = orig_code;
-
- /* Remember where this code item starts so we can pick up the length
- next time round. */
-
- last_code = code;
- }
-
- /* In the real compile phase, just check the workspace used by the forward
- reference list. */
-
- else if (cd->hwm > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN)
- {
- *errorcodeptr = ERR52;
- goto FAILED;
- }
-
- /* If in \Q...\E, check for the end; if not, we have a literal */
-
- if (inescq && c != CHAR_NULL)
- {
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E)
- {
- inescq = FALSE;
- ptr++;
- continue;
- }
- else
- {
- if (previous_callout != NULL)
- {
- if (lengthptr == NULL) /* Don't attempt in pre-compile phase */
- complete_callout(previous_callout, ptr, cd);
- previous_callout = NULL;
- }
- if ((options & PCRE_AUTO_CALLOUT) != 0)
- {
- previous_callout = code;
- code = auto_callout(code, ptr, cd);
- }
- goto NORMAL_CHAR;
- }
- /* Control does not reach here. */
- }
-
- /* In extended mode, skip white space and comments. We need a loop in order
- to check for more white space and more comments after a comment. */
-
- if ((options & PCRE_EXTENDED) != 0)
- {
- for (;;)
- {
- while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr);
- if (c != CHAR_NUMBER_SIGN) break;
- ptr++;
- while (*ptr != CHAR_NULL)
- {
- if (IS_NEWLINE(ptr)) /* For non-fixed-length newline cases, */
- { /* IS_NEWLINE sets cd->nllen. */
- ptr += cd->nllen;
- break;
- }
- ptr++;
-#ifdef SUPPORT_UTF
- if (utf) FORWARDCHAR(ptr);
-#endif
- }
- c = *ptr; /* Either NULL or the char after a newline */
- }
- }
-
- /* See if the next thing is a quantifier. */
-
- is_quantifier =
- c == CHAR_ASTERISK || c == CHAR_PLUS || c == CHAR_QUESTION_MARK ||
- (c == CHAR_LEFT_CURLY_BRACKET && is_counted_repeat(ptr+1));
-
- /* Fill in length of a previous callout, except when the next thing is a
- quantifier or when processing a property substitution string in UCP mode. */
-
- if (!is_quantifier && previous_callout != NULL && nestptr == NULL &&
- after_manual_callout-- <= 0)
- {
- if (lengthptr == NULL) /* Don't attempt in pre-compile phase */
- complete_callout(previous_callout, ptr, cd);
- previous_callout = NULL;
- }
-
- /* Create auto callout, except for quantifiers, or while processing property
- strings that are substituted for \w etc in UCP mode. */
-
- if ((options & PCRE_AUTO_CALLOUT) != 0 && !is_quantifier && nestptr == NULL)
- {
- previous_callout = code;
- code = auto_callout(code, ptr, cd);
- }
-
- /* Process the next pattern item. */
-
- switch(c)
- {
- /* ===================================================================*/
- case CHAR_NULL: /* The branch terminates at string end */
- case CHAR_VERTICAL_LINE: /* or | or ) */
- case CHAR_RIGHT_PARENTHESIS:
- *firstcharptr = firstchar;
- *firstcharflagsptr = firstcharflags;
- *reqcharptr = reqchar;
- *reqcharflagsptr = reqcharflags;
- *codeptr = code;
- *ptrptr = ptr;
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < code - last_code)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += (int)(code - last_code); /* To include callout length */
- DPRINTF((">> end branch\n"));
- }
- return TRUE;
-
-
- /* ===================================================================*/
- /* Handle single-character metacharacters. In multiline mode, ^ disables
- the setting of any following char as a first character. */
-
- case CHAR_CIRCUMFLEX_ACCENT:
- previous = NULL;
- if ((options & PCRE_MULTILINE) != 0)
- {
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- *code++ = OP_CIRCM;
- }
- else *code++ = OP_CIRC;
- break;
-
- case CHAR_DOLLAR_SIGN:
- previous = NULL;
- *code++ = ((options & PCRE_MULTILINE) != 0)? OP_DOLLM : OP_DOLL;
- break;
-
- /* There can never be a first char if '.' is first, whatever happens about
- repeats. The value of reqchar doesn't change either. */
-
- case CHAR_DOT:
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
- previous = code;
- *code++ = ((options & PCRE_DOTALL) != 0)? OP_ALLANY: OP_ANY;
- break;
-
-
- /* ===================================================================*/
- /* Character classes. If the included characters are all < 256, we build a
- 32-byte bitmap of the permitted characters, except in the special case
- where there is only one such character. For negated classes, we build the
- map as usual, then invert it at the end. However, we use a different opcode
- so that data characters > 255 can be handled correctly.
-
- If the class contains characters outside the 0-255 range, a different
- opcode is compiled. It may optionally have a bit map for characters < 256,
- but those above are are explicitly listed afterwards. A flag byte tells
- whether the bitmap is present, and whether this is a negated class or not.
-
- In JavaScript compatibility mode, an isolated ']' causes an error. In
- default (Perl) mode, it is treated as a data character. */
-
- case CHAR_RIGHT_SQUARE_BRACKET:
- if ((cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- *errorcodeptr = ERR64;
- goto FAILED;
- }
- goto NORMAL_CHAR;
-
- /* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
- used for "start of word" and "end of word". As these are otherwise illegal
- sequences, we don't break anything by recognizing them. They are replaced
- by \b(?=\w) and \b(?<=\w) respectively. Sequences like [a[:<:]] are
- erroneous and are handled by the normal code below. */
-
- case CHAR_LEFT_SQUARE_BRACKET:
- if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
- {
- nestptr = ptr + 7;
- ptr = sub_start_of_word - 1;
- continue;
- }
-
- if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
- {
- nestptr = ptr + 7;
- ptr = sub_end_of_word - 1;
- continue;
- }
-
- /* Handle a real character class. */
-
- previous = code;
-
- /* PCRE supports POSIX class stuff inside a class. Perl gives an error if
- they are encountered at the top level, so we'll do that too. */
-
- if ((ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) &&
- check_posix_syntax(ptr, &tempptr))
- {
- *errorcodeptr = (ptr[1] == CHAR_COLON)? ERR13 : ERR31;
- goto FAILED;
- }
-
- /* If the first character is '^', set the negation flag and skip it. Also,
- if the first few characters (either before or after ^) are \Q\E or \E we
- skip them too. This makes for compatibility with Perl. */
-
- negate_class = FALSE;
- for (;;)
- {
- c = *(++ptr);
- if (c == CHAR_BACKSLASH)
- {
- if (ptr[1] == CHAR_E)
- ptr++;
- else if (STRNCMP_UC_C8(ptr + 1, STR_Q STR_BACKSLASH STR_E, 3) == 0)
- ptr += 3;
- else
- break;
- }
- else if (!negate_class && c == CHAR_CIRCUMFLEX_ACCENT)
- negate_class = TRUE;
- else break;
- }
-
- /* Empty classes are allowed in JavaScript compatibility mode. Otherwise,
- an initial ']' is taken as a data character -- the code below handles
- that. In JS mode, [] must always fail, so generate OP_FAIL, whereas
- [^] must match any character, so generate OP_ALLANY. */
-
- if (c == CHAR_RIGHT_SQUARE_BRACKET &&
- (cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- *code++ = negate_class? OP_ALLANY : OP_FAIL;
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- break;
- }
-
- /* If a class contains a negative special such as \S, we need to flip the
- negation flag at the end, so that support for characters > 255 works
- correctly (they are all included in the class). */
-
- should_flip_negation = FALSE;
-
- /* Extended class (xclass) will be used when characters > 255
- might match. */
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- xclass = FALSE;
- class_uchardata = code + LINK_SIZE + 2; /* For XCLASS items */
- class_uchardata_base = class_uchardata; /* Save the start */
-#endif
-
- /* For optimization purposes, we track some properties of the class:
- class_has_8bitchar will be non-zero if the class contains at least one <
- 256 character; class_one_char will be 1 if the class contains just one
- character; xclass_has_prop will be TRUE if unicode property checks
- are present in the class. */
-
- class_has_8bitchar = 0;
- class_one_char = 0;
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- xclass_has_prop = FALSE;
-#endif
-
- /* Initialize the 32-char bit map to all zeros. We build the map in a
- temporary bit of memory, in case the class contains fewer than two
- 8-bit characters because in that case the compiled code doesn't use the bit
- map. */
-
- memset(classbits, 0, 32 * sizeof(pcre_uint8));
-
- /* Process characters until ] is reached. By writing this as a "do" it
- means that an initial ] is taken as a data character. At the start of the
- loop, c contains the first byte of the character. */
-
- if (c != CHAR_NULL) do
- {
- const pcre_uchar *oldptr;
-
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(c))
- { /* Braces are required because the */
- GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */
- }
-#endif
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- /* In the pre-compile phase, accumulate the length of any extra
- data and reset the pointer. This is so that very large classes that
- contain a zillion > 255 characters no longer overwrite the work space
- (which is on the stack). We have to remember that there was XCLASS data,
- however. */
-
- if (lengthptr != NULL && class_uchardata > class_uchardata_base)
- {
- xclass = TRUE;
- *lengthptr += class_uchardata - class_uchardata_base;
- class_uchardata = class_uchardata_base;
- }
-#endif
-
- /* Inside \Q...\E everything is literal except \E */
-
- if (inescq)
- {
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E) /* If we are at \E */
- {
- inescq = FALSE; /* Reset literal state */
- ptr++; /* Skip the 'E' */
- continue; /* Carry on with next */
- }
- goto CHECK_RANGE; /* Could be range if \E follows */
- }
-
- /* Handle POSIX class names. Perl allows a negation extension of the
- form [:^name:]. A square bracket that doesn't match the syntax is
- treated as a literal. We also recognize the POSIX constructions
- [.ch.] and [=ch=] ("collating elements") and fault them, as Perl
- 5.6 and 5.8 do. */
-
- if (c == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) && check_posix_syntax(ptr, &tempptr))
- {
- BOOL local_negate = FALSE;
- int posix_class, taboffset, tabopt;
- register const pcre_uint8 *cbits = cd->cbits;
- pcre_uint8 pbits[32];
-
- if (ptr[1] != CHAR_COLON)
- {
- *errorcodeptr = ERR31;
- goto FAILED;
- }
-
- ptr += 2;
- if (*ptr == CHAR_CIRCUMFLEX_ACCENT)
- {
- local_negate = TRUE;
- should_flip_negation = TRUE; /* Note negative special */
- ptr++;
- }
-
- posix_class = check_posix_name(ptr, (int)(tempptr - ptr));
- if (posix_class < 0)
- {
- *errorcodeptr = ERR30;
- goto FAILED;
- }
-
- /* If matching is caseless, upper and lower are converted to
- alpha. This relies on the fact that the class table starts with
- alpha, lower, upper as the first 3 entries. */
-
- if ((options & PCRE_CASELESS) != 0 && posix_class <= 2)
- posix_class = 0;
-
- /* When PCRE_UCP is set, some of the POSIX classes are converted to
- different escape sequences that use Unicode properties \p or \P. Others
- that are not available via \p or \P generate XCL_PROP/XCL_NOTPROP
- directly. */
-
-#ifdef SUPPORT_UCP
- if ((options & PCRE_UCP) != 0)
- {
- unsigned int ptype = 0;
- int pc = posix_class + ((local_negate)? POSIX_SUBSIZE/2 : 0);
-
- /* The posix_substitutes table specifies which POSIX classes can be
- converted to \p or \P items. */
-
- if (posix_substitutes[pc] != NULL)
- {
- nestptr = tempptr + 1;
- ptr = posix_substitutes[pc] - 1;
- continue;
- }
-
- /* There are three other classes that generate special property calls
- that are recognized only in an XCLASS. */
-
- else switch(posix_class)
- {
- case PC_GRAPH:
- ptype = PT_PXGRAPH;
- /* Fall through */
- case PC_PRINT:
- if (ptype == 0) ptype = PT_PXPRINT;
- /* Fall through */
- case PC_PUNCT:
- if (ptype == 0) ptype = PT_PXPUNCT;
- *class_uchardata++ = local_negate? XCL_NOTPROP : XCL_PROP;
- *class_uchardata++ = ptype;
- *class_uchardata++ = 0;
- xclass_has_prop = TRUE;
- ptr = tempptr + 1;
- continue;
-
- /* For all other POSIX classes, no special action is taken in UCP
- mode. Fall through to the non_UCP case. */
-
- default:
- break;
- }
- }
-#endif
- /* In the non-UCP case, or when UCP makes no difference, we build the
- bit map for the POSIX class in a chunk of local store because we may be
- adding and subtracting from it, and we don't want to subtract bits that
- may be in the main map already. At the end we or the result into the
- bit map that is being built. */
-
- posix_class *= 3;
-
- /* Copy in the first table (always present) */
-
- memcpy(pbits, cbits + posix_class_maps[posix_class],
- 32 * sizeof(pcre_uint8));
-
- /* If there is a second table, add or remove it as required. */
-
- taboffset = posix_class_maps[posix_class + 1];
- tabopt = posix_class_maps[posix_class + 2];
-
- if (taboffset >= 0)
- {
- if (tabopt >= 0)
- for (c = 0; c < 32; c++) pbits[c] |= cbits[c + taboffset];
- else
- for (c = 0; c < 32; c++) pbits[c] &= ~cbits[c + taboffset];
- }
-
- /* Now see if we need to remove any special characters. An option
- value of 1 removes vertical space and 2 removes underscore. */
-
- if (tabopt < 0) tabopt = -tabopt;
- if (tabopt == 1) pbits[1] &= ~0x3c;
- else if (tabopt == 2) pbits[11] &= 0x7f;
-
- /* Add the POSIX table or its complement into the main table that is
- being built and we are done. */
-
- if (local_negate)
- for (c = 0; c < 32; c++) classbits[c] |= ~pbits[c];
- else
- for (c = 0; c < 32; c++) classbits[c] |= pbits[c];
-
- ptr = tempptr + 1;
- /* Every class contains at least one < 256 character. */
- class_has_8bitchar = 1;
- /* Every class contains at least two characters. */
- class_one_char = 2;
- continue; /* End of POSIX syntax handling */
- }
-
- /* Backslash may introduce a single character, or it may introduce one
- of the specials, which just set a flag. The sequence \b is a special
- case. Inside a class (and only there) it is treated as backspace. We
- assume that other escapes have more than one character in them, so
- speculatively set both class_has_8bitchar and class_one_char bigger
- than one. Unrecognized escapes fall through and are either treated
- as literal characters (by default), or are faulted if
- PCRE_EXTRA is set. */
-
- if (c == CHAR_BACKSLASH)
- {
- escape = check_escape(&ptr, &ec, errorcodeptr, cd->bracount, options,
- TRUE);
- if (*errorcodeptr != 0) goto FAILED;
- if (escape == 0) c = ec;
- else if (escape == ESC_b) c = CHAR_BS; /* \b is backspace in a class */
- else if (escape == ESC_N) /* \N is not supported in a class */
- {
- *errorcodeptr = ERR71;
- goto FAILED;
- }
- else if (escape == ESC_Q) /* Handle start of quoted string */
- {
- if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
- {
- ptr += 2; /* avoid empty string */
- }
- else inescq = TRUE;
- continue;
- }
- else if (escape == ESC_E) continue; /* Ignore orphan \E */
-
- else
- {
- register const pcre_uint8 *cbits = cd->cbits;
- /* Every class contains at least two < 256 characters. */
- class_has_8bitchar++;
- /* Every class contains at least two characters. */
- class_one_char += 2;
-
- switch (escape)
- {
-#ifdef SUPPORT_UCP
- case ESC_du: /* These are the values given for \d etc */
- case ESC_DU: /* when PCRE_UCP is set. We replace the */
- case ESC_wu: /* escape sequence with an appropriate \p */
- case ESC_WU: /* or \P to test Unicode properties instead */
- case ESC_su: /* of the default ASCII testing. */
- case ESC_SU:
- nestptr = ptr;
- ptr = substitutes[escape - ESC_DU] - 1; /* Just before substitute */
- class_has_8bitchar--; /* Undo! */
- continue;
-#endif
- case ESC_d:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_digit];
- continue;
-
- case ESC_D:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit];
- continue;
-
- case ESC_w:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_word];
- continue;
-
- case ESC_W:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word];
- continue;
-
- /* Perl 5.004 onwards omitted VT from \s, but restored it at Perl
- 5.18. Before PCRE 8.34, we had to preserve the VT bit if it was
- previously set by something earlier in the character class.
- Luckily, the value of CHAR_VT is 0x0b in both ASCII and EBCDIC, so
- we could just adjust the appropriate bit. From PCRE 8.34 we no
- longer treat \s and \S specially. */
-
- case ESC_s:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_space];
- continue;
-
- case ESC_S:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space];
- continue;
-
- /* The rest apply in both UCP and non-UCP cases. */
-
- case ESC_h:
- (void)add_list_to_class(classbits, &class_uchardata, options, cd,
- PRIV(hspace_list), NOTACHAR);
- continue;
-
- case ESC_H:
- (void)add_not_list_to_class(classbits, &class_uchardata, options,
- cd, PRIV(hspace_list));
- continue;
-
- case ESC_v:
- (void)add_list_to_class(classbits, &class_uchardata, options, cd,
- PRIV(vspace_list), NOTACHAR);
- continue;
-
- case ESC_V:
- (void)add_not_list_to_class(classbits, &class_uchardata, options,
- cd, PRIV(vspace_list));
- continue;
-
-#ifdef SUPPORT_UCP
- case ESC_p:
- case ESC_P:
- {
- BOOL negated;
- unsigned int ptype = 0, pdata = 0;
- if (!get_ucp(&ptr, &negated, &ptype, &pdata, errorcodeptr))
- goto FAILED;
- *class_uchardata++ = ((escape == ESC_p) != negated)?
- XCL_PROP : XCL_NOTPROP;
- *class_uchardata++ = ptype;
- *class_uchardata++ = pdata;
- xclass_has_prop = TRUE;
- class_has_8bitchar--; /* Undo! */
- continue;
- }
-#endif
- /* Unrecognized escapes are faulted if PCRE is running in its
- strict mode. By default, for compatibility with Perl, they are
- treated as literals. */
-
- default:
- if ((options & PCRE_EXTRA) != 0)
- {
- *errorcodeptr = ERR7;
- goto FAILED;
- }
- class_has_8bitchar--; /* Undo the speculative increase. */
- class_one_char -= 2; /* Undo the speculative increase. */
- c = *ptr; /* Get the final character and fall through */
- break;
- }
- }
-
- /* Fall through if the escape just defined a single character (c >= 0).
- This may be greater than 256. */
-
- escape = 0;
-
- } /* End of backslash handling */
-
- /* A character may be followed by '-' to form a range. However, Perl does
- not permit ']' to be the end of the range. A '-' character at the end is
- treated as a literal. Perl ignores orphaned \E sequences entirely. The
- code for handling \Q and \E is messy. */
-
- CHECK_RANGE:
- while (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
- {
- inescq = FALSE;
- ptr += 2;
- }
- oldptr = ptr;
-
- /* Remember if \r or \n were explicitly used */
-
- if (c == CHAR_CR || c == CHAR_NL) cd->external_flags |= PCRE_HASCRORLF;
-
- /* Check for range */
-
- if (!inescq && ptr[1] == CHAR_MINUS)
- {
- pcre_uint32 d;
- ptr += 2;
- while (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_E) ptr += 2;
-
- /* If we hit \Q (not followed by \E) at this point, go into escaped
- mode. */
-
- while (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_Q)
- {
- ptr += 2;
- if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_E)
- { ptr += 2; continue; }
- inescq = TRUE;
- break;
- }
-
- /* Minus (hyphen) at the end of a class is treated as a literal, so put
- back the pointer and jump to handle the character that preceded it. */
-
- if (*ptr == CHAR_NULL || (!inescq && *ptr == CHAR_RIGHT_SQUARE_BRACKET))
- {
- ptr = oldptr;
- goto CLASS_SINGLE_CHARACTER;
- }
-
- /* Otherwise, we have a potential range; pick up the next character */
-
-#ifdef SUPPORT_UTF
- if (utf)
- { /* Braces are required because the */
- GETCHARLEN(d, ptr, ptr); /* macro generates multiple statements */
- }
- else
-#endif
- d = *ptr; /* Not UTF-8 mode */
-
- /* The second part of a range can be a single-character escape
- sequence, but not any of the other escapes. Perl treats a hyphen as a
- literal in such circumstances. However, in Perl's warning mode, a
- warning is given, so PCRE now faults it as it is almost certainly a
- mistake on the user's part. */
-
- if (!inescq)
- {
- if (d == CHAR_BACKSLASH)
- {
- int descape;
- descape = check_escape(&ptr, &d, errorcodeptr, cd->bracount, options, TRUE);
- if (*errorcodeptr != 0) goto FAILED;
-
- /* 0 means a character was put into d; \b is backspace; any other
- special causes an error. */
-
- if (descape != 0)
- {
- if (descape == ESC_b) d = CHAR_BS; else
- {
- *errorcodeptr = ERR83;
- goto FAILED;
- }
- }
- }
-
- /* A hyphen followed by a POSIX class is treated in the same way. */
-
- else if (d == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) &&
- check_posix_syntax(ptr, &tempptr))
- {
- *errorcodeptr = ERR83;
- goto FAILED;
- }
- }
-
- /* Check that the two values are in the correct order. Optimize
- one-character ranges. */
-
- if (d < c)
- {
- *errorcodeptr = ERR8;
- goto FAILED;
- }
- if (d == c) goto CLASS_SINGLE_CHARACTER; /* A few lines below */
-
- /* We have found a character range, so single character optimizations
- cannot be done anymore. Any value greater than 1 indicates that there
- is more than one character. */
-
- class_one_char = 2;
-
- /* Remember an explicit \r or \n, and add the range to the class. */
-
- if (d == CHAR_CR || d == CHAR_NL) cd->external_flags |= PCRE_HASCRORLF;
-
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cd, c, d);
-
- continue; /* Go get the next char in the class */
- }
-
- /* Handle a single character - we can get here for a normal non-escape
- char, or after \ that introduces a single character or for an apparent
- range that isn't. Only the value 1 matters for class_one_char, so don't
- increase it if it is already 2 or more ... just in case there's a class
- with a zillion characters in it. */
-
- CLASS_SINGLE_CHARACTER:
- if (class_one_char < 2) class_one_char++;
-
- /* If class_one_char is 1, we have the first single character in the
- class, and there have been no prior ranges, or XCLASS items generated by
- escapes. If this is the final character in the class, we can optimize by
- turning the item into a 1-character OP_CHAR[I] if it's positive, or
- OP_NOT[I] if it's negative. In the positive case, it can cause firstchar
- to be set. Otherwise, there can be no first char if this item is first,
- whatever repeat count may follow. In the case of reqchar, save the
- previous value for reinstating. */
-
- if (class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
- {
- ptr++;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
-
- if (negate_class)
- {
-#ifdef SUPPORT_UCP
- int d;
-#endif
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
-
- /* For caseless UTF-8 mode when UCP support is available, check
- whether this character has more than one other case. If so, generate
- a special OP_NOTPROP item instead of OP_NOTI. */
-
-#ifdef SUPPORT_UCP
- if (utf && (options & PCRE_CASELESS) != 0 &&
- (d = UCD_CASESET(c)) != 0)
- {
- *code++ = OP_NOTPROP;
- *code++ = PT_CLIST;
- *code++ = d;
- }
- else
-#endif
- /* Char has only one other case, or UCP not available */
-
- {
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_NOTI: OP_NOT;
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR)
- code += PRIV(ord2utf)(c, code);
- else
-#endif
- *code++ = c;
- }
-
- /* We are finished with this character class */
-
- goto END_CLASS;
- }
-
- /* For a single, positive character, get the value into mcbuffer, and
- then we can handle this with the normal one-character code. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR)
- mclength = PRIV(ord2utf)(c, mcbuffer);
- else
-#endif
- {
- mcbuffer[0] = c;
- mclength = 1;
- }
- goto ONE_CHAR;
- } /* End of 1-char optimization */
-
- /* There is more than one character in the class, or an XCLASS item
- has been generated. Add this character to the class. */
-
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cd, c, c);
- }
-
- /* Loop until ']' reached. This "while" is the end of the "do" far above.
- If we are at the end of an internal nested string, revert to the outer
- string. */
-
- while (((c = *(++ptr)) != CHAR_NULL ||
- (nestptr != NULL &&
- (ptr = nestptr, nestptr = NULL, c = *(++ptr)) != CHAR_NULL)) &&
- (c != CHAR_RIGHT_SQUARE_BRACKET || inescq));
-
- /* Check for missing terminating ']' */
-
- if (c == CHAR_NULL)
- {
- *errorcodeptr = ERR6;
- goto FAILED;
- }
-
- /* We will need an XCLASS if data has been placed in class_uchardata. In
- the second phase this is a sufficient test. However, in the pre-compile
- phase, class_uchardata gets emptied to prevent workspace overflow, so it
- only if the very last character in the class needs XCLASS will it contain
- anything at this point. For this reason, xclass gets set TRUE above when
- uchar_classdata is emptied, and that's why this code is the way it is here
- instead of just doing a test on class_uchardata below. */
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- if (class_uchardata > class_uchardata_base) xclass = TRUE;
-#endif
-
- /* If this is the first thing in the branch, there can be no first char
- setting, whatever the repeat count. Any reqchar setting must remain
- unchanged after any kind of repeat. */
-
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
-
- /* If there are characters with values > 255, we have to compile an
- extended class, with its own opcode, unless there was a negated special
- such as \S in the class, and PCRE_UCP is not set, because in that case all
- characters > 255 are in the class, so any that were explicitly given as
- well can be ignored. If (when there are explicit characters > 255 that must
- be listed) there are no characters < 256, we can omit the bitmap in the
- actual compiled code. */
-
-#ifdef SUPPORT_UTF
- if (xclass && (!should_flip_negation || (options & PCRE_UCP) != 0))
-#elif !defined COMPILE_PCRE8
- if (xclass && !should_flip_negation)
-#endif
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- {
- *class_uchardata++ = XCL_END; /* Marks the end of extra data */
- *code++ = OP_XCLASS;
- code += LINK_SIZE;
- *code = negate_class? XCL_NOT:0;
- if (xclass_has_prop) *code |= XCL_HASPROP;
-
- /* If the map is required, move up the extra data to make room for it;
- otherwise just move the code pointer to the end of the extra data. */
-
- if (class_has_8bitchar > 0)
- {
- *code++ |= XCL_MAP;
- memmove(code + (32 / sizeof(pcre_uchar)), code,
- IN_UCHARS(class_uchardata - code));
- if (negate_class && !xclass_has_prop)
- for (c = 0; c < 32; c++) classbits[c] = ~classbits[c];
- memcpy(code, classbits, 32);
- code = class_uchardata + (32 / sizeof(pcre_uchar));
- }
- else code = class_uchardata;
-
- /* Now fill in the complete length of the item */
-
- PUT(previous, 1, (int)(code - previous));
- break; /* End of class handling */
- }
-#endif
-
- /* If there are no characters > 255, or they are all to be included or
- excluded, set the opcode to OP_CLASS or OP_NCLASS, depending on whether the
- whole class was negated and whether there were negative specials such as \S
- (non-UCP) in the class. Then copy the 32-byte map into the code vector,
- negating it if necessary. */
-
- *code++ = (negate_class == should_flip_negation) ? OP_CLASS : OP_NCLASS;
- if (lengthptr == NULL) /* Save time in the pre-compile phase */
- {
- if (negate_class)
- for (c = 0; c < 32; c++) classbits[c] = ~classbits[c];
- memcpy(code, classbits, 32);
- }
- code += 32 / sizeof(pcre_uchar);
-
- END_CLASS:
- break;
-
-
- /* ===================================================================*/
- /* Various kinds of repeat; '{' is not necessarily a quantifier, but this
- has been tested above. */
-
- case CHAR_LEFT_CURLY_BRACKET:
- if (!is_quantifier) goto NORMAL_CHAR;
- ptr = read_repeat_counts(ptr+1, &repeat_min, &repeat_max, errorcodeptr);
- if (*errorcodeptr != 0) goto FAILED;
- goto REPEAT;
-
- case CHAR_ASTERISK:
- repeat_min = 0;
- repeat_max = -1;
- goto REPEAT;
-
- case CHAR_PLUS:
- repeat_min = 1;
- repeat_max = -1;
- goto REPEAT;
-
- case CHAR_QUESTION_MARK:
- repeat_min = 0;
- repeat_max = 1;
-
- REPEAT:
- if (previous == NULL)
- {
- *errorcodeptr = ERR9;
- goto FAILED;
- }
-
- if (repeat_min == 0)
- {
- firstchar = zerofirstchar; /* Adjust for zero repeat */
- firstcharflags = zerofirstcharflags;
- reqchar = zeroreqchar; /* Ditto */
- reqcharflags = zeroreqcharflags;
- }
-
- /* Remember whether this is a variable length repeat */
-
- reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY;
-
- op_type = 0; /* Default single-char op codes */
- possessive_quantifier = FALSE; /* Default not possessive quantifier */
-
- /* Save start of previous item, in case we have to move it up in order to
- insert something before it. */
-
- tempcode = previous;
-
- /* Before checking for a possessive quantifier, we must skip over
- whitespace and comments in extended mode because Perl allows white space at
- this point. */
-
- if ((options & PCRE_EXTENDED) != 0)
- {
- const pcre_uchar *p = ptr + 1;
- for (;;)
- {
- while (MAX_255(*p) && (cd->ctypes[*p] & ctype_space) != 0) p++;
- if (*p != CHAR_NUMBER_SIGN) break;
- p++;
- while (*p != CHAR_NULL)
- {
- if (IS_NEWLINE(p)) /* For non-fixed-length newline cases, */
- { /* IS_NEWLINE sets cd->nllen. */
- p += cd->nllen;
- break;
- }
- p++;
-#ifdef SUPPORT_UTF
- if (utf) FORWARDCHAR(p);
-#endif
- } /* Loop for comment characters */
- } /* Loop for multiple comments */
- ptr = p - 1; /* Character before the next significant one. */
- }
-
- /* If the next character is '+', we have a possessive quantifier. This
- implies greediness, whatever the setting of the PCRE_UNGREEDY option.
- If the next character is '?' this is a minimizing repeat, by default,
- but if PCRE_UNGREEDY is set, it works the other way round. We change the
- repeat type to the non-default. */
-
- if (ptr[1] == CHAR_PLUS)
- {
- repeat_type = 0; /* Force greedy */
- possessive_quantifier = TRUE;
- ptr++;
- }
- else if (ptr[1] == CHAR_QUESTION_MARK)
- {
- repeat_type = greedy_non_default;
- ptr++;
- }
- else repeat_type = greedy_default;
-
- /* If previous was a recursion call, wrap it in atomic brackets so that
- previous becomes the atomic group. All recursions were so wrapped in the
- past, but it no longer happens for non-repeated recursions. In fact, the
- repeated ones could be re-implemented independently so as not to need this,
- but for the moment we rely on the code for repeating groups. */
-
- if (*previous == OP_RECURSE)
- {
- memmove(previous + 1 + LINK_SIZE, previous, IN_UCHARS(1 + LINK_SIZE));
- *previous = OP_ONCE;
- PUT(previous, 1, 2 + 2*LINK_SIZE);
- previous[2 + 2*LINK_SIZE] = OP_KET;
- PUT(previous, 3 + 2*LINK_SIZE, 2 + 2*LINK_SIZE);
- code += 2 + 2 * LINK_SIZE;
- length_prevgroup = 3 + 3*LINK_SIZE;
-
- /* When actually compiling, we need to check whether this was a forward
- reference, and if so, adjust the offset. */
-
- if (lengthptr == NULL && cd->hwm >= cd->start_workspace + LINK_SIZE)
- {
- int offset = GET(cd->hwm, -LINK_SIZE);
- if (offset == previous + 1 - cd->start_code)
- PUT(cd->hwm, -LINK_SIZE, offset + 1 + LINK_SIZE);
- }
- }
-
- /* Now handle repetition for the different types of item. */
-
- /* If previous was a character or negated character match, abolish the item
- and generate a repeat item instead. If a char item has a minimum of more
- than one, ensure that it is set in reqchar - it might not be if a sequence
- such as x{3} is the first thing in a branch because the x will have gone
- into firstchar instead. */
-
- if (*previous == OP_CHAR || *previous == OP_CHARI
- || *previous == OP_NOT || *previous == OP_NOTI)
- {
- switch (*previous)
- {
- default: /* Make compiler happy. */
- case OP_CHAR: op_type = OP_STAR - OP_STAR; break;
- case OP_CHARI: op_type = OP_STARI - OP_STAR; break;
- case OP_NOT: op_type = OP_NOTSTAR - OP_STAR; break;
- case OP_NOTI: op_type = OP_NOTSTARI - OP_STAR; break;
- }
-
- /* Deal with UTF characters that take up more than one character. It's
- easier to write this out separately than try to macrify it. Use c to
- hold the length of the character in bytes, plus UTF_LENGTH to flag that
- it's a length rather than a small character. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && NOT_FIRSTCHAR(code[-1]))
- {
- pcre_uchar *lastchar = code - 1;
- BACKCHAR(lastchar);
- c = (int)(code - lastchar); /* Length of UTF-8 character */
- memcpy(utf_chars, lastchar, IN_UCHARS(c)); /* Save the char */
- c |= UTF_LENGTH; /* Flag c as a length */
- }
- else
-#endif /* SUPPORT_UTF */
-
- /* Handle the case of a single charater - either with no UTF support, or
- with UTF disabled, or for a single character UTF character. */
- {
- c = code[-1];
- if (*previous <= OP_CHARI && repeat_min > 1)
- {
- reqchar = c;
- reqcharflags = req_caseopt | cd->req_varyopt;
- }
- }
-
- goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */
- }
-
- /* If previous was a character type match (\d or similar), abolish it and
- create a suitable repeat item. The code is shared with single-character
- repeats by setting op_type to add a suitable offset into repeat_type. Note
- the the Unicode property types will be present only when SUPPORT_UCP is
- defined, but we don't wrap the little bits of code here because it just
- makes it horribly messy. */
-
- else if (*previous < OP_EODN)
- {
- pcre_uchar *oldcode;
- int prop_type, prop_value;
- op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */
- c = *previous;
-
- OUTPUT_SINGLE_REPEAT:
- if (*previous == OP_PROP || *previous == OP_NOTPROP)
- {
- prop_type = previous[1];
- prop_value = previous[2];
- }
- else prop_type = prop_value = -1;
-
- oldcode = code;
- code = previous; /* Usually overwrite previous item */
-
- /* If the maximum is zero then the minimum must also be zero; Perl allows
- this case, so we do too - by simply omitting the item altogether. */
-
- if (repeat_max == 0) goto END_REPEAT;
-
- /* Combine the op_type with the repeat_type */
-
- repeat_type += op_type;
-
- /* A minimum of zero is handled either as the special case * or ?, or as
- an UPTO, with the maximum given. */
-
- if (repeat_min == 0)
- {
- if (repeat_max == -1) *code++ = OP_STAR + repeat_type;
- else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type;
- else
- {
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max);
- }
- }
-
- /* A repeat minimum of 1 is optimized into some special cases. If the
- maximum is unlimited, we use OP_PLUS. Otherwise, the original item is
- left in place and, if the maximum is greater than 1, we use OP_UPTO with
- one less than the maximum. */
-
- else if (repeat_min == 1)
- {
- if (repeat_max == -1)
- *code++ = OP_PLUS + repeat_type;
- else
- {
- code = oldcode; /* leave previous item in place */
- if (repeat_max == 1) goto END_REPEAT;
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max - 1);
- }
- }
-
- /* The case {n,n} is just an EXACT, while the general case {n,m} is
- handled as an EXACT followed by an UPTO. */
-
- else
- {
- *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */
- PUT2INC(code, 0, repeat_min);
-
- /* If the maximum is unlimited, insert an OP_STAR. Before doing so,
- we have to insert the character for the previous code. For a repeated
- Unicode property match, there are two extra bytes that define the
- required property. In UTF-8 mode, long characters have their length in
- c, with the UTF_LENGTH bit as a flag. */
-
- if (repeat_max < 0)
- {
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && (c & UTF_LENGTH) != 0)
- {
- memcpy(code, utf_chars, IN_UCHARS(c & 7));
- code += c & 7;
- }
- else
-#endif
- {
- *code++ = c;
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
- }
- *code++ = OP_STAR + repeat_type;
- }
-
- /* Else insert an UPTO if the max is greater than the min, again
- preceded by the character, for the previously inserted code. If the
- UPTO is just for 1 instance, we can use QUERY instead. */
-
- else if (repeat_max != repeat_min)
- {
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && (c & UTF_LENGTH) != 0)
- {
- memcpy(code, utf_chars, IN_UCHARS(c & 7));
- code += c & 7;
- }
- else
-#endif
- *code++ = c;
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
- repeat_max -= repeat_min;
-
- if (repeat_max == 1)
- {
- *code++ = OP_QUERY + repeat_type;
- }
- else
- {
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max);
- }
- }
- }
-
- /* The character or character type itself comes last in all cases. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && (c & UTF_LENGTH) != 0)
- {
- memcpy(code, utf_chars, IN_UCHARS(c & 7));
- code += c & 7;
- }
- else
-#endif
- *code++ = c;
-
- /* For a repeated Unicode property match, there are two extra bytes that
- define the required property. */
-
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
-#endif
- }
-
- /* If previous was a character class or a back reference, we put the repeat
- stuff after it, but just skip the item if the repeat was {0,0}. */
-
- else if (*previous == OP_CLASS || *previous == OP_NCLASS ||
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- *previous == OP_XCLASS ||
-#endif
- *previous == OP_REF || *previous == OP_REFI ||
- *previous == OP_DNREF || *previous == OP_DNREFI)
- {
- if (repeat_max == 0)
- {
- code = previous;
- goto END_REPEAT;
- }
-
- if (repeat_min == 0 && repeat_max == -1)
- *code++ = OP_CRSTAR + repeat_type;
- else if (repeat_min == 1 && repeat_max == -1)
- *code++ = OP_CRPLUS + repeat_type;
- else if (repeat_min == 0 && repeat_max == 1)
- *code++ = OP_CRQUERY + repeat_type;
- else
- {
- *code++ = OP_CRRANGE + repeat_type;
- PUT2INC(code, 0, repeat_min);
- if (repeat_max == -1) repeat_max = 0; /* 2-byte encoding for max */
- PUT2INC(code, 0, repeat_max);
- }
- }
-
- /* If previous was a bracket group, we may have to replicate it in certain
- cases. Note that at this point we can encounter only the "basic" bracket
- opcodes such as BRA and CBRA, as this is the place where they get converted
- into the more special varieties such as BRAPOS and SBRA. A test for >=
- OP_ASSERT and <= OP_COND includes ASSERT, ASSERT_NOT, ASSERTBACK,
- ASSERTBACK_NOT, ONCE, ONCE_NC, BRA, BRAPOS, CBRA, CBRAPOS, and COND.
- Originally, PCRE did not allow repetition of assertions, but now it does,
- for Perl compatibility. */
-
- else if (*previous >= OP_ASSERT && *previous <= OP_COND)
- {
- register int i;
- int len = (int)(code - previous);
- pcre_uchar *bralink = NULL;
- pcre_uchar *brazeroptr = NULL;
-
- /* Repeating a DEFINE group is pointless, but Perl allows the syntax, so
- we just ignore the repeat. */
-
- if (*previous == OP_COND && previous[LINK_SIZE+1] == OP_DEF)
- goto END_REPEAT;
-
- /* There is no sense in actually repeating assertions. The only potential
- use of repetition is in cases when the assertion is optional. Therefore,
- if the minimum is greater than zero, just ignore the repeat. If the
- maximum is not zero or one, set it to 1. */
-
- if (*previous < OP_ONCE) /* Assertion */
- {
- if (repeat_min > 0) goto END_REPEAT;
- if (repeat_max < 0 || repeat_max > 1) repeat_max = 1;
- }
-
- /* The case of a zero minimum is special because of the need to stick
- OP_BRAZERO in front of it, and because the group appears once in the
- data, whereas in other cases it appears the minimum number of times. For
- this reason, it is simplest to treat this case separately, as otherwise
- the code gets far too messy. There are several special subcases when the
- minimum is zero. */
-
- if (repeat_min == 0)
- {
- /* If the maximum is also zero, we used to just omit the group from the
- output altogether, like this:
-
- ** if (repeat_max == 0)
- ** {
- ** code = previous;
- ** goto END_REPEAT;
- ** }
-
- However, that fails when a group or a subgroup within it is referenced
- as a subroutine from elsewhere in the pattern, so now we stick in
- OP_SKIPZERO in front of it so that it is skipped on execution. As we
- don't have a list of which groups are referenced, we cannot do this
- selectively.
-
- If the maximum is 1 or unlimited, we just have to stick in the BRAZERO
- and do no more at this point. However, we do need to adjust any
- OP_RECURSE calls inside the group that refer to the group itself or any
- internal or forward referenced group, because the offset is from the
- start of the whole regex. Temporarily terminate the pattern while doing
- this. */
-
- if (repeat_max <= 1) /* Covers 0, 1, and unlimited */
- {
- *code = OP_END;
- adjust_recurse(previous, 1, utf, cd, save_hwm);
- memmove(previous + 1, previous, IN_UCHARS(len));
- code++;
- if (repeat_max == 0)
- {
- *previous++ = OP_SKIPZERO;
- goto END_REPEAT;
- }
- brazeroptr = previous; /* Save for possessive optimizing */
- *previous++ = OP_BRAZERO + repeat_type;
- }
-
- /* If the maximum is greater than 1 and limited, we have to replicate
- in a nested fashion, sticking OP_BRAZERO before each set of brackets.
- The first one has to be handled carefully because it's the original
- copy, which has to be moved up. The remainder can be handled by code
- that is common with the non-zero minimum case below. We have to
- adjust the value or repeat_max, since one less copy is required. Once
- again, we may have to adjust any OP_RECURSE calls inside the group. */
-
- else
- {
- int offset;
- *code = OP_END;
- adjust_recurse(previous, 2 + LINK_SIZE, utf, cd, save_hwm);
- memmove(previous + 2 + LINK_SIZE, previous, IN_UCHARS(len));
- code += 2 + LINK_SIZE;
- *previous++ = OP_BRAZERO + repeat_type;
- *previous++ = OP_BRA;
-
- /* We chain together the bracket offset fields that have to be
- filled in later when the ends of the brackets are reached. */
-
- offset = (bralink == NULL)? 0 : (int)(previous - bralink);
- bralink = previous;
- PUTINC(previous, 0, offset);
- }
-
- repeat_max--;
- }
-
- /* If the minimum is greater than zero, replicate the group as many
- times as necessary, and adjust the maximum to the number of subsequent
- copies that we need. If we set a first char from the group, and didn't
- set a required char, copy the latter from the former. If there are any
- forward reference subroutine calls in the group, there will be entries on
- the workspace list; replicate these with an appropriate increment. */
-
- else
- {
- if (repeat_min > 1)
- {
- /* In the pre-compile phase, we don't actually do the replication. We
- just adjust the length as if we had. Do some paranoid checks for
- potential integer overflow. The INT64_OR_DOUBLE type is a 64-bit
- integer type when available, otherwise double. */
-
- if (lengthptr != NULL)
- {
- int delta = (repeat_min - 1)*length_prevgroup;
- if ((INT64_OR_DOUBLE)(repeat_min - 1)*
- (INT64_OR_DOUBLE)length_prevgroup >
- (INT64_OR_DOUBLE)INT_MAX ||
- OFLOW_MAX - *lengthptr < delta)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += delta;
- }
-
- /* This is compiling for real. If there is a set first byte for
- the group, and we have not yet set a "required byte", set it. Make
- sure there is enough workspace for copying forward references before
- doing the copy. */
-
- else
- {
- if (groupsetfirstchar && reqcharflags < 0)
- {
- reqchar = firstchar;
- reqcharflags = firstcharflags;
- }
-
- for (i = 1; i < repeat_min; i++)
- {
- pcre_uchar *hc;
- pcre_uchar *this_hwm = cd->hwm;
- memcpy(code, previous, IN_UCHARS(len));
-
- while (cd->hwm > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN - (this_hwm - save_hwm))
- {
- int save_offset = save_hwm - cd->start_workspace;
- int this_offset = this_hwm - cd->start_workspace;
- *errorcodeptr = expand_workspace(cd);
- if (*errorcodeptr != 0) goto FAILED;
- save_hwm = (pcre_uchar *)cd->start_workspace + save_offset;
- this_hwm = (pcre_uchar *)cd->start_workspace + this_offset;
- }
-
- for (hc = save_hwm; hc < this_hwm; hc += LINK_SIZE)
- {
- PUT(cd->hwm, 0, GET(hc, 0) + len);
- cd->hwm += LINK_SIZE;
- }
- save_hwm = this_hwm;
- code += len;
- }
- }
- }
-
- if (repeat_max > 0) repeat_max -= repeat_min;
- }
-
- /* This code is common to both the zero and non-zero minimum cases. If
- the maximum is limited, it replicates the group in a nested fashion,
- remembering the bracket starts on a stack. In the case of a zero minimum,
- the first one was set up above. In all cases the repeat_max now specifies
- the number of additional copies needed. Again, we must remember to
- replicate entries on the forward reference list. */
-
- if (repeat_max >= 0)
- {
- /* In the pre-compile phase, we don't actually do the replication. We
- just adjust the length as if we had. For each repetition we must add 1
- to the length for BRAZERO and for all but the last repetition we must
- add 2 + 2*LINKSIZE to allow for the nesting that occurs. Do some
- paranoid checks to avoid integer overflow. The INT64_OR_DOUBLE type is
- a 64-bit integer type when available, otherwise double. */
-
- if (lengthptr != NULL && repeat_max > 0)
- {
- int delta = repeat_max * (length_prevgroup + 1 + 2 + 2*LINK_SIZE) -
- 2 - 2*LINK_SIZE; /* Last one doesn't nest */
- if ((INT64_OR_DOUBLE)repeat_max *
- (INT64_OR_DOUBLE)(length_prevgroup + 1 + 2 + 2*LINK_SIZE)
- > (INT64_OR_DOUBLE)INT_MAX ||
- OFLOW_MAX - *lengthptr < delta)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += delta;
- }
-
- /* This is compiling for real */
-
- else for (i = repeat_max - 1; i >= 0; i--)
- {
- pcre_uchar *hc;
- pcre_uchar *this_hwm = cd->hwm;
-
- *code++ = OP_BRAZERO + repeat_type;
-
- /* All but the final copy start a new nesting, maintaining the
- chain of brackets outstanding. */
-
- if (i != 0)
- {
- int offset;
- *code++ = OP_BRA;
- offset = (bralink == NULL)? 0 : (int)(code - bralink);
- bralink = code;
- PUTINC(code, 0, offset);
- }
-
- memcpy(code, previous, IN_UCHARS(len));
-
- /* Ensure there is enough workspace for forward references before
- copying them. */
-
- while (cd->hwm > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN - (this_hwm - save_hwm))
- {
- int save_offset = save_hwm - cd->start_workspace;
- int this_offset = this_hwm - cd->start_workspace;
- *errorcodeptr = expand_workspace(cd);
- if (*errorcodeptr != 0) goto FAILED;
- save_hwm = (pcre_uchar *)cd->start_workspace + save_offset;
- this_hwm = (pcre_uchar *)cd->start_workspace + this_offset;
- }
-
- for (hc = save_hwm; hc < this_hwm; hc += LINK_SIZE)
- {
- PUT(cd->hwm, 0, GET(hc, 0) + len + ((i != 0)? 2+LINK_SIZE : 1));
- cd->hwm += LINK_SIZE;
- }
- save_hwm = this_hwm;
- code += len;
- }
-
- /* Now chain through the pending brackets, and fill in their length
- fields (which are holding the chain links pro tem). */
-
- while (bralink != NULL)
- {
- int oldlinkoffset;
- int offset = (int)(code - bralink + 1);
- pcre_uchar *bra = code - offset;
- oldlinkoffset = GET(bra, 1);
- bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset;
- *code++ = OP_KET;
- PUTINC(code, 0, offset);
- PUT(bra, 1, offset);
- }
- }
-
- /* 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.
-
- 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.]
-
- 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 pcre_exec(). 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
- atomic brackets, does not happen. When the minimum is greater than 1,
- there will be earlier copies of the group, and so we still have to wrap
- the whole thing. */
-
- else
- {
- pcre_uchar *ketcode = code - 1 - LINK_SIZE;
- pcre_uchar *bracode = ketcode - GET(ketcode, 1);
-
- /* Convert possessive ONCE brackets to non-capturing */
-
- if ((*bracode == OP_ONCE || *bracode == OP_ONCE_NC) &&
- possessive_quantifier) *bracode = OP_BRA;
-
- /* For non-possessive ONCE brackets, all we need to do is to
- set the KET. */
-
- if (*bracode == OP_ONCE || *bracode == OP_ONCE_NC)
- *ketcode = OP_KETRMAX + repeat_type;
-
- /* Handle non-ONCE brackets and possessive ONCEs (which have been
- converted to non-capturing above). */
-
- else
- {
- /* In the compile phase, check for empty string matching. */
-
- if (lengthptr == NULL)
- {
- pcre_uchar *scode = bracode;
- do
- {
- if (could_be_empty_branch(scode, ketcode, utf, cd, NULL))
- {
- *bracode += OP_SBRA - OP_BRA;
- break;
- }
- scode += GET(scode, 1);
- }
- while (*scode == OP_ALT);
- }
-
- /* Handle possessive quantifiers. */
-
- if (possessive_quantifier)
- {
- /* For COND brackets, we wrap the whole thing in a possessively
- repeated non-capturing bracket, because we have not invented POS
- versions of the COND opcodes. Because we are moving code along, we
- must ensure that any pending recursive references are updated. */
-
- if (*bracode == OP_COND || *bracode == OP_SCOND)
- {
- int nlen = (int)(code - bracode);
- *code = OP_END;
- adjust_recurse(bracode, 1 + LINK_SIZE, utf, cd, save_hwm);
- memmove(bracode + 1 + LINK_SIZE, bracode, IN_UCHARS(nlen));
- code += 1 + LINK_SIZE;
- nlen += 1 + LINK_SIZE;
- *bracode = OP_BRAPOS;
- *code++ = OP_KETRPOS;
- PUTINC(code, 0, nlen);
- PUT(bracode, 1, nlen);
- }
-
- /* For non-COND brackets, we modify the BRA code and use KETRPOS. */
-
- else
- {
- *bracode += 1; /* Switch to xxxPOS opcodes */
- *ketcode = OP_KETRPOS;
- }
-
- /* If the minimum is zero, mark it as possessive, then unset the
- possessive flag when the minimum is 0 or 1. */
-
- if (brazeroptr != NULL) *brazeroptr = OP_BRAPOSZERO;
- if (repeat_min < 2) possessive_quantifier = FALSE;
- }
-
- /* Non-possessive quantifier */
-
- else *ketcode = OP_KETRMAX + repeat_type;
- }
- }
- }
-
- /* If previous is OP_FAIL, it was generated by an empty class [] in
- JavaScript mode. The other ways in which OP_FAIL can be generated, that is
- by (*FAIL) or (?!) set previous to NULL, which gives a "nothing to repeat"
- error above. We can just ignore the repeat in JS case. */
-
- else if (*previous == OP_FAIL) goto END_REPEAT;
-
- /* Else there's some kind of shambles */
-
- else
- {
- *errorcodeptr = ERR11;
- goto FAILED;
- }
-
- /* If the character following a repeat is '+', possessive_quantifier is
- TRUE. For some opcodes, there are special alternative opcodes for this
- case. For anything else, we wrap the entire repeated item inside OP_ONCE
- brackets. Logically, the '+' notation is just syntactic sugar, taken from
- Sun's Java package, but the special opcodes can optimize it.
-
- Some (but not all) possessively repeated subpatterns have already been
- completely handled in the code just above. For them, possessive_quantifier
- is always FALSE at this stage. Note that the repeated item starts at
- tempcode, not at previous, which might be the first part of a string whose
- (former) last char we repeated. */
-
- if (possessive_quantifier)
- {
- int len;
-
- /* Possessifying an EXACT quantifier has no effect, so we can ignore it.
- However, QUERY, STAR, or UPTO may follow (for quantifiers such as {5,6},
- {5,}, or {5,10}). We skip over an EXACT item; if the length of what
- remains is greater than zero, there's a further opcode that can be
- handled. If not, do nothing, leaving the EXACT alone. */
-
- switch(*tempcode)
- {
- case OP_TYPEEXACT:
- tempcode += PRIV(OP_lengths)[*tempcode] +
- ((tempcode[1 + IMM2_SIZE] == OP_PROP
- || tempcode[1 + IMM2_SIZE] == OP_NOTPROP)? 2 : 0);
- break;
-
- /* CHAR opcodes are used for exacts whose count is 1. */
-
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- tempcode += PRIV(OP_lengths)[*tempcode];
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(tempcode[-1]))
- tempcode += GET_EXTRALEN(tempcode[-1]);
-#endif
- break;
-
- /* For the class opcodes, the repeat operator appears at the end;
- adjust tempcode to point to it. */
-
- case OP_CLASS:
- case OP_NCLASS:
- tempcode += 1 + 32/sizeof(pcre_uchar);
- break;
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- tempcode += GET(tempcode, 1);
- break;
-#endif
- }
-
- /* If tempcode is equal to code (which points to the end of the repeated
- item), it means we have skipped an EXACT item but there is no following
- QUERY, STAR, or UPTO; the value of len will be 0, and we do nothing. In
- all other cases, tempcode will be pointing to the repeat opcode, and will
- be less than code, so the value of len will be greater than 0. */
-
- len = (int)(code - tempcode);
- if (len > 0)
- {
- unsigned int repcode = *tempcode;
-
- /* There is a table for possessifying opcodes, all of which are less
- than OP_CALLOUT. A zero entry means there is no possessified version.
- */
-
- if (repcode < OP_CALLOUT && opcode_possessify[repcode] > 0)
- *tempcode = opcode_possessify[repcode];
-
- /* For opcode without a special possessified version, wrap the item in
- ONCE brackets. Because we are moving code along, we must ensure that any
- pending recursive references are updated. */
-
- else
- {
- *code = OP_END;
- adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, save_hwm);
- memmove(tempcode + 1 + LINK_SIZE, tempcode, IN_UCHARS(len));
- code += 1 + LINK_SIZE;
- len += 1 + LINK_SIZE;
- tempcode[0] = OP_ONCE;
- *code++ = OP_KET;
- PUTINC(code, 0, len);
- PUT(tempcode, 1, len);
- }
- }
-
-#ifdef NEVER
- if (len > 0) switch (*tempcode)
- {
- case OP_STAR: *tempcode = OP_POSSTAR; break;
- case OP_PLUS: *tempcode = OP_POSPLUS; break;
- case OP_QUERY: *tempcode = OP_POSQUERY; break;
- case OP_UPTO: *tempcode = OP_POSUPTO; break;
-
- case OP_STARI: *tempcode = OP_POSSTARI; break;
- case OP_PLUSI: *tempcode = OP_POSPLUSI; break;
- case OP_QUERYI: *tempcode = OP_POSQUERYI; break;
- case OP_UPTOI: *tempcode = OP_POSUPTOI; break;
-
- case OP_NOTSTAR: *tempcode = OP_NOTPOSSTAR; break;
- case OP_NOTPLUS: *tempcode = OP_NOTPOSPLUS; break;
- case OP_NOTQUERY: *tempcode = OP_NOTPOSQUERY; break;
- case OP_NOTUPTO: *tempcode = OP_NOTPOSUPTO; break;
-
- case OP_NOTSTARI: *tempcode = OP_NOTPOSSTARI; break;
- case OP_NOTPLUSI: *tempcode = OP_NOTPOSPLUSI; break;
- case OP_NOTQUERYI: *tempcode = OP_NOTPOSQUERYI; break;
- case OP_NOTUPTOI: *tempcode = OP_NOTPOSUPTOI; break;
-
- case OP_TYPESTAR: *tempcode = OP_TYPEPOSSTAR; break;
- case OP_TYPEPLUS: *tempcode = OP_TYPEPOSPLUS; break;
- case OP_TYPEQUERY: *tempcode = OP_TYPEPOSQUERY; break;
- case OP_TYPEUPTO: *tempcode = OP_TYPEPOSUPTO; break;
-
- case OP_CRSTAR: *tempcode = OP_CRPOSSTAR; break;
- case OP_CRPLUS: *tempcode = OP_CRPOSPLUS; break;
- case OP_CRQUERY: *tempcode = OP_CRPOSQUERY; break;
- case OP_CRRANGE: *tempcode = OP_CRPOSRANGE; break;
-
- /* Because we are moving code along, we must ensure that any
- pending recursive references are updated. */
-
- default:
- *code = OP_END;
- adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, save_hwm);
- memmove(tempcode + 1 + LINK_SIZE, tempcode, IN_UCHARS(len));
- code += 1 + LINK_SIZE;
- len += 1 + LINK_SIZE;
- tempcode[0] = OP_ONCE;
- *code++ = OP_KET;
- PUTINC(code, 0, len);
- PUT(tempcode, 1, len);
- break;
- }
-#endif
- }
-
- /* In all case we no longer have a previous item. We also set the
- "follows varying string" flag for subsequently encountered reqchars if
- it isn't already set and we have just passed a varying length item. */
-
- END_REPEAT:
- previous = NULL;
- cd->req_varyopt |= reqvary;
- break;
-
-
- /* ===================================================================*/
- /* Start of nested parenthesized sub-expression, or comment or lookahead or
- lookbehind or option setting or condition or all the other extended
- parenthesis forms. */
-
- case CHAR_LEFT_PARENTHESIS:
- newoptions = options;
- skipbytes = 0;
- bravalue = OP_CBRA;
- save_hwm = cd->hwm;
- reset_bracount = FALSE;
-
- /* First deal with various "verbs" that can be introduced by '*'. */
-
- ptr++;
- if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':'
- || (MAX_255(ptr[1]) && ((cd->ctypes[ptr[1]] & ctype_letter) != 0))))
- {
- int i, namelen;
- int arglen = 0;
- const char *vn = verbnames;
- const pcre_uchar *name = ptr + 1;
- const pcre_uchar *arg = NULL;
- previous = NULL;
- ptr++;
- while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_letter) != 0) ptr++;
- namelen = (int)(ptr - name);
-
- /* It appears that Perl allows any characters whatsoever, other than
- a closing parenthesis, to appear in arguments, so we no longer insist on
- letters, digits, and underscores. */
-
- if (*ptr == CHAR_COLON)
- {
- arg = ++ptr;
- while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
- arglen = (int)(ptr - arg);
- if ((unsigned int)arglen > MAX_MARK)
- {
- *errorcodeptr = ERR75;
- goto FAILED;
- }
- }
-
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR60;
- goto FAILED;
- }
-
- /* Scan the table of verb names */
-
- for (i = 0; i < verbcount; i++)
- {
- if (namelen == verbs[i].len &&
- STRNCMP_UC_C8(name, vn, namelen) == 0)
- {
- int setverb;
-
- /* Check for open captures before ACCEPT and convert it to
- ASSERT_ACCEPT if in an assertion. */
-
- if (verbs[i].op == OP_ACCEPT)
- {
- open_capitem *oc;
- if (arglen != 0)
- {
- *errorcodeptr = ERR59;
- goto FAILED;
- }
- cd->had_accept = TRUE;
- for (oc = cd->open_caps; oc != NULL; oc = oc->next)
- {
- *code++ = OP_CLOSE;
- PUT2INC(code, 0, oc->number);
- }
- setverb = *code++ =
- (cd->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT;
-
- /* Do not set firstchar after *ACCEPT */
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- }
-
- /* Handle other cases with/without an argument */
-
- else if (arglen == 0)
- {
- if (verbs[i].op < 0) /* Argument is mandatory */
- {
- *errorcodeptr = ERR66;
- goto FAILED;
- }
- setverb = *code++ = verbs[i].op;
- }
-
- else
- {
- if (verbs[i].op_arg < 0) /* Argument is forbidden */
- {
- *errorcodeptr = ERR59;
- goto FAILED;
- }
- setverb = *code++ = verbs[i].op_arg;
- *code++ = arglen;
- memcpy(code, arg, IN_UCHARS(arglen));
- code += arglen;
- *code++ = 0;
- }
-
- switch (setverb)
- {
- case OP_THEN:
- case OP_THEN_ARG:
- cd->external_flags |= PCRE_HASTHEN;
- break;
-
- case OP_PRUNE:
- case OP_PRUNE_ARG:
- case OP_SKIP:
- case OP_SKIP_ARG:
- cd->had_pruneorskip = TRUE;
- break;
- }
-
- break; /* Found verb, exit loop */
- }
-
- vn += verbs[i].len + 1;
- }
-
- if (i < verbcount) continue; /* Successfully handled a verb */
- *errorcodeptr = ERR60; /* Verb not recognized */
- goto FAILED;
- }
-
- /* Deal with the extended parentheses; all are introduced by '?', and the
- appearance of any of them means that this is not a capturing group. */
-
- else if (*ptr == CHAR_QUESTION_MARK)
- {
- int i, set, unset, namelen;
- int *optset;
- const pcre_uchar *name;
- pcre_uchar *slot;
-
- switch (*(++ptr))
- {
- case CHAR_NUMBER_SIGN: /* Comment; skip to ket */
- ptr++;
- while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
- if (*ptr == CHAR_NULL)
- {
- *errorcodeptr = ERR18;
- goto FAILED;
- }
- continue;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_VERTICAL_LINE: /* Reset capture count for each branch */
- reset_bracount = TRUE;
- /* Fall through */
-
- /* ------------------------------------------------------------ */
- case CHAR_COLON: /* Non-capturing bracket */
- bravalue = OP_BRA;
- ptr++;
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_LEFT_PARENTHESIS:
- bravalue = OP_COND; /* Conditional group */
- tempptr = ptr;
-
- /* A condition can be an assertion, a number (referring to a numbered
- group's having been set), a name (referring to a named group), or 'R',
- referring to recursion. R<digits> and R&name are also permitted for
- recursion tests.
-
- There are ways of testing a named group: (?(name)) is used by Python;
- Perl 5.10 onwards uses (?(<name>) or (?('name')).
-
- There is one unfortunate ambiguity, caused by history. 'R' can be the
- recursive thing or the name 'R' (and similarly for 'R' followed by
- digits). We look for a name first; if not found, we try the other case.
-
- For compatibility with auto-callouts, we allow a callout to be
- specified before a condition that is an assertion. First, check for the
- syntax of a callout; if found, adjust the temporary pointer that is
- used to check for an assertion condition. That's all that is needed! */
-
- if (ptr[1] == CHAR_QUESTION_MARK && ptr[2] == CHAR_C)
- {
- for (i = 3;; i++) if (!IS_DIGIT(ptr[i])) break;
- if (ptr[i] == CHAR_RIGHT_PARENTHESIS)
- tempptr += i + 1;
- }
-
- /* For conditions that are assertions, check the syntax, and then exit
- the switch. This will take control down to where bracketed groups,
- including assertions, are processed. */
-
- if (tempptr[1] == CHAR_QUESTION_MARK &&
- (tempptr[2] == CHAR_EQUALS_SIGN ||
- tempptr[2] == CHAR_EXCLAMATION_MARK ||
- tempptr[2] == CHAR_LESS_THAN_SIGN))
- break;
-
- /* Other conditions use OP_CREF/OP_DNCREF/OP_RREF/OP_DNRREF, and all
- need to skip at least 1+IMM2_SIZE bytes at the start of the group. */
-
- code[1+LINK_SIZE] = OP_CREF;
- skipbytes = 1+IMM2_SIZE;
- refsign = -1; /* => not a number */
- namelen = -1; /* => not a name; must set to avoid warning */
- name = NULL; /* Always set to avoid warning */
- recno = 0; /* Always set to avoid warning */
-
- /* Check for a test for recursion in a named group. */
-
- ptr++;
- if (*ptr == CHAR_R && ptr[1] == CHAR_AMPERSAND)
- {
- terminator = -1;
- ptr += 2;
- code[1+LINK_SIZE] = OP_RREF; /* Change the type of test */
- }
-
- /* Check for a test for a named group's having been set, using the Perl
- syntax (?(<name>) or (?('name'), and also allow for the original PCRE
- syntax of (?(name) or for (?(+n), (?(-n), and just (?(n). */
-
- else if (*ptr == CHAR_LESS_THAN_SIGN)
- {
- terminator = CHAR_GREATER_THAN_SIGN;
- ptr++;
- }
- else if (*ptr == CHAR_APOSTROPHE)
- {
- terminator = CHAR_APOSTROPHE;
- ptr++;
- }
- else
- {
- terminator = CHAR_NULL;
- if (*ptr == CHAR_MINUS || *ptr == CHAR_PLUS) refsign = *ptr++;
- else if (IS_DIGIT(*ptr)) refsign = 0;
- }
-
- /* Handle a number */
-
- if (refsign >= 0)
- {
- while (IS_DIGIT(*ptr))
- {
- recno = recno * 10 + (int)(*ptr - CHAR_0);
- ptr++;
- }
- }
-
- /* Otherwise we expect to read a name; anything else is an error. When
- a name is one of a number of duplicates, a different opcode is used and
- it needs more memory. Unfortunately we cannot tell whether a name is a
- duplicate in the first pass, so we have to allow for more memory. */
-
- else
- {
- if (IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR84;
- goto FAILED;
- }
- if (!MAX_255(*ptr) || (cd->ctypes[*ptr] & ctype_word) == 0)
- {
- *errorcodeptr = ERR28; /* Assertion expected */
- goto FAILED;
- }
- name = ptr++;
- while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0)
- {
- ptr++;
- }
- namelen = (int)(ptr - name);
- if (lengthptr != NULL) *lengthptr += IMM2_SIZE;
- }
-
- /* Check the terminator */
-
- if ((terminator > 0 && *ptr++ != (pcre_uchar)terminator) ||
- *ptr++ != CHAR_RIGHT_PARENTHESIS)
- {
- ptr--; /* Error offset */
- *errorcodeptr = ERR26; /* Malformed number or name */
- goto FAILED;
- }
-
- /* Do no further checking in the pre-compile phase. */
-
- if (lengthptr != NULL) break;
-
- /* In the real compile we do the work of looking for the actual
- reference. If refsign is not negative, it means we have a number in
- recno. */
-
- if (refsign >= 0)
- {
- if (recno <= 0)
- {
- *errorcodeptr = ERR35;
- goto FAILED;
- }
- if (refsign != 0) recno = (refsign == CHAR_MINUS)?
- cd->bracount - recno + 1 : recno + cd->bracount;
- if (recno <= 0 || recno > cd->final_bracount)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- PUT2(code, 2+LINK_SIZE, recno);
- break;
- }
-
- /* Otherwise look for the name. */
-
- slot = cd->name_table;
- for (i = 0; i < cd->names_found; i++)
- {
- if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) == 0) break;
- slot += cd->name_entry_size;
- }
-
- /* Found the named subpattern. If the name is duplicated, add one to
- the opcode to change CREF/RREF into DNCREF/DNRREF and insert
- appropriate data values. Otherwise, just insert the unique subpattern
- number. */
-
- if (i < cd->names_found)
- {
- int offset = i++;
- int count = 1;
- recno = GET2(slot, 0); /* Number from first found */
- for (; i < cd->names_found; i++)
- {
- slot += cd->name_entry_size;
- if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) != 0) break;
- count++;
- }
- if (count > 1)
- {
- PUT2(code, 2+LINK_SIZE, offset);
- PUT2(code, 2+LINK_SIZE+IMM2_SIZE, count);
- skipbytes += IMM2_SIZE;
- code[1+LINK_SIZE]++;
- }
- else /* Not a duplicated name */
- {
- PUT2(code, 2+LINK_SIZE, recno);
- }
- }
-
- /* If terminator == CHAR_NULL it means that the name followed directly
- after the opening parenthesis [e.g. (?(abc)...] and in this case there
- are some further alternatives to try. For the cases where terminator !=
- CHAR_NULL [things like (?(<name>... or (?('name')... or (?(R&name)... ]
- we have now checked all the possibilities, so give an error. */
-
- else if (terminator != CHAR_NULL)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
-
- /* Check for (?(R) for recursion. Allow digits after R to specify a
- specific group number. */
-
- else if (*name == CHAR_R)
- {
- recno = 0;
- for (i = 1; i < namelen; i++)
- {
- if (!IS_DIGIT(name[i]))
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- recno = recno * 10 + name[i] - CHAR_0;
- }
- if (recno == 0) recno = RREF_ANY;
- code[1+LINK_SIZE] = OP_RREF; /* Change test type */
- PUT2(code, 2+LINK_SIZE, recno);
- }
-
- /* Similarly, check for the (?(DEFINE) "condition", which is always
- false. */
-
- else if (namelen == 6 && STRNCMP_UC_C8(name, STRING_DEFINE, 6) == 0)
- {
- code[1+LINK_SIZE] = OP_DEF;
- skipbytes = 1;
- }
-
- /* Reference to an unidentified subpattern. */
-
- else
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_EQUALS_SIGN: /* Positive lookahead */
- bravalue = OP_ASSERT;
- cd->assert_depth += 1;
- ptr++;
- break;
-
- /* 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
- this feature. Not that that applies to a quantified (?!) but we allow
- it for uniformity. */
-
- /* ------------------------------------------------------------ */
- case CHAR_EXCLAMATION_MARK: /* Negative lookahead */
- ptr++;
- if (*ptr == CHAR_RIGHT_PARENTHESIS && ptr[1] != CHAR_ASTERISK &&
- ptr[1] != CHAR_PLUS && ptr[1] != CHAR_QUESTION_MARK &&
- (ptr[1] != CHAR_LEFT_CURLY_BRACKET || !is_counted_repeat(ptr+2)))
- {
- *code++ = OP_FAIL;
- previous = NULL;
- continue;
- }
- bravalue = OP_ASSERT_NOT;
- cd->assert_depth += 1;
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_LESS_THAN_SIGN: /* Lookbehind or named define */
- switch (ptr[1])
- {
- case CHAR_EQUALS_SIGN: /* Positive lookbehind */
- bravalue = OP_ASSERTBACK;
- cd->assert_depth += 1;
- ptr += 2;
- break;
-
- case CHAR_EXCLAMATION_MARK: /* Negative lookbehind */
- bravalue = OP_ASSERTBACK_NOT;
- cd->assert_depth += 1;
- ptr += 2;
- break;
-
- default: /* Could be name define, else bad */
- if (MAX_255(ptr[1]) && (cd->ctypes[ptr[1]] & ctype_word) != 0)
- goto DEFINE_NAME;
- ptr++; /* Correct offset for error */
- *errorcodeptr = ERR24;
- goto FAILED;
- }
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_GREATER_THAN_SIGN: /* One-time brackets */
- bravalue = OP_ONCE;
- ptr++;
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_C: /* Callout - may be followed by digits; */
- previous_callout = code; /* Save for later completion */
- after_manual_callout = 1; /* Skip one item before completing */
- *code++ = OP_CALLOUT;
- {
- int n = 0;
- ptr++;
- while(IS_DIGIT(*ptr))
- n = n * 10 + *ptr++ - CHAR_0;
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR39;
- goto FAILED;
- }
- if (n > 255)
- {
- *errorcodeptr = ERR38;
- goto FAILED;
- }
- *code++ = n;
- PUT(code, 0, (int)(ptr - cd->start_pattern + 1)); /* Pattern offset */
- PUT(code, LINK_SIZE, 0); /* Default length */
- code += 2 * LINK_SIZE;
- }
- previous = NULL;
- continue;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_P: /* Python-style named subpattern handling */
- if (*(++ptr) == CHAR_EQUALS_SIGN ||
- *ptr == CHAR_GREATER_THAN_SIGN) /* Reference or recursion */
- {
- is_recurse = *ptr == CHAR_GREATER_THAN_SIGN;
- terminator = CHAR_RIGHT_PARENTHESIS;
- goto NAMED_REF_OR_RECURSE;
- }
- else if (*ptr != CHAR_LESS_THAN_SIGN) /* Test for Python-style defn */
- {
- *errorcodeptr = ERR41;
- goto FAILED;
- }
- /* Fall through to handle (?P< as (?< is handled */
-
-
- /* ------------------------------------------------------------ */
- DEFINE_NAME: /* Come here from (?< handling */
- case CHAR_APOSTROPHE:
- terminator = (*ptr == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE;
- name = ++ptr;
- if (IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR84; /* Group name must start with non-digit */
- goto FAILED;
- }
- while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0) ptr++;
- namelen = (int)(ptr - name);
-
- /* In the pre-compile phase, do a syntax check, remember the longest
- name, and then remember the group in a vector, expanding it if
- necessary. Duplicates for the same number are skipped; other duplicates
- are checked for validity. In the actual compile, there is nothing to
- do. */
-
- if (lengthptr != NULL)
- {
- named_group *ng;
- pcre_uint32 number = cd->bracount + 1;
-
- if (*ptr != (pcre_uchar)terminator)
- {
- *errorcodeptr = ERR42;
- goto FAILED;
- }
-
- if (cd->names_found >= MAX_NAME_COUNT)
- {
- *errorcodeptr = ERR49;
- goto FAILED;
- }
-
- if (namelen + IMM2_SIZE + 1 > cd->name_entry_size)
- {
- cd->name_entry_size = namelen + IMM2_SIZE + 1;
- if (namelen > MAX_NAME_SIZE)
- {
- *errorcodeptr = ERR48;
- goto FAILED;
- }
- }
-
- /* Scan the list to check for duplicates. For duplicate names, if the
- number is the same, break the loop, which causes the name to be
- discarded; otherwise, if DUPNAMES is not set, give an error.
- If it is set, allow the name with a different number, but continue
- scanning in case this is a duplicate with the same number. For
- non-duplicate names, give an error if the number is duplicated. */
-
- ng = cd->named_groups;
- for (i = 0; i < cd->names_found; i++, ng++)
- {
- if (namelen == ng->length &&
- STRNCMP_UC_UC(name, ng->name, namelen) == 0)
- {
- if (ng->number == number) break;
- if ((options & PCRE_DUPNAMES) == 0)
- {
- *errorcodeptr = ERR43;
- goto FAILED;
- }
- cd->dupnames = TRUE; /* Duplicate names exist */
- }
- else if (ng->number == number)
- {
- *errorcodeptr = ERR65;
- goto FAILED;
- }
- }
-
- if (i >= cd->names_found) /* Not a duplicate with same number */
- {
- /* Increase the list size if necessary */
-
- if (cd->names_found >= cd->named_group_list_size)
- {
- int newsize = cd->named_group_list_size * 2;
- named_group *newspace = (PUBL(malloc))
- (newsize * sizeof(named_group));
-
- if (newspace == NULL)
- {
- *errorcodeptr = ERR21;
- goto FAILED;
- }
-
- memcpy(newspace, cd->named_groups,
- cd->named_group_list_size * sizeof(named_group));
- if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
- (PUBL(free))((void *)cd->named_groups);
- cd->named_groups = newspace;
- cd->named_group_list_size = newsize;
- }
-
- cd->named_groups[cd->names_found].name = name;
- cd->named_groups[cd->names_found].length = namelen;
- cd->named_groups[cd->names_found].number = number;
- cd->names_found++;
- }
- }
-
- ptr++; /* Move past > or ' in both passes. */
- goto NUMBERED_GROUP;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_AMPERSAND: /* Perl recursion/subroutine syntax */
- terminator = CHAR_RIGHT_PARENTHESIS;
- is_recurse = TRUE;
- /* Fall through */
-
- /* We come here from the Python syntax above that handles both
- references (?P=name) and recursion (?P>name), as well as falling
- through from the Perl recursion syntax (?&name). We also come here from
- the Perl \k<name> or \k'name' back reference syntax and the \k{name}
- .NET syntax, and the Oniguruma \g<...> and \g'...' subroutine syntax. */
-
- NAMED_REF_OR_RECURSE:
- name = ++ptr;
- if (IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR84; /* Group name must start with non-digit */
- goto FAILED;
- }
- while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0) ptr++;
- namelen = (int)(ptr - name);
-
- /* In the pre-compile phase, do a syntax check. We used to just set
- a dummy reference number, because it was not used in the first pass.
- However, with the change of recursive back references to be atomic,
- we have to look for the number so that this state can be identified, as
- otherwise the incorrect length is computed. If it's not a backwards
- reference, the dummy number will do. */
-
- if (lengthptr != NULL)
- {
- named_group *ng;
-
- if (namelen == 0)
- {
- *errorcodeptr = ERR62;
- goto FAILED;
- }
- if (*ptr != (pcre_uchar)terminator)
- {
- *errorcodeptr = ERR42;
- goto FAILED;
- }
- if (namelen > MAX_NAME_SIZE)
- {
- *errorcodeptr = ERR48;
- goto FAILED;
- }
-
- /* The name table does not exist in the first pass; instead we must
- scan the list of names encountered so far in order to get the
- number. If the name is not found, set the value to 0 for a forward
- reference. */
-
- ng = cd->named_groups;
- for (i = 0; i < cd->names_found; i++, ng++)
- {
- if (namelen == ng->length &&
- STRNCMP_UC_UC(name, ng->name, namelen) == 0)
- break;
- }
- recno = (i < cd->names_found)? ng->number : 0;
-
- /* Count named back references. */
-
- if (!is_recurse) cd->namedrefcount++;
- }
-
- /* In the real compile, search the name table. We check the name
- first, and then check that we have reached the end of the name in the
- table. That way, if the name is longer than any in the table, the
- comparison will fail without reading beyond the table entry. */
-
- else
- {
- slot = cd->name_table;
- for (i = 0; i < cd->names_found; i++)
- {
- if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) == 0 &&
- slot[IMM2_SIZE+namelen] == 0)
- break;
- slot += cd->name_entry_size;
- }
-
- if (i < cd->names_found)
- {
- recno = GET2(slot, 0);
- }
- else
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- }
-
- /* In both phases, for recursions, we can now go to the code than
- handles numerical recursion. */
-
- if (is_recurse) goto HANDLE_RECURSION;
-
- /* In the second pass we must see if the name is duplicated. If so, we
- generate a different opcode. */
-
- if (lengthptr == NULL && cd->dupnames)
- {
- int count = 1;
- unsigned int index = i;
- pcre_uchar *cslot = slot + cd->name_entry_size;
-
- for (i++; i < cd->names_found; i++)
- {
- if (STRCMP_UC_UC(slot + IMM2_SIZE, cslot + IMM2_SIZE) != 0) break;
- count++;
- cslot += cd->name_entry_size;
- }
-
- if (count > 1)
- {
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- previous = code;
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_DNREFI : OP_DNREF;
- PUT2INC(code, 0, index);
- PUT2INC(code, 0, count);
-
- /* Process each potentially referenced group. */
-
- for (; slot < cslot; slot += cd->name_entry_size)
- {
- open_capitem *oc;
- recno = GET2(slot, 0);
- cd->backref_map |= (recno < 32)? (1 << recno) : 1;
- if (recno > cd->top_backref) cd->top_backref = recno;
-
- /* Check to see if this back reference is recursive, that it, it
- is inside the group that it references. A flag is set so that the
- group can be made atomic. */
-
- for (oc = cd->open_caps; oc != NULL; oc = oc->next)
- {
- if (oc->number == recno)
- {
- oc->flag = TRUE;
- break;
- }
- }
- }
-
- continue; /* End of back ref handling */
- }
- }
-
- /* First pass, or a non-duplicated name. */
-
- goto HANDLE_REFERENCE;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_R: /* Recursion */
- ptr++; /* Same as (?0) */
- /* Fall through */
-
-
- /* ------------------------------------------------------------ */
- case CHAR_MINUS: case CHAR_PLUS: /* Recursion or subroutine */
- case CHAR_0: case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4:
- case CHAR_5: case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9:
- {
- const pcre_uchar *called;
- terminator = CHAR_RIGHT_PARENTHESIS;
-
- /* Come here from the \g<...> and \g'...' code (Oniguruma
- compatibility). However, the syntax has been checked to ensure that
- the ... are a (signed) number, so that neither ERR63 nor ERR29 will
- be called on this path, nor with the jump to OTHER_CHAR_AFTER_QUERY
- ever be taken. */
-
- HANDLE_NUMERICAL_RECURSION:
-
- if ((refsign = *ptr) == CHAR_PLUS)
- {
- ptr++;
- if (!IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR63;
- goto FAILED;
- }
- }
- else if (refsign == CHAR_MINUS)
- {
- if (!IS_DIGIT(ptr[1]))
- goto OTHER_CHAR_AFTER_QUERY;
- ptr++;
- }
-
- recno = 0;
- while(IS_DIGIT(*ptr))
- recno = recno * 10 + *ptr++ - CHAR_0;
-
- if (*ptr != (pcre_uchar)terminator)
- {
- *errorcodeptr = ERR29;
- goto FAILED;
- }
-
- if (refsign == CHAR_MINUS)
- {
- if (recno == 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno = cd->bracount - recno + 1;
- if (recno <= 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- }
- else if (refsign == CHAR_PLUS)
- {
- if (recno == 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno += cd->bracount;
- }
-
- /* Come here from code above that handles a named recursion */
-
- HANDLE_RECURSION:
-
- previous = code;
- called = cd->start_code;
-
- /* When we are actually compiling, find the bracket that is being
- referenced. Temporarily end the regex in case it doesn't exist before
- this point. If we end up with a forward reference, first check that
- the bracket does occur later so we can give the error (and position)
- now. Then remember this forward reference in the workspace so it can
- be filled in at the end. */
-
- if (lengthptr == NULL)
- {
- *code = OP_END;
- if (recno != 0)
- called = PRIV(find_bracket)(cd->start_code, utf, recno);
-
- /* Forward reference */
-
- if (called == NULL)
- {
- if (recno > cd->final_bracount)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
-
- /* Fudge the value of "called" so that when it is inserted as an
- offset below, what it actually inserted is the reference number
- of the group. Then remember the forward reference. */
-
- called = cd->start_code + recno;
- if (cd->hwm >= cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN)
- {
- *errorcodeptr = expand_workspace(cd);
- if (*errorcodeptr != 0) goto FAILED;
- }
- PUTINC(cd->hwm, 0, (int)(code + 1 - cd->start_code));
- }
-
- /* If not a forward reference, and the subpattern is still open,
- this is a recursive call. We check to see if this is a left
- recursion that could loop for ever, and diagnose that case. We
- must not, however, do this check if we are in a conditional
- subpattern because the condition might be testing for recursion in
- a pattern such as /(?(R)a+|(?R)b)/, which is perfectly valid.
- Forever loops are also detected at runtime, so those that occur in
- conditional subpatterns will be picked up then. */
-
- else if (GET(called, 1) == 0 && cond_depth <= 0 &&
- could_be_empty(called, code, bcptr, utf, cd))
- {
- *errorcodeptr = ERR40;
- goto FAILED;
- }
- }
-
- /* Insert the recursion/subroutine item. It does not have a set first
- character (relevant if it is repeated, because it will then be
- wrapped with ONCE brackets). */
-
- *code = OP_RECURSE;
- PUT(code, 1, (int)(called - cd->start_code));
- code += 1 + LINK_SIZE;
- groupsetfirstchar = FALSE;
- }
-
- /* Can't determine a first byte now */
-
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- continue;
-
-
- /* ------------------------------------------------------------ */
- default: /* Other characters: check option setting */
- OTHER_CHAR_AFTER_QUERY:
- set = unset = 0;
- optset = &set;
-
- while (*ptr != CHAR_RIGHT_PARENTHESIS && *ptr != CHAR_COLON)
- {
- switch (*ptr++)
- {
- case CHAR_MINUS: optset = &unset; break;
-
- case CHAR_J: /* Record that it changed in the external options */
- *optset |= PCRE_DUPNAMES;
- cd->external_flags |= PCRE_JCHANGED;
- break;
-
- case CHAR_i: *optset |= PCRE_CASELESS; break;
- case CHAR_m: *optset |= PCRE_MULTILINE; break;
- case CHAR_s: *optset |= PCRE_DOTALL; break;
- case CHAR_x: *optset |= PCRE_EXTENDED; break;
- case CHAR_U: *optset |= PCRE_UNGREEDY; break;
- case CHAR_X: *optset |= PCRE_EXTRA; break;
-
- default: *errorcodeptr = ERR12;
- ptr--; /* Correct the offset */
- goto FAILED;
- }
- }
-
- /* Set up the changed option bits, but don't change anything yet. */
-
- newoptions = (options | set) & (~unset);
-
- /* If the options ended with ')' this is not the start of a nested
- group with option changes, so the options change at this level. If this
- item is right at the start of the pattern, the options can be
- abstracted and made external in the pre-compile phase, and ignored in
- the compile phase. This can be helpful when matching -- for instance in
- caseless checking of required bytes.
-
- If the code pointer is not (cd->start_code + 1 + LINK_SIZE), we are
- definitely *not* at the start of the pattern because something has been
- compiled. In the pre-compile phase, however, the code pointer can have
- that value after the start, because it gets reset as code is discarded
- during the pre-compile. However, this can happen only at top level - if
- we are within parentheses, the starting BRA will still be present. At
- any parenthesis level, the length value can be used to test if anything
- has been compiled at that level. Thus, a test for both these conditions
- is necessary to ensure we correctly detect the start of the pattern in
- both phases.
-
- If we are not at the pattern start, reset the greedy defaults and the
- case value for firstchar and reqchar. */
-
- if (*ptr == CHAR_RIGHT_PARENTHESIS)
- {
- if (code == cd->start_code + 1 + LINK_SIZE &&
- (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE))
- {
- cd->external_options = newoptions;
- }
- else
- {
- greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
- greedy_non_default = greedy_default ^ 1;
- req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
- }
-
- /* Change options at this level, and pass them back for use
- in subsequent branches. */
-
- *optionsptr = options = newoptions;
- previous = NULL; /* This item can't be repeated */
- continue; /* It is complete */
- }
-
- /* If the options ended with ':' we are heading into a nested group
- with possible change of options. Such groups are non-capturing and are
- not assertions of any kind. All we need to do is skip over the ':';
- the newoptions value is handled below. */
-
- bravalue = OP_BRA;
- ptr++;
- } /* End of switch for character following (? */
- } /* End of (? handling */
-
- /* Opening parenthesis not followed by '*' or '?'. If PCRE_NO_AUTO_CAPTURE
- is set, all unadorned brackets become non-capturing and behave like (?:...)
- brackets. */
-
- else if ((options & PCRE_NO_AUTO_CAPTURE) != 0)
- {
- bravalue = OP_BRA;
- }
-
- /* Else we have a capturing group. */
-
- else
- {
- NUMBERED_GROUP:
- cd->bracount += 1;
- PUT2(code, 1+LINK_SIZE, cd->bracount);
- skipbytes = IMM2_SIZE;
- }
-
- /* Process nested bracketed regex. First check for parentheses nested too
- deeply. */
-
- if ((cd->parens_depth += 1) > PARENS_NEST_LIMIT)
- {
- *errorcodeptr = ERR82;
- goto FAILED;
- }
-
- /* Assertions used not to be repeatable, but this was changed for Perl
- compatibility, so all kinds can now be repeated. We copy code into a
- non-register variable (tempcode) in order to be able to pass its address
- because some compilers complain otherwise. */
-
- previous = code; /* For handling repetition */
- *code = bravalue;
- tempcode = code;
- tempreqvary = cd->req_varyopt; /* Save value before bracket */
- tempbracount = cd->bracount; /* Save value before bracket */
- length_prevgroup = 0; /* Initialize for pre-compile phase */
-
- if (!compile_regex(
- newoptions, /* The complete new option state */
- &tempcode, /* Where to put code (updated) */
- &ptr, /* Input pointer (updated) */
- errorcodeptr, /* Where to put an error message */
- (bravalue == OP_ASSERTBACK ||
- bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */
- reset_bracount, /* True if (?| group */
- skipbytes, /* Skip over bracket number */
- cond_depth +
- ((bravalue == OP_COND)?1:0), /* Depth of condition subpatterns */
- &subfirstchar, /* For possible first char */
- &subfirstcharflags,
- &subreqchar, /* For possible last char */
- &subreqcharflags,
- bcptr, /* Current branch chain */
- cd, /* Tables block */
- (lengthptr == NULL)? NULL : /* Actual compile phase */
- &length_prevgroup /* Pre-compile phase */
- ))
- goto FAILED;
-
- cd->parens_depth -= 1;
-
- /* If this was an atomic group and there are no capturing groups within it,
- generate OP_ONCE_NC instead of OP_ONCE. */
-
- if (bravalue == OP_ONCE && cd->bracount <= tempbracount)
- *code = OP_ONCE_NC;
-
- if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT)
- cd->assert_depth -= 1;
-
- /* At the end of compiling, code is still pointing to the start of the
- group, while tempcode has been updated to point past the end of the group.
- The pattern pointer (ptr) is on the bracket.
-
- If this is a conditional bracket, check that there are no more than
- two branches in the group, or just one if it's a DEFINE group. We do this
- in the real compile phase, not in the pre-pass, where the whole group may
- not be available. */
-
- if (bravalue == OP_COND && lengthptr == NULL)
- {
- pcre_uchar *tc = code;
- int condcount = 0;
-
- do {
- condcount++;
- tc += GET(tc,1);
- }
- while (*tc != OP_KET);
-
- /* A DEFINE group is never obeyed inline (the "condition" is always
- false). It must have only one branch. */
-
- if (code[LINK_SIZE+1] == OP_DEF)
- {
- if (condcount > 1)
- {
- *errorcodeptr = ERR54;
- goto FAILED;
- }
- bravalue = OP_DEF; /* Just a flag to suppress char handling below */
- }
-
- /* A "normal" conditional group. If there is just one branch, we must not
- make use of its firstchar or reqchar, because this is equivalent to an
- empty second branch. */
-
- else
- {
- if (condcount > 2)
- {
- *errorcodeptr = ERR27;
- goto FAILED;
- }
- if (condcount == 1) subfirstcharflags = subreqcharflags = REQ_NONE;
- }
- }
-
- /* Error if hit end of pattern */
-
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR14;
- goto FAILED;
- }
-
- /* In the pre-compile phase, update the length by the length of the group,
- less the brackets at either end. Then reduce the compiled code to just a
- set of non-capturing brackets so that it doesn't use much memory if it is
- duplicated by a quantifier.*/
-
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < length_prevgroup - 2 - 2*LINK_SIZE)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += length_prevgroup - 2 - 2*LINK_SIZE;
- code++; /* This already contains bravalue */
- PUTINC(code, 0, 1 + LINK_SIZE);
- *code++ = OP_KET;
- PUTINC(code, 0, 1 + LINK_SIZE);
- break; /* No need to waste time with special character handling */
- }
-
- /* Otherwise update the main code pointer to the end of the group. */
-
- code = tempcode;
-
- /* For a DEFINE group, required and first character settings are not
- relevant. */
-
- if (bravalue == OP_DEF) break;
-
- /* Handle updating of the required and first characters for other types of
- group. Update for normal brackets of all kinds, and conditions with two
- branches (see code above). If the bracket is followed by a quantifier with
- zero repeat, we have to back off. Hence the definition of zeroreqchar and
- zerofirstchar outside the main loop so that they can be accessed for the
- back off. */
-
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- groupsetfirstchar = FALSE;
-
- if (bravalue >= OP_ONCE)
- {
- /* If we have not yet set a firstchar in this branch, take it from the
- subpattern, remembering that it was set here so that a repeat of more
- than one can replicate it as reqchar if necessary. If the subpattern has
- no firstchar, set "none" for the whole branch. In both cases, a zero
- repeat forces firstchar to "none". */
-
- if (firstcharflags == REQ_UNSET)
- {
- if (subfirstcharflags >= 0)
- {
- firstchar = subfirstchar;
- firstcharflags = subfirstcharflags;
- groupsetfirstchar = TRUE;
- }
- else firstcharflags = REQ_NONE;
- zerofirstcharflags = REQ_NONE;
- }
-
- /* If firstchar was previously set, convert the subpattern's firstchar
- into reqchar if there wasn't one, using the vary flag that was in
- existence beforehand. */
-
- else if (subfirstcharflags >= 0 && subreqcharflags < 0)
- {
- subreqchar = subfirstchar;
- subreqcharflags = subfirstcharflags | tempreqvary;
- }
-
- /* If the subpattern set a required byte (or set a first byte that isn't
- really the first byte - see above), set it. */
-
- if (subreqcharflags >= 0)
- {
- reqchar = subreqchar;
- reqcharflags = subreqcharflags;
- }
- }
-
- /* For a forward assertion, we take the reqchar, if set. This can be
- helpful if the pattern that follows the assertion doesn't set a different
- char. For example, it's useful for /(?=abcde).+/. We can't set firstchar
- for an assertion, however because it leads to incorrect effect for patterns
- such as /(?=a)a.+/ when the "real" "a" would then become a reqchar instead
- of a firstchar. This is overcome by a scan at the end if there's no
- firstchar, looking for an asserted first char. */
-
- else if (bravalue == OP_ASSERT && subreqcharflags >= 0)
- {
- reqchar = subreqchar;
- reqcharflags = subreqcharflags;
- }
- break; /* End of processing '(' */
-
-
- /* ===================================================================*/
- /* Handle metasequences introduced by \. For ones like \d, the ESC_ values
- are arranged to be the negation of the corresponding OP_values in the
- default case when PCRE_UCP is not set. For the back references, the values
- are negative the reference number. Only back references and those types
- that consume a character may be repeated. We can test for values between
- ESC_b and ESC_Z for the latter; this may have to change if any new ones are
- ever created. */
-
- case CHAR_BACKSLASH:
- tempptr = ptr;
- escape = check_escape(&ptr, &ec, errorcodeptr, cd->bracount, options, FALSE);
- if (*errorcodeptr != 0) goto FAILED;
-
- if (escape == 0) /* The escape coded a single character */
- c = ec;
- else
- {
- if (escape == ESC_Q) /* Handle start of quoted string */
- {
- if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
- ptr += 2; /* avoid empty string */
- else inescq = TRUE;
- continue;
- }
-
- if (escape == ESC_E) continue; /* Perl ignores an orphan \E */
-
- /* For metasequences that actually match a character, we disable the
- setting of a first character if it hasn't already been set. */
-
- if (firstcharflags == REQ_UNSET && escape > ESC_b && escape < ESC_Z)
- firstcharflags = REQ_NONE;
-
- /* Set values to reset to if this is followed by a zero repeat. */
-
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
-
- /* \g<name> or \g'name' is a subroutine call by name and \g<n> or \g'n'
- is a subroutine call by number (Oniguruma syntax). In fact, the value
- ESC_g is returned only for these cases. So we don't need to check for <
- or ' if the value is ESC_g. For the Perl syntax \g{n} the value is
- -n, and for the Perl syntax \g{name} the result is ESC_k (as
- that is a synonym for a named back reference). */
-
- if (escape == ESC_g)
- {
- const pcre_uchar *p;
- pcre_uint32 cf;
-
- save_hwm = cd->hwm; /* Normally this is set when '(' is read */
- terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE;
-
- /* These two statements stop the compiler for warning about possibly
- unset variables caused by the jump to HANDLE_NUMERICAL_RECURSION. In
- fact, because we do the check for a number below, the paths that
- would actually be in error are never taken. */
-
- skipbytes = 0;
- reset_bracount = FALSE;
-
- /* If it's not a signed or unsigned number, treat it as a name. */
-
- cf = ptr[1];
- if (cf != CHAR_PLUS && cf != CHAR_MINUS && !IS_DIGIT(cf))
- {
- is_recurse = TRUE;
- goto NAMED_REF_OR_RECURSE;
- }
-
- /* Signed or unsigned number (cf = ptr[1]) is known to be plus or minus
- or a digit. */
-
- p = ptr + 2;
- while (IS_DIGIT(*p)) p++;
- if (*p != (pcre_uchar)terminator)
- {
- *errorcodeptr = ERR57;
- break;
- }
- ptr++;
- goto HANDLE_NUMERICAL_RECURSION;
- }
-
- /* \k<name> or \k'name' is a back reference by name (Perl syntax).
- We also support \k{name} (.NET syntax). */
-
- if (escape == ESC_k)
- {
- if ((ptr[1] != CHAR_LESS_THAN_SIGN &&
- ptr[1] != CHAR_APOSTROPHE && ptr[1] != CHAR_LEFT_CURLY_BRACKET))
- {
- *errorcodeptr = ERR69;
- break;
- }
- is_recurse = FALSE;
- terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : (*ptr == CHAR_APOSTROPHE)?
- CHAR_APOSTROPHE : CHAR_RIGHT_CURLY_BRACKET;
- goto NAMED_REF_OR_RECURSE;
- }
-
- /* Back references are handled specially; must disable firstchar if
- not set to cope with cases like (?=(\w+))\1: which would otherwise set
- ':' later. */
-
- if (escape < 0)
- {
- open_capitem *oc;
- recno = -escape;
-
- /* Come here from named backref handling when the reference is to a
- single group (i.e. not to a duplicated name. */
-
- HANDLE_REFERENCE:
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- previous = code;
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF;
- PUT2INC(code, 0, recno);
- cd->backref_map |= (recno < 32)? (1 << recno) : 1;
- if (recno > cd->top_backref) cd->top_backref = recno;
-
- /* Check to see if this back reference is recursive, that it, it
- is inside the group that it references. A flag is set so that the
- group can be made atomic. */
-
- for (oc = cd->open_caps; oc != NULL; oc = oc->next)
- {
- if (oc->number == recno)
- {
- oc->flag = TRUE;
- break;
- }
- }
- }
-
- /* So are Unicode property matches, if supported. */
-
-#ifdef SUPPORT_UCP
- else if (escape == ESC_P || escape == ESC_p)
- {
- BOOL negated;
- unsigned int ptype = 0, pdata = 0;
- if (!get_ucp(&ptr, &negated, &ptype, &pdata, errorcodeptr))
- goto FAILED;
- previous = code;
- *code++ = ((escape == ESC_p) != negated)? OP_PROP : OP_NOTPROP;
- *code++ = ptype;
- *code++ = pdata;
- }
-#else
-
- /* If Unicode properties are not supported, \X, \P, and \p are not
- allowed. */
-
- else if (escape == ESC_X || escape == ESC_P || escape == ESC_p)
- {
- *errorcodeptr = ERR45;
- goto FAILED;
- }
-#endif
-
- /* For the rest (including \X when Unicode properties are supported), we
- can obtain the OP value by negating the escape value in the default
- situation when PCRE_UCP is not set. When it *is* set, we substitute
- Unicode property tests. Note that \b and \B do a one-character
- lookbehind, and \A also behaves as if it does. */
-
- else
- {
- if ((escape == ESC_b || escape == ESC_B || escape == ESC_A) &&
- cd->max_lookbehind == 0)
- cd->max_lookbehind = 1;
-#ifdef SUPPORT_UCP
- if (escape >= ESC_DU && escape <= ESC_wu)
- {
- nestptr = ptr + 1; /* Where to resume */
- ptr = substitutes[escape - ESC_DU] - 1; /* Just before substitute */
- }
- else
-#endif
- /* In non-UTF-8 mode, we turn \C into OP_ALLANY instead of OP_ANYBYTE
- so that it works in DFA mode and in lookbehinds. */
-
- {
- previous = (escape > ESC_b && escape < ESC_Z)? code : NULL;
- *code++ = (!utf && escape == ESC_C)? OP_ALLANY : escape;
- }
- }
- continue;
- }
-
- /* We have a data character whose value is in c. In UTF-8 mode it may have
- a value > 127. We set its representation in the length/buffer, and then
- handle it as a data character. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR)
- mclength = PRIV(ord2utf)(c, mcbuffer);
- else
-#endif
-
- {
- mcbuffer[0] = c;
- mclength = 1;
- }
- goto ONE_CHAR;
-
-
- /* ===================================================================*/
- /* Handle a literal character. It is guaranteed not to be whitespace or #
- when the extended flag is set. If we are in a UTF mode, it may be a
- multi-unit literal character. */
-
- default:
- NORMAL_CHAR:
- mclength = 1;
- mcbuffer[0] = c;
-
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(c))
- ACROSSCHAR(TRUE, ptr[1], mcbuffer[mclength++] = *(++ptr));
-#endif
-
- /* At this point we have the character's bytes in mcbuffer, and the length
- in mclength. When not in UTF-8 mode, the length is always 1. */
-
- ONE_CHAR:
- previous = code;
-
- /* For caseless UTF-8 mode when UCP support is available, check whether
- this character has more than one other case. If so, generate a special
- OP_PROP item instead of OP_CHARI. */
-
-#ifdef SUPPORT_UCP
- if (utf && (options & PCRE_CASELESS) != 0)
- {
- GETCHAR(c, mcbuffer);
- if ((c = UCD_CASESET(c)) != 0)
- {
- *code++ = OP_PROP;
- *code++ = PT_CLIST;
- *code++ = c;
- if (firstcharflags == REQ_UNSET)
- firstcharflags = zerofirstcharflags = REQ_NONE;
- break;
- }
- }
-#endif
-
- /* Caseful matches, or not one of the multicase characters. */
-
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARI : OP_CHAR;
- for (c = 0; c < mclength; c++) *code++ = mcbuffer[c];
-
- /* Remember if \r or \n were seen */
-
- if (mcbuffer[0] == CHAR_CR || mcbuffer[0] == CHAR_NL)
- cd->external_flags |= PCRE_HASCRORLF;
-
- /* Set the first and required bytes appropriately. If no previous first
- byte, set it from this character, but revert to none on a zero repeat.
- Otherwise, leave the firstchar value alone, and don't change it on a zero
- repeat. */
-
- if (firstcharflags == REQ_UNSET)
- {
- zerofirstcharflags = REQ_NONE;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
-
- /* If the character is more than one byte long, we can set firstchar
- only if it is not to be matched caselessly. */
-
- if (mclength == 1 || req_caseopt == 0)
- {
- firstchar = mcbuffer[0] | req_caseopt;
- firstchar = mcbuffer[0];
- firstcharflags = req_caseopt;
-
- if (mclength != 1)
- {
- reqchar = code[-1];
- reqcharflags = cd->req_varyopt;
- }
- }
- else firstcharflags = reqcharflags = REQ_NONE;
- }
-
- /* firstchar was previously set; we can set reqchar only if the length is
- 1 or the matching is caseful. */
-
- else
- {
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
- if (mclength == 1 || req_caseopt == 0)
- {
- reqchar = code[-1];
- reqcharflags = req_caseopt | cd->req_varyopt;
- }
- }
-
- break; /* End of literal character handling */
- }
- } /* end of big loop */
-
-
-/* Control never reaches here by falling through, only by a goto for all the
-error states. Pass back the position in the pattern so that it can be displayed
-to the user for diagnosing the error. */
-
-FAILED:
-*ptrptr = ptr;
-return FALSE;
-}
-
-
-
-/*************************************************
-* Compile sequence of alternatives *
-*************************************************/
-
-/* On entry, ptr is pointing past the bracket character, but on return it
-points to the closing bracket, or vertical bar, or end of string. The code
-variable is pointing at the byte into which the BRA operator has been stored.
-This function is used during the pre-compile phase when we are trying to find
-out the amount of memory needed, as well as during the real compile phase. The
-value of lengthptr distinguishes the two phases.
-
-Arguments:
- options option bits, including any changes for this subpattern
- codeptr -> the address of the current code pointer
- ptrptr -> the address of the current pattern pointer
- errorcodeptr -> pointer to error code variable
- lookbehind TRUE if this is a lookbehind assertion
- reset_bracount TRUE to reset the count for each branch
- skipbytes skip this many bytes at start (for brackets and OP_COND)
- cond_depth depth of nesting for conditional subpatterns
- firstcharptr place to put the first required character
- firstcharflagsptr place to put the first character flags, or a negative number
- reqcharptr place to put the last required character
- reqcharflagsptr place to put the last required character flags, or a negative number
- bcptr pointer to the chain of currently open branches
- cd points to the data block with tables pointers etc.
- lengthptr NULL during the real compile phase
- points to length accumulator during pre-compile phase
-
-Returns: TRUE on success
-*/
-
-static BOOL
-compile_regex(int options, pcre_uchar **codeptr, const pcre_uchar **ptrptr,
- int *errorcodeptr, BOOL lookbehind, BOOL reset_bracount, int skipbytes,
- int cond_depth,
- pcre_uint32 *firstcharptr, pcre_int32 *firstcharflagsptr,
- pcre_uint32 *reqcharptr, pcre_int32 *reqcharflagsptr,
- branch_chain *bcptr, compile_data *cd, int *lengthptr)
-{
-const pcre_uchar *ptr = *ptrptr;
-pcre_uchar *code = *codeptr;
-pcre_uchar *last_branch = code;
-pcre_uchar *start_bracket = code;
-pcre_uchar *reverse_count = NULL;
-open_capitem capitem;
-int capnumber = 0;
-pcre_uint32 firstchar, reqchar;
-pcre_int32 firstcharflags, reqcharflags;
-pcre_uint32 branchfirstchar, branchreqchar;
-pcre_int32 branchfirstcharflags, branchreqcharflags;
-int length;
-unsigned int orig_bracount;
-unsigned int max_bracount;
-branch_chain bc;
-
-/* If set, call the external function that checks for stack availability. */
-
-if (PUBL(stack_guard) != NULL && PUBL(stack_guard)())
- {
- *errorcodeptr= ERR85;
- return FALSE;
- }
-
-/* Miscellaneous initialization */
-
-bc.outer = bcptr;
-bc.current_branch = code;
-
-firstchar = reqchar = 0;
-firstcharflags = reqcharflags = REQ_UNSET;
-
-/* Accumulate the length for use in the pre-compile phase. Start with the
-length of the BRA and KET and any extra bytes that are required at the
-beginning. We accumulate in a local variable to save frequent testing of
-lenthptr for NULL. We cannot do this by looking at the value of code at the
-start and end of each alternative, because compiled items are discarded during
-the pre-compile phase so that the work space is not exceeded. */
-
-length = 2 + 2*LINK_SIZE + skipbytes;
-
-/* WARNING: If the above line is changed for any reason, you must also change
-the code that abstracts option settings at the start of the pattern and makes
-them global. It tests the value of length for (2 + 2*LINK_SIZE) in the
-pre-compile phase to find out whether anything has yet been compiled or not. */
-
-/* If this is a capturing subpattern, add to the chain of open capturing items
-so that we can detect them if (*ACCEPT) is encountered. This is also used to
-detect groups that contain recursive back references to themselves. Note that
-only OP_CBRA need be tested here; changing this opcode to one of its variants,
-e.g. OP_SCBRAPOS, happens later, after the group has been compiled. */
-
-if (*code == OP_CBRA)
- {
- capnumber = GET2(code, 1 + LINK_SIZE);
- capitem.number = capnumber;
- capitem.next = cd->open_caps;
- capitem.flag = FALSE;
- cd->open_caps = &capitem;
- }
-
-/* Offset is set zero to mark that this bracket is still open */
-
-PUT(code, 1, 0);
-code += 1 + LINK_SIZE + skipbytes;
-
-/* Loop for each alternative branch */
-
-orig_bracount = max_bracount = cd->bracount;
-for (;;)
- {
- /* For a (?| group, reset the capturing bracket count so that each branch
- uses the same numbers. */
-
- if (reset_bracount) cd->bracount = orig_bracount;
-
- /* Set up dummy OP_REVERSE if lookbehind assertion */
-
- if (lookbehind)
- {
- *code++ = OP_REVERSE;
- reverse_count = code;
- PUTINC(code, 0, 0);
- length += 1 + LINK_SIZE;
- }
-
- /* Now compile the branch; in the pre-compile phase its length gets added
- into the length. */
-
- if (!compile_branch(&options, &code, &ptr, errorcodeptr, &branchfirstchar,
- &branchfirstcharflags, &branchreqchar, &branchreqcharflags, &bc,
- cond_depth, cd, (lengthptr == NULL)? NULL : &length))
- {
- *ptrptr = ptr;
- return FALSE;
- }
-
- /* Keep the highest bracket count in case (?| was used and some branch
- has fewer than the rest. */
-
- if (cd->bracount > max_bracount) max_bracount = cd->bracount;
-
- /* In the real compile phase, there is some post-processing to be done. */
-
- if (lengthptr == NULL)
- {
- /* If this is the first branch, the firstchar and reqchar values for the
- branch become the values for the regex. */
-
- if (*last_branch != OP_ALT)
- {
- firstchar = branchfirstchar;
- firstcharflags = branchfirstcharflags;
- reqchar = branchreqchar;
- reqcharflags = branchreqcharflags;
- }
-
- /* If this is not the first branch, the first char and reqchar have to
- match the values from all the previous branches, except that if the
- previous value for reqchar didn't have REQ_VARY set, it can still match,
- and we set REQ_VARY for the regex. */
-
- else
- {
- /* If we previously had a firstchar, but it doesn't match the new branch,
- we have to abandon the firstchar for the regex, but if there was
- previously no reqchar, it takes on the value of the old firstchar. */
-
- if (firstcharflags >= 0 &&
- (firstcharflags != branchfirstcharflags || firstchar != branchfirstchar))
- {
- if (reqcharflags < 0)
- {
- reqchar = firstchar;
- reqcharflags = firstcharflags;
- }
- firstcharflags = REQ_NONE;
- }
-
- /* If we (now or from before) have no firstchar, a firstchar from the
- branch becomes a reqchar if there isn't a branch reqchar. */
-
- if (firstcharflags < 0 && branchfirstcharflags >= 0 && branchreqcharflags < 0)
- {
- branchreqchar = branchfirstchar;
- branchreqcharflags = branchfirstcharflags;
- }
-
- /* Now ensure that the reqchars match */
-
- if (((reqcharflags & ~REQ_VARY) != (branchreqcharflags & ~REQ_VARY)) ||
- reqchar != branchreqchar)
- reqcharflags = REQ_NONE;
- else
- {
- reqchar = branchreqchar;
- reqcharflags |= branchreqcharflags; /* To "or" REQ_VARY */
- }
- }
-
- /* If lookbehind, check that this branch matches a fixed-length string, and
- put the length into the OP_REVERSE item. Temporarily mark the end of the
- branch with OP_END. If the branch contains OP_RECURSE, the result is -3
- because there may be forward references that we can't check here. Set a
- flag to cause another lookbehind check at the end. Why not do it all at the
- end? Because common, erroneous checks are picked up here and the offset of
- the problem can be shown. */
-
- if (lookbehind)
- {
- int fixed_length;
- *code = OP_END;
- fixed_length = find_fixedlength(last_branch, (options & PCRE_UTF8) != 0,
- FALSE, cd);
- DPRINTF(("fixed length = %d\n", fixed_length));
- if (fixed_length == -3)
- {
- cd->check_lookbehind = TRUE;
- }
- else if (fixed_length < 0)
- {
- *errorcodeptr = (fixed_length == -2)? ERR36 :
- (fixed_length == -4)? ERR70: ERR25;
- *ptrptr = ptr;
- return FALSE;
- }
- else
- {
- if (fixed_length > cd->max_lookbehind)
- cd->max_lookbehind = fixed_length;
- PUT(reverse_count, 0, fixed_length);
- }
- }
- }
-
- /* Reached end of expression, either ')' or end of pattern. In the real
- compile phase, go back through the alternative branches and reverse the chain
- of offsets, with the field in the BRA item now becoming an offset to the
- first alternative. If there are no alternatives, it points to the end of the
- group. The length in the terminating ket is always the length of the whole
- bracketed item. Return leaving the pointer at the terminating char. */
-
- if (*ptr != CHAR_VERTICAL_LINE)
- {
- if (lengthptr == NULL)
- {
- int branch_length = (int)(code - last_branch);
- do
- {
- int prev_length = GET(last_branch, 1);
- PUT(last_branch, 1, branch_length);
- branch_length = prev_length;
- last_branch -= branch_length;
- }
- while (branch_length > 0);
- }
-
- /* Fill in the ket */
-
- *code = OP_KET;
- PUT(code, 1, (int)(code - start_bracket));
- code += 1 + LINK_SIZE;
-
- /* If it was a capturing subpattern, check to see if it contained any
- recursive back references. If so, we must wrap it in atomic brackets.
- In any event, remove the block from the chain. */
-
- if (capnumber > 0)
- {
- if (cd->open_caps->flag)
- {
- memmove(start_bracket + 1 + LINK_SIZE, start_bracket,
- IN_UCHARS(code - start_bracket));
- *start_bracket = OP_ONCE;
- code += 1 + LINK_SIZE;
- PUT(start_bracket, 1, (int)(code - start_bracket));
- *code = OP_KET;
- PUT(code, 1, (int)(code - start_bracket));
- code += 1 + LINK_SIZE;
- length += 2 + 2*LINK_SIZE;
- }
- cd->open_caps = cd->open_caps->next;
- }
-
- /* Retain the highest bracket number, in case resetting was used. */
-
- cd->bracount = max_bracount;
-
- /* Set values to pass back */
-
- *codeptr = code;
- *ptrptr = ptr;
- *firstcharptr = firstchar;
- *firstcharflagsptr = firstcharflags;
- *reqcharptr = reqchar;
- *reqcharflagsptr = reqcharflags;
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < length)
- {
- *errorcodeptr = ERR20;
- return FALSE;
- }
- *lengthptr += length;
- }
- return TRUE;
- }
-
- /* Another branch follows. In the pre-compile phase, we can move the code
- pointer back to where it was for the start of the first branch. (That is,
- pretend that each branch is the only one.)
-
- In the real compile phase, insert an ALT node. Its length field points back
- to the previous branch while the bracket remains open. At the end the chain
- is reversed. It's done like this so that the start of the bracket has a
- zero offset until it is closed, making it possible to detect recursion. */
-
- if (lengthptr != NULL)
- {
- code = *codeptr + 1 + LINK_SIZE + skipbytes;
- length += 1 + LINK_SIZE;
- }
- else
- {
- *code = OP_ALT;
- PUT(code, 1, (int)(code - last_branch));
- bc.current_branch = last_branch = code;
- code += 1 + LINK_SIZE;
- }
-
- ptr++;
- }
-/* Control never reaches here */
-}
-
-
-
-
-/*************************************************
-* Check for anchored expression *
-*************************************************/
-
-/* Try to find out if this is an anchored regular expression. Consider each
-alternative branch. If they all start with OP_SOD or OP_CIRC, or with a bracket
-all of whose alternatives start with OP_SOD or OP_CIRC (recurse ad lib), then
-it's anchored. However, if this is a multiline pattern, then only OP_SOD will
-be found, because ^ generates OP_CIRCM in that mode.
-
-We can also consider a regex to be anchored if OP_SOM starts all its branches.
-This is the code for \G, which means "match at start of match position, taking
-into account the match offset".
-
-A branch is also implicitly anchored if it starts with .* and DOTALL is set,
-because that will try the rest of the pattern at all possible matching points,
-so there is no point trying again.... er ....
-
-.... except when the .* appears inside capturing parentheses, and there is a
-subsequent back reference to those parentheses. We haven't enough information
-to catch that case precisely.
-
-At first, the best we could do was to detect when .* was in capturing brackets
-and the highest back reference was greater than or equal to that level.
-However, by keeping a bitmap of the first 31 back references, we can catch some
-of the more common cases more precisely.
-
-... A second exception is when the .* appears inside an atomic group, because
-this prevents the number of characters it matches from being adjusted.
-
-Arguments:
- code points to start of expression (the bracket)
- bracket_map a bitmap of which brackets we are inside while testing; this
- handles up to substring 31; after that we just have to take
- the less precise approach
- cd points to the compile data block
- atomcount atomic group level
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_anchored(register const pcre_uchar *code, unsigned int bracket_map,
- compile_data *cd, int atomcount)
-{
-do {
- const pcre_uchar *scode = first_significant_code(
- code + PRIV(OP_lengths)[*code], FALSE);
- register int op = *scode;
-
- /* Non-capturing brackets */
-
- if (op == OP_BRA || op == OP_BRAPOS ||
- op == OP_SBRA || op == OP_SBRAPOS)
- {
- if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE;
- }
-
- /* Capturing brackets */
-
- else if (op == OP_CBRA || op == OP_CBRAPOS ||
- op == OP_SCBRA || op == OP_SCBRAPOS)
- {
- int n = GET2(scode, 1+LINK_SIZE);
- int new_map = bracket_map | ((n < 32)? (1 << n) : 1);
- if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE;
- }
-
- /* Positive forward assertions and conditions */
-
- else if (op == OP_ASSERT || op == OP_COND)
- {
- if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE;
- }
-
- /* Atomic groups */
-
- else if (op == OP_ONCE || op == OP_ONCE_NC)
- {
- if (!is_anchored(scode, bracket_map, cd, atomcount + 1))
- return FALSE;
- }
-
- /* .* is not anchored unless DOTALL is set (which generates OP_ALLANY) and
- it isn't in brackets that are or may be referenced or inside an atomic
- group. */
-
- else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR ||
- op == OP_TYPEPOSSTAR))
- {
- if (scode[1] != OP_ALLANY || (bracket_map & cd->backref_map) != 0 ||
- atomcount > 0 || cd->had_pruneorskip)
- return FALSE;
- }
-
- /* Check for explicit anchoring */
-
- else if (op != OP_SOD && op != OP_SOM && op != OP_CIRC) return FALSE;
-
- code += GET(code, 1);
- }
-while (*code == OP_ALT); /* Loop for each alternative */
-return TRUE;
-}
-
-
-
-/*************************************************
-* Check for starting with ^ or .* *
-*************************************************/
-
-/* This is called to find out if every branch starts with ^ or .* so that
-"first char" processing can be done to speed things up in multiline
-matching and for non-DOTALL patterns that start with .* (which must start at
-the beginning or after \n). As in the case of is_anchored() (see above), we
-have to take account of back references to capturing brackets that contain .*
-because in that case we can't make the assumption. Also, the appearance of .*
-inside atomic brackets or in a pattern that contains *PRUNE or *SKIP does not
-count, because once again the assumption no longer holds.
-
-Arguments:
- code points to start of expression (the bracket)
- bracket_map a bitmap of which brackets we are inside while testing; this
- handles up to substring 31; after that we just have to take
- the less precise approach
- cd points to the compile data
- atomcount atomic group level
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_startline(const pcre_uchar *code, unsigned int bracket_map,
- compile_data *cd, int atomcount)
-{
-do {
- const pcre_uchar *scode = first_significant_code(
- code + PRIV(OP_lengths)[*code], FALSE);
- register int op = *scode;
-
- /* If we are at the start of a conditional assertion group, *both* the
- conditional assertion *and* what follows the condition must satisfy the test
- for start of line. Other kinds of condition fail. Note that there may be an
- auto-callout at the start of a condition. */
-
- if (op == OP_COND)
- {
- scode += 1 + LINK_SIZE;
- if (*scode == OP_CALLOUT) scode += PRIV(OP_lengths)[OP_CALLOUT];
- switch (*scode)
- {
- case OP_CREF:
- case OP_DNCREF:
- case OP_RREF:
- case OP_DNRREF:
- case OP_DEF:
- return FALSE;
-
- default: /* Assertion */
- if (!is_startline(scode, bracket_map, cd, atomcount)) return FALSE;
- do scode += GET(scode, 1); while (*scode == OP_ALT);
- scode += 1 + LINK_SIZE;
- break;
- }
- scode = first_significant_code(scode, FALSE);
- op = *scode;
- }
-
- /* Non-capturing brackets */
-
- if (op == OP_BRA || op == OP_BRAPOS ||
- op == OP_SBRA || op == OP_SBRAPOS)
- {
- if (!is_startline(scode, bracket_map, cd, atomcount)) return FALSE;
- }
-
- /* Capturing brackets */
-
- else if (op == OP_CBRA || op == OP_CBRAPOS ||
- op == OP_SCBRA || op == OP_SCBRAPOS)
- {
- int n = GET2(scode, 1+LINK_SIZE);
- int new_map = bracket_map | ((n < 32)? (1 << n) : 1);
- if (!is_startline(scode, new_map, cd, atomcount)) return FALSE;
- }
-
- /* Positive forward assertions */
-
- else if (op == OP_ASSERT)
- {
- if (!is_startline(scode, bracket_map, cd, atomcount)) return FALSE;
- }
-
- /* Atomic brackets */
-
- else if (op == OP_ONCE || op == OP_ONCE_NC)
- {
- if (!is_startline(scode, bracket_map, cd, atomcount + 1)) return FALSE;
- }
-
- /* .* means "start at start or after \n" if it isn't in atomic brackets or
- brackets that may be referenced, as long as the pattern does not contain
- *PRUNE or *SKIP, because these break the feature. Consider, for example,
- /.*?a(*PRUNE)b/ with the subject "aab", which matches "ab", i.e. not at the
- start of a line. */
-
- else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR || op == OP_TYPEPOSSTAR)
- {
- if (scode[1] != OP_ANY || (bracket_map & cd->backref_map) != 0 ||
- atomcount > 0 || cd->had_pruneorskip)
- return FALSE;
- }
-
- /* Check for explicit circumflex; anything else gives a FALSE result. Note
- in particular that this includes atomic brackets OP_ONCE and OP_ONCE_NC
- because the number of characters matched by .* cannot be adjusted inside
- them. */
-
- else if (op != OP_CIRC && op != OP_CIRCM) return FALSE;
-
- /* Move on to the next alternative */
-
- code += GET(code, 1);
- }
-while (*code == OP_ALT); /* Loop for each alternative */
-return TRUE;
-}
-
-
-
-/*************************************************
-* Check for asserted fixed first char *
-*************************************************/
-
-/* During compilation, the "first char" settings from forward assertions are
-discarded, because they can cause conflicts with actual literals that follow.
-However, if we end up without a first char setting for an unanchored pattern,
-it is worth scanning the regex to see if there is an initial asserted first
-char. If all branches start with the same asserted char, or with a
-non-conditional bracket all of whose alternatives start with the same asserted
-char (recurse ad lib), then we return that char, with the flags set to zero or
-REQ_CASELESS; otherwise return zero with REQ_NONE in the flags.
-
-Arguments:
- code points to start of expression (the bracket)
- flags points to the first char flags, or to REQ_NONE
- inassert TRUE if in an assertion
-
-Returns: the fixed first char, or 0 with REQ_NONE in flags
-*/
-
-static pcre_uint32
-find_firstassertedchar(const pcre_uchar *code, pcre_int32 *flags,
- BOOL inassert)
-{
-register pcre_uint32 c = 0;
-int cflags = REQ_NONE;
-
-*flags = REQ_NONE;
-do {
- pcre_uint32 d;
- int dflags;
- int xl = (*code == OP_CBRA || *code == OP_SCBRA ||
- *code == OP_CBRAPOS || *code == OP_SCBRAPOS)? IMM2_SIZE:0;
- const pcre_uchar *scode = first_significant_code(code + 1+LINK_SIZE + xl,
- TRUE);
- register pcre_uchar op = *scode;
-
- switch(op)
- {
- default:
- return 0;
-
- case OP_BRA:
- case OP_BRAPOS:
- case OP_CBRA:
- case OP_SCBRA:
- case OP_CBRAPOS:
- case OP_SCBRAPOS:
- case OP_ASSERT:
- case OP_ONCE:
- case OP_ONCE_NC:
- d = find_firstassertedchar(scode, &dflags, op == OP_ASSERT);
- if (dflags < 0)
- return 0;
- if (cflags < 0) { c = d; cflags = dflags; } else if (c != d || cflags != dflags) return 0;
- break;
-
- case OP_EXACT:
- scode += IMM2_SIZE;
- /* Fall through */
-
- case OP_CHAR:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_POSPLUS:
- if (!inassert) return 0;
- if (cflags < 0) { c = scode[1]; cflags = 0; }
- else if (c != scode[1]) return 0;
- break;
-
- case OP_EXACTI:
- scode += IMM2_SIZE;
- /* Fall through */
-
- case OP_CHARI:
- case OP_PLUSI:
- case OP_MINPLUSI:
- case OP_POSPLUSI:
- if (!inassert) return 0;
- if (cflags < 0) { c = scode[1]; cflags = REQ_CASELESS; }
- else if (c != scode[1]) return 0;
- break;
- }
-
- code += GET(code, 1);
- }
-while (*code == OP_ALT);
-
-*flags = cflags;
-return c;
-}
-
-
-
-/*************************************************
-* Add an entry to the name/number table *
-*************************************************/
-
-/* This function is called between compiling passes to add an entry to the
-name/number table, maintaining alphabetical order. Checking for permitted
-and forbidden duplicates has already been done.
-
-Arguments:
- cd the compile data block
- name the name to add
- length the length of the name
- groupno the group number
-
-Returns: nothing
-*/
-
-static void
-add_name(compile_data *cd, const pcre_uchar *name, int length,
- unsigned int groupno)
-{
-int i;
-pcre_uchar *slot = cd->name_table;
-
-for (i = 0; i < cd->names_found; i++)
- {
- int crc = memcmp(name, slot+IMM2_SIZE, IN_UCHARS(length));
- if (crc == 0 && slot[IMM2_SIZE+length] != 0)
- crc = -1; /* Current name is a substring */
-
- /* Make space in the table and break the loop for an earlier name. For a
- duplicate or later name, carry on. We do this for duplicates so that in the
- simple case (when ?(| is not used) they are in order of their numbers. In all
- cases they are in the order in which they appear in the pattern. */
-
- if (crc < 0)
- {
- memmove(slot + cd->name_entry_size, slot,
- IN_UCHARS((cd->names_found - i) * cd->name_entry_size));
- break;
- }
-
- /* Continue the loop for a later or duplicate name */
-
- slot += cd->name_entry_size;
- }
-
-PUT2(slot, 0, groupno);
-memcpy(slot + IMM2_SIZE, name, IN_UCHARS(length));
-slot[IMM2_SIZE + length] = 0;
-cd->names_found++;
-}
-
-
-
-/*************************************************
-* Compile a Regular Expression *
-*************************************************/
-
-/* This function takes a string and returns a pointer to a block of store
-holding a compiled version of the expression. The original API for this
-function had no error code return variable; it is retained for backwards
-compatibility. The new function is given a new name.
-
-Arguments:
- pattern the regular expression
- options various option bits
- errorcodeptr pointer to error code variable (pcre_compile2() only)
- can be NULL if you don't want a code value
- errorptr pointer to pointer to error text
- erroroffset ptr offset in pattern where error was detected
- tables pointer to character tables or NULL
-
-Returns: pointer to compiled data block, or NULL on error,
- with errorptr and erroroffset set
-*/
-
-#if defined COMPILE_PCRE8
-PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION
-pcre_compile(const char *pattern, int options, const char **errorptr,
- int *erroroffset, const unsigned char *tables)
-#elif defined COMPILE_PCRE16
-PCRE_EXP_DEFN pcre16 * PCRE_CALL_CONVENTION
-pcre16_compile(PCRE_SPTR16 pattern, int options, const char **errorptr,
- int *erroroffset, const unsigned char *tables)
-#elif defined COMPILE_PCRE32
-PCRE_EXP_DEFN pcre32 * PCRE_CALL_CONVENTION
-pcre32_compile(PCRE_SPTR32 pattern, int options, const char **errorptr,
- int *erroroffset, const unsigned char *tables)
-#endif
-{
-#if defined COMPILE_PCRE8
-return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables);
-#elif defined COMPILE_PCRE16
-return pcre16_compile2(pattern, options, NULL, errorptr, erroroffset, tables);
-#elif defined COMPILE_PCRE32
-return pcre32_compile2(pattern, options, NULL, errorptr, erroroffset, tables);
-#endif
-}
-
-
-#if defined COMPILE_PCRE8
-PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION
-pcre_compile2(const char *pattern, int options, int *errorcodeptr,
- const char **errorptr, int *erroroffset, const unsigned char *tables)
-#elif defined COMPILE_PCRE16
-PCRE_EXP_DEFN pcre16 * PCRE_CALL_CONVENTION
-pcre16_compile2(PCRE_SPTR16 pattern, int options, int *errorcodeptr,
- const char **errorptr, int *erroroffset, const unsigned char *tables)
-#elif defined COMPILE_PCRE32
-PCRE_EXP_DEFN pcre32 * PCRE_CALL_CONVENTION
-pcre32_compile2(PCRE_SPTR32 pattern, int options, int *errorcodeptr,
- const char **errorptr, int *erroroffset, const unsigned char *tables)
-#endif
-{
-REAL_PCRE *re;
-int length = 1; /* For final END opcode */
-pcre_int32 firstcharflags, reqcharflags;
-pcre_uint32 firstchar, reqchar;
-pcre_uint32 limit_match = PCRE_UINT32_MAX;
-pcre_uint32 limit_recursion = PCRE_UINT32_MAX;
-int newline;
-int errorcode = 0;
-int skipatstart = 0;
-BOOL utf;
-BOOL never_utf = FALSE;
-size_t size;
-pcre_uchar *code;
-const pcre_uchar *codestart;
-const pcre_uchar *ptr;
-compile_data compile_block;
-compile_data *cd = &compile_block;
-
-/* This space is used for "compiling" into during the first phase, when we are
-computing the amount of memory that is needed. Compiled items are thrown away
-as soon as possible, so that a fairly large buffer should be sufficient for
-this purpose. The same space is used in the second phase for remembering where
-to fill in forward references to subpatterns. That may overflow, in which case
-new memory is obtained from malloc(). */
-
-pcre_uchar cworkspace[COMPILE_WORK_SIZE];
-
-/* This vector is used for remembering name groups during the pre-compile. In a
-similar way to cworkspace, it can be expanded using malloc() if necessary. */
-
-named_group named_groups[NAMED_GROUP_LIST_SIZE];
-
-/* Set this early so that early errors get offset 0. */
-
-ptr = (const pcre_uchar *)pattern;
-
-/* We can't pass back an error message if errorptr is NULL; I guess the best we
-can do is just return NULL, but we can set a code value if there is a code
-pointer. */
-
-if (errorptr == NULL)
- {
- if (errorcodeptr != NULL) *errorcodeptr = 99;
- return NULL;
- }
-
-*errorptr = NULL;
-if (errorcodeptr != NULL) *errorcodeptr = ERR0;
-
-/* However, we can give a message for this error */
-
-if (erroroffset == NULL)
- {
- errorcode = ERR16;
- goto PCRE_EARLY_ERROR_RETURN2;
- }
-
-*erroroffset = 0;
-
-/* Set up pointers to the individual character tables */
-
-if (tables == NULL) tables = PRIV(default_tables);
-cd->lcc = tables + lcc_offset;
-cd->fcc = tables + fcc_offset;
-cd->cbits = tables + cbits_offset;
-cd->ctypes = tables + ctypes_offset;
-
-/* Check that all undefined public option bits are zero */
-
-if ((options & ~PUBLIC_COMPILE_OPTIONS) != 0)
- {
- errorcode = ERR17;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* If PCRE_NEVER_UTF is set, remember it. */
-
-if ((options & PCRE_NEVER_UTF) != 0) never_utf = TRUE;
-
-/* Check for global one-time settings at the start of the pattern, and remember
-the offset for later. */
-
-cd->external_flags = 0; /* Initialize here for LIMIT_MATCH/RECURSION */
-
-while (ptr[skipatstart] == CHAR_LEFT_PARENTHESIS &&
- ptr[skipatstart+1] == CHAR_ASTERISK)
- {
- int newnl = 0;
- int newbsr = 0;
-
-/* For completeness and backward compatibility, (*UTFn) is supported in the
-relevant libraries, but (*UTF) is generic and always supported. Note that
-PCRE_UTF8 == PCRE_UTF16 == PCRE_UTF32. */
-
-#ifdef COMPILE_PCRE8
- if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF8_RIGHTPAR, 5) == 0)
- { skipatstart += 7; options |= PCRE_UTF8; continue; }
-#endif
-#ifdef COMPILE_PCRE16
- if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF16_RIGHTPAR, 6) == 0)
- { skipatstart += 8; options |= PCRE_UTF16; continue; }
-#endif
-#ifdef COMPILE_PCRE32
- if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF32_RIGHTPAR, 6) == 0)
- { skipatstart += 8; options |= PCRE_UTF32; continue; }
-#endif
-
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF_RIGHTPAR, 4) == 0)
- { skipatstart += 6; options |= PCRE_UTF8; continue; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UCP_RIGHTPAR, 4) == 0)
- { skipatstart += 6; options |= PCRE_UCP; continue; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_NO_AUTO_POSSESS_RIGHTPAR, 16) == 0)
- { skipatstart += 18; options |= PCRE_NO_AUTO_POSSESS; continue; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_NO_START_OPT_RIGHTPAR, 13) == 0)
- { skipatstart += 15; options |= PCRE_NO_START_OPTIMIZE; continue; }
-
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_LIMIT_MATCH_EQ, 12) == 0)
- {
- pcre_uint32 c = 0;
- int p = skipatstart + 14;
- while (isdigit(ptr[p]))
- {
- if (c > PCRE_UINT32_MAX / 10 - 1) break; /* Integer overflow */
- c = c*10 + ptr[p++] - CHAR_0;
- }
- if (ptr[p++] != CHAR_RIGHT_PARENTHESIS) break;
- if (c < limit_match)
- {
- limit_match = c;
- cd->external_flags |= PCRE_MLSET;
- }
- skipatstart = p;
- continue;
- }
-
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_LIMIT_RECURSION_EQ, 16) == 0)
- {
- pcre_uint32 c = 0;
- int p = skipatstart + 18;
- while (isdigit(ptr[p]))
- {
- if (c > PCRE_UINT32_MAX / 10 - 1) break; /* Integer overflow check */
- c = c*10 + ptr[p++] - CHAR_0;
- }
- if (ptr[p++] != CHAR_RIGHT_PARENTHESIS) break;
- if (c < limit_recursion)
- {
- limit_recursion = c;
- cd->external_flags |= PCRE_RLSET;
- }
- skipatstart = p;
- continue;
- }
-
- if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_CR_RIGHTPAR, 3) == 0)
- { skipatstart += 5; newnl = PCRE_NEWLINE_CR; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_LF_RIGHTPAR, 3) == 0)
- { skipatstart += 5; newnl = PCRE_NEWLINE_LF; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_CRLF_RIGHTPAR, 5) == 0)
- { skipatstart += 7; newnl = PCRE_NEWLINE_CR + PCRE_NEWLINE_LF; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_ANY_RIGHTPAR, 4) == 0)
- { skipatstart += 6; newnl = PCRE_NEWLINE_ANY; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_ANYCRLF_RIGHTPAR, 8) == 0)
- { skipatstart += 10; newnl = PCRE_NEWLINE_ANYCRLF; }
-
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_BSR_ANYCRLF_RIGHTPAR, 12) == 0)
- { skipatstart += 14; newbsr = PCRE_BSR_ANYCRLF; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_BSR_UNICODE_RIGHTPAR, 12) == 0)
- { skipatstart += 14; newbsr = PCRE_BSR_UNICODE; }
-
- if (newnl != 0)
- options = (options & ~PCRE_NEWLINE_BITS) | newnl;
- else if (newbsr != 0)
- options = (options & ~(PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) | newbsr;
- else break;
- }
-
-/* PCRE_UTF(16|32) have the same value as PCRE_UTF8. */
-utf = (options & PCRE_UTF8) != 0;
-if (utf && never_utf)
- {
- errorcode = ERR78;
- goto PCRE_EARLY_ERROR_RETURN2;
- }
-
-/* Can't support UTF unless PCRE has been compiled to include the code. The
-return of an error code from PRIV(valid_utf)() is a new feature, introduced in
-release 8.13. It is passed back from pcre_[dfa_]exec(), but at the moment is
-not used here. */
-
-#ifdef SUPPORT_UTF
-if (utf && (options & PCRE_NO_UTF8_CHECK) == 0 &&
- (errorcode = PRIV(valid_utf)((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0)
- {
-#if defined COMPILE_PCRE8
- errorcode = ERR44;
-#elif defined COMPILE_PCRE16
- errorcode = ERR74;
-#elif defined COMPILE_PCRE32
- errorcode = ERR77;
-#endif
- goto PCRE_EARLY_ERROR_RETURN2;
- }
-#else
-if (utf)
- {
- errorcode = ERR32;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-#endif
-
-/* Can't support UCP unless PCRE has been compiled to include the code. */
-
-#ifndef SUPPORT_UCP
-if ((options & PCRE_UCP) != 0)
- {
- errorcode = ERR67;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-#endif
-
-/* Check validity of \R options. */
-
-if ((options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) ==
- (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))
- {
- errorcode = ERR56;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Handle different types of newline. The three bits give seven cases. The
-current code allows for fixed one- or two-byte sequences, plus "any" and
-"anycrlf". */
-
-switch (options & PCRE_NEWLINE_BITS)
- {
- case 0: newline = NEWLINE; break; /* Build-time default */
- case PCRE_NEWLINE_CR: newline = CHAR_CR; break;
- case PCRE_NEWLINE_LF: newline = CHAR_NL; break;
- case PCRE_NEWLINE_CR+
- PCRE_NEWLINE_LF: newline = (CHAR_CR << 8) | CHAR_NL; break;
- case PCRE_NEWLINE_ANY: newline = -1; break;
- case PCRE_NEWLINE_ANYCRLF: newline = -2; break;
- default: errorcode = ERR56; goto PCRE_EARLY_ERROR_RETURN;
- }
-
-if (newline == -2)
- {
- cd->nltype = NLTYPE_ANYCRLF;
- }
-else if (newline < 0)
- {
- cd->nltype = NLTYPE_ANY;
- }
-else
- {
- cd->nltype = NLTYPE_FIXED;
- if (newline > 255)
- {
- cd->nllen = 2;
- cd->nl[0] = (newline >> 8) & 255;
- cd->nl[1] = newline & 255;
- }
- else
- {
- cd->nllen = 1;
- cd->nl[0] = newline;
- }
- }
-
-/* Maximum back reference and backref bitmap. The bitmap records up to 31 back
-references to help in deciding whether (.*) can be treated as anchored or not.
-*/
-
-cd->top_backref = 0;
-cd->backref_map = 0;
-
-/* Reflect pattern for debugging output */
-
-DPRINTF(("------------------------------------------------------------------\n"));
-#ifdef PCRE_DEBUG
-print_puchar(stdout, (PCRE_PUCHAR)pattern);
-#endif
-DPRINTF(("\n"));
-
-/* Pretend to compile the pattern while actually just accumulating the length
-of memory required. This behaviour is triggered by passing a non-NULL final
-argument to compile_regex(). We pass a block of workspace (cworkspace) for it
-to compile parts of the pattern into; the compiled code is discarded when it is
-no longer needed, so hopefully this workspace will never overflow, though there
-is a test for its doing so. */
-
-cd->bracount = cd->final_bracount = 0;
-cd->names_found = 0;
-cd->name_entry_size = 0;
-cd->name_table = NULL;
-cd->dupnames = FALSE;
-cd->namedrefcount = 0;
-cd->start_code = cworkspace;
-cd->hwm = cworkspace;
-cd->start_workspace = cworkspace;
-cd->workspace_size = COMPILE_WORK_SIZE;
-cd->named_groups = named_groups;
-cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
-cd->start_pattern = (const pcre_uchar *)pattern;
-cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar *)pattern));
-cd->req_varyopt = 0;
-cd->parens_depth = 0;
-cd->assert_depth = 0;
-cd->max_lookbehind = 0;
-cd->external_options = options;
-cd->open_caps = NULL;
-
-/* Now do the pre-compile. On error, errorcode will be set non-zero, so we
-don't need to look at the result of the function here. The initial options have
-been put into the cd block so that they can be changed if an option setting is
-found within the regex right at the beginning. Bringing initial option settings
-outside can help speed up starting point checks. */
-
-ptr += skipatstart;
-code = cworkspace;
-*code = OP_BRA;
-
-(void)compile_regex(cd->external_options, &code, &ptr, &errorcode, FALSE,
- FALSE, 0, 0, &firstchar, &firstcharflags, &reqchar, &reqcharflags, NULL,
- cd, &length);
-if (errorcode != 0) goto PCRE_EARLY_ERROR_RETURN;
-
-DPRINTF(("end pre-compile: length=%d workspace=%d\n", length,
- (int)(cd->hwm - cworkspace)));
-
-if (length > MAX_PATTERN_SIZE)
- {
- errorcode = ERR20;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* If there are groups with duplicate names and there are also references by
-name, we must allow for the possibility of named references to duplicated
-groups. These require an extra data item each. */
-
-if (cd->dupnames && cd->namedrefcount > 0)
- length += cd->namedrefcount * IMM2_SIZE * sizeof(pcre_uchar);
-
-/* Compute the size of the data block for storing the compiled pattern. Integer
-overflow should no longer be possible because nowadays we limit the maximum
-value of cd->names_found and cd->name_entry_size. */
-
-size = sizeof(REAL_PCRE) +
- (length + cd->names_found * cd->name_entry_size) * sizeof(pcre_uchar);
-
-/* Get the memory. */
-
-re = (REAL_PCRE *)(PUBL(malloc))(size);
-if (re == NULL)
- {
- errorcode = ERR21;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Put in the magic number, and save the sizes, initial options, internal
-flags, and character table pointer. NULL is used for the default character
-tables. The nullpad field is at the end; it's there to help in the case when a
-regex compiled on a system with 4-byte pointers is run on another with 8-byte
-pointers. */
-
-re->magic_number = MAGIC_NUMBER;
-re->size = (int)size;
-re->options = cd->external_options;
-re->flags = cd->external_flags;
-re->limit_match = limit_match;
-re->limit_recursion = limit_recursion;
-re->first_char = 0;
-re->req_char = 0;
-re->name_table_offset = sizeof(REAL_PCRE) / sizeof(pcre_uchar);
-re->name_entry_size = cd->name_entry_size;
-re->name_count = cd->names_found;
-re->ref_count = 0;
-re->tables = (tables == PRIV(default_tables))? NULL : tables;
-re->nullpad = NULL;
-#ifdef COMPILE_PCRE32
-re->dummy = 0;
-#else
-re->dummy1 = re->dummy2 = re->dummy3 = 0;
-#endif
-
-/* The starting points of the name/number translation table and of the code are
-passed around in the compile data block. The start/end pattern and initial
-options are already set from the pre-compile phase, as is the name_entry_size
-field. Reset the bracket count and the names_found field. Also reset the hwm
-field; this time it's used for remembering forward references to subpatterns.
-*/
-
-cd->final_bracount = cd->bracount; /* Save for checking forward references */
-cd->parens_depth = 0;
-cd->assert_depth = 0;
-cd->bracount = 0;
-cd->max_lookbehind = 0;
-cd->name_table = (pcre_uchar *)re + re->name_table_offset;
-codestart = cd->name_table + re->name_entry_size * re->name_count;
-cd->start_code = codestart;
-cd->hwm = (pcre_uchar *)(cd->start_workspace);
-cd->req_varyopt = 0;
-cd->had_accept = FALSE;
-cd->had_pruneorskip = FALSE;
-cd->check_lookbehind = FALSE;
-cd->open_caps = NULL;
-
-/* If any named groups were found, create the name/number table from the list
-created in the first pass. */
-
-if (cd->names_found > 0)
- {
- int i = cd->names_found;
- named_group *ng = cd->named_groups;
- cd->names_found = 0;
- for (; i > 0; i--, ng++)
- add_name(cd, ng->name, ng->length, ng->number);
- if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
- (PUBL(free))((void *)cd->named_groups);
- }
-
-/* Set up a starting, non-extracting bracket, then compile the expression. On
-error, errorcode will be set non-zero, so we don't need to look at the result
-of the function here. */
-
-ptr = (const pcre_uchar *)pattern + skipatstart;
-code = (pcre_uchar *)codestart;
-*code = OP_BRA;
-(void)compile_regex(re->options, &code, &ptr, &errorcode, FALSE, FALSE, 0, 0,
- &firstchar, &firstcharflags, &reqchar, &reqcharflags, NULL, cd, NULL);
-re->top_bracket = cd->bracount;
-re->top_backref = cd->top_backref;
-re->max_lookbehind = cd->max_lookbehind;
-re->flags = cd->external_flags | PCRE_MODE;
-
-if (cd->had_accept)
- {
- reqchar = 0; /* Must disable after (*ACCEPT) */
- reqcharflags = REQ_NONE;
- }
-
-/* If not reached end of pattern on success, there's an excess bracket. */
-
-if (errorcode == 0 && *ptr != CHAR_NULL) errorcode = ERR22;
-
-/* Fill in the terminating state and check for disastrous overflow, but
-if debugging, leave the test till after things are printed out. */
-
-*code++ = OP_END;
-
-#ifndef PCRE_DEBUG
-if (code - codestart > length) errorcode = ERR23;
-#endif
-
-#ifdef SUPPORT_VALGRIND
-/* If the estimated length exceeds the really used length, mark the extra
-allocated memory as unaddressable, so that any out-of-bound reads can be
-detected. */
-VALGRIND_MAKE_MEM_NOACCESS(code, (length - (code - codestart)) * sizeof(pcre_uchar));
-#endif
-
-/* Fill in any forward references that are required. There may be repeated
-references; optimize for them, as searching a large regex takes time. */
-
-if (cd->hwm > cd->start_workspace)
- {
- int prev_recno = -1;
- const pcre_uchar *groupptr = NULL;
- while (errorcode == 0 && cd->hwm > cd->start_workspace)
- {
- int offset, recno;
- cd->hwm -= LINK_SIZE;
- offset = GET(cd->hwm, 0);
- recno = GET(codestart, offset);
- if (recno != prev_recno)
- {
- groupptr = PRIV(find_bracket)(codestart, utf, recno);
- prev_recno = recno;
- }
- if (groupptr == NULL) errorcode = ERR53;
- else PUT(((pcre_uchar *)codestart), offset, (int)(groupptr - codestart));
- }
- }
-
-/* If the workspace had to be expanded, free the new memory. Set the pointer to
-NULL to indicate that forward references have been filled in. */
-
-if (cd->workspace_size > COMPILE_WORK_SIZE)
- (PUBL(free))((void *)cd->start_workspace);
-cd->start_workspace = NULL;
-
-/* Give an error if there's back reference to a non-existent capturing
-subpattern. */
-
-if (errorcode == 0 && re->top_backref > re->top_bracket) errorcode = ERR15;
-
-/* Unless disabled, check whether single character iterators can be
-auto-possessified. The function overwrites the appropriate opcode values. */
-
-if ((options & PCRE_NO_AUTO_POSSESS) == 0)
- auto_possessify((pcre_uchar *)codestart, utf, cd);
-
-/* If there were any lookbehind assertions that contained OP_RECURSE
-(recursions or subroutine calls), a flag is set for them to be checked here,
-because they may contain forward references. Actual recursions cannot be fixed
-length, but subroutine calls can. It is done like this so that those without
-OP_RECURSE that are not fixed length get a diagnosic with a useful offset. The
-exceptional ones forgo this. We scan the pattern to check that they are fixed
-length, and set their lengths. */
-
-if (cd->check_lookbehind)
- {
- pcre_uchar *cc = (pcre_uchar *)codestart;
-
- /* Loop, searching for OP_REVERSE items, and process those that do not have
- their length set. (Actually, it will also re-process any that have a length
- of zero, but that is a pathological case, and it does no harm.) When we find
- one, we temporarily terminate the branch it is in while we scan it. */
-
- for (cc = (pcre_uchar *)PRIV(find_bracket)(codestart, utf, -1);
- cc != NULL;
- cc = (pcre_uchar *)PRIV(find_bracket)(cc, utf, -1))
- {
- if (GET(cc, 1) == 0)
- {
- int fixed_length;
- pcre_uchar *be = cc - 1 - LINK_SIZE + GET(cc, -LINK_SIZE);
- int end_op = *be;
- *be = OP_END;
- fixed_length = find_fixedlength(cc, (re->options & PCRE_UTF8) != 0, TRUE,
- cd);
- *be = end_op;
- DPRINTF(("fixed length = %d\n", fixed_length));
- if (fixed_length < 0)
- {
- errorcode = (fixed_length == -2)? ERR36 :
- (fixed_length == -4)? ERR70 : ERR25;
- break;
- }
- if (fixed_length > cd->max_lookbehind) cd->max_lookbehind = fixed_length;
- PUT(cc, 1, fixed_length);
- }
- cc += 1 + LINK_SIZE;
- }
- }
-
-/* Failed to compile, or error while post-processing */
-
-if (errorcode != 0)
- {
- (PUBL(free))(re);
- PCRE_EARLY_ERROR_RETURN:
- *erroroffset = (int)(ptr - (const pcre_uchar *)pattern);
- PCRE_EARLY_ERROR_RETURN2:
- *errorptr = find_error_text(errorcode);
- if (errorcodeptr != NULL) *errorcodeptr = errorcode;
- return NULL;
- }
-
-/* If the anchored option was not passed, set the flag if we can determine that
-the pattern is anchored by virtue of ^ characters or \A or anything else, such
-as starting with non-atomic .* when DOTALL is set and there are no occurrences
-of *PRUNE or *SKIP.
-
-Otherwise, if we know what the first byte has to be, save it, because that
-speeds up unanchored matches no end. If not, see if we can set the
-PCRE_STARTLINE flag. This is helpful for multiline matches when all branches
-start with ^. and also when all branches start with non-atomic .* for
-non-DOTALL matches when *PRUNE and SKIP are not present. */
-
-if ((re->options & PCRE_ANCHORED) == 0)
- {
- if (is_anchored(codestart, 0, cd, 0)) re->options |= PCRE_ANCHORED;
- else
- {
- if (firstcharflags < 0)
- firstchar = find_firstassertedchar(codestart, &firstcharflags, FALSE);
- if (firstcharflags >= 0) /* Remove caseless flag for non-caseable chars */
- {
-#if defined COMPILE_PCRE8
- re->first_char = firstchar & 0xff;
-#elif defined COMPILE_PCRE16
- re->first_char = firstchar & 0xffff;
-#elif defined COMPILE_PCRE32
- re->first_char = firstchar;
-#endif
- if ((firstcharflags & REQ_CASELESS) != 0)
- {
-#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)
- /* We ignore non-ASCII first chars in 8 bit mode. */
- if (utf)
- {
- if (re->first_char < 128)
- {
- if (cd->fcc[re->first_char] != re->first_char)
- re->flags |= PCRE_FCH_CASELESS;
- }
- else if (UCD_OTHERCASE(re->first_char) != re->first_char)
- re->flags |= PCRE_FCH_CASELESS;
- }
- else
-#endif
- if (MAX_255(re->first_char)
- && cd->fcc[re->first_char] != re->first_char)
- re->flags |= PCRE_FCH_CASELESS;
- }
-
- re->flags |= PCRE_FIRSTSET;
- }
-
- else if (is_startline(codestart, 0, cd, 0)) re->flags |= PCRE_STARTLINE;
- }
- }
-
-/* For an anchored pattern, we use the "required byte" only if it follows a
-variable length item in the regex. Remove the caseless flag for non-caseable
-bytes. */
-
-if (reqcharflags >= 0 &&
- ((re->options & PCRE_ANCHORED) == 0 || (reqcharflags & REQ_VARY) != 0))
- {
-#if defined COMPILE_PCRE8
- re->req_char = reqchar & 0xff;
-#elif defined COMPILE_PCRE16
- re->req_char = reqchar & 0xffff;
-#elif defined COMPILE_PCRE32
- re->req_char = reqchar;
-#endif
- if ((reqcharflags & REQ_CASELESS) != 0)
- {
-#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)
- /* We ignore non-ASCII first chars in 8 bit mode. */
- if (utf)
- {
- if (re->req_char < 128)
- {
- if (cd->fcc[re->req_char] != re->req_char)
- re->flags |= PCRE_RCH_CASELESS;
- }
- else if (UCD_OTHERCASE(re->req_char) != re->req_char)
- re->flags |= PCRE_RCH_CASELESS;
- }
- else
-#endif
- if (MAX_255(re->req_char) && cd->fcc[re->req_char] != re->req_char)
- re->flags |= PCRE_RCH_CASELESS;
- }
-
- re->flags |= PCRE_REQCHSET;
- }
-
-/* Print out the compiled data if debugging is enabled. This is never the
-case when building a production library. */
-
-#ifdef PCRE_DEBUG
-printf("Length = %d top_bracket = %d top_backref = %d\n",
- length, re->top_bracket, re->top_backref);
-
-printf("Options=%08x\n", re->options);
-
-if ((re->flags & PCRE_FIRSTSET) != 0)
- {
- pcre_uchar ch = re->first_char;
- const char *caseless =
- ((re->flags & PCRE_FCH_CASELESS) == 0)? "" : " (caseless)";
- if (PRINTABLE(ch)) printf("First char = %c%s\n", ch, caseless);
- else printf("First char = \\x%02x%s\n", ch, caseless);
- }
-
-if ((re->flags & PCRE_REQCHSET) != 0)
- {
- pcre_uchar ch = re->req_char;
- const char *caseless =
- ((re->flags & PCRE_RCH_CASELESS) == 0)? "" : " (caseless)";
- if (PRINTABLE(ch)) printf("Req char = %c%s\n", ch, caseless);
- else printf("Req char = \\x%02x%s\n", ch, caseless);
- }
-
-#if defined COMPILE_PCRE8
-pcre_printint((pcre *)re, stdout, TRUE);
-#elif defined COMPILE_PCRE16
-pcre16_printint((pcre *)re, stdout, TRUE);
-#elif defined COMPILE_PCRE32
-pcre32_printint((pcre *)re, stdout, TRUE);
-#endif
-
-/* This check is done here in the debugging case so that the code that
-was compiled can be seen. */
-
-if (code - codestart > length)
- {
- (PUBL(free))(re);
- *errorptr = find_error_text(ERR23);
- *erroroffset = ptr - (pcre_uchar *)pattern;
- if (errorcodeptr != NULL) *errorcodeptr = ERR23;
- return NULL;
- }
-#endif /* PCRE_DEBUG */
-
-/* Check for a pattern than can match an empty string, so that this information
-can be provided to applications. */
-
-do
- {
- if (could_be_empty_branch(codestart, code, utf, cd, NULL))
- {
- re->flags |= PCRE_MATCH_EMPTY;
- break;
- }
- codestart += GET(codestart, 1);
- }
-while (*codestart == OP_ALT);
-
-#if defined COMPILE_PCRE8
-return (pcre *)re;
-#elif defined COMPILE_PCRE16
-return (pcre16 *)re;
-#elif defined COMPILE_PCRE32
-return (pcre32 *)re;
-#endif
-}
-
-/* End of pcre_compile.c */
-
diff --git a/.pc/Fix-silly-quantifier-size-check.patch/testdata/testoutput2 b/.pc/Fix-silly-quantifier-size-check.patch/testdata/testoutput2
deleted file mode 100644
index b6da7df..0000000
--- a/.pc/Fix-silly-quantifier-size-check.patch/testdata/testoutput2
+++ /dev/null
@@ -1,14152 +0,0 @@
-/-- This set of tests is not Perl-compatible. It checks on special features
- of PCRE's API, error diagnostics, and the compiled code of some patterns.
- It also checks the non-Perl syntax the PCRE supports (Python, .NET,
- Oniguruma). Finally, there are some tests where PCRE and Perl differ,
- either because PCRE can't be compatible, or there is a possible Perl
- bug.
-
- NOTE: This is a non-UTF set of tests. When UTF support is needed, use
- test 5, and if Unicode Property Support is needed, use test 7. --/
-
-< forbid 8W
-
-/(a)b|/I
-Capturing subpattern count = 1
-May match empty string
-No options
-No first char
-No need char
-
-/abc/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
- abc
- 0: abc
- defabc
- 0: abc
- \Aabc
- 0: abc
- *** Failers
-No match
- \Adefabc
-No match
- ABC
-No match
-
-/^abc/I
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
- abc
- 0: abc
- \Aabc
- 0: abc
- *** Failers
-No match
- defabc
-No match
- \Adefabc
-No match
-
-/a+bc/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-
-/a*bc/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'c'
-
-/a{3}bc/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-
-/(abc|a+z)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/^abc$/I
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
- abc
- 0: abc
- *** Failers
-No match
- def\nabc
-No match
-
-/ab\idef/X
-Failed: unrecognized character follows \ at offset 3
-
-/(?X)ab\idef/X
-Failed: unrecognized character follows \ at offset 7
-
-/x{5,4}/
-Failed: numbers out of order in {} quantifier at offset 5
-
-/z{65536}/
-Failed: number too big in {} quantifier at offset 7
-
-/[abcd/
-Failed: missing terminating ] for character class at offset 5
-
-/(?X)[\B]/
-Failed: invalid escape sequence in character class at offset 6
-
-/(?X)[\R]/
-Failed: invalid escape sequence in character class at offset 6
-
-/(?X)[\X]/
-Failed: invalid escape sequence in character class at offset 6
-
-/[\B]/BZ
-------------------------------------------------------------------
- Bra
- B
- Ket
- End
-------------------------------------------------------------------
-
-/[\R]/BZ
-------------------------------------------------------------------
- Bra
- R
- Ket
- End
-------------------------------------------------------------------
-
-/[\X]/BZ
-------------------------------------------------------------------
- Bra
- X
- Ket
- End
-------------------------------------------------------------------
-
-/[z-a]/
-Failed: range out of order in character class at offset 3
-
-/^*/
-Failed: nothing to repeat at offset 1
-
-/(abc/
-Failed: missing ) at offset 4
-
-/(?# abc/
-Failed: missing ) after comment at offset 7
-
-/(?z)abc/
-Failed: unrecognized character after (? or (?- at offset 2
-
-/.*b/I
-Capturing subpattern count = 0
-No options
-First char at start or follows newline
-Need char = 'b'
-
-/.*?b/I
-Capturing subpattern count = 0
-No options
-First char at start or follows newline
-Need char = 'b'
-
-/cat|dog|elephant/I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
- this sentence eventually mentions a cat
- 0: cat
- this sentences rambles on and on for a while and then reaches elephant
- 0: elephant
-
-/cat|dog|elephant/IS
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-Subject length lower bound = 3
-Starting chars: c d e
- this sentence eventually mentions a cat
- 0: cat
- this sentences rambles on and on for a while and then reaches elephant
- 0: elephant
-
-/cat|dog|elephant/IiS
-Capturing subpattern count = 0
-Options: caseless
-No first char
-No need char
-Subject length lower bound = 3
-Starting chars: C D E c d e
- this sentence eventually mentions a CAT cat
- 0: CAT
- this sentences rambles on and on for a while to elephant ElePhant
- 0: elephant
-
-/a|[bcd]/IS
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b c d
-
-/(a|[^\dZ])/IS
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: \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 ! " # $ % & ' ( ) * + , - . / : ; < = >
- ? @ 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 [ \ ] ^ _ ` 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 { | } ~ \x7f \x80 \x81 \x82 \x83
- \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92
- \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1
- \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0
- \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf
- \xc0 \xc1 \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
-
-/(a|b)*[\s]/IS
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 a b
-
-/(ab\2)/
-Failed: reference to non-existent subpattern at offset 6
-
-/{4,5}abc/
-Failed: nothing to repeat at offset 4
-
-/(a)(b)(c)\2/I
-Capturing subpattern count = 3
-Max back reference = 2
-No options
-First char = 'a'
-Need char = 'c'
- abcb
- 0: abcb
- 1: a
- 2: b
- 3: c
- \O0abcb
-Matched, but too many substrings
- \O3abcb
-Matched, but too many substrings
- 0: abcb
- \O6abcb
-Matched, but too many substrings
- 0: abcb
- 1: a
- \O9abcb
-Matched, but too many substrings
- 0: abcb
- 1: a
- 2: b
- \O12abcb
- 0: abcb
- 1: a
- 2: b
- 3: c
-
-/(a)bc|(a)(b)\2/I
-Capturing subpattern count = 3
-Max back reference = 2
-No options
-First char = 'a'
-No need char
- abc
- 0: abc
- 1: a
- \O0abc
-Matched, but too many substrings
- \O3abc
-Matched, but too many substrings
- 0: abc
- \O6abc
- 0: abc
- 1: a
- aba
- 0: aba
- 1: <unset>
- 2: a
- 3: b
- \O0aba
-Matched, but too many substrings
- \O3aba
-Matched, but too many substrings
- 0: aba
- \O6aba
-Matched, but too many substrings
- 0: aba
- 1: <unset>
- \O9aba
-Matched, but too many substrings
- 0: aba
- 1: <unset>
- 2: a
- \O12aba
- 0: aba
- 1: <unset>
- 2: a
- 3: b
-
-/abc$/IE
-Capturing subpattern count = 0
-Options: dollar_endonly
-First char = 'a'
-Need char = 'c'
- abc
- 0: abc
- *** Failers
-No match
- abc\n
-No match
- abc\ndef
-No match
-
-/(a)(b)(c)(d)(e)\6/
-Failed: reference to non-existent subpattern at offset 17
-
-/the quick brown fox/I
-Capturing subpattern count = 0
-No options
-First char = 't'
-Need char = 'x'
- the quick brown fox
- 0: the quick brown fox
- this is a line with the quick brown fox
- 0: the quick brown fox
-
-/the quick brown fox/IA
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
- the quick brown fox
- 0: the quick brown fox
- *** Failers
-No match
- this is a line with the quick brown fox
-No match
-
-/ab(?z)cd/
-Failed: unrecognized character after (? or (?- at offset 4
-
-/^abc|def/I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
- abcdef
- 0: abc
- abcdef\B
- 0: def
-
-/.*((abc)$|(def))/I
-Capturing subpattern count = 3
-No options
-First char at start or follows newline
-No need char
- defabc
- 0: defabc
- 1: abc
- 2: abc
- \Zdefabc
- 0: def
- 1: def
- 2: <unset>
- 3: def
-
-/)/
-Failed: unmatched parentheses at offset 0
-
-/a[]b/
-Failed: missing terminating ] for character class at offset 4
-
-/[^aeiou ]{3,}/I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
- co-processors, and for
- 0: -pr
-
-/<.*>/I
-Capturing subpattern count = 0
-No options
-First char = '<'
-Need char = '>'
- abc<def>ghi<klm>nop
- 0: <def>ghi<klm>
-
-/<.*?>/I
-Capturing subpattern count = 0
-No options
-First char = '<'
-Need char = '>'
- abc<def>ghi<klm>nop
- 0: <def>
-
-/<.*>/IU
-Capturing subpattern count = 0
-Options: ungreedy
-First char = '<'
-Need char = '>'
- abc<def>ghi<klm>nop
- 0: <def>
-
-/(?U)<.*>/I
-Capturing subpattern count = 0
-Options: ungreedy
-First char = '<'
-Need char = '>'
- abc<def>ghi<klm>nop
- 0: <def>
-
-/<.*?>/IU
-Capturing subpattern count = 0
-Options: ungreedy
-First char = '<'
-Need char = '>'
- abc<def>ghi<klm>nop
- 0: <def>ghi<klm>
-
-/={3,}/IU
-Capturing subpattern count = 0
-Options: ungreedy
-First char = '='
-Need char = '='
- abc========def
- 0: ===
-
-/(?U)={3,}?/I
-Capturing subpattern count = 0
-Options: ungreedy
-First char = '='
-Need char = '='
- abc========def
- 0: ========
-
-/(?<!bar|cattle)foo/I
-Capturing subpattern count = 0
-Max lookbehind = 6
-No options
-First char = 'f'
-Need char = 'o'
- foo
- 0: foo
- catfoo
- 0: foo
- *** Failers
-No match
- the barfoo
-No match
- and cattlefoo
-No match
-
-/(?<=a+)b/
-Failed: lookbehind assertion is not fixed length at offset 6
-
-/(?<=aaa|b{0,3})b/
-Failed: lookbehind assertion is not fixed length at offset 14
-
-/(?<!(foo)a\1)bar/
-Failed: lookbehind assertion is not fixed length at offset 12
-
-/(?i)abc/I
-Capturing subpattern count = 0
-Options: caseless
-First char = 'a' (caseless)
-Need char = 'c' (caseless)
-
-/(a|(?m)a)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/(?i)^1234/I
-Capturing subpattern count = 0
-Options: anchored caseless
-No first char
-No need char
-
-/(^b|(?i)^d)/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
-
-/(?s).*/I
-Capturing subpattern count = 0
-May match empty string
-Options: anchored dotall
-No first char
-No need char
-
-/[abcd]/IS
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b c d
-
-/(?i)[abcd]/IS
-Capturing subpattern count = 0
-Options: caseless
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: A B C D a b c d
-
-/(?m)[xy]|(b|c)/IS
-Capturing subpattern count = 1
-Options: multiline
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: b c x y
-
-/(^a|^b)/Im
-Capturing subpattern count = 1
-Options: multiline
-First char at start or follows newline
-No need char
-
-/(?i)(^a|^b)/Im
-Capturing subpattern count = 1
-Options: caseless multiline
-First char at start or follows newline
-No need char
-
-/(a)(?(1)a|b|c)/
-Failed: conditional group contains more than two branches at offset 13
-
-/(?(?=a)a|b|c)/
-Failed: conditional group contains more than two branches at offset 12
-
-/(?(1a)/
-Failed: malformed number or name after (?( at offset 4
-
-/(?(1a))/
-Failed: malformed number or name after (?( at offset 4
-
-/(?(?i))/
-Failed: assertion expected after (?( at offset 3
-
-/(?(abc))/
-Failed: reference to non-existent subpattern at offset 7
-
-/(?(?<ab))/
-Failed: syntax error in subpattern name (missing terminator) at offset 7
-
-/((?s)blah)\s+\1/I
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-First char = 'b'
-Need char = 'h'
-
-/((?i)blah)\s+\1/I
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-First char = 'b' (caseless)
-Need char = 'h' (caseless)
-
-/((?i)b)/IDZS
-------------------------------------------------------------------
- Bra
- CBra 1
- /i b
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-No options
-First char = 'b' (caseless)
-No need char
-Subject length lower bound = 1
-No starting char list
-
-/(a*b|(?i:c*(?-i)d))/IS
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: C a b c d
-
-/a$/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
- a
- 0: a
- a\n
- 0: a
- *** Failers
-No match
- \Za
-No match
- \Za\n
-No match
-
-/a$/Im
-Capturing subpattern count = 0
-Options: multiline
-First char = 'a'
-No need char
- a
- 0: a
- a\n
- 0: a
- \Za\n
- 0: a
- *** Failers
-No match
- \Za
-No match
-
-/\Aabc/Im
-Capturing subpattern count = 0
-Max lookbehind = 1
-Options: anchored multiline
-No first char
-No need char
-
-/^abc/Im
-Capturing subpattern count = 0
-Options: multiline
-First char at start or follows newline
-Need char = 'c'
-
-/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
-Capturing subpattern count = 5
-Options: anchored
-No first char
-No need char
- aaaaabbbbbcccccdef
- 0: aaaaabbbbbcccccdef
- 1: aaaaabbbbbcccccdef
- 2: aaaaa
- 3: b
- 4: bbbbccccc
- 5: def
-
-/(?<=foo)[ab]/IS
-Capturing subpattern count = 0
-Max lookbehind = 3
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b
-
-/(?<!foo)(alpha|omega)/IS
-Capturing subpattern count = 1
-Max lookbehind = 3
-No options
-No first char
-Need char = 'a'
-Subject length lower bound = 5
-Starting chars: a o
-
-/(?!alphabet)[ab]/IS
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b
-
-/(?<=foo\n)^bar/Im
-Capturing subpattern count = 0
-Max lookbehind = 4
-Contains explicit CR or LF match
-Options: multiline
-No first char
-Need char = 'r'
- foo\nbarbar
- 0: bar
- ***Failers
-No match
- rhubarb
-No match
- barbell
-No match
- abc\nbarton
-No match
-
-/^(?<=foo\n)bar/Im
-Capturing subpattern count = 0
-Max lookbehind = 4
-Contains explicit CR or LF match
-Options: multiline
-First char at start or follows newline
-Need char = 'r'
- foo\nbarbar
- 0: bar
- ***Failers
-No match
- rhubarb
-No match
- barbell
-No match
- abc\nbarton
-No match
-
-/(?>^abc)/Im
-Capturing subpattern count = 0
-Options: multiline
-First char at start or follows newline
-Need char = 'c'
- abc
- 0: abc
- def\nabc
- 0: abc
- *** Failers
-No match
- defabc
-No match
-
-/(?<=ab(c+)d)ef/
-Failed: lookbehind assertion is not fixed length at offset 11
-
-/(?<=ab(?<=c+)d)ef/
-Failed: lookbehind assertion is not fixed length at offset 12
-
-/(?<=ab(c|de)f)g/
-Failed: lookbehind assertion is not fixed length at offset 13
-
-/The next three are in testinput2 because they have variable length branches/
-
-/(?<=bullock|donkey)-cart/I
-Capturing subpattern count = 0
-Max lookbehind = 7
-No options
-First char = '-'
-Need char = 't'
- the bullock-cart
- 0: -cart
- a donkey-cart race
- 0: -cart
- *** Failers
-No match
- cart
-No match
- horse-and-cart
-No match
-
-/(?<=ab(?i)x|y|z)/I
-Capturing subpattern count = 0
-Max lookbehind = 3
-May match empty string
-No options
-No first char
-No need char
-
-/(?>.*)(?<=(abcd)|(xyz))/I
-Capturing subpattern count = 2
-Max lookbehind = 4
-May match empty string
-No options
-No first char
-No need char
- alphabetabcd
- 0: alphabetabcd
- 1: abcd
- endingxyz
- 0: endingxyz
- 1: <unset>
- 2: xyz
-
-/(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
-Capturing subpattern count = 0
-Max lookbehind = 4
-No options
-First char = 'Z'
-Need char = 'Z'
- abxyZZ
- 0: ZZ
- abXyZZ
- 0: ZZ
- ZZZ
- 0: ZZ
- zZZ
- 0: ZZ
- bZZ
- 0: ZZ
- BZZ
- 0: ZZ
- *** Failers
-No match
- ZZ
-No match
- abXYZZ
-No match
- zzz
-No match
- bzz
-No match
-
-/(?<!(foo)a)bar/I
-Capturing subpattern count = 1
-Max lookbehind = 4
-No options
-First char = 'b'
-Need char = 'r'
- bar
- 0: bar
- foobbar
- 0: bar
- *** Failers
-No match
- fooabar
-No match
-
-/This one is here because Perl behaves differently; see also the following/I
-Capturing subpattern count = 0
-No options
-First char = 'T'
-Need char = 'g'
-
-/^(a\1?){4}$/I
-Capturing subpattern count = 1
-Max back reference = 1
-Options: anchored
-No first char
-No need char
- aaaa
-No match
- aaaaaa
-No match
-
-/Perl does not fail these two for the final subjects. Neither did PCRE until/
-/release 8.01. The problem is in backtracking into a subpattern that contains/
-No match
-/a recursive reference to itself. PCRE has now made these into atomic patterns./
-No match
-
-/^(xa|=?\1a){2}$/
- xa=xaa
- 0: xa=xaa
- 1: =xaa
- ** Failers
-No match
- xa=xaaa
-No match
-
-/^(xa|=?\1a)+$/
- xa=xaa
- 0: xa=xaa
- 1: =xaa
- ** Failers
-No match
- xa=xaaa
-No match
-
-/These are syntax tests from Perl 5.005/I
-Capturing subpattern count = 0
-No options
-First char = 'T'
-Need char = '5'
-
-/a[b-a]/
-Failed: range out of order in character class at offset 4
-
-/a[]b/
-Failed: missing terminating ] for character class at offset 4
-
-/a[/
-Failed: missing terminating ] for character class at offset 2
-
-/*a/
-Failed: nothing to repeat at offset 0
-
-/(*)b/
-Failed: nothing to repeat at offset 1
-
-/abc)/
-Failed: unmatched parentheses at offset 3
-
-/(abc/
-Failed: missing ) at offset 4
-
-/a**/
-Failed: nothing to repeat at offset 2
-
-/)(/
-Failed: unmatched parentheses at offset 0
-
-/\1/
-Failed: reference to non-existent subpattern at offset 2
-
-/\2/
-Failed: reference to non-existent subpattern at offset 2
-
-/(a)|\2/
-Failed: reference to non-existent subpattern at offset 6
-
-/a[b-a]/Ii
-Failed: range out of order in character class at offset 4
-
-/a[]b/Ii
-Failed: missing terminating ] for character class at offset 4
-
-/a[/Ii
-Failed: missing terminating ] for character class at offset 2
-
-/*a/Ii
-Failed: nothing to repeat at offset 0
-
-/(*)b/Ii
-Failed: nothing to repeat at offset 1
-
-/abc)/Ii
-Failed: unmatched parentheses at offset 3
-
-/(abc/Ii
-Failed: missing ) at offset 4
-
-/a**/Ii
-Failed: nothing to repeat at offset 2
-
-/)(/Ii
-Failed: unmatched parentheses at offset 0
-
-/:(?:/
-Failed: missing ) at offset 4
-
-/(?<%)b/
-Failed: unrecognized character after (?< at offset 3
-
-/a(?{)b/
-Failed: unrecognized character after (? or (?- at offset 3
-
-/a(?{{})b/
-Failed: unrecognized character after (? or (?- at offset 3
-
-/a(?{}})b/
-Failed: unrecognized character after (? or (?- at offset 3
-
-/a(?{"{"})b/
-Failed: unrecognized character after (? or (?- at offset 3
-
-/a(?{"{"}})b/
-Failed: unrecognized character after (? or (?- at offset 3
-
-/(?(1?)a|b)/
-Failed: malformed number or name after (?( at offset 4
-
-/[a[:xyz:/
-Failed: missing terminating ] for character class at offset 8
-
-/(?<=x+)y/
-Failed: lookbehind assertion is not fixed length at offset 6
-
-/a{37,17}/
-Failed: numbers out of order in {} quantifier at offset 7
-
-/abc/\
-Failed: \ at end of pattern at offset 4
-
-/abc/\i
-Failed: \ at end of pattern at offset 4
-
-/(a)bc(d)/I
-Capturing subpattern count = 2
-No options
-First char = 'a'
-Need char = 'd'
- abcd
- 0: abcd
- 1: a
- 2: d
- abcd\C2
- 0: abcd
- 1: a
- 2: d
- 2C d (1)
- abcd\C5
- 0: abcd
- 1: a
- 2: d
-copy substring 5 failed -7
-
-/(.{20})/I
-Capturing subpattern count = 1
-No options
-No first char
-No need char
- abcdefghijklmnopqrstuvwxyz
- 0: abcdefghijklmnopqrst
- 1: abcdefghijklmnopqrst
- abcdefghijklmnopqrstuvwxyz\C1
- 0: abcdefghijklmnopqrst
- 1: abcdefghijklmnopqrst
- 1C abcdefghijklmnopqrst (20)
- abcdefghijklmnopqrstuvwxyz\G1
- 0: abcdefghijklmnopqrst
- 1: abcdefghijklmnopqrst
- 1G abcdefghijklmnopqrst (20)
-
-/(.{15})/I
-Capturing subpattern count = 1
-No options
-No first char
-No need char
- abcdefghijklmnopqrstuvwxyz
- 0: abcdefghijklmno
- 1: abcdefghijklmno
- abcdefghijklmnopqrstuvwxyz\C1\G1
- 0: abcdefghijklmno
- 1: abcdefghijklmno
- 1C abcdefghijklmno (15)
- 1G abcdefghijklmno (15)
-
-/(.{16})/I
-Capturing subpattern count = 1
-No options
-No first char
-No need char
- abcdefghijklmnopqrstuvwxyz
- 0: abcdefghijklmnop
- 1: abcdefghijklmnop
- abcdefghijklmnopqrstuvwxyz\C1\G1\L
- 0: abcdefghijklmnop
- 1: abcdefghijklmnop
- 1C abcdefghijklmnop (16)
- 1G abcdefghijklmnop (16)
- 0L abcdefghijklmnop
- 1L abcdefghijklmnop
-
-/^(a|(bc))de(f)/I
-Capturing subpattern count = 3
-Options: anchored
-No first char
-No need char
- adef\G1\G2\G3\G4\L
- 0: adef
- 1: a
- 2: <unset>
- 3: f
- 1G a (1)
- 2G (0)
- 3G f (1)
-get substring 4 failed -7
- 0L adef
- 1L a
- 2L
- 3L f
- bcdef\G1\G2\G3\G4\L
- 0: bcdef
- 1: bc
- 2: bc
- 3: f
- 1G bc (2)
- 2G bc (2)
- 3G f (1)
-get substring 4 failed -7
- 0L bcdef
- 1L bc
- 2L bc
- 3L f
- adefghijk\C0
- 0: adef
- 1: a
- 2: <unset>
- 3: f
- 0C adef (4)
-
-/^abc\00def/I
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
- abc\00def\L\C0
- 0: abc\x00def
- 0C abc\x00def (7)
- 0L abc
-
-/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
-Contains explicit CR or LF match
-No options
-First char = 'w'
-Need char = 'd'
-
-/.*X/IDZ
-------------------------------------------------------------------
- Bra
- Any*
- X
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char at start or follows newline
-Need char = 'X'
-
-/.*X/IDZs
-------------------------------------------------------------------
- Bra
- AllAny*
- X
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored dotall
-No first char
-Need char = 'X'
-
-/(.*X|^B)/IDZ
-------------------------------------------------------------------
- Bra
- CBra 1
- Any*
- X
- Alt
- ^
- B
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-No options
-First char at start or follows newline
-No need char
-
-/(.*X|^B)/IDZs
-------------------------------------------------------------------
- Bra
- CBra 1
- AllAny*
- X
- Alt
- ^
- B
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Options: anchored dotall
-No first char
-No need char
-
-/(?s)(.*X|^B)/IDZ
-------------------------------------------------------------------
- Bra
- CBra 1
- AllAny*
- X
- Alt
- ^
- B
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Options: anchored dotall
-No first char
-No need char
-
-/(?s:.*X|^B)/IDZ
-------------------------------------------------------------------
- Bra
- Bra
- AllAny*
- X
- Alt
- ^
- B
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/\Biss\B/I+
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-First char = 'i'
-Need char = 's'
- Mississippi
- 0: iss
- 0+ issippi
-
-/iss/IG+
-Capturing subpattern count = 0
-No options
-First char = 'i'
-Need char = 's'
- Mississippi
- 0: iss
- 0+ issippi
- 0: iss
- 0+ ippi
-
-/\Biss\B/IG+
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-First char = 'i'
-Need char = 's'
- Mississippi
- 0: iss
- 0+ issippi
-
-/\Biss\B/Ig+
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-First char = 'i'
-Need char = 's'
- Mississippi
- 0: iss
- 0+ issippi
- 0: iss
- 0+ ippi
- *** Failers
-No match
- Mississippi\A
-No match
-
-/(?<=[Ms])iss/Ig+
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-First char = 'i'
-Need char = 's'
- Mississippi
- 0: iss
- 0+ issippi
- 0: iss
- 0+ ippi
-
-/(?<=[Ms])iss/IG+
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-First char = 'i'
-Need char = 's'
- Mississippi
- 0: iss
- 0+ issippi
-
-/^iss/Ig+
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
- ississippi
- 0: iss
- 0+ issippi
-
-/.*iss/Ig+
-Capturing subpattern count = 0
-No options
-First char at start or follows newline
-Need char = 's'
- abciss\nxyzisspqr
- 0: abciss
- 0+ \x0axyzisspqr
- 0: xyziss
- 0+ pqr
-
-/.i./I+g
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'i'
- Mississippi
- 0: Mis
- 0+ sissippi
- 0: sis
- 0+ sippi
- 0: sip
- 0+ pi
- Mississippi\A
- 0: Mis
- 0+ sissippi
- 0: sis
- 0+ sippi
- 0: sip
- 0+ pi
- Missouri river
- 0: Mis
- 0+ souri river
- 0: ri
- 0+ river
- 0: riv
- 0+ er
- Missouri river\A
- 0: Mis
- 0+ souri river
-
-/^.is/I+g
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
- Mississippi
- 0: Mis
- 0+ sissippi
-
-/^ab\n/Ig+
-Capturing subpattern count = 0
-Contains explicit CR or LF match
-Options: anchored
-No first char
-No need char
- ab\nab\ncd
- 0: ab\x0a
- 0+ ab\x0acd
-
-/^ab\n/Img+
-Capturing subpattern count = 0
-Contains explicit CR or LF match
-Options: multiline
-First char at start or follows newline
-Need char = \x0a
- ab\nab\ncd
- 0: ab\x0a
- 0+ ab\x0acd
- 0: ab\x0a
- 0+ cd
-
-/abc/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-
-/abc|bac/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'c'
-
-/(abc|bac)/I
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'c'
-
-/(abc|(c|dc))/I
-Capturing subpattern count = 2
-No options
-No first char
-Need char = 'c'
-
-/(abc|(d|de)c)/I
-Capturing subpattern count = 2
-No options
-No first char
-Need char = 'c'
-
-/a*/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
-
-/a+/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/(baa|a+)/I
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'a'
-
-/a{0,3}/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
-
-/baa{3,}/I
-Capturing subpattern count = 0
-No options
-First char = 'b'
-Need char = 'a'
-
-/"([^\\"]+|\\.)*"/I
-Capturing subpattern count = 1
-No options
-First char = '"'
-Need char = '"'
-
-/(abc|ab[cd])/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/(a|.)/I
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-
-/a|ba|\w/I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/abc(?=pqr)/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'r'
-
-/...(?<=abc)/I
-Capturing subpattern count = 0
-Max lookbehind = 3
-No options
-No first char
-No need char
-
-/abc(?!pqr)/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-
-/ab./I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/ab[xyz]/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/abc*/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/ab.c*/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/a.c*/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/.c*/I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/ac*/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/(a.c*|b.c*)/I
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-
-/a.c*|aba/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/.+a/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'a'
-
-/(?=abcda)a.*/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'a'
-
-/(?=a)a.*/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/a(b)*/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/a\d*/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/ab\d*/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/a(\d)*/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/abcde{0,0}/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'd'
-
-/ab\d+/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/a(?(1)b)(.)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/a(?(1)bag|big)(.)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'g'
-
-/a(?(1)bag|big)*(.)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/a(?(1)bag|big)+(.)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'g'
-
-/a(?(1)b..|b..)(.)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'b'
-
-/ab\d{0}e/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'e'
-
-/a?b?/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- a
- 0: a
- b
- 0: b
- ab
- 0: ab
- \
- 0:
- *** Failers
- 0:
- \N
-No match
-
-/|-/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- abcd
- 0:
- -abc
- 0:
- \Nab-c
- 0: -
- *** Failers
- 0:
- \Nabc
-No match
-
-/^.?abcd/IS
-Capturing subpattern count = 0
-Options: anchored
-No first char
-Need char = 'd'
-Subject length lower bound = 4
-No starting char list
-
-/\( # ( at start
- (?: # Non-capturing bracket
- (?>[^()]+) # Either a sequence of non-brackets (no backtracking)
- | # Or
- (?R) # Recurse - i.e. nested bracketed string
- )* # Zero or more contents
- \) # Closing )
- /Ix
-Capturing subpattern count = 0
-Options: extended
-First char = '('
-Need char = ')'
- (abcd)
- 0: (abcd)
- (abcd)xyz
- 0: (abcd)
- xyz(abcd)
- 0: (abcd)
- (ab(xy)cd)pqr
- 0: (ab(xy)cd)
- (ab(xycd)pqr
- 0: (xycd)
- () abc ()
- 0: ()
- 12(abcde(fsh)xyz(foo(bar))lmno)89
- 0: (abcde(fsh)xyz(foo(bar))lmno)
- *** Failers
-No match
- abcd
-No match
- abcd)
-No match
- (abcd
-No match
-
-/\( ( (?>[^()]+) | (?R) )* \) /Ixg
-Capturing subpattern count = 1
-Options: extended
-First char = '('
-Need char = ')'
- (ab(xy)cd)pqr
- 0: (ab(xy)cd)
- 1: cd
- 1(abcd)(x(y)z)pqr
- 0: (abcd)
- 1: abcd
- 0: (x(y)z)
- 1: z
-
-/\( (?: (?>[^()]+) | (?R) ) \) /Ix
-Capturing subpattern count = 0
-Options: extended
-First char = '('
-Need char = ')'
- (abcd)
- 0: (abcd)
- (ab(xy)cd)
- 0: (xy)
- (a(b(c)d)e)
- 0: (c)
- ((ab))
- 0: ((ab))
- *** Failers
-No match
- ()
-No match
-
-/\( (?: (?>[^()]+) | (?R) )? \) /Ix
-Capturing subpattern count = 0
-Options: extended
-First char = '('
-Need char = ')'
- ()
- 0: ()
- 12(abcde(fsh)xyz(foo(bar))lmno)89
- 0: (fsh)
-
-/\( ( (?>[^()]+) | (?R) )* \) /Ix
-Capturing subpattern count = 1
-Options: extended
-First char = '('
-Need char = ')'
- (ab(xy)cd)
- 0: (ab(xy)cd)
- 1: cd
-
-/\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
-Capturing subpattern count = 2
-Options: extended
-First char = '('
-Need char = ')'
- (ab(xy)cd)
- 0: (ab(xy)cd)
- 1: ab(xy)cd
- 2: cd
-
-/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
-Capturing subpattern count = 3
-Options: extended
-First char = '('
-Need char = ')'
- (ab(xy)cd)
- 0: (ab(xy)cd)
- 1: <unset>
- 2: ab(xy)cd
- 3: cd
- (123ab(xy)cd)
- 0: (123ab(xy)cd)
- 1: 123
- 2: ab(xy)cd
- 3: cd
-
-/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
-Capturing subpattern count = 3
-Options: extended
-First char = '('
-Need char = ')'
- (ab(xy)cd)
- 0: (ab(xy)cd)
- 1: ab(xy)cd
- 2: <unset>
- 3: cd
- (123ab(xy)cd)
- 0: (123ab(xy)cd)
- 1: 123ab(xy)cd
- 2: 123
- 3: cd
-
-/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
-Capturing subpattern count = 11
-Options: extended
-First char = '('
-Need char = ')'
- (ab(xy)cd)
- 0: (ab(xy)cd)
- 1: ab(xy)cd
- 2: ab(xy)cd
- 3: ab(xy)cd
- 4: ab(xy)cd
- 5: ab(xy)cd
- 6: ab(xy)cd
- 7: ab(xy)cd
- 8: ab(xy)cd
- 9: ab(xy)cd
-10: ab(xy)cd
-11: cd
-
-/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
-Capturing subpattern count = 3
-Options: extended
-First char = '('
-Need char = ')'
- (abcd(xyz<p>qrs)123)
- 0: (abcd(xyz<p>qrs)123)
- 1: abcd(xyz<p>qrs)123
- 2: 123
-
-/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
-Capturing subpattern count = 3
-Options: extended
-First char = '('
-Need char = ')'
- (ab(cd)ef)
- 0: (ab(cd)ef)
- 1: ab(cd)ef
- 2: ef
- 3: (cd)
- (ab(cd(ef)gh)ij)
- 0: (ab(cd(ef)gh)ij)
- 1: ab(cd(ef)gh)ij
- 2: ij
- 3: (cd(ef)gh)
-
-/^[[:alnum:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [0-9A-Za-z]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:^alnum:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x00-/:-@[-`{-\xff] (neg)
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:alpha:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [A-Za-z]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:^alpha:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x00-@[-`{-\xff] (neg)
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/[_[:alpha:]]/IS
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: 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
-
-/^[[:ascii:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x00-\x7f]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:^ascii:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x80-\xff] (neg)
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:blank:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x09 ]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:^blank:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x00-\x08\x0a-\x1f!-\xff] (neg)
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/[\n\x0b\x0c\x0d[:blank:]]/IS
-Capturing subpattern count = 0
-Contains explicit CR or LF match
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: \x09 \x0a \x0b \x0c \x0d \x20
-
-/^[[:cntrl:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x00-\x1f\x7f]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:digit:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [0-9]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:graph:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [!-~]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:lower:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [a-z]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:print:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [ -~]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:punct:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [!-/:-@[-`{-~]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:space:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x09-\x0d ]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:upper:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [A-Z]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:xdigit:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [0-9A-Fa-f]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:word:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [0-9A-Z_a-z]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:^cntrl:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [ -~\x80-\xff] (neg)
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[12[:^digit:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x00-/12:-\xff] (neg)
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/^[[:^blank:]]/DZ
-------------------------------------------------------------------
- Bra
- ^
- [\x00-\x08\x0a-\x1f!-\xff] (neg)
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/[01[:alpha:]%]/DZ
-------------------------------------------------------------------
- Bra
- [%01A-Za-z]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/[[.ch.]]/I
-Failed: POSIX collating elements are not supported at offset 1
-
-/[[=ch=]]/I
-Failed: POSIX collating elements are not supported at offset 1
-
-/[[:rhubarb:]]/I
-Failed: unknown POSIX class name at offset 3
-
-/[[:upper:]]/Ii
-Capturing subpattern count = 0
-Options: caseless
-No first char
-No need char
- A
- 0: A
- a
- 0: a
-
-/[[:lower:]]/Ii
-Capturing subpattern count = 0
-Options: caseless
-No first char
-No need char
- A
- 0: A
- a
- 0: a
-
-/((?-i)[[:lower:]])[[:lower:]]/Ii
-Capturing subpattern count = 1
-Options: caseless
-No first char
-No need char
- ab
- 0: ab
- 1: a
- aB
- 0: aB
- 1: a
- *** Failers
- 0: ai
- 1: a
- Ab
-No match
- AB
-No match
-
-/[\200-\110]/I
-Failed: range out of order in character class at offset 9
-
-/^(?(0)f|b)oo/I
-Failed: invalid condition (?(0) at offset 6
-
-/This one's here because of the large output vector needed/I
-Capturing subpattern count = 0
-No options
-First char = 'T'
-Need char = 'd'
-
-/(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\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
-Max back reference = 270
-No options
-No first char
-No need char
- \O900 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
- 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
- 2: 2
- 3: 3
- 4: 4
- 5: 5
- 6: 6
- 7: 7
- 8: 8
- 9: 9
-10: 10
-11: 11
-12: 12
-13: 13
-14: 14
-15: 15
-16: 16
-17: 17
-18: 18
-19: 19
-20: 20
-21: 21
-22: 22
-23: 23
-24: 24
-25: 25
-26: 26
-27: 27
-28: 28
-29: 29
-30: 30
-31: 31
-32: 32
-33: 33
-34: 34
-35: 35
-36: 36
-37: 37
-38: 38
-39: 39
-40: 40
-41: 41
-42: 42
-43: 43
-44: 44
-45: 45
-46: 46
-47: 47
-48: 48
-49: 49
-50: 50
-51: 51
-52: 52
-53: 53
-54: 54
-55: 55
-56: 56
-57: 57
-58: 58
-59: 59
-60: 60
-61: 61
-62: 62
-63: 63
-64: 64
-65: 65
-66: 66
-67: 67
-68: 68
-69: 69
-70: 70
-71: 71
-72: 72
-73: 73
-74: 74
-75: 75
-76: 76
-77: 77
-78: 78
-79: 79
-80: 80
-81: 81
-82: 82
-83: 83
-84: 84
-85: 85
-86: 86
-87: 87
-88: 88
-89: 89
-90: 90
-91: 91
-92: 92
-93: 93
-94: 94
-95: 95
-96: 96
-97: 97
-98: 98
-99: 99
-100: 100
-101: 101
-102: 102
-103: 103
-104: 104
-105: 105
-106: 106
-107: 107
-108: 108
-109: 109
-110: 110
-111: 111
-112: 112
-113: 113
-114: 114
-115: 115
-116: 116
-117: 117
-118: 118
-119: 119
-120: 120
-121: 121
-122: 122
-123: 123
-124: 124
-125: 125
-126: 126
-127: 127
-128: 128
-129: 129
-130: 130
-131: 131
-132: 132
-133: 133
-134: 134
-135: 135
-136: 136
-137: 137
-138: 138
-139: 139
-140: 140
-141: 141
-142: 142
-143: 143
-144: 144
-145: 145
-146: 146
-147: 147
-148: 148
-149: 149
-150: 150
-151: 151
-152: 152
-153: 153
-154: 154
-155: 155
-156: 156
-157: 157
-158: 158
-159: 159
-160: 160
-161: 161
-162: 162
-163: 163
-164: 164
-165: 165
-166: 166
-167: 167
-168: 168
-169: 169
-170: 170
-171: 171
-172: 172
-173: 173
-174: 174
-175: 175
-176: 176
-177: 177
-178: 178
-179: 179
-180: 180
-181: 181
-182: 182
-183: 183
-184: 184
-185: 185
-186: 186
-187: 187
-188: 188
-189: 189
-190: 190
-191: 191
-192: 192
-193: 193
-194: 194
-195: 195
-196: 196
-197: 197
-198: 198
-199: 199
-200: 200
-201: 201
-202: 202
-203: 203
-204: 204
-205: 205
-206: 206
-207: 207
-208: 208
-209: 209
-210: 210
-211: 211
-212: 212
-213: 213
-214: 214
-215: 215
-216: 216
-217: 217
-218: 218
-219: 219
-220: 220
-221: 221
-222: 222
-223: 223
-224: 224
-225: 225
-226: 226
-227: 227
-228: 228
-229: 229
-230: 230
-231: 231
-232: 232
-233: 233
-234: 234
-235: 235
-236: 236
-237: 237
-238: 238
-239: 239
-240: 240
-241: 241
-242: 242
-243: 243
-244: 244
-245: 245
-246: 246
-247: 247
-248: 248
-249: 249
-250: 250
-251: 251
-252: 252
-253: 253
-254: 254
-255: 255
-256: 256
-257: 257
-258: 258
-259: 259
-260: 260
-261: 261
-262: 262
-263: 263
-264: 264
-265: 265
-266: 266
-267: 267
-268: 268
-269: 269
-270: ABC
-271: ABC
-
-/This one's here because Perl does this differently and PCRE can't at present/I
-Capturing subpattern count = 0
-No options
-First char = 'T'
-Need char = 't'
-
-/(main(O)?)+/I
-Capturing subpattern count = 2
-No options
-First char = 'm'
-Need char = 'n'
- mainmain
- 0: mainmain
- 1: main
- mainOmain
- 0: mainOmain
- 1: main
- 2: O
-
-/These are all cases where Perl does it differently (nested captures)/I
-Capturing subpattern count = 1
-No options
-First char = 'T'
-Need char = 's'
-
-/^(a(b)?)+$/I
-Capturing subpattern count = 2
-Options: anchored
-No first char
-No need char
- aba
- 0: aba
- 1: a
- 2: b
-
-/^(aa(bb)?)+$/I
-Capturing subpattern count = 2
-Options: anchored
-No first char
-No need char
- aabbaa
- 0: aabbaa
- 1: aa
- 2: bb
-
-/^(aa|aa(bb))+$/I
-Capturing subpattern count = 2
-Options: anchored
-No first char
-No need char
- aabbaa
- 0: aabbaa
- 1: aa
- 2: bb
-
-/^(aa(bb)??)+$/I
-Capturing subpattern count = 2
-Options: anchored
-No first char
-No need char
- aabbaa
- 0: aabbaa
- 1: aa
- 2: bb
-
-/^(?:aa(bb)?)+$/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- aabbaa
- 0: aabbaa
- 1: bb
-
-/^(aa(b(b))?)+$/I
-Capturing subpattern count = 3
-Options: anchored
-No first char
-No need char
- aabbaa
- 0: aabbaa
- 1: aa
- 2: bb
- 3: b
-
-/^(?:aa(b(b))?)+$/I
-Capturing subpattern count = 2
-Options: anchored
-No first char
-No need char
- aabbaa
- 0: aabbaa
- 1: bb
- 2: b
-
-/^(?:aa(b(?:b))?)+$/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- aabbaa
- 0: aabbaa
- 1: bb
-
-/^(?:aa(bb(?:b))?)+$/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- aabbbaa
- 0: aabbbaa
- 1: bbb
-
-/^(?:aa(b(?:bb))?)+$/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- aabbbaa
- 0: aabbbaa
- 1: bbb
-
-/^(?:aa(?:b(b))?)+$/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- aabbaa
- 0: aabbaa
- 1: b
-
-/^(?:aa(?:b(bb))?)+$/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- aabbbaa
- 0: aabbbaa
- 1: bb
-
-/^(aa(b(bb))?)+$/I
-Capturing subpattern count = 3
-Options: anchored
-No first char
-No need char
- aabbbaa
- 0: aabbbaa
- 1: aa
- 2: bbb
- 3: bb
-
-/^(aa(bb(bb))?)+$/I
-Capturing subpattern count = 3
-Options: anchored
-No first char
-No need char
- aabbbbaa
- 0: aabbbbaa
- 1: aa
- 2: bbbb
- 3: bb
-
-/--------------------------------------------------------------------/I
-Capturing subpattern count = 0
-No options
-First char = '-'
-Need char = '-'
-
-/#/IxDZ
-------------------------------------------------------------------
- Bra
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-May match empty string
-Options: extended
-No first char
-No need char
-
-/a#/IxDZ
-------------------------------------------------------------------
- Bra
- a
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: extended
-First char = 'a'
-No need char
-
-/[\s]/DZ
-------------------------------------------------------------------
- Bra
- [\x09-\x0d ]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/[\S]/DZ
-------------------------------------------------------------------
- Bra
- [\x00-\x08\x0e-\x1f!-\xff] (neg)
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/a(?i)b/DZ
-------------------------------------------------------------------
- Bra
- a
- /i b
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b' (caseless)
- ab
- 0: ab
- aB
- 0: aB
- *** Failers
-No match
- AB
-No match
-
-/(a(?i)b)/DZ
-------------------------------------------------------------------
- Bra
- CBra 1
- a
- /i b
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'b' (caseless)
- ab
- 0: ab
- 1: ab
- aB
- 0: aB
- 1: aB
- *** Failers
-No match
- AB
-No match
-
-/ (?i)abc/IxDZ
-------------------------------------------------------------------
- Bra
- /i abc
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: caseless extended
-First char = 'a' (caseless)
-Need char = 'c' (caseless)
-
-/#this is a comment
- (?i)abc/IxDZ
-------------------------------------------------------------------
- Bra
- /i abc
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: caseless extended
-First char = 'a' (caseless)
-Need char = 'c' (caseless)
-
-/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
-------------------------------------------------------------------
- Bra
- 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = '1'
-Need char = '0'
-
-/\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
-------------------------------------------------------------------
- Bra
- 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = '1'
-Need char = '0'
-
-/\Q\E/DZ
-------------------------------------------------------------------
- Bra
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- \
- 0:
-
-/\Q\Ex/DZ
-------------------------------------------------------------------
- Bra
- x
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'x'
-No need char
-
-/ \Q\E/DZ
-------------------------------------------------------------------
- Bra
-
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = ' '
-No need char
-
-/a\Q\E/DZ
-------------------------------------------------------------------
- Bra
- a
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
- abc
- 0: a
- bca
- 0: a
- bac
- 0: a
-
-/a\Q\Eb/DZ
-------------------------------------------------------------------
- Bra
- ab
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
- abc
- 0: ab
-
-/\Q\Eabc/DZ
-------------------------------------------------------------------
- Bra
- abc
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-
-/x*+\w/DZ
-------------------------------------------------------------------
- Bra
- x*+
- \w
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-No need char
- *** Failers
- 0: F
- xxxxx
-No match
-
-/x?+/DZ
-------------------------------------------------------------------
- Bra
- x?+
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
-
-/x++/DZ
-------------------------------------------------------------------
- Bra
- x++
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'x'
-No need char
-
-/x{1,3}+/BZO
-------------------------------------------------------------------
- Bra
- x
- x{0,2}+
- Ket
- End
-------------------------------------------------------------------
-
-/x{1,3}+/BZOi
-------------------------------------------------------------------
- Bra
- /i x
- /i x{0,2}+
- Ket
- End
-------------------------------------------------------------------
-
-/[^x]{1,3}+/BZO
-------------------------------------------------------------------
- Bra
- [^x]
- [^x]{0,2}+
- Ket
- End
-------------------------------------------------------------------
-
-/[^x]{1,3}+/BZOi
-------------------------------------------------------------------
- Bra
- /i [^x]
- /i [^x]{0,2}+
- Ket
- End
-------------------------------------------------------------------
-
-/(x)*+/DZ
-------------------------------------------------------------------
- Bra
- Braposzero
- CBraPos 1
- x
- KetRpos
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-May match empty string
-No options
-No first char
-No need char
-
-/^(\w++|\s++)*$/I
-Capturing subpattern count = 1
-May match empty string
-Options: anchored
-No first char
-No need char
- now is the time for all good men to come to the aid of the party
- 0: now is the time for all good men to come to the aid of the party
- 1: party
- *** Failers
-No match
- this is not a line with only words and spaces!
-No match
-
-/(\d++)(\w)/I
-Capturing subpattern count = 2
-No options
-No first char
-No need char
- 12345a
- 0: 12345a
- 1: 12345
- 2: a
- *** Failers
-No match
- 12345+
-No match
-
-/a++b/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
- aaab
- 0: aaab
-
-/(a++b)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'b'
- aaab
- 0: aaab
- 1: aaab
-
-/(a++)b/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'b'
- aaab
- 0: aaab
- 1: aaa
-
-/([^()]++|\([^()]*\))+/I
-Capturing subpattern count = 1
-No options
-No first char
-No need char
- ((abc(ade)ufh()()x
- 0: abc(ade)ufh()()x
- 1: x
-
-/\(([^()]++|\([^()]+\))+\)/I
-Capturing subpattern count = 1
-No options
-First char = '('
-Need char = ')'
- (abc)
- 0: (abc)
- 1: abc
- (abc(def)xyz)
- 0: (abc(def)xyz)
- 1: xyz
- *** Failers
-No match
- ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-No match
-
-/(abc){1,3}+/DZ
-------------------------------------------------------------------
- Bra
- Once
- CBra 1
- abc
- Ket
- Brazero
- Bra
- CBra 1
- abc
- Ket
- Brazero
- CBra 1
- abc
- Ket
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'c'
-
-/a+?+/I
-Failed: nothing to repeat at offset 3
-
-/a{2,3}?+b/I
-Failed: nothing to repeat at offset 7
-
-/(?U)a+?+/I
-Failed: nothing to repeat at offset 7
-
-/a{2,3}?+b/IU
-Failed: nothing to repeat at offset 7
-
-/x(?U)a++b/DZ
-------------------------------------------------------------------
- Bra
- x
- a++
- b
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'x'
-Need char = 'b'
- xaaaab
- 0: xaaaab
-
-/(?U)xa++b/DZ
-------------------------------------------------------------------
- Bra
- x
- a++
- b
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: ungreedy
-First char = 'x'
-Need char = 'b'
- xaaaab
- 0: xaaaab
-
-/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/DZ
-------------------------------------------------------------------
- Bra
- ^
- CBra 1
- CBra 2
- a+
- Ket
- CBra 3
- [ab]+?
- Ket
- CBra 4
- [bc]+
- Ket
- CBra 5
- \w*+
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 5
-Options: anchored
-No first char
-No need char
-
-/^x(?U)a+b/DZ
-------------------------------------------------------------------
- Bra
- ^
- x
- a++
- b
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-Need char = 'b'
-
-/^x(?U)(a+)b/DZ
-------------------------------------------------------------------
- Bra
- ^
- x
- CBra 1
- a+?
- Ket
- b
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Options: anchored
-No first char
-Need char = 'b'
-
-/[.x.]/I
-Failed: POSIX collating elements are not supported at offset 0
-
-/[=x=]/I
-Failed: POSIX collating elements are not supported at offset 0
-
-/[:x:]/I
-Failed: POSIX named classes are supported only within a class at offset 0
-
-/\l/I
-Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
-
-/\L/I
-Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
-
-/\N{name}/I
-Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
-
-/\u/I
-Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
-
-/\U/I
-Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
-
-/a{1,3}b/U
- ab
- 0: ab
-
-/[/I
-Failed: missing terminating ] for character class at offset 1
-
-/[a-/I
-Failed: missing terminating ] for character class at offset 3
-
-/[[:space:]/I
-Failed: missing terminating ] for character class at offset 10
-
-/[\s]/IDZ
-------------------------------------------------------------------
- Bra
- [\x09-\x0d ]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/[[:space:]]/IDZ
-------------------------------------------------------------------
- Bra
- [\x09-\x0d ]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/[[:space:]abcde]/IDZ
-------------------------------------------------------------------
- Bra
- [\x09-\x0d a-e]
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
-Capturing subpattern count = 0
-Options: extended
-First char = '<'
-Need char = '>'
- <>
- 0: <>
- <abcd>
- 0: <abcd>
- <abc <123> hij>
- 0: <abc <123> hij>
- <abc <def> hij>
- 0: <def>
- <abc<>def>
- 0: <abc<>def>
- <abc<>
- 0: <>
- *** Failers
-No match
- <abc
-No match
-
-|8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|IDZ
-------------------------------------------------------------------
- Bra
- 8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
- \b
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-First char = '8'
-Need char = 'X'
-
-|\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|IDZ
-------------------------------------------------------------------
- Bra
- $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
- \b
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-First char = '$'
-Need char = 'X'
-
-/(.*)\d+\1/I
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-No first char
-No need char
-
-/(.*)\d+/I
-Capturing subpattern count = 1
-No options
-First char at start or follows newline
-No need char
-
-/(.*)\d+\1/Is
-Capturing subpattern count = 1
-Max back reference = 1
-Options: dotall
-No first char
-No need char
-
-/(.*)\d+/Is
-Capturing subpattern count = 1
-Options: anchored dotall
-No first char
-No need char
-
-/(.*(xyz))\d+\2/I
-Capturing subpattern count = 2
-Max back reference = 2
-No options
-First char at start or follows newline
-Need char = 'z'
-
-/((.*))\d+\1/I
-Capturing subpattern count = 2
-Max back reference = 1
-No options
-No first char
-No need char
- abc123bc
- 0: bc123bc
- 1: bc
- 2: bc
-
-/a[b]/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/(?=a).*/I
-Capturing subpattern count = 0
-May match empty string
-No options
-First char = 'a'
-No need char
-
-/(?=abc).xyz/IiI
-Capturing subpattern count = 0
-Options: caseless
-First char = 'a' (caseless)
-Need char = 'z' (caseless)
-
-/(?=abc)(?i).xyz/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'z' (caseless)
-
-/(?=a)(?=b)/I
-Capturing subpattern count = 0
-May match empty string
-No options
-First char = 'a'
-No need char
-
-/(?=.)a/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/((?=abcda)a)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'a'
-
-/((?=abcda)ab)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'b'
-
-/()a/I
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'a'
-
-/(?(1)ab|ac)(.)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/(?(1)abz|acz)(.)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'z'
-
-/(?(1)abz)(.)/I
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-
-/(?(1)abz)(1)23/I
-Capturing subpattern count = 1
-No options
-No first char
-Need char = '3'
-
-/(a)+/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/(a){2,3}/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'a'
-
-/(a)*/I
-Capturing subpattern count = 1
-May match empty string
-No options
-No first char
-No need char
-
-/[a]/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/[ab]/I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/[ab]/IS
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b
-
-/[^a]/I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/\d456/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = '6'
-
-/\d456/IS
-Capturing subpattern count = 0
-No options
-No first char
-Need char = '6'
-Subject length lower bound = 4
-Starting chars: 0 1 2 3 4 5 6 7 8 9
-
-/a^b/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/^a/Im
-Capturing subpattern count = 0
-Options: multiline
-First char at start or follows newline
-Need char = 'a'
- abcde
- 0: a
- xy\nabc
- 0: a
- *** Failers
-No match
- xyabc
-No match
-
-/c|abc/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'c'
-
-/(?i)[ab]/IS
-Capturing subpattern count = 0
-Options: caseless
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: A B a b
-
-/[ab](?i)cd/IS
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'd' (caseless)
-Subject length lower bound = 3
-Starting chars: a b
-
-/abc(?C)def/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'f'
- abcdef
---->abcdef
- 0 ^ ^ d
- 0: abcdef
- 1234abcdef
---->1234abcdef
- 0 ^ ^ d
- 0: abcdef
- *** Failers
-No match
- abcxyz
-No match
- abcxyzf
---->abcxyzf
- 0 ^ ^ d
-No match
-
-/abc(?C)de(?C1)f/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'f'
- 123abcdef
---->123abcdef
- 0 ^ ^ d
- 1 ^ ^ f
- 0: abcdef
-
-/(?C1)\dabc(?C2)def/IS
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'f'
-Subject length lower bound = 7
-Starting chars: 0 1 2 3 4 5 6 7 8 9
- 1234abcdef
---->1234abcdef
- 1 ^ \d
- 1 ^ \d
- 1 ^ \d
- 1 ^ \d
- 2 ^ ^ d
- 0: 4abcdef
- *** Failers
-No match
- abcdef
-No match
-
-/(?C1)\dabc(?C2)def/ISS
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'f'
- 1234abcdef
---->1234abcdef
- 1 ^ \d
- 1 ^ \d
- 1 ^ \d
- 1 ^ \d
- 2 ^ ^ d
- 0: 4abcdef
- *** Failers
-No match
- abcdef
---->abcdef
- 1 ^ \d
- 1 ^ \d
- 1 ^ \d
- 1 ^ \d
- 1 ^ \d
- 1 ^ \d
-No match
-
-/(?C255)ab/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'b'
-
-/(?C256)ab/I
-Failed: number after (?C is > 255 at offset 6
-
-/(?Cab)xx/I
-Failed: closing ) for (?C expected at offset 3
-
-/(?C12vr)x/I
-Failed: closing ) for (?C expected at offset 5
-
-/abc(?C)def/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'f'
- *** Failers
-No match
- \x83\x0\x61bcdef
---->\x83\x00abcdef
- 0 ^ ^ d
- 0: abcdef
-
-/(abc)(?C)de(?C1)f/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'f'
- 123abcdef
---->123abcdef
- 0 ^ ^ d
- 1 ^ ^ f
- 0: abcdef
- 1: abc
- 123abcdef\C+
-Callout 0: last capture = 1
- 0: <unset>
- 1: abc
---->123abcdef
- ^ ^ d
-Callout 1: last capture = 1
- 0: <unset>
- 1: abc
---->123abcdef
- ^ ^ f
- 0: abcdef
- 1: abc
- 123abcdef\C-
- 0: abcdef
- 1: abc
- *** Failers
-No match
- 123abcdef\C!1
---->123abcdef
- 0 ^ ^ d
- 1 ^ ^ f
-No match
-
-/(?C0)(abc(?C1))*/I
-Capturing subpattern count = 1
-May match empty string
-No options
-No first char
-No need char
- abcabcabc
---->abcabcabc
- 0 ^ (abc(?C1))*
- 1 ^ ^ )
- 1 ^ ^ )
- 1 ^ ^ )
- 0: abcabcabc
- 1: abc
- abcabc\C!1!3
---->abcabc
- 0 ^ (abc(?C1))*
- 1 ^ ^ )
- 1 ^ ^ )
- 0: abcabc
- 1: abc
- *** Failers
---->*** Failers
- 0 ^ (abc(?C1))*
- 0:
- abcabcabc\C!1!3
---->abcabcabc
- 0 ^ (abc(?C1))*
- 1 ^ ^ )
- 1 ^ ^ )
- 1 ^ ^ )
- 0: abcabc
- 1: abc
-
-/(\d{3}(?C))*/I
-Capturing subpattern count = 1
-May match empty string
-No options
-No first char
-No need char
- 123\C+
-Callout 0: last capture = -1
- 0: <unset>
---->123
- ^ ^ )
- 0: 123
- 1: 123
- 123456\C+
-Callout 0: last capture = -1
- 0: <unset>
---->123456
- ^ ^ )
-Callout 0: last capture = 1
- 0: <unset>
- 1: 123
---->123456
- ^ ^ )
- 0: 123456
- 1: 456
- 123456789\C+
-Callout 0: last capture = -1
- 0: <unset>
---->123456789
- ^ ^ )
-Callout 0: last capture = 1
- 0: <unset>
- 1: 123
---->123456789
- ^ ^ )
-Callout 0: last capture = 1
- 0: <unset>
- 1: 456
---->123456789
- ^ ^ )
- 0: 123456789
- 1: 789
-
-/((xyz)(?C)p|(?C1)xyzabc)/I
-Capturing subpattern count = 2
-No options
-First char = 'x'
-No need char
- xyzabc\C+
-Callout 0: last capture = 2
- 0: <unset>
- 1: <unset>
- 2: xyz
---->xyzabc
- ^ ^ p
-Callout 1: last capture = -1
- 0: <unset>
---->xyzabc
- ^ x
- 0: xyzabc
- 1: xyzabc
-
-/(X)((xyz)(?C)p|(?C1)xyzabc)/I
-Capturing subpattern count = 3
-No options
-First char = 'X'
-Need char = 'x'
- Xxyzabc\C+
-Callout 0: last capture = 3
- 0: <unset>
- 1: X
- 2: <unset>
- 3: xyz
---->Xxyzabc
- ^ ^ p
-Callout 1: last capture = 1
- 0: <unset>
- 1: X
---->Xxyzabc
- ^^ x
- 0: Xxyzabc
- 1: X
- 2: xyzabc
-
-/(?=(abc))(?C)abcdef/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'f'
- abcdef\C+
-Callout 0: last capture = 1
- 0: <unset>
- 1: abc
---->abcdef
- ^ a
- 0: abcdef
- 1: abc
-
-/(?!(abc)(?C1)d)(?C2)abcxyz/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'z'
- abcxyz\C+
-Callout 1: last capture = 1
- 0: <unset>
- 1: abc
---->abcxyz
- ^ ^ d
-Callout 2: last capture = -1
- 0: <unset>
---->abcxyz
- ^ a
- 0: abcxyz
-
-/(?<=(abc)(?C))xyz/I
-Capturing subpattern count = 1
-Max lookbehind = 3
-No options
-First char = 'x'
-Need char = 'z'
- abcxyz\C+
-Callout 0: last capture = 1
- 0: <unset>
- 1: abc
---->abcxyz
- ^ )
- 0: xyz
- 1: abc
-
-/a(b+)(c*)(?C1)/I
-Capturing subpattern count = 2
-No options
-First char = 'a'
-Need char = 'b'
- abbbbbccc\C*1
---->abbbbbccc
- 1 ^ ^
-Callout data = 1
-No match
-
-/a(b+?)(c*?)(?C1)/I
-Capturing subpattern count = 2
-No options
-First char = 'a'
-Need char = 'b'
- abbbbbccc\C*1
---->abbbbbccc
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
-No match
-
-/(?C)abc/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-
-/(?C)^abc/I
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/(?C)a|b/IS
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b
-
-/(?R)/I
-Failed: recursive call could loop indefinitely at offset 3
-
-/(a|(?R))/I
-Failed: recursive call could loop indefinitely at offset 6
-
-/(ab|(bc|(de|(?R))))/I
-Failed: recursive call could loop indefinitely at offset 15
-
-/x(ab|(bc|(de|(?R))))/I
-Capturing subpattern count = 3
-No options
-First char = 'x'
-No need char
- xab
- 0: xab
- 1: ab
- xbc
- 0: xbc
- 1: bc
- 2: bc
- xde
- 0: xde
- 1: de
- 2: de
- 3: de
- xxab
- 0: xxab
- 1: xab
- 2: xab
- 3: xab
- xxxab
- 0: xxxab
- 1: xxab
- 2: xxab
- 3: xxab
- *** Failers
-No match
- xyab
-No match
-
-/(ab|(bc|(de|(?1))))/I
-Failed: recursive call could loop indefinitely at offset 15
-
-/x(ab|(bc|(de|(?1)x)x)x)/I
-Failed: recursive call could loop indefinitely at offset 16
-
-/^([^()]|\((?1)*\))*$/I
-Capturing subpattern count = 1
-May match empty string
-Options: anchored
-No first char
-No need char
- abc
- 0: abc
- 1: c
- a(b)c
- 0: a(b)c
- 1: c
- a(b(c))d
- 0: a(b(c))d
- 1: d
- *** Failers)
-No match
- a(b(c)d
-No match
-
-/^>abc>([^()]|\((?1)*\))*<xyz<$/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-Need char = '<'
- >abc>123<xyz<
- 0: >abc>123<xyz<
- 1: 3
- >abc>1(2)3<xyz<
- 0: >abc>1(2)3<xyz<
- 1: 3
- >abc>(1(2)3)<xyz<
- 0: >abc>(1(2)3)<xyz<
- 1: (1(2)3)
-
-/(a(?1)b)/DZ
-------------------------------------------------------------------
- Bra
- CBra 1
- a
- Recurse
- b
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'b'
-
-/(a(?1)+b)/DZ
-------------------------------------------------------------------
- Bra
- CBra 1
- a
- Once
- Recurse
- KetRmax
- b
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'b'
-
-/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
-Capturing subpattern count = 2
-Options: anchored
-No first char
-No need char
- 12
- 0: 12
- 1: 12
- (((2+2)*-3)-7)
- 0: (((2+2)*-3)-7)
- 1: (((2+2)*-3)-7)
- 2: -
- -12
- 0: -12
- 1: -12
- *** Failers
-No match
- ((2+2)*-3)-7)
-No match
-
-/^(x(y|(?1){2})z)/I
-Capturing subpattern count = 2
-Options: anchored
-No first char
-No need char
- xyz
- 0: xyz
- 1: xyz
- 2: y
- xxyzxyzz
- 0: xxyzxyzz
- 1: xxyzxyzz
- 2: xyzxyz
- *** Failers
-No match
- xxyzz
-No match
- xxyzxyzxyzz
-No match
-
-/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
-Capturing subpattern count = 2
-Options: extended
-First char = '<'
-Need char = '>'
- <>
- 0: <>
- 1: <>
- 2: <>
- <abcd>
- 0: <abcd>
- 1: <abcd>
- 2: <abcd>
- <abc <123> hij>
- 0: <abc <123> hij>
- 1: <abc <123> hij>
- 2: <abc <123> hij>
- <abc <def> hij>
- 0: <def>
- 1: <def>
- 2: <def>
- <abc<>def>
- 0: <abc<>def>
- 1: <abc<>def>
- 2: <abc<>def>
- <abc<>
- 0: <>
- 1: <>
- 2: <>
- *** Failers
-No match
- <abc
-No match
-
-/(?1)/I
-Failed: reference to non-existent subpattern at offset 3
-
-/((?2)(abc)/I
-Failed: missing ) at offset 10
-
-/^(abc)def(?1)/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- abcdefabc
- 0: abcdefabc
- 1: abc
-
-/^(a|b|c)=(?1)+/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- a=a
- 0: a=a
- 1: a
- a=b
- 0: a=b
- 1: a
- a=bc
- 0: a=bc
- 1: a
-
-/^(a|b|c)=((?1))+/I
-Capturing subpattern count = 2
-Options: anchored
-No first char
-No need char
- a=a
- 0: a=a
- 1: a
- 2: a
- a=b
- 0: a=b
- 1: a
- 2: b
- a=bc
- 0: a=bc
- 1: a
- 2: c
-
-/a(?P<name1>b|c)d(?P<longername2>e)/DZ
-------------------------------------------------------------------
- Bra
- a
- CBra 1
- b
- Alt
- c
- Ket
- d
- CBra 2
- e
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
- longername2 2
- name1 1
-No options
-First char = 'a'
-Need char = 'e'
- abde
- 0: abde
- 1: b
- 2: e
- acde
- 0: acde
- 1: c
- 2: e
-
-/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/DZ
-------------------------------------------------------------------
- Bra
- Bra
- a
- CBra 1
- c
- CBra 2
- d
- Ket
- Ket
- Ket
- CBra 3
- a
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 3
-Named capturing subpatterns:
- a 3
- c 1
- d 2
-No options
-First char = 'a'
-Need char = 'a'
-
-/(?P<a>a)...(?P=a)bbb(?P>a)d/DZ
-------------------------------------------------------------------
- Bra
- CBra 1
- a
- Ket
- Any
- Any
- Any
- \1
- bbb
- Recurse
- d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Max back reference = 1
-Named capturing subpatterns:
- a 1
-No options
-First char = 'a'
-Need char = 'd'
-
-/^\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
-Max back reference = 4
-Named capturing subpatterns:
- four 4
- one 1
- three 3
- two 2
-May match empty string
-Options: anchored caseless
-No first char
-No need char
- 1221
- 0: 1221
- 1: 1221
- 2: 1
- Satan, oscillate my metallic sonatas!
- 0: Satan, oscillate my metallic sonatas!
- 1: <unset>
- 2: <unset>
- 3: Satan, oscillate my metallic sonatas
- 4: S
- A man, a plan, a canal: Panama!
- 0: A man, a plan, a canal: Panama!
- 1: <unset>
- 2: <unset>
- 3: A man, a plan, a canal: Panama
- 4: A
- Able was I ere I saw Elba.
- 0: Able was I ere I saw Elba.
- 1: <unset>
- 2: <unset>
- 3: Able was I ere I saw Elba
- 4: A
- *** Failers
-No match
- The quick brown fox
-No match
-
-/((?(R)a|b))\1(?1)?/I
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-No first char
-No need char
- bb
- 0: bb
- 1: b
- bbaa
- 0: bba
- 1: b
-
-/(.*)a/Is
-Capturing subpattern count = 1
-Options: anchored dotall
-No first char
-Need char = 'a'
-
-/(.*)a\1/Is
-Capturing subpattern count = 1
-Max back reference = 1
-Options: dotall
-No first char
-Need char = 'a'
-
-/(.*)a(b)\2/Is
-Capturing subpattern count = 2
-Max back reference = 2
-Options: anchored dotall
-No first char
-Need char = 'b'
-
-/((.*)a|(.*)b)z/Is
-Capturing subpattern count = 3
-Options: anchored dotall
-No first char
-Need char = 'z'
-
-/((.*)a|(.*)b)z\1/Is
-Capturing subpattern count = 3
-Max back reference = 1
-Options: dotall
-No first char
-Need char = 'z'
-
-/((.*)a|(.*)b)z\2/Is
-Capturing subpattern count = 3
-Max back reference = 2
-Options: dotall
-No first char
-Need char = 'z'
-
-/((.*)a|(.*)b)z\3/Is
-Capturing subpattern count = 3
-Max back reference = 3
-Options: dotall
-No first char
-Need char = 'z'
-
-/((.*)a|^(.*)b)z\3/Is
-Capturing subpattern count = 3
-Max back reference = 3
-Options: anchored dotall
-No first char
-Need char = 'z'
-
-/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
-Capturing subpattern count = 31
-May match empty string
-Options: anchored dotall
-No first char
-No need char
-
-/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
-Capturing subpattern count = 31
-Max back reference = 31
-May match empty string
-Options: dotall
-No first char
-No need char
-
-/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
-Capturing subpattern count = 32
-Max back reference = 32
-May match empty string
-Options: dotall
-No first char
-No need char
-
-/(a)(bc)/INDZ
-------------------------------------------------------------------
- Bra
- Bra
- a
- Ket
- Bra
- bc
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: no_auto_capture
-First char = 'a'
-Need char = 'c'
- abc
- 0: abc
-
-/(?P<one>a)(bc)/INDZ
-------------------------------------------------------------------
- Bra
- CBra 1
- a
- Ket
- Bra
- bc
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Named capturing subpatterns:
- one 1
-Options: no_auto_capture
-First char = 'a'
-Need char = 'c'
- abc
- 0: abc
- 1: a
-
-/(a)(?P<named>bc)/INDZ
-------------------------------------------------------------------
- Bra
- Bra
- a
- Ket
- CBra 1
- bc
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Named capturing subpatterns:
- named 1
-Options: no_auto_capture
-First char = 'a'
-Need char = 'c'
-
-/(a+)*zz/I
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'z'
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M
-Minimum match() limit = 8
-Minimum match() recursion limit = 6
- 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
- 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- aaaaaaaaaaaaaz\M
-Minimum match() limit = 32768
-Minimum match() recursion limit = 29
-No match
-
-/(aaa(?C1)bbb|ab)/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'b'
- aaabbb
---->aaabbb
- 1 ^ ^ b
- 0: aaabbb
- 1: aaabbb
- aaabbb\C*0
---->aaabbb
- 1 ^ ^ b
- 0: aaabbb
- 1: aaabbb
- aaabbb\C*1
---->aaabbb
- 1 ^ ^ b
-Callout data = 1
- 0: ab
- 1: ab
- aaabbb\C*-1
---->aaabbb
- 1 ^ ^ b
-Callout data = -1
-No match
-
-/ab(?P<one>cd)ef(?P<two>gh)/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
- one 1
- two 2
-No options
-First char = 'a'
-Need char = 'h'
- abcdefgh
- 0: abcdefgh
- 1: cd
- 2: gh
- abcdefgh\C1\Gtwo
- 0: abcdefgh
- 1: cd
- 2: gh
- 1C cd (2)
- G gh (2) two
- abcdefgh\Cone\Ctwo
- 0: abcdefgh
- 1: cd
- 2: gh
- C cd (2) one
- C gh (2) two
- abcdefgh\Cthree
-no parentheses with name "three"
- 0: abcdefgh
- 1: cd
- 2: gh
-copy substring three failed -7
-
-/(?P<Tes>)(?P<Test>)/DZ
-------------------------------------------------------------------
- Bra
- CBra 1
- Ket
- CBra 2
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
- Tes 1
- Test 2
-May match empty string
-No options
-No first char
-No need char
-
-/(?P<Test>)(?P<Tes>)/DZ
-------------------------------------------------------------------
- Bra
- CBra 1
- Ket
- CBra 2
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-Named capturing subpatterns:
- Tes 2
- Test 1
-May match empty string
-No options
-No first char
-No need char
-
-/(?P<Z>zz)(?P<A>aa)/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
- A 2
- Z 1
-No options
-First char = 'z'
-Need char = 'a'
- zzaa\CZ
- 0: zzaa
- 1: zz
- 2: aa
- C zz (2) Z
- zzaa\CA
- 0: zzaa
- 1: zz
- 2: aa
- C aa (2) A
-
-/(?P<x>eks)(?P<x>eccs)/I
-Failed: two named subpatterns have the same name at offset 15
-
-/(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
-Failed: two named subpatterns have the same name at offset 30
-
-"\[((?P<elem>\d+)(,(?P>elem))*)\]"I
-Capturing subpattern count = 3
-Named capturing subpatterns:
- elem 2
-No options
-First char = '['
-Need char = ']'
- [10,20,30,5,5,4,4,2,43,23,4234]
- 0: [10,20,30,5,5,4,4,2,43,23,4234]
- 1: 10,20,30,5,5,4,4,2,43,23,4234
- 2: 10
- 3: ,4234
- *** Failers
-No match
- []
-No match
-
-"\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
-Capturing subpattern count = 3
-Named capturing subpatterns:
- elem 2
-No options
-First char = '['
-Need char = ']'
- [10,20,30,5,5,4,4,2,43,23,4234]
- 0: [10,20,30,5,5,4,4,2,43,23,4234]
- 1: 10,20,30,5,5,4,4,2,43,23,4234
- 2: 10
- 3: ,4234
- []
- 0: []
-
-/(a(b(?2)c))?/DZ
-------------------------------------------------------------------
- Bra
- Brazero
- CBra 1
- a
- CBra 2
- b
- Recurse
- c
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-May match empty string
-No options
-No first char
-No need char
-
-/(a(b(?2)c))*/DZ
-------------------------------------------------------------------
- Bra
- Brazero
- CBra 1
- a
- CBra 2
- b
- Recurse
- c
- Ket
- KetRmax
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-May match empty string
-No options
-No first char
-No need char
-
-/(a(b(?2)c)){0,2}/DZ
-------------------------------------------------------------------
- Bra
- Brazero
- Bra
- CBra 1
- a
- CBra 2
- b
- Recurse
- c
- Ket
- Ket
- Brazero
- CBra 1
- a
- CBra 2
- b
- Recurse
- c
- Ket
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 2
-May match empty string
-No options
-No first char
-No need char
-
-/[ab]{1}+/DZ
-------------------------------------------------------------------
- Bra
- [ab]{1,1}+
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
-Capturing subpattern count = 3
-Options: caseless
-No first char
-Need char = 'g' (caseless)
- Baby Bjorn Active Carrier - With free SHIPPING!!
- 0: Baby Bjorn Active Carrier - With free SHIPPING!!
- 1: Baby Bjorn Active Carrier - With free SHIPPING!!
-
-/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/IiS
-Capturing subpattern count = 3
-Options: caseless
-No first char
-Need char = 'g' (caseless)
-Subject length lower bound = 8
-No starting char list
- Baby Bjorn Active Carrier - With free SHIPPING!!
- 0: Baby Bjorn Active Carrier - With free SHIPPING!!
- 1: Baby Bjorn Active Carrier - With free SHIPPING!!
-
-/a*.*b/ISDZ
-------------------------------------------------------------------
- Bra
- a*
- Any*
- b
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'b'
-Subject length lower bound = 1
-No starting char list
-
-/(a|b)*.?c/ISDZ
-------------------------------------------------------------------
- Bra
- Brazero
- CBra 1
- a
- Alt
- b
- KetRmax
- Any?
- c
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'c'
-Subject length lower bound = 1
-No starting char list
-
-/abc(?C255)de(?C)f/DZ
-------------------------------------------------------------------
- Bra
- abc
- Callout 255 10 1
- de
- Callout 0 16 1
- f
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'f'
-
-/abcde/ICDZ
-------------------------------------------------------------------
- Bra
- Callout 255 0 1
- a
- Callout 255 1 1
- b
- Callout 255 2 1
- c
- Callout 255 3 1
- d
- Callout 255 4 1
- e
- Callout 255 5 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options:
-First char = 'a'
-Need char = 'e'
- abcde
---->abcde
- +0 ^ a
- +1 ^^ b
- +2 ^ ^ c
- +3 ^ ^ d
- +4 ^ ^ e
- +5 ^ ^
- 0: abcde
- abcdfe
---->abcdfe
- +0 ^ a
- +1 ^^ b
- +2 ^ ^ c
- +3 ^ ^ d
- +4 ^ ^ e
-No match
-
-/a*b/ICDZS
-------------------------------------------------------------------
- Bra
- Callout 255 0 2
- a*+
- Callout 255 2 1
- b
- Callout 255 3 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options:
-No first char
-Need char = 'b'
-Subject length lower bound = 1
-Starting chars: a b
- ab
---->ab
- +0 ^ a*
- +2 ^^ b
- +3 ^ ^
- 0: ab
- aaaab
---->aaaab
- +0 ^ a*
- +2 ^ ^ b
- +3 ^ ^
- 0: aaaab
- aaaacb
---->aaaacb
- +0 ^ a*
- +2 ^ ^ b
- +0 ^ a*
- +2 ^ ^ b
- +0 ^ a*
- +2 ^ ^ b
- +0 ^ a*
- +2 ^^ b
- +0 ^ a*
- +2 ^ b
- +3 ^^
- 0: b
-
-/a*b/ICDZSS
-------------------------------------------------------------------
- Bra
- Callout 255 0 2
- a*+
- Callout 255 2 1
- b
- Callout 255 3 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options:
-No first char
-Need char = 'b'
- ab
---->ab
- +0 ^ a*
- +2 ^^ b
- +3 ^ ^
- 0: ab
- aaaab
---->aaaab
- +0 ^ a*
- +2 ^ ^ b
- +3 ^ ^
- 0: aaaab
- aaaacb
---->aaaacb
- +0 ^ a*
- +2 ^ ^ b
- +0 ^ a*
- +2 ^ ^ b
- +0 ^ a*
- +2 ^ ^ b
- +0 ^ a*
- +2 ^^ b
- +0 ^ a*
- +2 ^ b
- +0 ^ a*
- +2 ^ b
- +3 ^^
- 0: b
-
-/a+b/ICDZ
-------------------------------------------------------------------
- Bra
- Callout 255 0 2
- a++
- Callout 255 2 1
- b
- Callout 255 3 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options:
-First char = 'a'
-Need char = 'b'
- ab
---->ab
- +0 ^ a+
- +2 ^^ b
- +3 ^ ^
- 0: ab
- aaaab
---->aaaab
- +0 ^ a+
- +2 ^ ^ b
- +3 ^ ^
- 0: aaaab
- aaaacb
---->aaaacb
- +0 ^ a+
- +2 ^ ^ b
- +0 ^ a+
- +2 ^ ^ b
- +0 ^ a+
- +2 ^ ^ b
- +0 ^ a+
- +2 ^^ b
-No match
-
-/(abc|def)x/ICDZS
-------------------------------------------------------------------
- Bra
- Callout 255 0 9
- CBra 1
- Callout 255 1 1
- a
- Callout 255 2 1
- b
- Callout 255 3 1
- c
- Callout 255 4 0
- Alt
- Callout 255 5 1
- d
- Callout 255 6 1
- e
- Callout 255 7 1
- f
- Callout 255 8 0
- Ket
- Callout 255 9 1
- x
- Callout 255 10 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Options:
-No first char
-Need char = 'x'
-Subject length lower bound = 4
-Starting chars: a d
- abcx
---->abcx
- +0 ^ (abc|def)
- +1 ^ a
- +2 ^^ b
- +3 ^ ^ c
- +4 ^ ^ |
- +9 ^ ^ x
-+10 ^ ^
- 0: abcx
- 1: abc
- defx
---->defx
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +6 ^^ e
- +7 ^ ^ f
- +8 ^ ^ )
- +9 ^ ^ x
-+10 ^ ^
- 0: defx
- 1: def
- ** Failers
-No match
- abcdefzx
---->abcdefzx
- +0 ^ (abc|def)
- +1 ^ a
- +2 ^^ b
- +3 ^ ^ c
- +4 ^ ^ |
- +9 ^ ^ x
- +5 ^ d
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +6 ^^ e
- +7 ^ ^ f
- +8 ^ ^ )
- +9 ^ ^ x
-No match
-
-/(abc|def)x/ICDZSS
-------------------------------------------------------------------
- Bra
- Callout 255 0 9
- CBra 1
- Callout 255 1 1
- a
- Callout 255 2 1
- b
- Callout 255 3 1
- c
- Callout 255 4 0
- Alt
- Callout 255 5 1
- d
- Callout 255 6 1
- e
- Callout 255 7 1
- f
- Callout 255 8 0
- Ket
- Callout 255 9 1
- x
- Callout 255 10 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Options:
-No first char
-Need char = 'x'
- abcx
---->abcx
- +0 ^ (abc|def)
- +1 ^ a
- +2 ^^ b
- +3 ^ ^ c
- +4 ^ ^ |
- +9 ^ ^ x
-+10 ^ ^
- 0: abcx
- 1: abc
- defx
---->defx
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +6 ^^ e
- +7 ^ ^ f
- +8 ^ ^ )
- +9 ^ ^ x
-+10 ^ ^
- 0: defx
- 1: def
- ** Failers
-No match
- abcdefzx
---->abcdefzx
- +0 ^ (abc|def)
- +1 ^ a
- +2 ^^ b
- +3 ^ ^ c
- +4 ^ ^ |
- +9 ^ ^ x
- +5 ^ d
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +6 ^^ e
- +7 ^ ^ f
- +8 ^ ^ )
- +9 ^ ^ x
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
- +0 ^ (abc|def)
- +1 ^ a
- +5 ^ d
-No match
-
-/(ab|cd){3,4}/IC
-Capturing subpattern count = 1
-Options:
-No first char
-No need char
- ababab
---->ababab
- +0 ^ (ab|cd){3,4}
- +1 ^ a
- +2 ^^ b
- +3 ^ ^ |
- +1 ^ ^ a
- +2 ^ ^ b
- +3 ^ ^ |
- +1 ^ ^ a
- +2 ^ ^ b
- +3 ^ ^ |
- +1 ^ ^ a
- +4 ^ ^ c
-+12 ^ ^
- 0: ababab
- 1: ab
- abcdabcd
---->abcdabcd
- +0 ^ (ab|cd){3,4}
- +1 ^ a
- +2 ^^ b
- +3 ^ ^ |
- +1 ^ ^ a
- +4 ^ ^ c
- +5 ^ ^ d
- +6 ^ ^ )
- +1 ^ ^ a
- +2 ^ ^ b
- +3 ^ ^ |
- +1 ^ ^ a
- +4 ^ ^ c
- +5 ^ ^ d
- +6 ^ ^ )
-+12 ^ ^
- 0: abcdabcd
- 1: cd
- abcdcdcdcdcd
---->abcdcdcdcdcd
- +0 ^ (ab|cd){3,4}
- +1 ^ a
- +2 ^^ b
- +3 ^ ^ |
- +1 ^ ^ a
- +4 ^ ^ c
- +5 ^ ^ d
- +6 ^ ^ )
- +1 ^ ^ a
- +4 ^ ^ c
- +5 ^ ^ d
- +6 ^ ^ )
- +1 ^ ^ a
- +4 ^ ^ c
- +5 ^ ^ d
- +6 ^ ^ )
-+12 ^ ^
- 0: abcdcdcd
- 1: cd
-
-/([ab]{,4}c|xy)/ICDZS
-------------------------------------------------------------------
- Bra
- Callout 255 0 14
- CBra 1
- Callout 255 1 4
- [ab]
- Callout 255 5 1
- {
- Callout 255 6 1
- ,
- Callout 255 7 1
- 4
- Callout 255 8 1
- }
- Callout 255 9 1
- c
- Callout 255 10 0
- Alt
- Callout 255 11 1
- x
- Callout 255 12 1
- y
- Callout 255 13 0
- Ket
- Callout 255 14 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Options:
-No first char
-No need char
-Subject length lower bound = 2
-Starting chars: a b x
- Note: that { does NOT introduce a quantifier
---->Note: that { does NOT introduce a quantifier
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
- +5 ^^ {
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
- +5 ^^ {
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
- +5 ^^ {
-+11 ^ x
-No match
-
-/([ab]{,4}c|xy)/ICDZSS
-------------------------------------------------------------------
- Bra
- Callout 255 0 14
- CBra 1
- Callout 255 1 4
- [ab]
- Callout 255 5 1
- {
- Callout 255 6 1
- ,
- Callout 255 7 1
- 4
- Callout 255 8 1
- }
- Callout 255 9 1
- c
- Callout 255 10 0
- Alt
- Callout 255 11 1
- x
- Callout 255 12 1
- y
- Callout 255 13 0
- Ket
- Callout 255 14 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Options:
-No first char
-No need char
- Note: that { does NOT introduce a quantifier
---->Note: that { does NOT introduce a quantifier
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
- +5 ^^ {
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
- +5 ^^ {
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
- +5 ^^ {
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
- +0 ^ ([ab]{,4}c|xy)
- +1 ^ [ab]
-+11 ^ x
-No match
-
-/([ab]{1,4}c|xy){4,5}?123/ICDZ
-------------------------------------------------------------------
- Bra
- Callout 255 0 21
- CBra 1
- Callout 255 1 9
- [ab]{1,4}+
- Callout 255 10 1
- c
- Callout 255 11 0
- Alt
- Callout 255 12 1
- x
- Callout 255 13 1
- y
- Callout 255 14 0
- Ket
- CBra 1
- Callout 255 1 9
- [ab]{1,4}+
- Callout 255 10 1
- c
- Callout 255 11 0
- Alt
- Callout 255 12 1
- x
- Callout 255 13 1
- y
- Callout 255 14 0
- Ket
- CBra 1
- Callout 255 1 9
- [ab]{1,4}+
- Callout 255 10 1
- c
- Callout 255 11 0
- Alt
- Callout 255 12 1
- x
- Callout 255 13 1
- y
- Callout 255 14 0
- Ket
- CBra 1
- Callout 255 1 9
- [ab]{1,4}+
- Callout 255 10 1
- c
- Callout 255 11 0
- Alt
- Callout 255 12 1
- x
- Callout 255 13 1
- y
- Callout 255 14 0
- Ket
- Braminzero
- CBra 1
- Callout 255 1 9
- [ab]{1,4}+
- Callout 255 10 1
- c
- Callout 255 11 0
- Alt
- Callout 255 12 1
- x
- Callout 255 13 1
- y
- Callout 255 14 0
- Ket
- Callout 255 21 1
- 1
- Callout 255 22 1
- 2
- Callout 255 23 1
- 3
- Callout 255 24 0
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-Options:
-No first char
-Need char = '3'
- aacaacaacaacaac123
---->aacaacaacaacaac123
- +0 ^ ([ab]{1,4}c|xy){4,5}?
- +1 ^ [ab]{1,4}
-+10 ^ ^ c
-+11 ^ ^ |
- +1 ^ ^ [ab]{1,4}
-+10 ^ ^ c
-+11 ^ ^ |
- +1 ^ ^ [ab]{1,4}
-+10 ^ ^ c
-+11 ^ ^ |
- +1 ^ ^ [ab]{1,4}
-+10 ^ ^ c
-+11 ^ ^ |
-+21 ^ ^ 1
- +1 ^ ^ [ab]{1,4}
-+10 ^ ^ c
-+11 ^ ^ |
-+21 ^ ^ 1
-+22 ^ ^ 2
-+23 ^ ^ 3
-+24 ^ ^
- 0: aacaacaacaacaac123
- 1: aac
-
-/\b.*/I
-Capturing subpattern count = 0
-Max lookbehind = 1
-May match empty string
-No options
-No first char
-No need char
- ab cd\>1
- 0: cd
-
-/\b.*/Is
-Capturing subpattern count = 0
-Max lookbehind = 1
-May match empty string
-Options: dotall
-No first char
-No need char
- ab cd\>1
- 0: cd
-
-/(?!.bcd).*/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- Xbcd12345
- 0: bcd12345
-
-/abcde/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'e'
- ab\P
-Partial match: ab
- abc\P
-Partial match: abc
- abcd\P
-Partial match: abcd
- abcde\P
- 0: abcde
- the quick brown abc\P
-Partial match: abc
- ** Failers\P
-No match
- the quick brown abxyz fox\P
-No match
-
-"^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
-Capturing subpattern count = 3
-Options: anchored
-No first char
-Need char = '/'
- 13/05/04\P
- 0: 13/05/04
- 1: 13
- 2: 05
- 13/5/2004\P
- 0: 13/5/2004
- 1: 13
- 2: 5
- 3: 20
- 02/05/09\P
- 0: 02/05/09
- 1: 02
- 2: 05
- 1\P
-Partial match: 1
- 1/2\P
-Partial match: 1/2
- 1/2/0\P
-Partial match: 1/2/0
- 1/2/04\P
- 0: 1/2/04
- 1: 1
- 2: 2
- 0\P
-Partial match: 0
- 02/\P
-Partial match: 02/
- 02/0\P
-Partial match: 02/0
- 02/1\P
-Partial match: 02/1
- ** Failers\P
-No match
- \P
-No match
- 123\P
-No match
- 33/4/04\P
-No match
- 3/13/04\P
-No match
- 0/1/2003\P
-No match
- 0/\P
-No match
- 02/0/\P
-No match
- 02/13\P
-No match
-
-/0{0,2}ABC/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'C'
-
-/\d{3,}ABC/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'C'
-
-/\d*ABC/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'C'
-
-/[abc]+DE/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'E'
-
-/[abc]?123/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = '3'
- 123\P
- 0: 123
- a\P
-Partial match: a
- b\P
-Partial match: b
- c\P
-Partial match: c
- c12\P
-Partial match: c12
- c123\P
- 0: c123
-
-/^(?:\d){3,5}X/I
-Capturing subpattern count = 0
-Options: anchored
-No first char
-Need char = 'X'
- 1\P
-Partial match: 1
- 123\P
-Partial match: 123
- 123X
- 0: 123X
- 1234\P
-Partial match: 1234
- 1234X
- 0: 1234X
- 12345\P
-Partial match: 12345
- 12345X
- 0: 12345X
- *** Failers
-No match
- 1X
-No match
- 123456\P
-No match
-
-/abc/IS>testsavedregex
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-Subject length lower bound = 3
-No starting char list
-Compiled pattern written to testsavedregex
-Study data written to testsavedregex
-<testsavedregex
-Compiled pattern loaded from testsavedregex
-Study data loaded from testsavedregex
- abc
- 0: abc
- ** Failers
-No match
- bca
-No match
-
-/abc/ISS>testsavedregex
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-Compiled pattern written to testsavedregex
-<testsavedregex
-Compiled pattern loaded from testsavedregex
-No study data
- abc
- 0: abc
- ** Failers
-No match
- bca
-No match
-
-/abc/IFS>testsavedregex
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-Subject length lower bound = 3
-No starting char list
-Compiled pattern written to testsavedregex
-Study data written to testsavedregex
-<testsavedregex
-Compiled pattern (byte-inverted) loaded from testsavedregex
-Study data loaded from testsavedregex
- abc
- 0: abc
- ** Failers
-No match
- bca
-No match
-
-/abc/IFSS>testsavedregex
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
-Compiled pattern written to testsavedregex
-<testsavedregex
-Compiled pattern (byte-inverted) loaded from testsavedregex
-No study data
- abc
- 0: abc
- ** Failers
-No match
- bca
-No match
-
-/(a|b)/IS>testsavedregex
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b
-Compiled pattern written to testsavedregex
-Study data written to testsavedregex
-<testsavedregex
-Compiled pattern loaded from testsavedregex
-Study data loaded from testsavedregex
- abc
- 0: a
- 1: a
- ** Failers
- 0: a
- 1: a
- def
-No match
-
-/(a|b)/ISS>testsavedregex
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Compiled pattern written to testsavedregex
-<testsavedregex
-Compiled pattern loaded from testsavedregex
-No study data
- abc
- 0: a
- 1: a
- ** Failers
- 0: a
- 1: a
- def
-No match
-
-/(a|b)/ISF>testsavedregex
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b
-Compiled pattern written to testsavedregex
-Study data written to testsavedregex
-<testsavedregex
-Compiled pattern (byte-inverted) loaded from testsavedregex
-Study data loaded from testsavedregex
- abc
- 0: a
- 1: a
- ** Failers
- 0: a
- 1: a
- def
-No match
-
-/(a|b)/ISSF>testsavedregex
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Compiled pattern written to testsavedregex
-<testsavedregex
-Compiled pattern (byte-inverted) loaded from testsavedregex
-No study data
- abc
- 0: a
- 1: a
- ** Failers
- 0: a
- 1: a
- def
-No match
-
-~<(\w+)/?>(.)*</(\1)>~smgI
-Capturing subpattern count = 3
-Max back reference = 1
-Options: multiline dotall
-First char = '<'
-Need char = '>'
- \J1024<!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>
- 0: <seite>\x0a<dokumenteninformation>\x0a<seitentitel>Partner der LCO</seitentitel>\x0a<sprache>de</sprache>\x0a<seitenbeschreibung>Partner der LINEAS Consulting\x0aGmbH</seitenbeschreibung>\x0a<schluesselworte>LINEAS Consulting GmbH Hamburg\x0aPartnerfirmen</schluesselworte>\x0a<revisit>30 days</revisit>\x0a<robots>index,follow</robots>\x0a<menueinformation>\x0a<aktiv>ja</aktiv>\x0a<menueposition>3</menueposition>\x0a<menuetext>Partner</menuetext>\x0a</menueinformation>\x0a<lastedited>\x0a<autor>LCO</autor>\x0a<firma>LINEAS Consulting</firma>\x0a<datum>15.10.2003</datum>\x0a</lastedited>\x0a</dokumenteninformation>\x0a<inhalt>\x0a\x0a<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\x0aGmbH</absatzueberschrift>\x0a\x0a<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\x0a<bild name="logo_ca.gif" rahmen="no"/></link> <link\x0aziel="http://www.ey.com/" zielfenster="_blank"><bild\x0aname="logo_euy.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\x0a<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.atelion.de/"\x0azielfenster="_blank"><bild\x0aname="logo_atelion.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.line-information.de/"\x0azielfenster="_blank">\x0a<bild name="logo_line_information.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\x0a\x0a<absatz><link ziel="http://www.incognis.de/"\x0azielfenster="_blank"><bild\x0aname="logo_incognis.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.addcraft.com/"\x0azielfenster="_blank"><bild\x0aname="logo_addcraft.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.comendo.com/"\x0azielfenster="_blank"><bild\x0aname="logo_comendo.gif" rahmen="no"/></link></absatz>\x0a\x0a</inhalt>\x0a</seite>
- 1: seite
- 2: \x0a
- 3: seite
-
-/^a/IF
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/line\nbreak/I
-Capturing subpattern count = 0
-Contains explicit CR or LF match
-No options
-First char = 'l'
-Need char = 'k'
- this is a line\nbreak
- 0: line\x0abreak
- line one\nthis is a line\nbreak in the second line
- 0: line\x0abreak
-
-/line\nbreak/If
-Capturing subpattern count = 0
-Contains explicit CR or LF match
-Options: firstline
-First char = 'l'
-Need char = 'k'
- this is a line\nbreak
- 0: line\x0abreak
- ** Failers
-No match
- line one\nthis is a line\nbreak in the second line
-No match
-
-/line\nbreak/Imf
-Capturing subpattern count = 0
-Contains explicit CR or LF match
-Options: multiline firstline
-First char = 'l'
-Need char = 'k'
- this is a line\nbreak
- 0: line\x0abreak
- ** Failers
-No match
- line one\nthis is a line\nbreak in the second line
-No match
-
-/(?i)(?-i)AbCd/I
-Capturing subpattern count = 0
-No options
-First char = 'A'
-Need char = 'd'
- AbCd
- 0: AbCd
- ** Failers
-No match
- abcd
-No match
-
-/a{11111111111111111111}/I
-Failed: number too big in {} quantifier at offset 22
-
-/(){64294967295}/I
-Failed: number too big in {} quantifier at offset 14
-
-/(){2,4294967295}/I
-Failed: number too big in {} quantifier at offset 15
-
-"(?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
-Max back reference = 1
-No options
-First char = 'a' (caseless)
-Need char = 'B'
- abcdefghijklAkB
- 0: abcdefghijklAkB
- 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
-Max back reference = 11
-Named capturing subpatterns:
- n0 1
- n1 2
- n10 11
- n11 12
- n2 3
- n3 4
- n4 5
- n5 6
- n6 7
- n7 8
- n8 9
- n9 10
-No options
-First char = 'a'
-Need char = 'B'
- abcdefghijklAkB
- 0: abcdefghijklAkB
- 1: a
- 2: b
- 3: c
- 4: d
- 5: e
- 6: f
- 7: g
- 8: h
- 9: i
-10: j
-11: k
-12: l
-
-"(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
-Capturing subpattern count = 12
-Max back reference = 11
-No options
-First char = 'a'
-Need char = 'B'
- abcdefghijklAkB
- 0: abcdefghijklAkB
- 1: a
- 2: b
- 3: c
- 4: d
- 5: e
- 6: f
- 7: g
- 8: h
- 9: i
-10: j
-11: k
-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:
- name0 1
- name1 2
- name10 11
- name100 101
- name11 12
- name12 13
- name13 14
- name14 15
- name15 16
- name16 17
- name17 18
- name18 19
- name19 20
- name2 3
- name20 21
- name21 22
- name22 23
- name23 24
- name24 25
- name25 26
- name26 27
- name27 28
- name28 29
- name29 30
- name3 4
- name30 31
- name31 32
- name32 33
- name33 34
- name34 35
- name35 36
- name36 37
- name37 38
- name38 39
- name39 40
- name4 5
- name40 41
- name41 42
- name42 43
- name43 44
- name44 45
- name45 46
- name46 47
- name47 48
- name48 49
- name49 50
- name5 6
- name50 51
- name51 52
- name52 53
- name53 54
- name54 55
- name55 56
- name56 57
- name57 58
- name58 59
- name59 60
- name6 7
- name60 61
- name61 62
- name62 63
- name63 64
- name64 65
- name65 66
- name66 67
- name67 68
- name68 69
- name69 70
- name7 8
- name70 71
- name71 72
- name72 73
- name73 74
- name74 75
- name75 76
- name76 77
- name77 78
- name78 79
- name79 80
- name8 9
- name80 81
- name81 82
- name82 83
- name83 84
- name84 85
- name85 86
- name86 87
- name87 88
- name88 89
- name89 90
- name9 10
- name90 91
- name91 92
- name92 93
- name93 94
- name94 95
- name95 96
- name96 97
- name97 98
- name98 99
- name99 100
-No options
-First char = 'a'
-Need char = 'a'
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-Matched, but too many substrings
- 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 1: a
- 2: a
- 3: a
- 4: a
- 5: a
- 6: a
- 7: a
- 8: a
- 9: a
-10: a
-11: a
-12: a
-13: a
-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
-No options
-First char = 'a'
-Need char = 'a'
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-Matched, but too many substrings
- 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 1: a
- 2: a
- 3: a
- 4: a
- 5: a
- 6: a
- 7: a
- 8: a
- 9: a
-10: a
-11: a
-12: a
-13: a
-14: a
-
-/[^()]*(?:\((?R)\)[^()]*)*/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- (this(and)that
- 0:
- (this(and)that)
- 0: (this(and)that)
- (this(and)that)stuff
- 0: (this(and)that)stuff
-
-/[^()]*(?:\((?>(?R))\)[^()]*)*/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- (this(and)that
- 0:
- (this(and)that)
- 0: (this(and)that)
-
-/[^()]*(?:\((?R)\))*[^()]*/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- (this(and)that
- 0:
- (this(and)that)
- 0: (this(and)that)
-
-/(?:\((?R)\))*[^()]*/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- (this(and)that
- 0:
- (this(and)that)
- 0:
- ((this))
- 0: ((this))
-
-/(?:\((?R)\))|[^()]*/I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
- (this(and)that
- 0:
- (this(and)that)
- 0:
- (this)
- 0: (this)
- ((this))
- 0: ((this))
-
-/\x{0000ff}/I
-Capturing subpattern count = 0
-No options
-First char = \xff
-No need char
-
-/^((?P<A>a1)|(?P<A>a2)b)/I
-Failed: two named subpatterns have the same name at offset 17
-
-/^((?P<A>a1)|(?P<A>a2)b)/IJ
-Capturing subpattern count = 3
-Named capturing subpatterns:
- A 2
- A 3
-Options: anchored dupnames
-No first char
-No need char
- a1b\CA
- 0: a1
- 1: a1
- 2: a1
- C a1 (2) A
- a2b\CA
- 0: a2b
- 1: a2b
- 2: <unset>
- 3: a2
- C a2 (2) A
- ** Failers
-No match
- a1b\CZ\CA
-no parentheses with name "Z"
- 0: a1
- 1: a1
- 2: a1
-copy substring Z failed -7
- C a1 (2) A
-
-/(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/IJ
-Capturing subpattern count = 3
-Named capturing subpatterns:
- a 1
- a 3
- b 2
-May match empty string
-Options: dupnames
-No first char
-No need char
-
-/^(?P<A>a)(?P<A>b)/IJ
-Capturing subpattern count = 2
-Named capturing subpatterns:
- A 1
- A 2
-Options: anchored dupnames
-No first char
-No need char
- ab\CA
- 0: ab
- 1: a
- 2: b
- C a (1) A
-
-/^(?P<A>a)(?P<A>b)|cd/IJ
-Capturing subpattern count = 2
-Named capturing subpatterns:
- A 1
- A 2
-Options: dupnames
-No first char
-No need char
- ab\CA
- 0: ab
- 1: a
- 2: b
- C a (1) A
- cd\CA
- 0: cd
-copy substring A failed -7
-
-/^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
-Capturing subpattern count = 4
-Named capturing subpatterns:
- A 1
- A 2
- A 3
- A 4
-Options: dupnames
-No first char
-No need char
- cdefgh\CA
- 0: cdefgh
- 1: <unset>
- 2: <unset>
- 3: ef
- 4: gh
- C ef (2) A
-
-/^((?P<A>a1)|(?P<A>a2)b)/IJ
-Capturing subpattern count = 3
-Named capturing subpatterns:
- A 2
- A 3
-Options: anchored dupnames
-No first char
-No need char
- a1b\GA
- 0: a1
- 1: a1
- 2: a1
- G a1 (2) A
- a2b\GA
- 0: a2b
- 1: a2b
- 2: <unset>
- 3: a2
- G a2 (2) A
- ** Failers
-No match
- a1b\GZ\GA
-no parentheses with name "Z"
- 0: a1
- 1: a1
- 2: a1
-get substring Z failed -7
- G a1 (2) A
-
-/^(?P<A>a)(?P<A>b)/IJ
-Capturing subpattern count = 2
-Named capturing subpatterns:
- A 1
- A 2
-Options: anchored dupnames
-No first char
-No need char
- ab\GA
- 0: ab
- 1: a
- 2: b
- G a (1) A
-
-/^(?P<A>a)(?P<A>b)|cd/IJ
-Capturing subpattern count = 2
-Named capturing subpatterns:
- A 1
- A 2
-Options: dupnames
-No first char
-No need char
- ab\GA
- 0: ab
- 1: a
- 2: b
- G a (1) A
- cd\GA
- 0: cd
-get substring A failed -7
-
-/^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/IJ
-Capturing subpattern count = 4
-Named capturing subpatterns:
- A 1
- A 2
- A 3
- A 4
-Options: dupnames
-No first char
-No need char
- cdefgh\GA
- 0: cdefgh
- 1: <unset>
- 2: <unset>
- 3: ef
- 4: gh
- G ef (2) A
-
-/(?J)^((?P<A>a1)|(?P<A>a2)b)/I
-Capturing subpattern count = 3
-Named capturing subpatterns:
- A 2
- A 3
-Options: anchored dupnames
-Duplicate name status changes
-No first char
-No need char
- a1b\CA
- 0: a1
- 1: a1
- 2: a1
- C a1 (2) A
- a2b\CA
- 0: a2b
- 1: a2b
- 2: <unset>
- 3: a2
- C a2 (2) A
-
-/^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
-Failed: two named subpatterns have the same name at offset 37
-
-/ In this next test, J is not set at the outer level; consequently it isn't
-set in the pattern's options; consequently pcre_get_named_substring() produces
-a random value. /Ix
-Capturing subpattern count = 1
-Options: extended
-First char = 'I'
-Need char = 'e'
-
-/^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
-Capturing subpattern count = 4
-Named capturing subpatterns:
- A 1
- B 2
- B 3
- C 4
-Options: anchored
-Duplicate name status changes
-No first char
-No need char
- a bc d\CA\CB\CC
- 0: a bc d
- 1: a
- 2: b
- 3: c
- 4: d
- C a (1) A
- C b (1) B
- C d (1) C
-
-/^(?P<A>a)?(?(A)a|b)/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
- A 1
-Options: anchored
-No first char
-No need char
- aabc
- 0: aa
- 1: a
- bc
- 0: b
- ** Failers
-No match
- abc
-No match
-
-/(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
- ZZ 1
-No options
-No first char
-Need char = 'X'
- bXaX
- 0: bXaX
- 1: X
-
-/(?:(?(2y)a|b)(X))+/I
-Failed: malformed number or name after (?( at offset 7
-
-/(?:(?(ZA)a|b)(?P<ZZ>X))+/I
-Failed: reference to non-existent subpattern at offset 9
-
-/(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
- ZZ 1
-No options
-No first char
-Need char = 'X'
- bbXaaX
- 0: bbXaaX
- 1: X
-
-/(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
- ZZ 1
-No options
-No first char
-Need char = 'X'
- (b)\\Xa\\X
- 0: (b)\Xa\X
- 1: X
-
-/(?P<ABC/I
-Failed: syntax error in subpattern name (missing terminator) at offset 7
-
-/(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
-Capturing subpattern count = 1
-Max back reference = 1
-Named capturing subpatterns:
- A 1
-No options
-No first char
-No need char
- bXXaYYaY
- 0: bXXaYYaY
- 1: Y
- bXYaXXaX
- 0: bX
- 1: X
-
-/()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
-Capturing subpattern count = 10
-Max back reference = 10
-Named capturing subpatterns:
- A 10
-No options
-No first char
-No need char
- bXXaYYaY
- 0: bXXaYYaY
- 1:
- 2:
- 3:
- 4:
- 5:
- 6:
- 7:
- 8:
- 9:
-10: Y
-
-/\s*,\s*/IS
-Capturing subpattern count = 0
-No options
-No first char
-Need char = ','
-Subject length lower bound = 1
-Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 ,
- \x0b,\x0b
- 0: \x0b,\x0b
- \x0c,\x0d
- 0: \x0c,\x0d
-
-/^abc/Im
-Capturing subpattern count = 0
-Options: multiline
-First char at start or follows newline
-Need char = 'c'
- xyz\nabc
- 0: abc
- xyz\nabc\<lf>
- 0: abc
- xyz\r\nabc\<lf>
- 0: abc
- xyz\rabc\<cr>
- 0: abc
- xyz\r\nabc\<crlf>
- 0: abc
- ** Failers
-No match
- xyz\nabc\<cr>
-No match
- xyz\r\nabc\<cr>
-No match
- xyz\nabc\<crlf>
-No match
- xyz\rabc\<crlf>
-No match
- xyz\rabc\<lf>
-No match
-
-/abc$/Im<lf>
-Capturing subpattern count = 0
-Options: multiline
-Forced newline sequence: LF
-First char = 'a'
-Need char = 'c'
- xyzabc
- 0: abc
- xyzabc\n
- 0: abc
- xyzabc\npqr
- 0: abc
- xyzabc\r\<cr>
- 0: abc
- xyzabc\rpqr\<cr>
- 0: abc
- xyzabc\r\n\<crlf>
- 0: abc
- xyzabc\r\npqr\<crlf>
- 0: abc
- ** Failers
-No match
- xyzabc\r
-No match
- xyzabc\rpqr
-No match
- xyzabc\r\n
-No match
- xyzabc\r\npqr
-No match
-
-/^abc/Im<cr>
-Capturing subpattern count = 0
-Options: multiline
-Forced newline sequence: CR
-First char at start or follows newline
-Need char = 'c'
- xyz\rabcdef
- 0: abc
- xyz\nabcdef\<lf>
- 0: abc
- ** Failers
-No match
- xyz\nabcdef
-No match
-
-/^abc/Im<lf>
-Capturing subpattern count = 0
-Options: multiline
-Forced newline sequence: LF
-First char at start or follows newline
-Need char = 'c'
- xyz\nabcdef
- 0: abc
- xyz\rabcdef\<cr>
- 0: abc
- ** Failers
-No match
- xyz\rabcdef
-No match
-
-/^abc/Im<crlf>
-Capturing subpattern count = 0
-Options: multiline
-Forced newline sequence: CRLF
-First char at start or follows newline
-Need char = 'c'
- xyz\r\nabcdef
- 0: abc
- xyz\rabcdef\<cr>
- 0: abc
- ** Failers
-No match
- xyz\rabcdef
-No match
-
-/^abc/Im<bad>
-Unknown modifier at: <bad>
-
-
-/abc/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-Need char = 'c'
- xyz\rabc\<bad>
-Unknown escape sequence at: <bad>
- abc
- 0: abc
-
-/.*/I<lf>
-Capturing subpattern count = 0
-May match empty string
-Options:
-Forced newline sequence: LF
-First char at start or follows newline
-No need char
- abc\ndef
- 0: abc
- abc\rdef
- 0: abc\x0ddef
- abc\r\ndef
- 0: abc\x0d
- \<cr>abc\ndef
- 0: abc\x0adef
- \<cr>abc\rdef
- 0: abc
- \<cr>abc\r\ndef
- 0: abc
- \<crlf>abc\ndef
- 0: abc\x0adef
- \<crlf>abc\rdef
- 0: abc\x0ddef
- \<crlf>abc\r\ndef
- 0: abc
-
-/\w+(.)(.)?def/Is
-Capturing subpattern count = 2
-Options: dotall
-No first char
-Need char = 'f'
- abc\ndef
- 0: abc\x0adef
- 1: \x0a
- abc\rdef
- 0: abc\x0ddef
- 1: \x0d
- abc\r\ndef
- 0: abc\x0d\x0adef
- 1: \x0d
- 2: \x0a
-
-+((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+I
-Capturing subpattern count = 1
-May match empty string
-No options
-No first char
-No need char
- /* this is a C style comment */\M
-Minimum match() limit = 120
-Minimum match() recursion limit = 6
- 0: /* this is a C style comment */
- 1: /* this is a C style comment */
-
-/(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
- B 1
-No options
-No first char
-Need char = '.'
-
-/()()()()()()()()()()()()()()()()()()()()
- ()()()()()()()()()()()()()()()()()()()()
- ()()()()()()()()()()()()()()()()()()()()
- ()()()()()()()()()()()()()()()()()()()()
- ()()()()()()()()()()()()()()()()()()()()
- (.(.))/Ix
-Capturing subpattern count = 102
-Options: extended
-No first char
-No need char
- XY\O400
- 0: XY
- 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: XY
-102: Y
-
-/(a*b|(?i:c*(?-i)d))/IS
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: C a b c d
-
-/()[ab]xyz/IS
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 4
-Starting chars: a b
-
-/(|)[ab]xyz/IS
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 4
-Starting chars: a b
-
-/(|c)[ab]xyz/IS
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 4
-Starting chars: a b c
-
-/(|c?)[ab]xyz/IS
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 4
-Starting chars: a b c
-
-/(d?|c?)[ab]xyz/IS
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 4
-Starting chars: a b c d
-
-/(d?|c)[ab]xyz/IS
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 4
-Starting chars: a b c d
-
-/^a*b\d/DZ
-------------------------------------------------------------------
- Bra
- ^
- a*+
- b
- \d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-Need char = 'b'
-
-/^a*+b\d/DZ
-------------------------------------------------------------------
- Bra
- ^
- a*+
- b
- \d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-Need char = 'b'
-
-/^a*?b\d/DZ
-------------------------------------------------------------------
- Bra
- ^
- a*+
- b
- \d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-Need char = 'b'
-
-/^a+A\d/DZ
-------------------------------------------------------------------
- Bra
- ^
- a++
- A
- \d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored
-No first char
-Need char = 'A'
- aaaA5
- 0: aaaA5
- ** Failers
-No match
- aaaa5
-No match
-
-/^a*A\d/IiDZ
-------------------------------------------------------------------
- Bra
- ^
- /i a*
- /i A
- \d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-Options: anchored caseless
-No first char
-Need char = 'A' (caseless)
- aaaA5
- 0: aaaA5
- aaaa5
- 0: aaaa5
-
-/(a*|b*)[cd]/IS
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b c d
-
-/(a+|b*)[cd]/IS
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b c d
-
-/(a*|b+)[cd]/IS
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: a b c d
-
-/(a+|b+)[cd]/IS
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 2
-Starting chars: a b
-
-/((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
- ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
- (((
- a
- ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
- ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
- )))
-/Ix
-Capturing subpattern count = 203
-Options: extended
-First char = 'a'
-No need char
- large nest
-Matched, but too many substrings
- 0: a
- 1: a
- 2: a
- 3: a
- 4: a
- 5: a
- 6: a
- 7: a
- 8: a
- 9: a
-10: a
-11: a
-12: a
-13: a
-14: a
-
-/a*\d/BZ
-------------------------------------------------------------------
- Bra
- a*+
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/a*\D/BZ
-------------------------------------------------------------------
- Bra
- a*
- \D
- Ket
- End
-------------------------------------------------------------------
-
-/0*\d/BZ
-------------------------------------------------------------------
- Bra
- 0*
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/0*\D/BZ
-------------------------------------------------------------------
- Bra
- 0*+
- \D
- Ket
- End
-------------------------------------------------------------------
-
-/a*\s/BZ
-------------------------------------------------------------------
- Bra
- a*+
- \s
- Ket
- End
-------------------------------------------------------------------
-
-/a*\S/BZ
-------------------------------------------------------------------
- Bra
- a*
- \S
- Ket
- End
-------------------------------------------------------------------
-
-/ *\s/BZ
-------------------------------------------------------------------
- Bra
- *
- \s
- Ket
- End
-------------------------------------------------------------------
-
-/ *\S/BZ
-------------------------------------------------------------------
- Bra
- *+
- \S
- Ket
- End
-------------------------------------------------------------------
-
-/a*\w/BZ
-------------------------------------------------------------------
- Bra
- a*
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/a*\W/BZ
-------------------------------------------------------------------
- Bra
- a*+
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/=*\w/BZ
-------------------------------------------------------------------
- Bra
- =*+
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/=*\W/BZ
-------------------------------------------------------------------
- Bra
- =*
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/\d*a/BZ
-------------------------------------------------------------------
- Bra
- \d*+
- a
- Ket
- End
-------------------------------------------------------------------
-
-/\d*2/BZ
-------------------------------------------------------------------
- Bra
- \d*
- 2
- Ket
- End
-------------------------------------------------------------------
-
-/\d*\d/BZ
-------------------------------------------------------------------
- Bra
- \d*
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/\d*\D/BZ
-------------------------------------------------------------------
- Bra
- \d*+
- \D
- Ket
- End
-------------------------------------------------------------------
-
-/\d*\s/BZ
-------------------------------------------------------------------
- Bra
- \d*+
- \s
- Ket
- End
-------------------------------------------------------------------
-
-/\d*\S/BZ
-------------------------------------------------------------------
- Bra
- \d*
- \S
- Ket
- End
-------------------------------------------------------------------
-
-/\d*\w/BZ
-------------------------------------------------------------------
- Bra
- \d*
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/\d*\W/BZ
-------------------------------------------------------------------
- Bra
- \d*+
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/\D*a/BZ
-------------------------------------------------------------------
- Bra
- \D*
- a
- Ket
- End
-------------------------------------------------------------------
-
-/\D*2/BZ
-------------------------------------------------------------------
- Bra
- \D*+
- 2
- Ket
- End
-------------------------------------------------------------------
-
-/\D*\d/BZ
-------------------------------------------------------------------
- Bra
- \D*+
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/\D*\D/BZ
-------------------------------------------------------------------
- Bra
- \D*
- \D
- Ket
- End
-------------------------------------------------------------------
-
-/\D*\s/BZ
-------------------------------------------------------------------
- Bra
- \D*
- \s
- Ket
- End
-------------------------------------------------------------------
-
-/\D*\S/BZ
-------------------------------------------------------------------
- Bra
- \D*
- \S
- Ket
- End
-------------------------------------------------------------------
-
-/\D*\w/BZ
-------------------------------------------------------------------
- Bra
- \D*
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/\D*\W/BZ
-------------------------------------------------------------------
- Bra
- \D*
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/\s*a/BZ
-------------------------------------------------------------------
- Bra
- \s*+
- a
- Ket
- End
-------------------------------------------------------------------
-
-/\s*2/BZ
-------------------------------------------------------------------
- Bra
- \s*+
- 2
- Ket
- End
-------------------------------------------------------------------
-
-/\s*\d/BZ
-------------------------------------------------------------------
- Bra
- \s*+
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/\s*\D/BZ
-------------------------------------------------------------------
- Bra
- \s*
- \D
- Ket
- End
-------------------------------------------------------------------
-
-/\s*\s/BZ
-------------------------------------------------------------------
- Bra
- \s*
- \s
- Ket
- End
-------------------------------------------------------------------
-
-/\s*\S/BZ
-------------------------------------------------------------------
- Bra
- \s*+
- \S
- Ket
- End
-------------------------------------------------------------------
-
-/\s*\w/BZ
-------------------------------------------------------------------
- Bra
- \s*+
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/\s*\W/BZ
-------------------------------------------------------------------
- Bra
- \s*
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/\S*a/BZ
-------------------------------------------------------------------
- Bra
- \S*
- a
- Ket
- End
-------------------------------------------------------------------
-
-/\S*2/BZ
-------------------------------------------------------------------
- Bra
- \S*
- 2
- Ket
- End
-------------------------------------------------------------------
-
-/\S*\d/BZ
-------------------------------------------------------------------
- Bra
- \S*
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/\S*\D/BZ
-------------------------------------------------------------------
- Bra
- \S*
- \D
- Ket
- End
-------------------------------------------------------------------
-
-/\S*\s/BZ
-------------------------------------------------------------------
- Bra
- \S*+
- \s
- Ket
- End
-------------------------------------------------------------------
-
-/\S*\S/BZ
-------------------------------------------------------------------
- Bra
- \S*
- \S
- Ket
- End
-------------------------------------------------------------------
-
-/\S*\w/BZ
-------------------------------------------------------------------
- Bra
- \S*
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/\S*\W/BZ
-------------------------------------------------------------------
- Bra
- \S*
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/\w*a/BZ
-------------------------------------------------------------------
- Bra
- \w*
- a
- Ket
- End
-------------------------------------------------------------------
-
-/\w*2/BZ
-------------------------------------------------------------------
- Bra
- \w*
- 2
- Ket
- End
-------------------------------------------------------------------
-
-/\w*\d/BZ
-------------------------------------------------------------------
- Bra
- \w*
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/\w*\D/BZ
-------------------------------------------------------------------
- Bra
- \w*
- \D
- Ket
- End
-------------------------------------------------------------------
-
-/\w*\s/BZ
-------------------------------------------------------------------
- Bra
- \w*+
- \s
- Ket
- End
-------------------------------------------------------------------
-
-/\w*\S/BZ
-------------------------------------------------------------------
- Bra
- \w*
- \S
- Ket
- End
-------------------------------------------------------------------
-
-/\w*\w/BZ
-------------------------------------------------------------------
- Bra
- \w*
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/\w*\W/BZ
-------------------------------------------------------------------
- Bra
- \w*+
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/\W*a/BZ
-------------------------------------------------------------------
- Bra
- \W*+
- a
- Ket
- End
-------------------------------------------------------------------
-
-/\W*2/BZ
-------------------------------------------------------------------
- Bra
- \W*+
- 2
- Ket
- End
-------------------------------------------------------------------
-
-/\W*\d/BZ
-------------------------------------------------------------------
- Bra
- \W*+
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/\W*\D/BZ
-------------------------------------------------------------------
- Bra
- \W*
- \D
- Ket
- End
-------------------------------------------------------------------
-
-/\W*\s/BZ
-------------------------------------------------------------------
- Bra
- \W*
- \s
- Ket
- End
-------------------------------------------------------------------
-
-/\W*\S/BZ
-------------------------------------------------------------------
- Bra
- \W*
- \S
- Ket
- End
-------------------------------------------------------------------
-
-/\W*\w/BZ
-------------------------------------------------------------------
- Bra
- \W*+
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/\W*\W/BZ
-------------------------------------------------------------------
- Bra
- \W*
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/[^a]+a/BZ
-------------------------------------------------------------------
- Bra
- [^a]++
- a
- Ket
- End
-------------------------------------------------------------------
-
-/[^a]+a/BZi
-------------------------------------------------------------------
- Bra
- /i [^a]++
- /i a
- Ket
- End
-------------------------------------------------------------------
-
-/[^a]+A/BZi
-------------------------------------------------------------------
- Bra
- /i [^a]++
- /i A
- Ket
- End
-------------------------------------------------------------------
-
-/[^a]+b/BZ
-------------------------------------------------------------------
- Bra
- [^a]+
- b
- Ket
- End
-------------------------------------------------------------------
-
-/[^a]+\d/BZ
-------------------------------------------------------------------
- Bra
- [^a]+
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/a*[^a]/BZ
-------------------------------------------------------------------
- Bra
- a*+
- [^a]
- Ket
- End
-------------------------------------------------------------------
-
-/(?P<abc>x)(?P<xyz>y)/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
- abc 1
- xyz 2
-No options
-First char = 'x'
-Need char = 'y'
- xy\Cabc\Cxyz
- 0: xy
- 1: x
- 2: y
- C x (1) abc
- C y (1) xyz
-
-/(?<abc>x)(?'xyz'y)/I
-Capturing subpattern count = 2
-Named capturing subpatterns:
- abc 1
- xyz 2
-No options
-First char = 'x'
-Need char = 'y'
- xy\Cabc\Cxyz
- 0: xy
- 1: x
- 2: y
- C x (1) abc
- C y (1) xyz
-
-/(?<abc'x)(?'xyz'y)/I
-Failed: syntax error in subpattern name (missing terminator) at offset 6
-
-/(?<abc>x)(?'xyz>y)/I
-Failed: syntax error in subpattern name (missing terminator) at offset 15
-
-/(?P'abc'x)(?P<xyz>y)/I
-Failed: unrecognized character after (?P at offset 3
-
-/^(?:(?(ZZ)a|b)(?<ZZ>X))+/
- bXaX
- 0: bXaX
- 1: X
- bXbX
- 0: bX
- 1: X
- ** Failers
-No match
- aXaX
-No match
- aXbX
-No match
-
-/^(?P>abc)(?<abcd>xxx)/
-Failed: reference to non-existent subpattern at offset 8
-
-/^(?P>abc)(?<abc>x|y)/
- xx
- 0: xx
- 1: x
- xy
- 0: xy
- 1: y
- yy
- 0: yy
- 1: y
- yx
- 0: yx
- 1: x
-
-/^(?P>abc)(?P<abc>x|y)/
- xx
- 0: xx
- 1: x
- xy
- 0: xy
- 1: y
- yy
- 0: yy
- 1: y
- yx
- 0: yx
- 1: x
-
-/^((?(abc)a|b)(?<abc>x|y))+/
- bxay
- 0: bxay
- 1: ay
- 2: y
- bxby
- 0: bx
- 1: bx
- 2: x
- ** Failers
-No match
- axby
-No match
-
-/^(((?P=abc)|X)(?<abc>x|y))+/
- XxXxxx
- 0: XxXxxx
- 1: xx
- 2: x
- 3: x
- XxXyyx
- 0: XxXyyx
- 1: yx
- 2: y
- 3: x
- XxXyxx
- 0: XxXy
- 1: Xy
- 2: X
- 3: y
- ** Failers
-No match
- x
-No match
-
-/^(?1)(abc)/
- abcabc
- 0: abcabc
- 1: abc
-
-/^(?:(?:\1|X)(a|b))+/
- Xaaa
- 0: Xaaa
- 1: a
- Xaba
- 0: Xa
- 1: a
-
-/^[\E\Qa\E-\Qz\E]+/BZ
-------------------------------------------------------------------
- Bra
- ^
- [a-z]++
- Ket
- End
-------------------------------------------------------------------
-
-/^[a\Q]bc\E]/BZ
-------------------------------------------------------------------
- Bra
- ^
- [\]a-c]
- Ket
- End
-------------------------------------------------------------------
-
-/^[a-\Q\E]/BZ
-------------------------------------------------------------------
- Bra
- ^
- [\-a]
- Ket
- End
-------------------------------------------------------------------
-
-/^(?P>abc)[()](?<abc>)/BZ
-------------------------------------------------------------------
- Bra
- ^
- Recurse
- [()]
- CBra 1
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/^((?(abc)y)[()](?P<abc>x))+/BZ
-------------------------------------------------------------------
- Bra
- ^
- CBra 1
- Cond
- 2 Cond ref
- y
- Ket
- [()]
- CBra 2
- x
- Ket
- KetRmax
- Ket
- End
-------------------------------------------------------------------
- (xy)x
- 0: (xy)x
- 1: y)x
- 2: x
-
-/^(?P>abc)\Q()\E(?<abc>)/BZ
-------------------------------------------------------------------
- Bra
- ^
- Recurse
- ()
- CBra 1
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/^(?P>abc)[a\Q(]\E(](?<abc>)/BZ
-------------------------------------------------------------------
- Bra
- ^
- Recurse
- [(\]a]
- CBra 1
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/^(?P>abc) # this is (a comment)
- (?<abc>)/BZx
-------------------------------------------------------------------
- Bra
- ^
- Recurse
- CBra 1
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
-Capturing subpattern count = 4
-Max back reference = 4
-Named capturing subpatterns:
- four 4
- one 1
- three 3
- two 2
-May match empty string
-Options: anchored caseless
-No first char
-No need char
- 1221
- 0: 1221
- 1: 1221
- 2: 1
- Satan, oscillate my metallic sonatas!
- 0: Satan, oscillate my metallic sonatas!
- 1: <unset>
- 2: <unset>
- 3: Satan, oscillate my metallic sonatas
- 4: S
- A man, a plan, a canal: Panama!
- 0: A man, a plan, a canal: Panama!
- 1: <unset>
- 2: <unset>
- 3: A man, a plan, a canal: Panama
- 4: A
- Able was I ere I saw Elba.
- 0: Able was I ere I saw Elba.
- 1: <unset>
- 2: <unset>
- 3: Able was I ere I saw Elba
- 4: A
- *** Failers
-No match
- The quick brown fox
-No match
-
-/(?=(\w+))\1:/I
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-No first char
-Need char = ':'
- abcd:
- 0: abcd:
- 1: abcd
-
-/(?=(?'abc'\w+))\k<abc>:/I
-Capturing subpattern count = 1
-Max back reference = 1
-Named capturing subpatterns:
- abc 1
-No options
-No first char
-Need char = ':'
- abcd:
- 0: abcd:
- 1: abcd
-
-/(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
- adaa
- 0: adaa
- 1: a
- 2: d
- ** Failers
-No match
- addd
-No match
- adbb
-No match
-
-/(?'abc'a|b)(?<abc>d|e)(?&abc){2}/J
- bdaa
- 0: bdaa
- 1: b
- 2: d
- bdab
- 0: bdab
- 1: b
- 2: d
- ** Failers
-No match
- bddd
-No match
-
-/(?(<bc))/
-Failed: malformed number or name after (?( at offset 6
-
-/(?(''))/
-Failed: assertion expected after (?( at offset 4
-
-/(?('R')stuff)/
-Failed: reference to non-existent subpattern at offset 7
-
-/((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
- abcabc1Xabc2XabcXabcabc
- 0: abcabc1Xabc2XabcX
- 1: abcabc1Xabc2XabcX
- 2: abcabc1Xabc2XabcX
-
-/(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
- abcabc1Xabc2XabcXabcabc
- 0: abcabc1Xabc2XabcX
- 1: abcabc1Xabc2XabcX
- 2: abcabc1Xabc2XabcX
-
-/(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
-Failed: reference to non-existent subpattern at offset 29
-
-/^(?(DEFINE) abc | xyz ) /x
-Failed: DEFINE group contains more than one branch at offset 22
-
-/(?(DEFINE) abc) xyz/xI
-Capturing subpattern count = 0
-Options: extended
-First char = 'x'
-Need char = 'z'
-
-/(a|)*\d/
- \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-No match
- \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
-Matched, but too many substrings
-
-/^a.b/<lf>
- a\rb
- 0: a\x0db
- a\nb\<cr>
- 0: a\x0ab
- a\x85b\<anycrlf>
- 0: a\x85b
- ** Failers
-No match
- a\nb
-No match
- a\nb\<any>
-No match
- a\rb\<cr>
-No match
- a\rb\<any>
-No match
- a\x85b\<any>
-No match
- a\rb\<anycrlf>
-No match
-
-/^abc./mgx<any>
- abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
- 0: abc1
- 0: abc2
- 0: abc3
- 0: abc4
- 0: abc5
- 0: abc6
- 0: abc7
-
-/abc.$/mgx<any>
- abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
- 0: abc1
- 0: abc2
- 0: abc3
- 0: abc4
- 0: abc5
- 0: abc6
- 0: abc9
-
-/a/<cr><any>
-
-/a/<any><crlf>
-Failed: inconsistent NEWLINE options at offset 0
-
-/^a\Rb/<bsr_unicode>
- a\nb
- 0: a\x0ab
- a\rb
- 0: a\x0db
- a\r\nb
- 0: a\x0d\x0ab
- a\x0bb
- 0: a\x0bb
- a\x0cb
- 0: a\x0cb
- a\x85b
- 0: a\x85b
- ** Failers
-No match
- a\n\rb
-No match
-
-/^a\R*b/<bsr_unicode>
- ab
- 0: ab
- a\nb
- 0: a\x0ab
- a\rb
- 0: a\x0db
- a\r\nb
- 0: a\x0d\x0ab
- a\x0bb
- 0: a\x0bb
- a\x0cb
- 0: a\x0cb
- a\x85b
- 0: a\x85b
- a\n\rb
- 0: a\x0a\x0db
- a\n\r\x85\x0cb
- 0: a\x0a\x0d\x85\x0cb
-
-/^a\R+b/<bsr_unicode>
- a\nb
- 0: a\x0ab
- a\rb
- 0: a\x0db
- a\r\nb
- 0: a\x0d\x0ab
- a\x0bb
- 0: a\x0bb
- a\x0cb
- 0: a\x0cb
- a\x85b
- 0: a\x85b
- a\n\rb
- 0: a\x0a\x0db
- a\n\r\x85\x0cb
- 0: a\x0a\x0d\x85\x0cb
- ** Failers
-No match
- ab
-No match
-
-/^a\R{1,3}b/<bsr_unicode>
- a\nb
- 0: a\x0ab
- a\n\rb
- 0: a\x0a\x0db
- a\n\r\x85b
- 0: a\x0a\x0d\x85b
- a\r\n\r\nb
- 0: a\x0d\x0a\x0d\x0ab
- a\r\n\r\n\r\nb
- 0: a\x0d\x0a\x0d\x0a\x0d\x0ab
- a\n\r\n\rb
- 0: a\x0a\x0d\x0a\x0db
- a\n\n\r\nb
- 0: a\x0a\x0a\x0d\x0ab
- ** Failers
-No match
- a\n\n\n\rb
-No match
- a\r
-No match
-
-/^a[\R]b/<bsr_unicode>
- aRb
- 0: aRb
- ** Failers
-No match
- a\nb
-No match
-
-/(?&abc)X(?<abc>P)/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
- abc 1
-No options
-No first char
-Need char = 'P'
- abcPXP123
- 0: PXP
- 1: P
-
-/(?1)X(?<abc>P)/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
- abc 1
-No options
-No first char
-Need char = 'P'
- abcPXP123
- 0: PXP
- 1: P
-
-/(?:a(?&abc)b)*(?<abc>x)/
- 123axbaxbaxbx456
- 0: axbaxbaxbx
- 1: x
- 123axbaxbaxb456
- 0: x
- 1: x
-
-/(?:a(?&abc)b){1,5}(?<abc>x)/
- 123axbaxbaxbx456
- 0: axbaxbaxbx
- 1: x
-
-/(?:a(?&abc)b){2,5}(?<abc>x)/
- 123axbaxbaxbx456
- 0: axbaxbaxbx
- 1: x
-
-/(?:a(?&abc)b){2,}(?<abc>x)/
- 123axbaxbaxbx456
- 0: axbaxbaxbx
- 1: x
-
-/(abc)(?i:(?1))/
- defabcabcxyz
- 0: abcabc
- 1: abc
- DEFabcABCXYZ
-No match
-
-/(abc)(?:(?i)(?1))/
- defabcabcxyz
- 0: abcabc
- 1: abc
- DEFabcABCXYZ
-No match
-
-/^(a)\g-2/
-Failed: reference to non-existent subpattern at offset 7
-
-/^(a)\g/
-Failed: a numbered reference must not be zero at offset 5
-
-/^(a)\g{0}/
-Failed: a numbered reference must not be zero at offset 8
-
-/^(a)\g{3/
-Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 8
-
-/^(a)\g{aa}/
-Failed: reference to non-existent subpattern at offset 9
-
-/^a.b/<lf>
- a\rb
- 0: a\x0db
- *** Failers
-No match
- a\nb
-No match
-
-/.+foo/
- afoo
- 0: afoo
- ** Failers
-No match
- \r\nfoo
-No match
- \nfoo
-No match
-
-/.+foo/<crlf>
- afoo
- 0: afoo
- \nfoo
- 0: \x0afoo
- ** Failers
-No match
- \r\nfoo
-No match
-
-/.+foo/<any>
- afoo
- 0: afoo
- ** Failers
-No match
- \nfoo
-No match
- \r\nfoo
-No match
-
-/.+foo/s
- afoo
- 0: afoo
- \r\nfoo
- 0: \x0d\x0afoo
- \nfoo
- 0: \x0afoo
-
-/^$/mg<any>
- abc\r\rxyz
- 0:
- abc\n\rxyz
- 0:
- ** Failers
-No match
- abc\r\nxyz
-No match
-
-/(?m)^$/<any>g+
- abc\r\n\r\n
- 0:
- 0+ \x0d\x0a
-
-/(?m)^$|^\r\n/<any>g+
- abc\r\n\r\n
- 0:
- 0+ \x0d\x0a
- 0: \x0d\x0a
- 0+
-
-/(?m)$/<any>g+
- abc\r\n\r\n
- 0:
- 0+ \x0d\x0a\x0d\x0a
- 0:
- 0+ \x0d\x0a
- 0:
- 0+
-
-/abc.$/mgx<anycrlf>
- abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
- 0: abc1
- 0: abc4
- 0: abc5
- 0: abc9
-
-/^X/m
- XABC
- 0: X
- ** Failers
-No match
- XABC\B
-No match
-
-/(ab|c)(?-1)/BZ
-------------------------------------------------------------------
- Bra
- CBra 1
- ab
- Alt
- c
- Ket
- Recurse
- Ket
- End
-------------------------------------------------------------------
- abc
- 0: abc
- 1: ab
-
-/xy(?+1)(abc)/BZ
-------------------------------------------------------------------
- Bra
- xy
- Recurse
- CBra 1
- abc
- Ket
- Ket
- End
-------------------------------------------------------------------
- xyabcabc
- 0: xyabcabc
- 1: abc
- ** Failers
-No match
- xyabc
-No match
-
-/x(?-0)y/
-Failed: a numbered reference must not be zero at offset 5
-
-/x(?-1)y/
-Failed: reference to non-existent subpattern at offset 5
-
-/x(?+0)y/
-Failed: a numbered reference must not be zero at offset 5
-
-/x(?+1)y/
-Failed: reference to non-existent subpattern at offset 5
-
-/^(abc)?(?(-1)X|Y)/BZ
-------------------------------------------------------------------
- Bra
- ^
- Brazero
- CBra 1
- abc
- Ket
- Cond
- 1 Cond ref
- X
- Alt
- Y
- Ket
- Ket
- End
-------------------------------------------------------------------
- abcX
- 0: abcX
- 1: abc
- Y
- 0: Y
- ** Failers
-No match
- abcY
-No match
-
-/^((?(+1)X|Y)(abc))+/BZ
-------------------------------------------------------------------
- Bra
- ^
- CBra 1
- Cond
- 2 Cond ref
- X
- Alt
- Y
- Ket
- CBra 2
- abc
- Ket
- KetRmax
- Ket
- End
-------------------------------------------------------------------
- YabcXabc
- 0: YabcXabc
- 1: Xabc
- 2: abc
- YabcXabcXabc
- 0: YabcXabcXabc
- 1: Xabc
- 2: abc
- ** Failers
-No match
- XabcXabc
-No match
-
-/(?(-1)a)/BZ
-Failed: reference to non-existent subpattern at offset 6
-
-/((?(-1)a))/BZ
-------------------------------------------------------------------
- Bra
- CBra 1
- Cond
- 1 Cond ref
- a
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/((?(-2)a))/BZ
-Failed: reference to non-existent subpattern at offset 7
-
-/^(?(+1)X|Y)(.)/BZ
-------------------------------------------------------------------
- Bra
- ^
- Cond
- 1 Cond ref
- X
- Alt
- Y
- Ket
- CBra 1
- Any
- Ket
- Ket
- End
-------------------------------------------------------------------
- Y!
- 0: Y!
- 1: !
-
-/(?<A>tom|bon)-\k{A}/
- tom-tom
- 0: tom-tom
- 1: tom
- bon-bon
- 0: bon-bon
- 1: bon
- ** Failers
-No match
- tom-bon
-No match
-
-/\g{A/
-Failed: syntax error in subpattern name (missing terminator) at offset 4
-
-/(?|(abc)|(xyz))/BZ
-------------------------------------------------------------------
- Bra
- Bra
- CBra 1
- abc
- Ket
- Alt
- CBra 1
- xyz
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
- >abc<
- 0: abc
- 1: abc
- >xyz<
- 0: xyz
- 1: xyz
-
-/(x)(?|(abc)|(xyz))(x)/BZ
-------------------------------------------------------------------
- Bra
- CBra 1
- x
- Ket
- Bra
- CBra 2
- abc
- Ket
- Alt
- CBra 2
- xyz
- Ket
- Ket
- CBra 3
- x
- Ket
- Ket
- End
-------------------------------------------------------------------
- xabcx
- 0: xabcx
- 1: x
- 2: abc
- 3: x
- xxyzx
- 0: xxyzx
- 1: x
- 2: xyz
- 3: x
-
-/(x)(?|(abc)(pqr)|(xyz))(x)/BZ
-------------------------------------------------------------------
- Bra
- CBra 1
- x
- Ket
- Bra
- CBra 2
- abc
- Ket
- CBra 3
- pqr
- Ket
- Alt
- CBra 2
- xyz
- Ket
- Ket
- CBra 4
- x
- Ket
- Ket
- End
-------------------------------------------------------------------
- xabcpqrx
- 0: xabcpqrx
- 1: x
- 2: abc
- 3: pqr
- 4: x
- xxyzx
- 0: xxyzx
- 1: x
- 2: xyz
- 3: <unset>
- 4: x
-
-/\H++X/BZ
-------------------------------------------------------------------
- Bra
- \H++
- X
- Ket
- End
-------------------------------------------------------------------
- ** Failers
-No match
- XXXX
-No match
-
-/\H+\hY/BZ
-------------------------------------------------------------------
- Bra
- \H++
- \h
- Y
- Ket
- End
-------------------------------------------------------------------
- XXXX Y
- 0: XXXX Y
-
-/\H+ Y/BZ
-------------------------------------------------------------------
- Bra
- \H++
- Y
- Ket
- End
-------------------------------------------------------------------
-
-/\h+A/BZ
-------------------------------------------------------------------
- Bra
- \h++
- A
- Ket
- End
-------------------------------------------------------------------
-
-/\v*B/BZ
-------------------------------------------------------------------
- Bra
- \v*+
- B
- Ket
- End
-------------------------------------------------------------------
-
-/\V+\x0a/BZ
-------------------------------------------------------------------
- Bra
- \V++
- \x0a
- Ket
- End
-------------------------------------------------------------------
-
-/A+\h/BZ
-------------------------------------------------------------------
- Bra
- A++
- \h
- Ket
- End
-------------------------------------------------------------------
-
-/ *\H/BZ
-------------------------------------------------------------------
- Bra
- *+
- \H
- Ket
- End
-------------------------------------------------------------------
-
-/A*\v/BZ
-------------------------------------------------------------------
- Bra
- A*+
- \v
- Ket
- End
-------------------------------------------------------------------
-
-/\x0b*\V/BZ
-------------------------------------------------------------------
- Bra
- \x0b*+
- \V
- Ket
- End
-------------------------------------------------------------------
-
-/\d+\h/BZ
-------------------------------------------------------------------
- Bra
- \d++
- \h
- Ket
- End
-------------------------------------------------------------------
-
-/\d*\v/BZ
-------------------------------------------------------------------
- Bra
- \d*+
- \v
- Ket
- End
-------------------------------------------------------------------
-
-/S+\h\S+\v/BZ
-------------------------------------------------------------------
- Bra
- S++
- \h
- \S++
- \v
- Ket
- End
-------------------------------------------------------------------
-
-/\w{3,}\h\w+\v/BZ
-------------------------------------------------------------------
- Bra
- \w{3}
- \w*+
- \h
- \w++
- \v
- Ket
- End
-------------------------------------------------------------------
-
-/\h+\d\h+\w\h+\S\h+\H/BZ
-------------------------------------------------------------------
- Bra
- \h++
- \d
- \h++
- \w
- \h++
- \S
- \h++
- \H
- Ket
- End
-------------------------------------------------------------------
-
-/\v+\d\v+\w\v+\S\v+\V/BZ
-------------------------------------------------------------------
- Bra
- \v++
- \d
- \v++
- \w
- \v++
- \S
- \v++
- \V
- Ket
- End
-------------------------------------------------------------------
-
-/\H+\h\H+\d/BZ
-------------------------------------------------------------------
- Bra
- \H++
- \h
- \H+
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/\V+\v\V+\w/BZ
-------------------------------------------------------------------
- Bra
- \V++
- \v
- \V+
- \w
- Ket
- End
-------------------------------------------------------------------
-
-/\( (?: [^()]* | (?R) )* \)/x
-\J1024(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(0(0(0(0(0(0(0(0(0(00)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)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)0)0)0)0)0)0)0)0)0)
-
-/[\E]AAA/
-Failed: missing terminating ] for character class at offset 7
-
-/[\Q\E]AAA/
-Failed: missing terminating ] for character class at offset 9
-
-/[^\E]AAA/
-Failed: missing terminating ] for character class at offset 8
-
-/[^\Q\E]AAA/
-Failed: missing terminating ] for character class at offset 10
-
-/[\E^]AAA/
-Failed: missing terminating ] for character class at offset 8
-
-/[\Q\E^]AAA/
-Failed: missing terminating ] for character class at offset 10
-
-/A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/BZ
-------------------------------------------------------------------
- Bra
- A
- *PRUNE
- B
- *SKIP
- C
- *THEN
- D
- *COMMIT
- E
- *FAIL
- F
- *FAIL
- G
- *FAIL
- H
- *ACCEPT
- I
- Ket
- End
-------------------------------------------------------------------
-
-/^a+(*FAIL)/C
- aaaaaa
---->aaaaaa
- +0 ^ ^
- +1 ^ a+
- +3 ^ ^ (*FAIL)
- +3 ^ ^ (*FAIL)
- +3 ^ ^ (*FAIL)
- +3 ^ ^ (*FAIL)
- +3 ^ ^ (*FAIL)
- +3 ^^ (*FAIL)
-No match
-
-/a+b?c+(*FAIL)/C
- aaabccc
---->aaabccc
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ c+
- +6 ^ ^ (*FAIL)
- +6 ^ ^ (*FAIL)
- +6 ^ ^ (*FAIL)
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ c+
- +6 ^ ^ (*FAIL)
- +6 ^ ^ (*FAIL)
- +6 ^ ^ (*FAIL)
- +0 ^ a+
- +2 ^^ b?
- +4 ^ ^ c+
- +6 ^ ^ (*FAIL)
- +6 ^ ^ (*FAIL)
- +6 ^ ^ (*FAIL)
-No match
-
-/a+b?(*PRUNE)c+(*FAIL)/C
- aaabccc
---->aaabccc
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ (*PRUNE)
-+12 ^ ^ c+
-+14 ^ ^ (*FAIL)
-+14 ^ ^ (*FAIL)
-+14 ^ ^ (*FAIL)
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ (*PRUNE)
-+12 ^ ^ c+
-+14 ^ ^ (*FAIL)
-+14 ^ ^ (*FAIL)
-+14 ^ ^ (*FAIL)
- +0 ^ a+
- +2 ^^ b?
- +4 ^ ^ (*PRUNE)
-+12 ^ ^ c+
-+14 ^ ^ (*FAIL)
-+14 ^ ^ (*FAIL)
-+14 ^ ^ (*FAIL)
-No match
-
-/a+b?(*COMMIT)c+(*FAIL)/C
- aaabccc
---->aaabccc
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ (*COMMIT)
-+13 ^ ^ c+
-+15 ^ ^ (*FAIL)
-+15 ^ ^ (*FAIL)
-+15 ^ ^ (*FAIL)
-No match
-
-/a+b?(*SKIP)c+(*FAIL)/C
- aaabcccaaabccc
---->aaabcccaaabccc
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ (*SKIP)
-+11 ^ ^ c+
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ (*SKIP)
-+11 ^ ^ c+
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
-No match
-
-/a+b?(*THEN)c+(*FAIL)/C
- aaabccc
---->aaabccc
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ (*THEN)
-+11 ^ ^ c+
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
- +0 ^ a+
- +2 ^ ^ b?
- +4 ^ ^ (*THEN)
-+11 ^ ^ c+
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
- +0 ^ a+
- +2 ^^ b?
- +4 ^ ^ (*THEN)
-+11 ^ ^ c+
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
-+13 ^ ^ (*FAIL)
-No match
-
-/a(*MARK)b/
-Failed: (*MARK) must have an argument at offset 7
-
-/(?i:A{1,}\6666666666)/
-Failed: number is too big at offset 19
-
-/\g6666666666/
-Failed: number is too big at offset 11
-
-/[\g6666666666]/BZ
-------------------------------------------------------------------
- Bra
- [6g]
- Ket
- End
-------------------------------------------------------------------
-
-/(?1)\c[/
-Failed: reference to non-existent subpattern at offset 3
-
-/.+A/<crlf>
- \r\nA
-No match
-
-/\nA/<crlf>
- \r\nA
- 0: \x0aA
-
-/[\r\n]A/<crlf>
- \r\nA
- 0: \x0aA
-
-/(\r|\n)A/<crlf>
- \r\nA
- 0: \x0aA
- 1: \x0a
-
-/a(*CR)b/
-Failed: (*VERB) not recognized or malformed at offset 5
-
-/(*CR)a.b/
- a\nb
- 0: a\x0ab
- ** Failers
-No match
- a\rb
-No match
-
-/(*CR)a.b/<lf>
- a\nb
- 0: a\x0ab
- ** Failers
-No match
- a\rb
-No match
-
-/(*LF)a.b/<CRLF>
- a\rb
- 0: a\x0db
- ** Failers
-No match
- a\nb
-No match
-
-/(*CRLF)a.b/
- a\rb
- 0: a\x0db
- a\nb
- 0: a\x0ab
- ** Failers
-No match
- a\r\nb
-No match
-
-/(*ANYCRLF)a.b/<CR>
- ** Failers
-No match
- a\rb
-No match
- a\nb
-No match
- a\r\nb
-No match
-
-/(*ANY)a.b/<cr>
- ** Failers
-No match
- a\rb
-No match
- a\nb
-No match
- a\r\nb
-No match
- a\x85b
-No match
-
-/(*ANY).*/g
- abc\r\ndef
- 0: abc
- 0:
- 0: def
- 0:
-
-/(*ANYCRLF).*/g
- abc\r\ndef
- 0: abc
- 0:
- 0: def
- 0:
-
-/(*CRLF).*/g
- abc\r\ndef
- 0: abc
- 0:
- 0: def
- 0:
-
-/a\Rb/I<bsr_anycrlf>
-Capturing subpattern count = 0
-Options: bsr_anycrlf
-First char = 'a'
-Need char = 'b'
- a\rb
- 0: a\x0db
- a\nb
- 0: a\x0ab
- a\r\nb
- 0: a\x0d\x0ab
- ** Failers
-No match
- a\x85b
-No match
- a\x0bb
-No match
-
-/a\Rb/I<bsr_unicode>
-Capturing subpattern count = 0
-Options: bsr_unicode
-First char = 'a'
-Need char = 'b'
- a\rb
- 0: a\x0db
- a\nb
- 0: a\x0ab
- a\r\nb
- 0: a\x0d\x0ab
- a\x85b
- 0: a\x85b
- a\x0bb
- 0: a\x0bb
- ** Failers
-No match
- a\x85b\<bsr_anycrlf>
-No match
- a\x0bb\<bsr_anycrlf>
-No match
-
-/a\R?b/I<bsr_anycrlf>
-Capturing subpattern count = 0
-Options: bsr_anycrlf
-First char = 'a'
-Need char = 'b'
- a\rb
- 0: a\x0db
- a\nb
- 0: a\x0ab
- a\r\nb
- 0: a\x0d\x0ab
- ** Failers
-No match
- a\x85b
-No match
- a\x0bb
-No match
-
-/a\R?b/I<bsr_unicode>
-Capturing subpattern count = 0
-Options: bsr_unicode
-First char = 'a'
-Need char = 'b'
- a\rb
- 0: a\x0db
- a\nb
- 0: a\x0ab
- a\r\nb
- 0: a\x0d\x0ab
- a\x85b
- 0: a\x85b
- a\x0bb
- 0: a\x0bb
- ** Failers
-No match
- a\x85b\<bsr_anycrlf>
-No match
- a\x0bb\<bsr_anycrlf>
-No match
-
-/a\R{2,4}b/I<bsr_anycrlf>
-Capturing subpattern count = 0
-Options: bsr_anycrlf
-First char = 'a'
-Need char = 'b'
- a\r\n\nb
- 0: a\x0d\x0a\x0ab
- a\n\r\rb
- 0: a\x0a\x0d\x0db
- a\r\n\r\n\r\n\r\nb
- 0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab
- ** Failers
-No match
- a\x85\85b
-No match
- a\x0b\0bb
-No match
-
-/a\R{2,4}b/I<bsr_unicode>
-Capturing subpattern count = 0
-Options: bsr_unicode
-First char = 'a'
-Need char = 'b'
- a\r\rb
- 0: a\x0d\x0db
- a\n\n\nb
- 0: a\x0a\x0a\x0ab
- a\r\n\n\r\rb
- 0: a\x0d\x0a\x0a\x0d\x0db
- a\x85\85b
-No match
- a\x0b\0bb
-No match
- ** Failers
-No match
- a\r\r\r\r\rb
-No match
- a\x85\85b\<bsr_anycrlf>
-No match
- a\x0b\0bb\<bsr_anycrlf>
-No match
-
-/(*BSR_ANYCRLF)a\Rb/I
-Capturing subpattern count = 0
-Options: bsr_anycrlf
-First char = 'a'
-Need char = 'b'
- a\nb
- 0: a\x0ab
- a\rb
- 0: a\x0db
-
-/(*BSR_UNICODE)a\Rb/I
-Capturing subpattern count = 0
-Options: bsr_unicode
-First char = 'a'
-Need char = 'b'
- a\x85b
- 0: a\x85b
-
-/(*BSR_ANYCRLF)(*CRLF)a\Rb/I
-Capturing subpattern count = 0
-Options: bsr_anycrlf
-Forced newline sequence: CRLF
-First char = 'a'
-Need char = 'b'
- a\nb
- 0: a\x0ab
- a\rb
- 0: a\x0db
-
-/(*CRLF)(*BSR_UNICODE)a\Rb/I
-Capturing subpattern count = 0
-Options: bsr_unicode
-Forced newline sequence: CRLF
-First char = 'a'
-Need char = 'b'
- a\x85b
- 0: a\x85b
-
-/(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
-Capturing subpattern count = 0
-Options: bsr_anycrlf
-Forced newline sequence: CR
-First char = 'a'
-Need char = 'b'
-
-/(?<a>)(?&)/
-Failed: subpattern name expected at offset 9
-
-/(?<abc>)(?&a)/
-Failed: reference to non-existent subpattern at offset 12
-
-/(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
-Failed: reference to non-existent subpattern at offset 32
-
-/(?+-a)/
-Failed: digit expected after (?+ at offset 3
-
-/(?-+a)/
-Failed: unrecognized character after (? or (?- at offset 3
-
-/(?(-1))/
-Failed: reference to non-existent subpattern at offset 6
-
-/(?(+10))/
-Failed: reference to non-existent subpattern at offset 7
-
-/(?(10))/
-Failed: reference to non-existent subpattern at offset 6
-
-/(?(+2))()()/
-
-/(?(2))()()/
-
-/\k''/
-Failed: subpattern name expected at offset 3
-
-/\k<>/
-Failed: subpattern name expected at offset 3
-
-/\k{}/
-Failed: subpattern name expected at offset 3
-
-/\k/
-Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 2
-
-/\kabc/
-Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 5
-
-/(?P=)/
-Failed: subpattern name expected at offset 4
-
-/(?P>)/
-Failed: subpattern name expected at offset 4
-
-/(?!\w)(?R)/
-Failed: recursive call could loop indefinitely at offset 9
-
-/(?=\w)(?R)/
-Failed: recursive call could loop indefinitely at offset 9
-
-/(?<!\w)(?R)/
-Failed: recursive call could loop indefinitely at offset 10
-
-/(?<=\w)(?R)/
-Failed: recursive call could loop indefinitely at offset 10
-
-/[[:foo:]]/
-Failed: unknown POSIX class name at offset 3
-
-/[[:1234:]]/
-Failed: unknown POSIX class name at offset 3
-
-/[[:f\oo:]]/
-Failed: unknown POSIX class name at offset 3
-
-/[[: :]]/
-Failed: unknown POSIX class name at offset 3
-
-/[[:...:]]/
-Failed: unknown POSIX class name at offset 3
-
-/[[:l\ower:]]/
-Failed: unknown POSIX class name at offset 3
-
-/[[:abc\:]]/
-Failed: unknown POSIX class name at offset 3
-
-/[abc[:x\]pqr:]]/
-Failed: unknown POSIX class name at offset 6
-
-/[[:a\dz:]]/
-Failed: unknown POSIX class name at offset 3
-
-/(^(a|b\g<-1'c))/
-Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15
-
-/^(?+1)(?<a>x|y){0}z/
- xzxx
- 0: xz
- yzyy
- 0: yz
- ** Failers
-No match
- xxz
-No match
-
-/(\3)(\1)(a)/
- cat
-No match
-
-/(\3)(\1)(a)/<JS>
- cat
- 0: a
- 1:
- 2:
- 3: a
-
-/TA]/
- The ACTA] comes
- 0: TA]
-
-/TA]/<JS>
-Failed: ] is an invalid data character in JavaScript compatibility mode at offset 2
-
-/(?2)[]a()b](abc)/
-Failed: reference to non-existent subpattern at offset 3
-
-/(?2)[^]a()b](abc)/
-Failed: reference to non-existent subpattern at offset 3
-
-/(?1)[]a()b](abc)/
- abcbabc
- 0: abcbabc
- 1: abc
- ** Failers
-No match
- abcXabc
-No match
-
-/(?1)[^]a()b](abc)/
- abcXabc
- 0: abcXabc
- 1: abc
- ** Failers
-No match
- abcbabc
-No match
-
-/(?2)[]a()b](abc)(xyz)/
- xyzbabcxyz
- 0: xyzbabcxyz
- 1: abc
- 2: xyz
-
-/(?&N)[]a(?<N>)](?<M>abc)/
-Failed: reference to non-existent subpattern at offset 4
-
-/(?&N)[]a(?<N>)](abc)/
-Failed: reference to non-existent subpattern at offset 4
-
-/a[]b/
-Failed: missing terminating ] for character class at offset 4
-
-/a[^]b/
-Failed: missing terminating ] for character class at offset 5
-
-/a[]b/<JS>
- ** Failers
-No match
- ab
-No match
-
-/a[]+b/<JS>
- ** Failers
-No match
- ab
-No match
-
-/a[]*+b/<JS>
- ** Failers
-No match
- ab
-No match
-
-/a[^]b/<JS>
- aXb
- 0: aXb
- a\nb
- 0: a\x0ab
- ** Failers
-No match
- ab
-No match
-
-/a[^]+b/<JS>
- aXb
- 0: aXb
- a\nX\nXb
- 0: a\x0aX\x0aXb
- ** Failers
-No match
- ab
-No match
-
-/a(?!)b/BZ
-------------------------------------------------------------------
- Bra
- a
- *FAIL
- b
- Ket
- End
-------------------------------------------------------------------
-
-/(?!)?a/BZ
-------------------------------------------------------------------
- Bra
- Brazero
- Assert not
- Ket
- a
- Ket
- End
-------------------------------------------------------------------
- ab
- 0: a
-
-/a(*FAIL)+b/
-Failed: nothing to repeat at offset 8
-
-/(abc|pqr|123){0}[xyz]/SI
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: x y z
-
-/(?(?=.*b)b|^)/CI
-Capturing subpattern count = 0
-May match empty string
-Options:
-No first char
-No need char
- adc
---->adc
- +0 ^ (?(?=.*b)b|^)
- +2 ^ (?=.*b)
- +5 ^ .*
- +7 ^ ^ b
- +7 ^ ^ b
- +7 ^^ b
- +7 ^ b
-+11 ^ ^
-+12 ^ )
-+13 ^
- 0:
- abc
---->abc
- +0 ^ (?(?=.*b)b|^)
- +2 ^ (?=.*b)
- +5 ^ .*
- +7 ^ ^ b
- +7 ^ ^ b
- +7 ^^ b
- +8 ^ ^ )
- +9 ^ b
- +0 ^ (?(?=.*b)b|^)
- +2 ^ (?=.*b)
- +5 ^ .*
- +7 ^ ^ b
- +7 ^^ b
- +7 ^ b
- +8 ^^ )
- +9 ^ b
-+10 ^^ |
-+13 ^^
- 0: b
-
-/(?(?=b).*b|^d)/I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-
-/(?(?=.*b).*b|^d)/I
-Capturing subpattern count = 0
-No options
-First char at start or follows newline
-No need char
-
-/xyz/C
- xyz
---->xyz
- +0 ^ x
- +1 ^^ y
- +2 ^ ^ z
- +3 ^ ^
- 0: xyz
- abcxyz
---->abcxyz
- +0 ^ x
- +1 ^^ y
- +2 ^ ^ z
- +3 ^ ^
- 0: xyz
- abcxyz\Y
---->abcxyz
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +1 ^^ y
- +2 ^ ^ z
- +3 ^ ^
- 0: xyz
- ** Failers
-No match
- abc
-No match
- abc\Y
---->abc
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +0 ^ x
-No match
- abcxypqr
-No match
- abcxypqr\Y
---->abcxypqr
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +1 ^^ y
- +2 ^ ^ z
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +0 ^ x
-No match
-
-/(*NO_START_OPT)xyz/C
- abcxyz
---->abcxyz
-+15 ^ x
-+15 ^ x
-+15 ^ x
-+15 ^ x
-+16 ^^ y
-+17 ^ ^ z
-+18 ^ ^
- 0: xyz
-
-/(*NO_AUTO_POSSESS)a+b/BZ
-------------------------------------------------------------------
- Bra
- a+
- b
- Ket
- End
-------------------------------------------------------------------
-
-/xyz/CY
- abcxyz
---->abcxyz
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +0 ^ x
- +1 ^^ y
- +2 ^ ^ z
- +3 ^ ^
- 0: xyz
-
-/^"((?(?=[a])[^"])|b)*"$/C
- "ab"
---->"ab"
- +0 ^ ^
- +1 ^ "
- +2 ^^ ((?(?=[a])[^"])|b)*
- +3 ^^ (?(?=[a])[^"])
- +5 ^^ (?=[a])
- +8 ^^ [a]
-+11 ^ ^ )
-+12 ^^ [^"]
-+16 ^ ^ )
-+17 ^ ^ |
- +3 ^ ^ (?(?=[a])[^"])
- +5 ^ ^ (?=[a])
- +8 ^ ^ [a]
-+17 ^ ^ |
-+21 ^ ^ "
-+18 ^ ^ b
-+19 ^ ^ )
- +3 ^ ^ (?(?=[a])[^"])
- +5 ^ ^ (?=[a])
- +8 ^ ^ [a]
-+17 ^ ^ |
-+21 ^ ^ "
-+22 ^ ^ $
-+23 ^ ^
- 0: "ab"
- 1:
-
-/^"((?(?=[a])[^"])|b)*"$/
- "ab"
- 0: "ab"
- 1:
-
-/^X(?5)(a)(?|(b)|(q))(c)(d)Y/
-Failed: reference to non-existent subpattern at offset 5
-
-/^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
- XYabcdY
- 0: XYabcdY
- 1: a
- 2: b
- 3: c
- 4: d
- 5: Y
-
-/Xa{2,4}b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/Xa{2,4}?b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/Xa{2,4}+b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/X\d{2,4}b/
- X\P
-Partial match: X
- X3\P
-Partial match: X3
- X33\P
-Partial match: X33
- X333\P
-Partial match: X333
- X3333\P
-Partial match: X3333
-
-/X\d{2,4}?b/
- X\P
-Partial match: X
- X3\P
-Partial match: X3
- X33\P
-Partial match: X33
- X333\P
-Partial match: X333
- X3333\P
-Partial match: X3333
-
-/X\d{2,4}+b/
- X\P
-Partial match: X
- X3\P
-Partial match: X3
- X33\P
-Partial match: X33
- X333\P
-Partial match: X333
- X3333\P
-Partial match: X3333
-
-/X\D{2,4}b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/X\D{2,4}?b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/X\D{2,4}+b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/X[abc]{2,4}b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/X[abc]{2,4}?b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/X[abc]{2,4}+b/
- X\P
-Partial match: X
- Xa\P
-Partial match: Xa
- Xaa\P
-Partial match: Xaa
- Xaaa\P
-Partial match: Xaaa
- Xaaaa\P
-Partial match: Xaaaa
-
-/X[^a]{2,4}b/
- X\P
-Partial match: X
- Xz\P
-Partial match: Xz
- Xzz\P
-Partial match: Xzz
- Xzzz\P
-Partial match: Xzzz
- Xzzzz\P
-Partial match: Xzzzz
-
-/X[^a]{2,4}?b/
- X\P
-Partial match: X
- Xz\P
-Partial match: Xz
- Xzz\P
-Partial match: Xzz
- Xzzz\P
-Partial match: Xzzz
- Xzzzz\P
-Partial match: Xzzzz
-
-/X[^a]{2,4}+b/
- X\P
-Partial match: X
- Xz\P
-Partial match: Xz
- Xzz\P
-Partial match: Xzz
- Xzzz\P
-Partial match: Xzzz
- Xzzzz\P
-Partial match: Xzzzz
-
-/(Y)X\1{2,4}b/
- YX\P
-Partial match: YX
- YXY\P
-Partial match: YXY
- YXYY\P
-Partial match: YXYY
- YXYYY\P
-Partial match: YXYYY
- YXYYYY\P
-Partial match: YXYYYY
-
-/(Y)X\1{2,4}?b/
- YX\P
-Partial match: YX
- YXY\P
-Partial match: YXY
- YXYY\P
-Partial match: YXYY
- YXYYY\P
-Partial match: YXYYY
- YXYYYY\P
-Partial match: YXYYYY
-
-/(Y)X\1{2,4}+b/
- YX\P
-Partial match: YX
- YXY\P
-Partial match: YXY
- YXYY\P
-Partial match: YXYY
- YXYYY\P
-Partial match: YXYYY
- YXYYYY\P
-Partial match: YXYYYY
-
-/\++\KZ|\d+X|9+Y/
- ++++123999\P
-Partial match: 123999
- ++++123999Y\P
- 0: 999Y
- ++++Z1234\P
- 0: Z
-
-/Z(*F)/
- Z\P
-No match
- ZA\P
-No match
-
-/Z(?!)/
- Z\P
-No match
- ZA\P
-No match
-
-/dog(sbody)?/
- dogs\P
- 0: dog
- dogs\P\P
-Partial match: dogs
-
-/dog(sbody)??/
- dogs\P
- 0: dog
- dogs\P\P
- 0: dog
-
-/dog|dogsbody/
- dogs\P
- 0: dog
- dogs\P\P
- 0: dog
-
-/dogsbody|dog/
- dogs\P
- 0: dog
- dogs\P\P
-Partial match: dogs
-
-/\bthe cat\b/
- the cat\P
- 0: the cat
- the cat\P\P
-Partial match: the cat
-
-/abc/
- abc\P
- 0: abc
- abc\P\P
- 0: abc
-
-/abc\K123/
- xyzabc123pqr
- 0: 123
- xyzabc12\P
-Partial match: abc12
- xyzabc12\P\P
-Partial match: abc12
-
-/(?<=abc)123/
- xyzabc123pqr
- 0: 123
- xyzabc12\P
-Partial match at offset 6: abc12
- xyzabc12\P\P
-Partial match at offset 6: abc12
-
-/\babc\b/
- +++abc+++
- 0: abc
- +++ab\P
-Partial match at offset 3: +ab
- +++ab\P\P
-Partial match at offset 3: +ab
-
-/(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
-------------------------------------------------------------------
- Bra
- Recurse
- Recurse
- Cond
- Cond def
- CBra 1
- <
- [^m]
- [^>]
- >
- [^<]
- Ket
- CBra 2
- \w*+
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
-------------------------------------------------------------------
- Bra
- Recurse
- Recurse
- Cond
- Cond def
- CBra 1
- <
- [\x00-/:-\xff] (neg)
- [^>]
- >
- [^<]
- Ket
- CBra 2
- \w*+
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
-------------------------------------------------------------------
- Bra
- CBra 1
- ab
- Ket
- CBra 2
- x
- CBra 3
- y
- Ket
- z
- CBra 4
- cd
- Close 4
- Close 2
- *ACCEPT
- Ket
- Ket
- pq
- Ket
- End
-------------------------------------------------------------------
-
-/abc\K/+
- abcdef
- 0:
- 0+ def
- abcdef\N\N
- 0:
- 0+ def
- xyzabcdef\N\N
- 0:
- 0+ def
- ** Failers
-No match
- abcdef\N
-No match
- xyzabcdef\N
-No match
-
-/^(?:(?=abc)|abc\K)/+
- abcdef
- 0:
- 0+ abcdef
- abcdef\N\N
- 0:
- 0+ def
- ** Failers
-No match
- abcdef\N
-No match
-
-/a?b?/+
- xyz
- 0:
- 0+ xyz
- xyzabc
- 0:
- 0+ xyzabc
- xyzabc\N
- 0: ab
- 0+ c
- xyzabc\N\N
- 0:
- 0+ yzabc
- xyz\N\N
- 0:
- 0+ yz
- ** Failers
- 0:
- 0+ ** Failers
- xyz\N
-No match
-
-/^a?b?/+
- xyz
- 0:
- 0+ xyz
- xyzabc
- 0:
- 0+ xyzabc
- ** Failers
- 0:
- 0+ ** Failers
- xyzabc\N
-No match
- xyzabc\N\N
-No match
- xyz\N\N
-No match
- xyz\N
-No match
-
-/^(?<name>a|b\g<name>c)/
- aaaa
- 0: a
- 1: a
- bacxxx
- 0: bac
- 1: bac
- bbaccxxx
- 0: bbacc
- 1: bbacc
- bbbacccxx
- 0: bbbaccc
- 1: bbbaccc
-
-/^(?<name>a|b\g'name'c)/
- aaaa
- 0: a
- 1: a
- bacxxx
- 0: bac
- 1: bac
- bbaccxxx
- 0: bbacc
- 1: bbacc
- bbbacccxx
- 0: bbbaccc
- 1: bbbaccc
-
-/^(a|b\g<1>c)/
- aaaa
- 0: a
- 1: a
- bacxxx
- 0: bac
- 1: bac
- bbaccxxx
- 0: bbacc
- 1: bbacc
- bbbacccxx
- 0: bbbaccc
- 1: bbbaccc
-
-/^(a|b\g'1'c)/
- aaaa
- 0: a
- 1: a
- bacxxx
- 0: bac
- 1: bac
- bbaccxxx
- 0: bbacc
- 1: bbacc
- bbbacccxx
- 0: bbbaccc
- 1: bbbaccc
-
-/^(a|b\g'-1'c)/
- aaaa
- 0: a
- 1: a
- bacxxx
- 0: bac
- 1: bac
- bbaccxxx
- 0: bbacc
- 1: bbacc
- bbbacccxx
- 0: bbbaccc
- 1: bbbaccc
-
-/(^(a|b\g<-1>c))/
- aaaa
- 0: a
- 1: a
- 2: a
- bacxxx
- 0: bac
- 1: bac
- 2: bac
- bbaccxxx
- 0: bbacc
- 1: bbacc
- 2: bbacc
- bbbacccxx
- 0: bbbaccc
- 1: bbbaccc
- 2: bbbaccc
-
-/(?-i:\g<name>)(?i:(?<name>a))/
- XaaX
- 0: aa
- 1: a
- XAAX
- 0: AA
- 1: A
-
-/(?i:\g<name>)(?-i:(?<name>a))/
- XaaX
- 0: aa
- 1: a
- ** Failers
-No match
- XAAX
-No match
-
-/(?-i:\g<+1>)(?i:(a))/
- XaaX
- 0: aa
- 1: a
- XAAX
- 0: AA
- 1: A
-
-/(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/
-
-/(?<n>a|b|c)\g<n>*/
- abc
- 0: abc
- 1: a
- accccbbb
- 0: accccbbb
- 1: a
-
-/^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
- XYabcdY
- 0: XYabcdY
- 1: a
- 2: b
- 3: <unset>
- 4: <unset>
- 5: c
- 6: d
- 7: Y
-
-/(?<=b(?1)|zzz)(a)/
- xbaax
- 0: a
- 1: a
- xzzzax
- 0: a
- 1: a
-
-/(a)(?<=b\1)/
-Failed: lookbehind assertion is not fixed length at offset 10
-
-/(a)(?<=b+(?1))/
-Failed: lookbehind assertion is not fixed length at offset 13
-
-/(a+)(?<=b(?1))/
-Failed: lookbehind assertion is not fixed length at offset 14
-
-/(a(?<=b(?1)))/
-Failed: lookbehind assertion is not fixed length at offset 13
-
-/(?<=b(?1))xyz/
-Failed: reference to non-existent subpattern at offset 8
-
-/(?<=b(?1))xyz(b+)pqrstuvew/
-Failed: lookbehind assertion is not fixed length at offset 26
-
-/(a|bc)\1/SI
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-No first char
-No need char
-Subject length lower bound = 2
-Starting chars: a b
-
-/(a|bc)\1{2,3}/SI
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-No first char
-No need char
-Subject length lower bound = 3
-Starting chars: a b
-
-/(a|bc)(?1)/SI
-Capturing subpattern count = 1
-No options
-No first char
-No need char
-Subject length lower bound = 2
-Starting chars: a b
-
-/(a|b\1)(a|b\1)/SI
-Capturing subpattern count = 2
-Max back reference = 1
-No options
-No first char
-No need char
-Subject length lower bound = 2
-Starting chars: a b
-
-/(a|b\1){2}/SI
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-No first char
-No need char
-Subject length lower bound = 2
-Starting chars: a b
-
-/(a|bbbb\1)(a|bbbb\1)/SI
-Capturing subpattern count = 2
-Max back reference = 1
-No options
-No first char
-No need char
-Subject length lower bound = 2
-Starting chars: a b
-
-/(a|bbbb\1){2}/SI
-Capturing subpattern count = 1
-Max back reference = 1
-No options
-No first char
-No need char
-Subject length lower bound = 2
-Starting chars: a b
-
-/^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]/SI
-Capturing subpattern count = 1
-Options: anchored
-No first char
-Need char = ':'
-Subject length lower bound = 22
-No starting char list
-
-/<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>/isIS
-Capturing subpattern count = 11
-Options: caseless dotall
-First char = '<'
-Need char = '>'
-Subject length lower bound = 47
-No starting char list
-
-"(?>.*/)foo"SI
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'o'
-Subject length lower bound = 4
-No starting char list
-
-/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI
-Capturing subpattern count = 0
-Options: extended
-No first char
-Need char = '-'
-Subject length lower bound = 8
-No starting char list
-
-/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
-Capturing subpattern count = 1
-Options: caseless
-No first char
-No need char
-Subject length lower bound = 1
-Starting chars: A B C a b c
-
-/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'b'
-Subject length lower bound = 41
-Starting chars: c d
-
-/<a[\s]+href[\s]*=[\s]* # find <a href=
- ([\"\'])? # find single or double quote
- (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space
-/isxSI
-Capturing subpattern count = 3
-Max back reference = 1
-Options: caseless extended dotall
-First char = '<'
-Need char = '='
-Subject length lower bound = 9
-No starting char list
-
-/^(?!:) # colon disallowed at start
- (?: # start of item
- (?: [0-9a-f]{1,4} | # 1-4 hex digits or
- (?(1)0 | () ) ) # if null previously matched, fail; else null
- : # followed by colon
- ){1,7} # end item; 1-7 of them required
- [0-9a-f]{1,4} $ # final hex number at end of string
- (?(1)|.) # check that there was an empty component
- /xiIS
-Capturing subpattern count = 1
-Options: anchored caseless extended
-No first char
-Need char = ':'
-Subject length lower bound = 2
-No starting char list
-
-/(?|(?<a>A)|(?<a>B))/I
-Capturing subpattern count = 1
-Named capturing subpatterns:
- a 1
-No options
-No first char
-No need char
- AB\Ca
- 0: A
- 1: A
- C A (1) a
- BA\Ca
- 0: B
- 1: B
- C B (1) a
-
-/(?|(?<a>A)|(?<b>B))/
-Failed: different names for subpatterns of the same number are not allowed at offset 15
-
-/(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
- b(?<quote> (?<apostrophe>')|(?<realquote>")) )
- (?('quote')[a-z]+|[0-9]+)/JIx
-Capturing subpattern count = 6
-Named capturing subpatterns:
- apostrophe 2
- apostrophe 5
- quote 1
- quote 4
- realquote 3
- realquote 6
-Options: extended dupnames
-No first char
-No need char
- a"aaaaa
- 0: a"aaaaa
- 1: "
- 2: <unset>
- 3: "
- b"aaaaa
- 0: b"aaaaa
- 1: <unset>
- 2: <unset>
- 3: <unset>
- 4: "
- 5: <unset>
- 6: "
- ** Failers
-No match
- b"11111
-No match
- a"11111
-No match
-
-/^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
-------------------------------------------------------------------
- Bra
- ^
- Bra
- CBra 1
- a
- Ket
- CBra 2
- b
- Ket
- CBra 3
- c
- Ket
- CBra 4
- d
- Ket
- Alt
- CBra 1
- e
- Ket
- Ket
- Cond
- Cond ref <D>2
- X
- Alt
- Y
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 4
-Named capturing subpatterns:
- D 4
- D 1
-Options: anchored extended dupnames
-No first char
-No need char
- abcdX
- 0: abcdX
- 1: a
- 2: b
- 3: c
- 4: d
- eX
- 0: eX
- 1: e
- ** Failers
-No match
- abcdY
-No match
- ey
-No match
-
-/(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/JDZx
-------------------------------------------------------------------
- Bra
- CBra 1
- a
- Ket
- CBra 2
- b
- Ket
- CBra 3
- c
- Ket
- CBra 4
- d
- Cond
- Cond recurse <A>2
- $
- Alt
- Recurse
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 4
-Named capturing subpatterns:
- A 1
- A 4
-Options: extended dupnames
-First char = 'a'
-Need char = 'd'
- abcdd
- 0: abcdd
- 1: a
- 2: b
- 3: c
- 4: dd
- ** Failers
-No match
- abcdde
-No match
-
-/abcd*/
- xxxxabcd\P
- 0: abcd
- xxxxabcd\P\P
-Partial match: abcd
-
-/abcd*/i
- xxxxabcd\P
- 0: abcd
- xxxxabcd\P\P
-Partial match: abcd
- XXXXABCD\P
- 0: ABCD
- XXXXABCD\P\P
-Partial match: ABCD
-
-/abc\d*/
- xxxxabc1\P
- 0: abc1
- xxxxabc1\P\P
-Partial match: abc1
-
-/(a)bc\1*/
- xxxxabca\P
- 0: abca
- 1: a
- xxxxabca\P\P
-Partial match: abca
-
-/abc[de]*/
- xxxxabcde\P
- 0: abcde
- xxxxabcde\P\P
-Partial match: abcde
-
-/-- This is not in the Perl-compatible test because Perl seems currently to be
- broken and not behaving as specified in that it *does* bumpalong after
- hitting (*COMMIT). --/
-
-/(?1)(A(*COMMIT)|B)D/
- ABD
- 0: ABD
- 1: B
- XABD
- 0: ABD
- 1: B
- BAD
- 0: BAD
- 1: A
- ABXABD
- 0: ABD
- 1: B
- ** Failers
-No match
- ABX
-No match
- BAXBAD
-No match
-
-/(\3)(\1)(a)/<JS>
- cat
- 0: a
- 1:
- 2:
- 3: a
-
-/(\3)(\1)(a)/SI<JS>
-Capturing subpattern count = 3
-Max back reference = 3
-Options:
-No first char
-Need char = 'a'
-Subject length lower bound = 1
-No starting char list
- cat
- 0: a
- 1:
- 2:
- 3: a
-
-/(\3)(\1)(a)/SI
-Capturing subpattern count = 3
-Max back reference = 3
-No options
-No first char
-Need char = 'a'
-Subject length lower bound = 3
-No starting char list
- cat
-No match
-
-/i(?(DEFINE)(?<s>a))/SI
-Capturing subpattern count = 1
-Named capturing subpatterns:
- s 1
-No options
-First char = 'i'
-No need char
-Subject length lower bound = 1
-No starting char list
- i
- 0: i
-
-/()i(?(1)a)/SI
-Capturing subpattern count = 1
-No options
-No first char
-Need char = 'i'
-Subject length lower bound = 1
-Starting chars: i
- ia
- 0: ia
- 1:
-
-/(?i)a(?-i)b|c/BZ
-------------------------------------------------------------------
- Bra
- /i a
- b
- Alt
- c
- Ket
- End
-------------------------------------------------------------------
- XabX
- 0: ab
- XAbX
- 0: Ab
- CcC
- 0: c
- ** Failers
-No match
- XABX
-No match
-
-/(?i)a(?s)b|c/BZ
-------------------------------------------------------------------
- Bra
- /i ab
- Alt
- /i c
- Ket
- End
-------------------------------------------------------------------
-
-/(?i)a(?s-i)b|c/BZ
-------------------------------------------------------------------
- Bra
- /i a
- b
- Alt
- c
- Ket
- End
-------------------------------------------------------------------
-
-/^(ab(c\1)d|x){2}$/BZ
-------------------------------------------------------------------
- Bra
- ^
- Once
- CBra 1
- ab
- CBra 2
- c
- \1
- Ket
- d
- Alt
- x
- Ket
- Ket
- Once
- CBra 1
- ab
- CBra 2
- c
- \1
- Ket
- d
- Alt
- x
- Ket
- Ket
- $
- Ket
- End
-------------------------------------------------------------------
- xabcxd
- 0: xabcxd
- 1: abcxd
- 2: cx
-
-/^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
-------------------------------------------------------------------
- Bra
- ^
- Braposzero
- SBraPos
- Recurse
- KetRpos
- Cond
- Cond def
- CBra 1
- Any
- Ket
- Ket
- $
- Ket
- End
-------------------------------------------------------------------
-
-/^(?&t)*(?(DEFINE)(?<t>.))$/BZ
-------------------------------------------------------------------
- Bra
- ^
- Brazero
- Once
- Recurse
- KetRmax
- Cond
- Cond def
- CBra 1
- Any
- Ket
- Ket
- $
- Ket
- End
-------------------------------------------------------------------
-
-/ -- This one is here because Perl gives the match as "b" rather than "ab". I
- believe this to be a Perl bug. --/
-
-/(?>a\Kb)z|(ab)/
- ab
- 0: ab
- 1: ab
-
-/(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
-Failed: recursive call could loop indefinitely at offset 31
-
-/abc(*MARK:)pqr/
-Failed: (*MARK) must have an argument at offset 10
-
-/abc(*:)pqr/
-Failed: (*MARK) must have an argument at offset 6
-
-/abc(*FAIL:123)xyz/
-Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
-
-/--- This should, and does, fail. In Perl, it does not, which I think is a
- bug because replacing the B in the pattern by (B|D) does make it fail. ---/
-
-/A(*COMMIT)B/+K
- ACABX
-No match
-
-/--- These should be different, but in Perl they are not, which I think
- is a bug in Perl. ---/
-
-/A(*THEN)B|A(*THEN)C/K
- AC
- 0: AC
-
-/A(*PRUNE)B|A(*PRUNE)C/K
- AC
-No match
-
-/--- Mark names can be duplicated. Perl doesn't give a mark for this one,
-though PCRE does. ---/
-
-/^A(*:A)B|^X(*:A)Y/K
- ** Failers
-No match
- XAQQ
-No match, mark = A
-
-/--- COMMIT at the start of a pattern should be the same as an anchor. Perl
-optimizations defeat this. So does the PCRE optimization unless we disable it
-with \Y. ---/
-
-/(*COMMIT)ABC/
- ABCDEFG
- 0: ABC
- ** Failers
-No match
- DEFGABC\Y
-No match
-
-/^(ab (c+(*THEN)cd) | xyz)/x
- abcccd
-No match
-
-/^(ab (c+(*PRUNE)cd) | xyz)/x
- abcccd
-No match
-
-/^(ab (c+(*FAIL)cd) | xyz)/x
- abcccd
-No match
-
-/--- Perl gets some of these wrong ---/
-
-/(?>.(*ACCEPT))*?5/
- abcde
- 0: a
-
-/(.(*ACCEPT))*?5/
- abcde
- 0: a
- 1: a
-
-/(.(*ACCEPT))5/
- abcde
- 0: a
- 1: a
-
-/(.(*ACCEPT))*5/
- abcde
- 0: a
- 1: a
-
-/A\NB./BZ
-------------------------------------------------------------------
- Bra
- A
- Any
- B
- Any
- Ket
- End
-------------------------------------------------------------------
- ACBD
- 0: ACBD
- *** Failers
-No match
- A\nB
-No match
- ACB\n
-No match
-
-/A\NB./sBZ
-------------------------------------------------------------------
- Bra
- A
- Any
- B
- AllAny
- Ket
- End
-------------------------------------------------------------------
- ACBD
- 0: ACBD
- ACB\n
- 0: ACB\x0a
- *** Failers
-No match
- A\nB
-No match
-
-/A\NB/<crlf>
- A\nB
- 0: A\x0aB
- A\rB
- 0: A\x0dB
- ** Failers
-No match
- A\r\nB
-No match
-
-/\R+b/BZ
-------------------------------------------------------------------
- Bra
- \R++
- b
- Ket
- End
-------------------------------------------------------------------
-
-/\R+\n/BZ
-------------------------------------------------------------------
- Bra
- \R+
- \x0a
- Ket
- End
-------------------------------------------------------------------
-
-/\R+\d/BZ
-------------------------------------------------------------------
- Bra
- \R++
- \d
- Ket
- End
-------------------------------------------------------------------
-
-/\d*\R/BZ
-------------------------------------------------------------------
- Bra
- \d*+
- \R
- Ket
- End
-------------------------------------------------------------------
-
-/\s*\R/BZ
-------------------------------------------------------------------
- Bra
- \s*
- \R
- Ket
- End
-------------------------------------------------------------------
- \x20\x0a
- 0: \x0a
- \x20\x0d
- 0: \x0d
- \x20\x0d\x0a
- 0: \x0d\x0a
-
-/\S*\R/BZ
-------------------------------------------------------------------
- Bra
- \S*+
- \R
- Ket
- End
-------------------------------------------------------------------
- a\x0a
- 0: a\x0a
-
-/X\h*\R/BZ
-------------------------------------------------------------------
- Bra
- X
- \h*+
- \R
- Ket
- End
-------------------------------------------------------------------
- X\x20\x0a
- 0: X \x0a
-
-/X\H*\R/BZ
-------------------------------------------------------------------
- Bra
- X
- \H*
- \R
- Ket
- End
-------------------------------------------------------------------
- X\x0d\x0a
- 0: X\x0d\x0a
-
-/X\H+\R/BZ
-------------------------------------------------------------------
- Bra
- X
- \H+
- \R
- Ket
- End
-------------------------------------------------------------------
- X\x0d\x0a
- 0: X\x0d\x0a
-
-/X\H++\R/BZ
-------------------------------------------------------------------
- Bra
- X
- \H++
- \R
- Ket
- End
-------------------------------------------------------------------
- X\x0d\x0a
-No match
-
-/(?<=abc)def/
- abc\P\P
-Partial match at offset 3: abc
-
-/abc$/
- abc
- 0: abc
- abc\P
- 0: abc
- abc\P\P
-Partial match: abc
-
-/abc$/m
- abc
- 0: abc
- abc\n
- 0: abc
- abc\P\P
-Partial match: abc
- abc\n\P\P
- 0: abc
- abc\P
- 0: abc
- abc\n\P
- 0: abc
-
-/abc\z/
- abc
- 0: abc
- abc\P
- 0: abc
- abc\P\P
-Partial match: abc
-
-/abc\Z/
- abc
- 0: abc
- abc\P
- 0: abc
- abc\P\P
-Partial match: abc
-
-/abc\b/
- abc
- 0: abc
- abc\P
- 0: abc
- abc\P\P
-Partial match: abc
-
-/abc\B/
- abc
-No match
- abc\P
-Partial match: abc
- abc\P\P
-Partial match: abc
-
-/.+/
- abc\>0
- 0: abc
- abc\>1
- 0: bc
- abc\>2
- 0: c
- abc\>3
-No match
- abc\>4
-Error -24 (bad offset value)
- abc\>-4
-Error -24 (bad offset value)
-
-/^\cģ/
-Failed: \c must be followed by an ASCII character at offset 3
-
-/(?P<abn>(?P=abn)xxx)/BZ
-------------------------------------------------------------------
- Bra
- Once
- CBra 1
- \1
- xxx
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/(a\1z)/BZ
-------------------------------------------------------------------
- Bra
- Once
- CBra 1
- a
- \1
- z
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/(?P<abn>(?P=abn)(?<badstufxxx)/BZ
-Failed: syntax error in subpattern name (missing terminator) at offset 29
-
-/(?P<abn>(?P=axn)xxx)/BZ
-Failed: reference to non-existent subpattern at offset 15
-
-/(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
-------------------------------------------------------------------
- Bra
- CBra 1
- \2
- xxx
- Ket
- CBra 2
- yy
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/-- These tests are here because Perl gets the first one wrong. --/
-
-/(\R*)(.)/s
- \r\n
- 0: \x0d
- 1:
- 2: \x0d
- \r\r\n\n\r
- 0: \x0d\x0d\x0a\x0a\x0d
- 1: \x0d\x0d\x0a\x0a
- 2: \x0d
- \r\r\n\n\r\n
- 0: \x0d\x0d\x0a\x0a\x0d
- 1: \x0d\x0d\x0a\x0a
- 2: \x0d
-
-/(\R)*(.)/s
- \r\n
- 0: \x0d
- 1: <unset>
- 2: \x0d
- \r\r\n\n\r
- 0: \x0d\x0d\x0a\x0a\x0d
- 1: \x0a
- 2: \x0d
- \r\r\n\n\r\n
- 0: \x0d\x0d\x0a\x0a\x0d
- 1: \x0a
- 2: \x0d
-
-/((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
- \r\n
- 0: \x0d
- 1:
- 2: \x0d
- \r\r\n\n\r
- 0: \x0d\x0d\x0a\x0a\x0d
- 1: \x0d\x0d\x0a\x0a
- 2: \x0d
- \r\r\n\n\r\n
- 0: \x0d\x0d\x0a\x0a\x0d
- 1: \x0d\x0d\x0a\x0a
- 2: \x0d
-
-/-- --/
-
-/^abc$/BZ
-------------------------------------------------------------------
- Bra
- ^
- abc
- $
- Ket
- End
-------------------------------------------------------------------
-
-/^abc$/BZm
-------------------------------------------------------------------
- Bra
- /m ^
- abc
- /m $
- Ket
- End
-------------------------------------------------------------------
-
-/^(a)*+(\w)/S
- aaaaX
- 0: aaaaX
- 1: a
- 2: X
- ** Failers
-No match
- aaaa
-No match
-
-/^(?:a)*+(\w)/S
- aaaaX
- 0: aaaaX
- 1: X
- ** Failers
-No match
- aaaa
-No match
-
-/(a)++1234/SDZ
-------------------------------------------------------------------
- Bra
- CBraPos 1
- a
- KetRpos
- 1234
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = '4'
-Subject length lower bound = 5
-No starting char list
-
-/([abc])++1234/SI
-Capturing subpattern count = 1
-No options
-No first char
-Need char = '4'
-Subject length lower bound = 5
-Starting chars: a b c
-
-/(?<=(abc)+)X/
-Failed: lookbehind assertion is not fixed length at offset 10
-
-/(^ab)/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
-
-/(^ab)++/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
-
-/(^ab|^)+/I
-Capturing subpattern count = 1
-May match empty string
-Options: anchored
-No first char
-No need char
-
-/(^ab|^)++/I
-Capturing subpattern count = 1
-May match empty string
-Options: anchored
-No first char
-No need char
-
-/(?:^ab)/I
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/(?:^ab)++/I
-Capturing subpattern count = 0
-Options: anchored
-No first char
-No need char
-
-/(?:^ab|^)+/I
-Capturing subpattern count = 0
-May match empty string
-Options: anchored
-No first char
-No need char
-
-/(?:^ab|^)++/I
-Capturing subpattern count = 0
-May match empty string
-Options: anchored
-No first char
-No need char
-
-/(.*ab)/I
-Capturing subpattern count = 1
-No options
-First char at start or follows newline
-Need char = 'b'
-
-/(.*ab)++/I
-Capturing subpattern count = 1
-No options
-First char at start or follows newline
-Need char = 'b'
-
-/(.*ab|.*)+/I
-Capturing subpattern count = 1
-May match empty string
-No options
-First char at start or follows newline
-No need char
-
-/(.*ab|.*)++/I
-Capturing subpattern count = 1
-May match empty string
-No options
-First char at start or follows newline
-No need char
-
-/(?:.*ab)/I
-Capturing subpattern count = 0
-No options
-First char at start or follows newline
-Need char = 'b'
-
-/(?:.*ab)++/I
-Capturing subpattern count = 0
-No options
-First char at start or follows newline
-Need char = 'b'
-
-/(?:.*ab|.*)+/I
-Capturing subpattern count = 0
-May match empty string
-No options
-First char at start or follows newline
-No need char
-
-/(?:.*ab|.*)++/I
-Capturing subpattern count = 0
-May match empty string
-No options
-First char at start or follows newline
-No need char
-
-/(?=a)[bcd]/I
-Capturing subpattern count = 0
-No options
-First char = 'a'
-No need char
-
-/((?=a))[bcd]/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/((?=a))+[bcd]/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/((?=a))++[bcd]/I
-Capturing subpattern count = 1
-No options
-First char = 'a'
-No need char
-
-/(?=a+)[bcd]/iI
-Capturing subpattern count = 0
-Options: caseless
-First char = 'a' (caseless)
-No need char
-
-/(?=a+?)[bcd]/iI
-Capturing subpattern count = 0
-Options: caseless
-First char = 'a' (caseless)
-No need char
-
-/(?=a++)[bcd]/iI
-Capturing subpattern count = 0
-Options: caseless
-First char = 'a' (caseless)
-No need char
-
-/(?=a{3})[bcd]/iI
-Capturing subpattern count = 0
-Options: caseless
-First char = 'a' (caseless)
-Need char = 'a' (caseless)
-
-/(abc)\1+/S
-
-/-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
-
-/(?1)(?:(b(*ACCEPT))){0}/
- b
- 0: b
-
-/(?1)(?:(b(*ACCEPT))){0}c/
- bc
- 0: bc
- ** Failers
-No match
- b
-No match
-
-/(?1)(?:((*ACCEPT))){0}c/
- c
- 0: c
- c\N
- 0: c
-
-/^.*?(?(?=a)a|b(*THEN)c)/
- ba
-No match
-
-/^.*?(?(?=a)a|bc)/
- ba
- 0: ba
-
-/^.*?(?(?=a)a(*THEN)b|c)/
- ac
-No match
-
-/^.*?(?(?=a)a(*THEN)b)c/
- ac
-No match
-
-/^.*?(a(*THEN)b)c/
- aabc
-No match
-
-/^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
- aabc
- 0: aabc
-
-/^.*?(a(*THEN)b|z)c/
- aabc
- 0: aabc
- 1: ab
-
-/^.*?(z|a(*THEN)b)c/
- aabc
- 0: aabc
- 1: ab
-
-/-- --/
-
-/-- These studied versions are here because they are not Perl-compatible; the
- studying means the mark is not seen. --/
-
-/(*MARK:A)(*SKIP:B)(C|X)/KS
- C
- 0: C
- 1: C
-MK: A
- D
-No match, mark = A
-
-/(*:A)A+(*SKIP:A)(B|Z)/KS
- AAAC
-No match, mark = A
-
-/-- --/
-
-"(?=a*(*ACCEPT)b)c"
- c
- 0: c
- c\N
- 0: c
-
-/(?1)c(?(DEFINE)((*ACCEPT)b))/
- c
- 0: c
- c\N
- 0: c
-
-/(?>(*ACCEPT)b)c/
- c
- 0:
- c\N
-No match
-
-/(?:(?>(a)))+a%/++
- %aa%
- 0: aa%
- 0+
- 1: a
- 1+ a%
-
-/(a)b|ac/++SS
- ac\O3
- 0: ac
- 0+
-
-/(a)(b)x|abc/++
- abc\O6
- 0: abc
- 0+
-
-/(a)bc|(a)(b)\2/
- \O3abc
-Matched, but too many substrings
- 0: abc
- \O4abc
-Matched, but too many substrings
- 0: abc
-
-/(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
-Capturing subpattern count = 2
-No options
-No first char
-No need char
-Subject length lower bound = 1
-No starting char list
-
-/(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
-Capturing subpattern count = 2
-No options
-No first char
-No need char
-Subject length lower bound = 3
-Starting chars: a b
-
-/(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
-Capturing subpattern count = 2
-No options
-No first char
-No need char
-Subject length lower bound = 4
-Starting chars: a b
-
-/(abc)(?1)/SI
-Capturing subpattern count = 1
-No options
-First char = 'a'
-Need char = 'c'
-Subject length lower bound = 6
-No starting char list
-
-/^(?>a)++/
- aa\M
-Minimum match() limit = 5
-Minimum match() recursion limit = 2
- 0: aa
- aaaaaaaaa\M
-Minimum match() limit = 12
-Minimum match() recursion limit = 2
- 0: aaaaaaaaa
-
-/(a)(?1)++/
- aa\M
-Minimum match() limit = 7
-Minimum match() recursion limit = 4
- 0: aa
- 1: a
- aaaaaaaaa\M
-Minimum match() limit = 21
-Minimum match() recursion limit = 4
- 0: aaaaaaaaa
- 1: a
-
-/(?:(foo)|(bar)|(baz))X/SS=
- bazfooX
- 0: fooX
- 1: foo
- 2: <unset>
- 3: <unset>
- foobazbarX
- 0: barX
- 1: <unset>
- 2: bar
- 3: <unset>
- barfooX
- 0: fooX
- 1: foo
- 2: <unset>
- 3: <unset>
- bazX
- 0: bazX
- 1: <unset>
- 2: <unset>
- 3: baz
- foobarbazX
- 0: bazX
- 1: <unset>
- 2: <unset>
- 3: baz
- bazfooX\O0
-Matched, but too many substrings
- bazfooX\O2
-Matched, but too many substrings
- 0: fooX
- bazfooX\O4
-Matched, but too many substrings
- 0: fooX
- 1: <unset>
- bazfooX\O6
-Matched, but too many substrings
- 0: fooX
- 1: foo
- 2: <unset>
- bazfooX\O8
-Matched, but too many substrings
- 0: fooX
- 1: foo
- 2: <unset>
- 3: <unset>
- bazfooX\O10
- 0: fooX
- 1: foo
- 2: <unset>
- 3: <unset>
-
-/(?=abc){3}abc/BZ
-------------------------------------------------------------------
- Bra
- Assert
- abc
- Ket
- abc
- Ket
- End
-------------------------------------------------------------------
-
-/(?=abc)+abc/BZ
-------------------------------------------------------------------
- Bra
- Assert
- abc
- Ket
- abc
- Ket
- End
-------------------------------------------------------------------
-
-/(?=abc)++abc/BZ
-------------------------------------------------------------------
- Bra
- Assert
- abc
- Ket
- abc
- Ket
- End
-------------------------------------------------------------------
-
-/(?=abc){0}xyz/BZ
-------------------------------------------------------------------
- Bra
- Skip zero
- Assert
- abc
- Ket
- xyz
- Ket
- End
-------------------------------------------------------------------
-
-/(?=(a))?./BZ
-------------------------------------------------------------------
- Bra
- Brazero
- Assert
- CBra 1
- a
- Ket
- Ket
- Any
- Ket
- End
-------------------------------------------------------------------
-
-/(?=(a))??./BZ
-------------------------------------------------------------------
- Bra
- Braminzero
- Assert
- CBra 1
- a
- Ket
- Ket
- Any
- Ket
- End
-------------------------------------------------------------------
-
-/^(?=(a)){0}b(?1)/BZ
-------------------------------------------------------------------
- Bra
- ^
- Skip zero
- Assert
- CBra 1
- a
- Ket
- Ket
- b
- Recurse
- Ket
- End
-------------------------------------------------------------------
-
-/(?(DEFINE)(a))?b(?1)/BZ
-------------------------------------------------------------------
- Bra
- Cond
- Cond def
- CBra 1
- a
- Ket
- Ket
- b
- Recurse
- Ket
- End
-------------------------------------------------------------------
-
-/^(?=(?1))?[az]([abc])d/BZ
-------------------------------------------------------------------
- Bra
- ^
- Brazero
- Assert
- Recurse
- Ket
- [az]
- CBra 1
- [a-c]
- Ket
- d
- Ket
- End
-------------------------------------------------------------------
-
-/^(?!a){0}\w+/BZ
-------------------------------------------------------------------
- Bra
- ^
- Skip zero
- Assert not
- a
- Ket
- \w++
- Ket
- End
-------------------------------------------------------------------
-
-/(?<=(abc))?xyz/BZ
-------------------------------------------------------------------
- Bra
- Brazero
- AssertB
- Reverse
- CBra 1
- abc
- Ket
- Ket
- xyz
- Ket
- End
-------------------------------------------------------------------
-
-/[:a[:abc]b:]/BZ
-------------------------------------------------------------------
- Bra
- [:[a-c]
- b:]
- Ket
- End
-------------------------------------------------------------------
-
-/((?2))((?1))/SS
- abc
-Error -26 (nested recursion at the same subject position)
-
-/((?(R2)a+|(?1)b))/SS
- aaaabcde
-Error -26 (nested recursion at the same subject position)
-
-/(?(R)a*(?1)|((?R))b)/SS
- aaaabcde
-Error -26 (nested recursion at the same subject position)
-
-/(a+|(?R)b)/
-Failed: recursive call could loop indefinitely at offset 7
-
-/^(a(*:A)(d|e(*:B))z|aeq)/C
- adz
---->adz
- +0 ^ ^
- +1 ^ (a(*:A)(d|e(*:B))z|aeq)
- +2 ^ a
- +3 ^^ (*:A)
- +8 ^^ (d|e(*:B))
-Latest Mark: A
- +9 ^^ d
-+10 ^ ^ |
-+18 ^ ^ z
-+19 ^ ^ |
-+24 ^ ^
- 0: adz
- 1: adz
- 2: d
- aez
---->aez
- +0 ^ ^
- +1 ^ (a(*:A)(d|e(*:B))z|aeq)
- +2 ^ a
- +3 ^^ (*:A)
- +8 ^^ (d|e(*:B))
-Latest Mark: A
- +9 ^^ d
-+11 ^^ e
-+12 ^ ^ (*:B)
-+17 ^ ^ )
-Latest Mark: B
-+18 ^ ^ z
-+19 ^ ^ |
-+24 ^ ^
- 0: aez
- 1: aez
- 2: e
- aeqwerty
---->aeqwerty
- +0 ^ ^
- +1 ^ (a(*:A)(d|e(*:B))z|aeq)
- +2 ^ a
- +3 ^^ (*:A)
- +8 ^^ (d|e(*:B))
-Latest Mark: A
- +9 ^^ d
-+11 ^^ e
-+12 ^ ^ (*:B)
-+17 ^ ^ )
-Latest Mark: B
-+18 ^ ^ z
-+20 ^ a
-+21 ^^ e
-+22 ^ ^ q
-+23 ^ ^ )
-+24 ^ ^
- 0: aeq
- 1: aeq
-
-/.(*F)/
- \P\Pabc
-No match
-
-/\btype\b\W*?\btext\b\W*?\bjavascript\b/IS
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-First char = 't'
-Need char = 't'
-Subject length lower bound = 18
-No starting char list
-
-/\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
-Capturing subpattern count = 0
-Max lookbehind = 1
-No options
-No first char
-No need char
-Subject length lower bound = 8
-Starting chars: < o t u
-
-/a(*SKIP)c|b(*ACCEPT)|/+S!I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
-Subject length lower bound = -1
-No starting char list
- a
- 0:
- 0+
-
-/a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/SI
-Capturing subpattern count = 0
-No options
-No first char
-No need char
-Subject length lower bound = -1
-Starting chars: a b x
- ax
- 0: x
-
-'a*(*ACCEPT)b'+
- \N\N
-No match
- abc\N\N
- 0: a
- 0+ bc
- bbb\N\N
- 0:
- 0+ bb
-
-/(*ACCEPT)a/+I
-Capturing subpattern count = 0
-No options
-No first char
-No need char
- bax
- 0:
- 0+ bax
-
-/z(*ACCEPT)a/+I
-Capturing subpattern count = 0
-No options
-First char = 'z'
-No need char
- baxzbx
- 0: z
- 0+ bx
-
-/a(?:.)*?a/ims
- \Mabbbbbbbbbbbbbbbbbbbbba
-Minimum match() limit = 65
-Minimum match() recursion limit = 2
- 0: abbbbbbbbbbbbbbbbbbbbba
-
-/a(?:.(*THEN))*?a/ims
- \Mabbbbbbbbbbbbbbbbbbbbba
-Minimum match() limit = 86
-Minimum match() recursion limit = 45
- 0: abbbbbbbbbbbbbbbbbbbbba
-
-/a(?:.(*THEN:ABC))*?a/ims
- \Mabbbbbbbbbbbbbbbbbbbbba
-Minimum match() limit = 86
-Minimum match() recursion limit = 45
- 0: abbbbbbbbbbbbbbbbbbbbba
-
-/^(?>a+)(?>(z+))\w/BZ
-------------------------------------------------------------------
- Bra
- ^
- Once_NC
- a++
- Ket
- Once
- CBra 1
- z++
- Ket
- Ket
- \w
- Ket
- End
-------------------------------------------------------------------
- aaaazzzzb
- 0: aaaazzzzb
- 1: zzzz
- ** Failers
-No match
- aazz
-No match
-
-/(.)(\1|a(?2))/
- bab
- 0: bab
- 1: b
- 2: ab
-
-/\1|(.)(?R)\1/
- cbbbc
- 0: cbbbc
- 1: c
-
-/(.)((?(1)c|a)|a(?2))/
- baa
-No match
-
-/(?P<abn>(?P=abn)xxx)/BZ
-------------------------------------------------------------------
- Bra
- Once
- CBra 1
- \1
- xxx
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/(a\1z)/BZ
-------------------------------------------------------------------
- Bra
- Once
- CBra 1
- a
- \1
- z
- Ket
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
- \Maabbccddee
-Minimum match() limit = 7
-Minimum match() recursion limit = 2
- 0: aabbccddee
-
-/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
- \Maabbccddee
-Minimum match() limit = 17
-Minimum match() recursion limit = 16
- 0: aabbccddee
- 1: aa
- 2: bb
- 3: cc
- 4: dd
- 5: ee
-
-/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
- \Maabbccddee
-Minimum match() limit = 13
-Minimum match() recursion limit = 10
- 0: aabbccddee
- 1: aa
- 2: cc
- 3: ee
-
-/^a\x41z/<JS>
- aAz
- 0: aAz
- *** Failers
-No match
- ax41z
-No match
-
-/^a[m\x41]z/<JS>
- aAz
- 0: aAz
-
-/^a\x1z/<JS>
- ax1z
- 0: ax1z
-
-/^a\u0041z/<JS>
- aAz
- 0: aAz
- *** Failers
-No match
- au0041z
-No match
-
-/^a[m\u0041]z/<JS>
- aAz
- 0: aAz
-
-/^a\u041z/<JS>
- au041z
- 0: au041z
- *** Failers
-No match
- aAz
-No match
-
-/^a\U0041z/<JS>
- aU0041z
- 0: aU0041z
- *** Failers
-No match
- aAz
-No match
-
-/(?(?=c)c|d)++Y/BZ
-------------------------------------------------------------------
- Bra
- BraPos
- Cond
- Assert
- c
- Ket
- c
- Alt
- d
- Ket
- KetRpos
- Y
- Ket
- End
-------------------------------------------------------------------
-
-/(?(?=c)c|d)*+Y/BZ
-------------------------------------------------------------------
- Bra
- Braposzero
- BraPos
- Cond
- Assert
- c
- Ket
- c
- Alt
- d
- Ket
- KetRpos
- Y
- Ket
- End
-------------------------------------------------------------------
-
-/a[\NB]c/
-Failed: \N is not supported in a class at offset 3
-
-/a[B-\Nc]/
-Failed: invalid range in character class at offset 5
-
-/a[B\Nc]/
-Failed: \N is not supported in a class at offset 4
-
-/(a)(?2){0,1999}?(b)/
-
-/(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
-
-/--- This test, with something more complicated than individual letters, causes
-different behaviour in Perl. Perhaps it disables some optimization; no tag is
-passed back for the failures, whereas in PCRE there is a tag. ---/
-
-/(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
- AABC
- 0: AB
- 1: A
- 2: B
-MK: A
- XXYZ
- 0: XXY
- 1: <unset>
- 2: <unset>
- 3: X
- 4: X
- 5: Y
-MK: B
- ** Failers
-No match
- XAQQ
-No match, mark = A
- XAQQXZZ
-No match, mark = A
- AXQQQ
-No match, mark = A
- AXXQQQ
-No match, mark = B
-
-/-- Perl doesn't give marks for these, though it does if the alternatives are
-replaced by single letters. --/
-
-/(b|q)(*:m)f|a(*:n)w/K
- aw
- 0: aw
-MK: n
- ** Failers
-No match, mark = n
- abc
-No match, mark = m
-
-/(q|b)(*:m)f|a(*:n)w/K
- aw
- 0: aw
-MK: n
- ** Failers
-No match, mark = n
- abc
-No match, mark = m
-
-/-- After a partial match, the behaviour is as for a failure. --/
-
-/^a(*:X)bcde/K
- abc\P
-Partial match, mark=X: abc
-
-/-- These are here because Perl doesn't return a mark, except for the first --/
-
-/(?=(*:x))(q|)/K+
- abc
- 0:
- 0+ abc
- 1:
-MK: x
-
-/(?=(*:x))((*:y)q|)/K+
- abc
- 0:
- 0+ abc
- 1:
-MK: x
-
-/(?=(*:x))(?:(*:y)q|)/K+
- abc
- 0:
- 0+ abc
-MK: x
-
-/(?=(*:x))(?>(*:y)q|)/K+
- abc
- 0:
- 0+ abc
-MK: x
-
-/(?=a(*:x))(?!a(*:y)c)/K+
- ab
- 0:
- 0+ ab
-MK: x
-
-/(?=a(*:x))(?=a(*:y)c|)/K+
- ab
- 0:
- 0+ ab
-MK: x
-
-/(..)\1/
- ab\P
-Partial match: ab
- aba\P
-Partial match: aba
- abab\P
- 0: abab
- 1: ab
-
-/(..)\1/i
- ab\P
-Partial match: ab
- abA\P
-Partial match: abA
- aBAb\P
- 0: aBAb
- 1: aB
-
-/(..)\1{2,}/
- ab\P
-Partial match: ab
- aba\P
-Partial match: aba
- abab\P
-Partial match: abab
- ababa\P
-Partial match: ababa
- ababab\P
- 0: ababab
- 1: ab
- ababab\P\P
-Partial match: ababab
- abababa\P
- 0: ababab
- 1: ab
- abababa\P\P
-Partial match: abababa
-
-/(..)\1{2,}/i
- ab\P
-Partial match: ab
- aBa\P
-Partial match: aBa
- aBAb\P
-Partial match: aBAb
- AbaBA\P
-Partial match: AbaBA
- abABAb\P
- 0: abABAb
- 1: ab
- aBAbaB\P\P
-Partial match: aBAbaB
- abABabA\P
- 0: abABab
- 1: ab
- abaBABa\P\P
-Partial match: abaBABa
-
-/(..)\1{2,}?x/i
- ab\P
-Partial match: ab
- abA\P
-Partial match: abA
- aBAb\P
-Partial match: aBAb
- abaBA\P
-Partial match: abaBA
- abAbaB\P
-Partial match: abAbaB
- abaBabA\P
-Partial match: abaBabA
- abAbABaBx\P
- 0: abAbABaBx
- 1: ab
-
-/^(..)\1/
- aba\P
-Partial match: aba
-
-/^(..)\1{2,3}x/
- aba\P
-Partial match: aba
- ababa\P
-Partial match: ababa
- ababa\P\P
-Partial match: ababa
- abababx
- 0: abababx
- 1: ab
- ababababx
- 0: ababababx
- 1: ab
-
-/^(..)\1{2,3}?x/
- aba\P
-Partial match: aba
- ababa\P
-Partial match: ababa
- ababa\P\P
-Partial match: ababa
- abababx
- 0: abababx
- 1: ab
- ababababx
- 0: ababababx
- 1: ab
-
-/^(..)(\1{2,3})ab/
- abababab
- 0: abababab
- 1: ab
- 2: abab
-
-/^\R/
- \r\P
- 0: \x0d
- \r\P\P
-Partial match: \x0d
-
-/^\R{2,3}x/
- \r\P
-Partial match: \x0d
- \r\P\P
-Partial match: \x0d
- \r\r\P
-Partial match: \x0d\x0d
- \r\r\P\P
-Partial match: \x0d\x0d
- \r\r\r\P
-Partial match: \x0d\x0d\x0d
- \r\r\r\P\P
-Partial match: \x0d\x0d\x0d
- \r\rx
- 0: \x0d\x0dx
- \r\r\rx
- 0: \x0d\x0d\x0dx
-
-/^\R{2,3}?x/
- \r\P
-Partial match: \x0d
- \r\P\P
-Partial match: \x0d
- \r\r\P
-Partial match: \x0d\x0d
- \r\r\P\P
-Partial match: \x0d\x0d
- \r\r\r\P
-Partial match: \x0d\x0d\x0d
- \r\r\r\P\P
-Partial match: \x0d\x0d\x0d
- \r\rx
- 0: \x0d\x0dx
- \r\r\rx
- 0: \x0d\x0d\x0dx
-
-/^\R?x/
- \r\P
-Partial match: \x0d
- \r\P\P
-Partial match: \x0d
- x
- 0: x
- \rx
- 0: \x0dx
-
-/^\R+x/
- \r\P
-Partial match: \x0d
- \r\P\P
-Partial match: \x0d
- \r\n\P
-Partial match: \x0d\x0a
- \r\n\P\P
-Partial match: \x0d\x0a
- \rx
- 0: \x0dx
-
-/^a$/<CRLF>
- a\r\P
-Partial match: a\x0d
- a\r\P\P
-Partial match: a\x0d
-
-/^a$/m<CRLF>
- a\r\P
-Partial match: a\x0d
- a\r\P\P
-Partial match: a\x0d
-
-/^(a$|a\r)/<CRLF>
- a\r\P
- 0: a\x0d
- 1: a\x0d
- a\r\P\P
-Partial match: a\x0d
-
-/^(a$|a\r)/m<CRLF>
- a\r\P
- 0: a\x0d
- 1: a\x0d
- a\r\P\P
-Partial match: a\x0d
-
-/./<CRLF>
- \r\P
- 0: \x0d
- \r\P\P
-Partial match: \x0d
-
-/.{2,3}/<CRLF>
- \r\P
-Partial match: \x0d
- \r\P\P
-Partial match: \x0d
- \r\r\P
- 0: \x0d\x0d
- \r\r\P\P
-Partial match: \x0d\x0d
- \r\r\r\P
- 0: \x0d\x0d\x0d
- \r\r\r\P\P
-Partial match: \x0d\x0d\x0d
-
-/.{2,3}?/<CRLF>
- \r\P
-Partial match: \x0d
- \r\P\P
-Partial match: \x0d
- \r\r\P
- 0: \x0d\x0d
- \r\r\P\P
-Partial match: \x0d\x0d
- \r\r\r\P
- 0: \x0d\x0d
- \r\r\r\P\P
- 0: \x0d\x0d
-
-"AB(C(D))(E(F))?(?(?=\2)(?=\4))"
- ABCDGHI\O03
-Matched, but too many substrings
- 0: ABCD
-
-/-- These are all run as real matches in test 1; here we are just checking the
-settings of the anchored and startline bits. --/
-
-/(?>.*?a)(?<=ba)/I
-Capturing subpattern count = 0
-Max lookbehind = 2
-No options
-No first char
-Need char = 'a'
-
-/(?:.*?a)(?<=ba)/I
-Capturing subpattern count = 0
-Max lookbehind = 2
-No options
-First char at start or follows newline
-Need char = 'a'
-
-/.*?a(*PRUNE)b/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'b'
-
-/.*?a(*PRUNE)b/sI
-Capturing subpattern count = 0
-Options: dotall
-No first char
-Need char = 'b'
-
-/^a(*PRUNE)b/sI
-Capturing subpattern count = 0
-Options: anchored dotall
-No first char
-No need char
-
-/.*?a(*SKIP)b/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'b'
-
-/(?>.*?a)b/sI
-Capturing subpattern count = 0
-Options: dotall
-No first char
-Need char = 'b'
-
-/(?>.*?a)b/I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'b'
-
-/(?>^a)b/sI
-Capturing subpattern count = 0
-Options: anchored dotall
-No first char
-No need char
-
-/(?>.*?)(?<=(abcd)|(wxyz))/I
-Capturing subpattern count = 2
-Max lookbehind = 4
-May match empty string
-No options
-No first char
-No need char
-
-/(?>.*)(?<=(abcd)|(wxyz))/I
-Capturing subpattern count = 2
-Max lookbehind = 4
-May match empty string
-No options
-No first char
-No need char
-
-"(?>.*)foo"I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'o'
-
-"(?>.*?)foo"I
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'o'
-
-/(?>^abc)/mI
-Capturing subpattern count = 0
-Options: multiline
-First char at start or follows newline
-Need char = 'c'
-
-/(?>.*abc)/mI
-Capturing subpattern count = 0
-Options: multiline
-No first char
-Need char = 'c'
-
-/(?:.*abc)/mI
-Capturing subpattern count = 0
-Options: multiline
-First char at start or follows newline
-Need char = 'c'
-
-/-- Check PCRE_STUDY_EXTRA_NEEDED --/
-
-/.?/S-I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
-Study returned NULL
-
-/.?/S!I
-Capturing subpattern count = 0
-May match empty string
-No options
-No first char
-No need char
-Subject length lower bound = -1
-No starting char list
-
-/(?:(a)+(?C1)bb|aa(?C2)b)/
- aab\C+
-Callout 1: last capture = 1
- 0: <unset>
- 1: a
---->aab
- ^ ^ b
-Callout 1: last capture = 1
- 0: <unset>
- 1: a
---->aab
- ^^ b
-Callout 2: last capture = -1
- 0: <unset>
---->aab
- ^ ^ b
- 0: aab
-
-/(?:(a)++(?C1)bb|aa(?C2)b)/
- aab\C+
-Callout 1: last capture = 1
- 0: <unset>
- 1: a
---->aab
- ^ ^ b
-Callout 2: last capture = -1
- 0: <unset>
---->aab
- ^ ^ b
- 0: aab
-
-/(?:(?>(a))(?C1)bb|aa(?C2)b)/
- aab\C+
-Callout 1: last capture = 1
- 0: <unset>
- 1: a
---->aab
- ^^ b
-Callout 2: last capture = -1
- 0: <unset>
---->aab
- ^ ^ b
- 0: aab
-
-/(?:(?1)(?C1)x|ab(?C2))((a)){0}/
- aab\C+
-Callout 1: last capture = -1
- 0: <unset>
---->aab
- ^^ x
-Callout 1: last capture = -1
- 0: <unset>
---->aab
- ^^ x
-Callout 2: last capture = -1
- 0: <unset>
---->aab
- ^ ^ )
- 0: ab
-
-/(?1)(?C1)((a)(?C2)){0}/
- aab\C+
-Callout 2: last capture = 2
- 0: <unset>
- 1: <unset>
- 2: a
---->aab
- ^^ )
-Callout 1: last capture = -1
- 0: <unset>
---->aab
- ^^ ((a)(?C2)){0}
- 0: a
-
-/(?:(a)+(?C1)bb|aa(?C2)b)++/
- aab\C+
-Callout 1: last capture = 1
- 0: <unset>
- 1: a
---->aab
- ^ ^ b
-Callout 1: last capture = 1
- 0: <unset>
- 1: a
---->aab
- ^^ b
-Callout 2: last capture = -1
- 0: <unset>
---->aab
- ^ ^ b
- 0: aab
- aab\C+\O2
-Callout 1: last capture = 1
- 0: <unset>
---->aab
- ^ ^ b
-Callout 1: last capture = 1
- 0: <unset>
---->aab
- ^^ b
-Callout 2: last capture = -1
- 0: <unset>
---->aab
- ^ ^ b
- 0: aab
-
-/(ab)x|ab/
- ab\O3
- 0: ab
- ab\O2
- 0: ab
-
-/(ab)/
- ab\O3
-Matched, but too many substrings
- 0: ab
- ab\O2
-Matched, but too many substrings
- 0: ab
-
-/(?<=123)(*MARK:xx)abc/K
- xxxx123a\P\P
-Partial match at offset 7, mark=xx: 123a
- xxxx123a\P
-Partial match at offset 7, mark=xx: 123a
-
-/123\Kabc/
- xxxx123a\P\P
-Partial match: 123a
- xxxx123a\P
-Partial match: 123a
-
-/^(?(?=a)aa|bb)/C
- bb
---->bb
- +0 ^ ^
- +1 ^ (?(?=a)aa|bb)
- +3 ^ (?=a)
- +6 ^ a
-+11 ^ b
-+12 ^^ b
-+13 ^ ^ )
-+14 ^ ^
- 0: bb
-
-/(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
- bb
---->bb
- 1 ^ ^
- 2 ^ (?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))
- 99 ^ (?=(?C3)a(?C4))
- 3 ^ a
- 8 ^ b
- 9 ^^ b
- 10 ^ ^ )
- 11 ^ ^
- 0: bb
-
-/-- Perl seems to have a bug with this one --/
-
-/aaaaa(*COMMIT)(*PRUNE)b|a+c/
- aaaaaac
- 0: aaaac
-
-/-- Here are some that Perl treats differently because of the way it handles
-backtracking verbs. --/
-
- /(?!a(*COMMIT)b)ac|ad/
- ac
- 0: ac
- ad
- 0: ad
-
-/^(?!a(*THEN)b|ac)../
- ac
-No match
- ad
- 0: ad
-
-/^(?=a(*THEN)b|ac)/
- ac
- 0:
-
-/\A.*?(?:a|b(*THEN)c)/
- ba
- 0: ba
-
-/\A.*?(?:a|b(*THEN)c)++/
- ba
- 0: ba
-
-/\A.*?(?:a|b(*THEN)c|d)/
- ba
- 0: ba
-
-/(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
- aac
- 0: aac
-
-/\A.*?(a|b(*THEN)c)/
- ba
- 0: ba
- 1: a
-
-/^(A(*THEN)B|A(*THEN)D)/
- AD
- 0: AD
- 1: AD
-
-/(?!b(*THEN)a)bn|bnn/
- bnn
- 0: bn
-
-/(?(?=b(*SKIP)a)bn|bnn)/
- bnn
-No match
-
-/(?=b(*THEN)a|)bn|bnn/
- bnn
- 0: bn
-
-/-------------------------/
-
-/(*LIMIT_MATCH=12bc)abc/
-Failed: (*VERB) not recognized or malformed at offset 7
-
-/(*LIMIT_MATCH=4294967290)abc/
-Failed: (*VERB) not recognized or malformed at offset 7
-
-/(*LIMIT_RECURSION=4294967280)abc/I
-Capturing subpattern count = 0
-Recursion limit = 4294967280
-No options
-First char = 'a'
-Need char = 'c'
-
-/(a+)*zz/
- aaaaaaaaaaaaaz
-No match
- aaaaaaaaaaaaaz\q3000
-Error -8 (match limit exceeded)
-
-/(a+)*zz/S-
- aaaaaaaaaaaaaz\Q10
-Error -21 (recursion limit exceeded)
-
-/(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 3000
-No options
-No first char
-Need char = 'z'
- aaaaaaaaaaaaaz
-Error -8 (match limit exceeded)
- aaaaaaaaaaaaaz\q60000
-Error -8 (match limit exceeded)
-
-/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 3000
-No options
-No first char
-Need char = 'z'
- aaaaaaaaaaaaaz
-Error -8 (match limit exceeded)
-
-/(*LIMIT_MATCH=60000)(a+)*zz/I
-Capturing subpattern count = 1
-Match limit = 60000
-No options
-No first char
-Need char = 'z'
- aaaaaaaaaaaaaz
-No match
- aaaaaaaaaaaaaz\q3000
-Error -8 (match limit exceeded)
-
-/(*LIMIT_RECURSION=10)(a+)*zz/IS-
-Capturing subpattern count = 1
-Recursion limit = 10
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 2
-Starting chars: a z
- aaaaaaaaaaaaaz
-Error -21 (recursion limit exceeded)
- aaaaaaaaaaaaaz\Q1000
-Error -21 (recursion limit exceeded)
-
-/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/IS-
-Capturing subpattern count = 1
-Recursion limit = 10
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 2
-Starting chars: a z
- aaaaaaaaaaaaaz
-Error -21 (recursion limit exceeded)
-
-/(*LIMIT_RECURSION=1000)(a+)*zz/IS-
-Capturing subpattern count = 1
-Recursion limit = 1000
-No options
-No first char
-Need char = 'z'
-Subject length lower bound = 2
-Starting chars: a z
- aaaaaaaaaaaaaz
-No match
- aaaaaaaaaaaaaz\Q10
-Error -21 (recursion limit exceeded)
-
-/-- This test causes a segfault with Perl 5.18.0 --/
-
-/^(?=(a)){0}b(?1)/
- backgammon
- 0: ba
-
-/(?|(?<n>f)|(?<n>b))/JI
-Capturing subpattern count = 1
-Named capturing subpatterns:
- n 1
-Options: dupnames
-No first char
-No need char
-
-/(?<a>abc)(?<a>z)\k<a>()/JDZS
-------------------------------------------------------------------
- Bra
- CBra 1
- abc
- Ket
- CBra 2
- z
- Ket
- \k<a>2
- CBra 3
- Ket
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 3
-Max back reference = 2
-Named capturing subpatterns:
- a 1
- a 2
-Options: dupnames
-First char = 'a'
-Need char = 'z'
-Subject length lower bound = 5
-No starting char list
-
-/a*[bcd]/BZ
-------------------------------------------------------------------
- Bra
- a*+
- [b-d]
- Ket
- End
-------------------------------------------------------------------
-
-/[bcd]*a/BZ
-------------------------------------------------------------------
- Bra
- [b-d]*+
- a
- Ket
- End
-------------------------------------------------------------------
-
-/-- A complete set of tests for auto-possessification of character types --/
-
-/\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\C \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/BZx
-------------------------------------------------------------------
- Bra
- \D+
- \D
- \D++
- \d
- \D+
- \S
- \D+
- \s
- \D+
- \W
- \D+
- \w
- \D+
- Any
- \D+
- AllAny
- \D+
- \R
- \D+
- \H
- \D+
- \h
- \D+
- \V
- \D+
- \v
- \D+
- \Z
- \D++
- \z
- \D+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\C \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/BZx
-------------------------------------------------------------------
- Bra
- \d++
- \D
- \d+
- \d
- \d+
- \S
- \d++
- \s
- \d++
- \W
- \d+
- \w
- \d+
- Any
- \d+
- AllAny
- \d++
- \R
- \d+
- \H
- \d++
- \h
- \d+
- \V
- \d++
- \v
- \d++
- \Z
- \d++
- \z
- \d++
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\C \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/BZx
-------------------------------------------------------------------
- Bra
- \S+
- \D
- \S+
- \d
- \S+
- \S
- \S++
- \s
- \S+
- \W
- \S+
- \w
- \S+
- Any
- \S+
- AllAny
- \S++
- \R
- \S+
- \H
- \S++
- \h
- \S+
- \V
- \S++
- \v
- \S++
- \Z
- \S++
- \z
- \S++
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\C \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/BZx
-------------------------------------------------------------------
- Bra
- \s+
- \D
- \s++
- \d
- \s++
- \S
- \s+
- \s
- \s+
- \W
- \s++
- \w
- \s+
- Any
- \s+
- AllAny
- \s+
- \R
- \s+
- \H
- \s+
- \h
- \s+
- \V
- \s+
- \v
- \s+
- \Z
- \s++
- \z
- \s+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\C \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/BZx
-------------------------------------------------------------------
- Bra
- \W+
- \D
- \W++
- \d
- \W+
- \S
- \W+
- \s
- \W+
- \W
- \W++
- \w
- \W+
- Any
- \W+
- AllAny
- \W+
- \R
- \W+
- \H
- \W+
- \h
- \W+
- \V
- \W+
- \v
- \W+
- \Z
- \W++
- \z
- \W+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\C \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/BZx
-------------------------------------------------------------------
- Bra
- \w+
- \D
- \w+
- \d
- \w+
- \S
- \w++
- \s
- \w++
- \W
- \w+
- \w
- \w+
- Any
- \w+
- AllAny
- \w++
- \R
- \w+
- \H
- \w++
- \h
- \w+
- \V
- \w++
- \v
- \w++
- \Z
- \w++
- \z
- \w++
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\C+\D \C+\d \C+\S \C+\s \C+\W \C+\w \C+. \C+\C \C+\R \C+\H \C+\h \C+\V \C+\v \C+\Z \C+\z \C+$/BZx
-------------------------------------------------------------------
- Bra
- AllAny+
- \D
- AllAny+
- \d
- AllAny+
- \S
- AllAny+
- \s
- AllAny+
- \W
- AllAny+
- \w
- AllAny+
- Any
- AllAny+
- AllAny
- AllAny+
- \R
- AllAny+
- \H
- AllAny+
- \h
- AllAny+
- \V
- AllAny+
- \v
- AllAny+
- \Z
- AllAny++
- \z
- AllAny+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\C \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/BZx
-------------------------------------------------------------------
- Bra
- \R+
- \D
- \R++
- \d
- \R+
- \S
- \R++
- \s
- \R+
- \W
- \R++
- \w
- \R++
- Any
- \R+
- AllAny
- \R+
- \R
- \R+
- \H
- \R++
- \h
- \R+
- \V
- \R+
- \v
- \R+
- \Z
- \R++
- \z
- \R+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\C \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/BZx
-------------------------------------------------------------------
- Bra
- \H+
- \D
- \H+
- \d
- \H+
- \S
- \H+
- \s
- \H+
- \W
- \H+
- \w
- \H+
- Any
- \H+
- AllAny
- \H+
- \R
- \H+
- \H
- \H++
- \h
- \H+
- \V
- \H+
- \v
- \H+
- \Z
- \H++
- \z
- \H+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\C \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/BZx
-------------------------------------------------------------------
- Bra
- \h+
- \D
- \h++
- \d
- \h++
- \S
- \h+
- \s
- \h+
- \W
- \h++
- \w
- \h+
- Any
- \h+
- AllAny
- \h++
- \R
- \h++
- \H
- \h+
- \h
- \h+
- \V
- \h++
- \v
- \h+
- \Z
- \h++
- \z
- \h+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\C \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/BZx
-------------------------------------------------------------------
- Bra
- \V+
- \D
- \V+
- \d
- \V+
- \S
- \V+
- \s
- \V+
- \W
- \V+
- \w
- \V+
- Any
- \V+
- AllAny
- \V++
- \R
- \V+
- \H
- \V+
- \h
- \V+
- \V
- \V++
- \v
- \V+
- \Z
- \V++
- \z
- \V+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\C \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/BZx
-------------------------------------------------------------------
- Bra
- \v+
- \D
- \v++
- \d
- \v++
- \S
- \v+
- \s
- \v+
- \W
- \v++
- \w
- \v+
- Any
- \v+
- AllAny
- \v+
- \R
- \v+
- \H
- \v++
- \h
- \v++
- \V
- \v+
- \v
- \v+
- \Z
- \v++
- \z
- \v+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/ a+\D a+\d a+\S a+\s a+\W a+\w a+. a+\C a+\R a+\H a+\h a+\V a+\v a+\Z a+\z a+$/BZx
-------------------------------------------------------------------
- Bra
- a+
- \D
- a++
- \d
- a+
- \S
- a++
- \s
- a++
- \W
- a+
- \w
- a+
- Any
- a+
- AllAny
- a++
- \R
- a+
- \H
- a++
- \h
- a+
- \V
- a++
- \v
- a++
- \Z
- a++
- \z
- a++
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\C \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/BZx
-------------------------------------------------------------------
- Bra
- \x0a+
- \D
- \x0a++
- \d
- \x0a++
- \S
- \x0a+
- \s
- \x0a+
- \W
- \x0a++
- \w
- \x0a+
- Any
- \x0a+
- AllAny
- \x0a+
- \R
- \x0a+
- \H
- \x0a++
- \h
- \x0a++
- \V
- \x0a+
- \v
- \x0a+
- \Z
- \x0a++
- \z
- \x0a+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/ .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZx
-------------------------------------------------------------------
- Bra
- Any+
- \D
- Any+
- \d
- Any+
- \S
- Any+
- \s
- Any+
- \W
- Any+
- \w
- Any+
- Any
- Any+
- AllAny
- Any++
- \R
- Any+
- \H
- Any+
- \h
- Any+
- \V
- Any+
- \v
- Any+
- \Z
- Any++
- \z
- Any+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/ .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZxs
-------------------------------------------------------------------
- Bra
- AllAny+
- \D
- AllAny+
- \d
- AllAny+
- \S
- AllAny+
- \s
- AllAny+
- \W
- AllAny+
- \w
- AllAny+
- AllAny
- AllAny+
- AllAny
- AllAny+
- \R
- AllAny+
- \H
- AllAny+
- \h
- AllAny+
- \V
- AllAny+
- \v
- AllAny+
- \Z
- AllAny++
- \z
- AllAny+
- $
- Ket
- End
-------------------------------------------------------------------
-
-/\D+$ \d+$ \S+$ \s+$ \W+$ \w+$ \C+$ \R+$ \H+$ \h+$ \V+$ \v+$ a+$ \n+$ .+$ .+$/BZxm
-------------------------------------------------------------------
- Bra
- \D+
- /m $
- \d++
- /m $
- \S++
- /m $
- \s+
- /m $
- \W+
- /m $
- \w++
- /m $
- AllAny+
- /m $
- \R+
- /m $
- \H+
- /m $
- \h+
- /m $
- \V+
- /m $
- \v+
- /m $
- a+
- /m $
- \x0a+
- /m $
- Any+
- /m $
- Any+
- /m $
- Ket
- End
-------------------------------------------------------------------
-
-/(?=a+)a(a+)++a/BZ
-------------------------------------------------------------------
- Bra
- Assert
- a++
- Ket
- a
- CBraPos 1
- a++
- KetRpos
- a
- Ket
- End
-------------------------------------------------------------------
-
-/a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/BZ
-------------------------------------------------------------------
- Bra
- a++
- CBra 1
- bb
- Alt
- cc
- Ket
- a++
- Bra
- bb
- Alt
- cc
- Ket
- a++
- Once_NC
- bb
- Alt
- cc
- Ket
- a++
- Bra
- bb
- Alt
- cc
- KetRmax
- a+
- CBra 2
- aa
- Ket
- a+
- Bra
- bb
- Alt
- aa
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/BZ
-------------------------------------------------------------------
- Bra
- a++
- Brazero
- CBra 1
- bb
- Alt
- cc
- Ket
- #
- a++
- Braminzero
- Bra
- bb
- Alt
- cc
- Ket
- #
- a++
- Once
- Brazero
- Bra
- bb
- Alt
- cc
- Ket
- Ket
- #
- a++
- Brazero
- Bra
- bb
- Alt
- cc
- KetRmax
- #
- a+
- Brazero
- CBra 2
- bb
- Alt
- cc
- Ket
- a#
- a+
- Brazero
- Bra
- aa
- Ket
- Ket
- End
-------------------------------------------------------------------
-
-/a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/BZ
-------------------------------------------------------------------
- Bra
- a+
- Brazero
- Bra
- bb
- Ket
- a#
- a++
- Bra
- Alt
- Alt
- Alt
- Ket
- #
- a+
- Bra
- Alt
- b
- Ket
- a#
- a+
- Brazero
- Bra
- Alt
- Alt
- Alt
- Ket
- a
- Ket
- End
-------------------------------------------------------------------
-
-/[ab]*/BZ
-------------------------------------------------------------------
- Bra
- [ab]*+
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0: aaaa
-
-/[ab]*?/BZ
-------------------------------------------------------------------
- Bra
- [ab]*?
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0:
-
-/[ab]?/BZ
-------------------------------------------------------------------
- Bra
- [ab]?+
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0: a
-
-/[ab]??/BZ
-------------------------------------------------------------------
- Bra
- [ab]??
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0:
-
-/[ab]+/BZ
-------------------------------------------------------------------
- Bra
- [ab]++
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0: aaaa
-
-/[ab]+?/BZ
-------------------------------------------------------------------
- Bra
- [ab]+?
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0: a
-
-/[ab]{2,3}/BZ
-------------------------------------------------------------------
- Bra
- [ab]{2,3}+
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0: aaa
-
-/[ab]{2,3}?/BZ
-------------------------------------------------------------------
- Bra
- [ab]{2,3}?
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0: aa
-
-/[ab]{2,}/BZ
-------------------------------------------------------------------
- Bra
- [ab]{2,}+
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0: aaaa
-
-/[ab]{2,}?/BZ
-------------------------------------------------------------------
- Bra
- [ab]{2,}?
- Ket
- End
-------------------------------------------------------------------
- aaaa
- 0: aa
-
-/\d+\s{0,5}=\s*\S?=\w{0,4}\W*/BZ
-------------------------------------------------------------------
- Bra
- \d++
- \s{0,5}+
- =
- \s*+
- \S?
- =
- \w{0,4}+
- \W*+
- Ket
- End
-------------------------------------------------------------------
-
-/[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/BZ
-------------------------------------------------------------------
- Bra
- [a-d]{5,12}+
- [0-9e-z]*+
- #
- [\x00-`{-\xff] (neg)++
- [b-y]*+
- a
- [2-7]?+
- [\x00-/:-`{-\xff] (neg)++
- Ket
- End
-------------------------------------------------------------------
-
-/[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/BZ
-------------------------------------------------------------------
- Bra
- [a-z]*+
- \s
- #
- [\x09 ]?+
- \S
- #
- [a-c]*
- \S
- #
- [C-G]++
- \d
- #
- [4-8]*+
- \D
- #
- [,4-9]*
- \D
- #
- [!$]{0,5}+
- \w
- #
- [M-Xf-l]++
- \W
- #
- [,a-c]?
- \W
- Ket
- End
-------------------------------------------------------------------
-
-/a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/BZ
-------------------------------------------------------------------
- Bra
- a+
- Brazero
- CBra 1
- aa
- Alt
- bb
- KetRmax
- c#
- a*
- Brazero
- CBra 2
- bb
- Alt
- cc
- KetRmax
- a#
- a?+
- Brazero
- CBra 3
- bb
- Alt
- cc
- KetRmax
- d#
- [a-f]*
- Brazero
- CBra 4
- g
- Alt
- hh
- KetRmax
- f
- Ket
- End
-------------------------------------------------------------------
-
-/[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/BZ
-------------------------------------------------------------------
- Bra
- [a-f]*+
- Brazero
- CBra 1
- g
- Alt
- hh
- Alt
- i
- KetRmax
- i#
- [a-x]{4,}
- Brazero
- SCBra 2
- y{0,6}
- KetRmax
- y#
- [a-k]++
- CBra 3
- ll
- Alt
- mm
- KetRmax
- n
- Ket
- End
-------------------------------------------------------------------
-
-/[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/BZ
-------------------------------------------------------------------
- Bra
- [a-f]*+
- Once_NC
- gg
- Alt
- hh
- KetRmax
- #
- [a-f]*+
- Brazero
- Once_NC
- gg
- Alt
- hh
- Ket
- #
- [a-f]*
- Brazero
- Once_NC
- gg
- Alt
- hh
- KetRmax
- a#
- [a-f]*+
- Brazero
- Once_NC
- gg
- Alt
- hh
- KetRmax
- h
- Ket
- End
-------------------------------------------------------------------
-
-/[a-c]*d/DZS
-------------------------------------------------------------------
- Bra
- [a-c]*+
- d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'd'
-Subject length lower bound = 1
-Starting chars: a b c d
-
-/[a-c]+d/DZS
-------------------------------------------------------------------
- Bra
- [a-c]++
- d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'd'
-Subject length lower bound = 2
-Starting chars: a b c
-
-/[a-c]?d/DZS
-------------------------------------------------------------------
- Bra
- [a-c]?+
- d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'd'
-Subject length lower bound = 1
-Starting chars: a b c d
-
-/[a-c]{4,6}d/DZS
-------------------------------------------------------------------
- Bra
- [a-c]{4,6}+
- d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'd'
-Subject length lower bound = 5
-Starting chars: a b c
-
-/[a-c]{0,6}d/DZS
-------------------------------------------------------------------
- Bra
- [a-c]{0,6}+
- d
- Ket
- End
-------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-No first char
-Need char = 'd'
-Subject length lower bound = 1
-Starting chars: a b c d
-
-/-- End of special auto-possessive tests --/
-
-/^A\o{1239}B/
-Failed: non-octal character in \o{} (closing brace missing?) at offset 8
-
-/^A\oB/
-Failed: missing opening brace after \o at offset 3
-
-/^A\x{zz}B/
-Failed: non-hex character in \x{} (closing brace missing?) at offset 5
-
-/^A\x{12Z/
-Failed: non-hex character in \x{} (closing brace missing?) at offset 7
-
-/^A\x{/
-Failed: non-hex character in \x{} (closing brace missing?) at offset 5
-
-/[ab]++/BZO
-------------------------------------------------------------------
- Bra
- [ab]++
- Ket
- End
-------------------------------------------------------------------
-
-/[^ab]*+/BZO
-------------------------------------------------------------------
- Bra
- [\x00-`c-\xff] (neg)*+
- Ket
- End
-------------------------------------------------------------------
-
-/a{4}+/BZO
-------------------------------------------------------------------
- Bra
- a{4}
- Ket
- End
-------------------------------------------------------------------
-
-/a{4}+/BZOi
-------------------------------------------------------------------
- Bra
- /i a{4}
- Ket
- End
-------------------------------------------------------------------
-
-/[a-[:digit:]]+/
-Failed: invalid range in character class at offset 3
-
-/[A-[:digit:]]+/
-Failed: invalid range in character class at offset 3
-
-/[a-[.xxx.]]+/
-Failed: invalid range in character class at offset 3
-
-/[a-[=xxx=]]+/
-Failed: invalid range in character class at offset 3
-
-/[a-[!xxx!]]+/
-Failed: range out of order in character class at offset 3
-
-/[A-[!xxx!]]+/
- A]]]
- 0: A]]]
-
-/[a-\d]+/
-Failed: invalid range in character class at offset 4
-
-/(?<0abc>xx)/
-Failed: group name must start with a non-digit at offset 3
-
-/(?&1abc)xx(?<1abc>y)/
-Failed: group name must start with a non-digit at offset 3
-
-/(?<ab-cd>xx)/
-Failed: syntax error in subpattern name (missing terminator) at offset 5
-
-/(?'0abc'xx)/
-Failed: group name must start with a non-digit at offset 3
-
-/(?P<0abc>xx)/
-Failed: group name must start with a non-digit at offset 4
-
-/\k<5ghj>/
-Failed: group name must start with a non-digit at offset 3
-
-/\k'5ghj'/
-Failed: group name must start with a non-digit at offset 3
-
-/\k{2fgh}/
-Failed: group name must start with a non-digit at offset 3
-
-/(?P=8yuki)/
-Failed: group name must start with a non-digit at offset 4
-
-/\g{4df}/
-Failed: group name must start with a non-digit at offset 3
-
-/(?&1abc)xx(?<1abc>y)/
-Failed: group name must start with a non-digit at offset 3
-
-/(?P>1abc)xx(?<1abc>y)/
-Failed: group name must start with a non-digit at offset 4
-
-/\g'3gh'/
-Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 7
-
-/\g<5fg>/
-Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 7
-
-/(?(<4gh>)abc)/
-Failed: group name must start with a non-digit at offset 4
-
-/(?('4gh')abc)/
-Failed: group name must start with a non-digit at offset 4
-
-/(?(4gh)abc)/
-Failed: malformed number or name after (?( at offset 4
-
-/(?(R&6yh)abc)/
-Failed: group name must start with a non-digit at offset 5
-
-/-- Test the ugly "start or end of word" compatibility syntax --/
-
-/[[:<:]]red[[:>:]]/BZ
-------------------------------------------------------------------
- Bra
- \b
- Assert
- \w
- Ket
- red
- \b
- AssertB
- Reverse
- \w
- Ket
- Ket
- End
-------------------------------------------------------------------
- little red riding hood
- 0: red
- a /red/ thing
- 0: red
- red is a colour
- 0: red
- put it all on red
- 0: red
- ** Failers
-No match
- no reduction
-No match
- Alfred Winifred
-No match
-
-/[a[:<:]] should give error/
-Failed: unknown POSIX class name at offset 4
-
-/(?=ab\K)/+
- abcd
-Start of matched string is beyond its end - displaying from end to start.
- 0: ab
- 0+ abcd
-
-/abcd/f<lf>
- xx\nxabcd
-No match
-
-/ -- Test stack check external calls --/
-
-/(((((a)))))/Q0
-
-/(((((a)))))/Q1
-Failed: parentheses are too deeply nested (stack check) at offset 0
-
-/(((((a)))))/Q
-** Missing 0 or 1 after /Q
-
-/-- End of testinput2 --/
diff --git a/.pc/PCRE6_compatible_API.patch/pcrecpp.cc b/.pc/PCRE6_compatible_API.patch/pcrecpp.cc
deleted file mode 100644
index c0ba9ca..0000000
--- a/.pc/PCRE6_compatible_API.patch/pcrecpp.cc
+++ /dev/null
@@ -1,922 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// 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 Google Inc. 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.
-//
-// Author: Sanjay Ghemawat
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <limits.h> /* for SHRT_MIN, USHRT_MAX, etc */
-#include <string.h> /* for memcpy */
-#include <assert.h>
-#include <errno.h>
-#include <string>
-#include <algorithm>
-
-#include "pcrecpp_internal.h"
-#include "pcre.h"
-#include "pcrecpp.h"
-#include "pcre_stringpiece.h"
-
-
-namespace pcrecpp {
-
-// Maximum number of args we can set
-static const int kMaxArgs = 16;
-static const int kVecSize = (1 + kMaxArgs) * 3; // results + PCRE workspace
-
-// Special object that stands-in for no argument
-Arg RE::no_arg((void*)NULL);
-
-// This is for ABI compatibility with old versions of pcre (pre-7.6),
-// which defined a global no_arg variable instead of putting it in the
-// RE class. This works on GCC >= 3, at least. It definitely works
-// for ELF, but may not for other object formats (Mach-O, for
-// instance, does not support aliases.) We could probably have a more
-// inclusive test if we ever needed it. (Note that not only the
-// __attribute__ syntax, but also __USER_LABEL_PREFIX__, are
-// gnu-specific.)
-#if defined(__GNUC__) && __GNUC__ >= 3 && defined(__ELF__)
-# define ULP_AS_STRING(x) ULP_AS_STRING_INTERNAL(x)
-# define ULP_AS_STRING_INTERNAL(x) #x
-# define USER_LABEL_PREFIX_STR ULP_AS_STRING(__USER_LABEL_PREFIX__)
-extern Arg no_arg
- __attribute__((alias(USER_LABEL_PREFIX_STR "_ZN7pcrecpp2RE6no_argE")));
-#endif
-
-// If a regular expression has no error, its error_ field points here
-static const string empty_string;
-
-// If the user doesn't ask for any options, we just use this one
-static RE_Options default_options;
-
-void RE::Init(const string& pat, const RE_Options* options) {
- pattern_ = pat;
- if (options == NULL) {
- options_ = default_options;
- } else {
- options_ = *options;
- }
- error_ = &empty_string;
- re_full_ = NULL;
- re_partial_ = NULL;
-
- re_partial_ = Compile(UNANCHORED);
- if (re_partial_ != NULL) {
- re_full_ = Compile(ANCHOR_BOTH);
- }
-}
-
-void RE::Cleanup() {
- if (re_full_ != NULL) (*pcre_free)(re_full_);
- if (re_partial_ != NULL) (*pcre_free)(re_partial_);
- if (error_ != &empty_string) delete error_;
-}
-
-
-RE::~RE() {
- Cleanup();
-}
-
-
-pcre* RE::Compile(Anchor anchor) {
- // First, convert RE_Options into pcre options
- int pcre_options = 0;
- pcre_options = options_.all_options();
-
- // Special treatment for anchoring. This is needed because at
- // runtime pcre only provides an option for anchoring at the
- // beginning of a string (unless you use offset).
- //
- // There are three types of anchoring we want:
- // UNANCHORED Compile the original pattern, and use
- // a pcre unanchored match.
- // ANCHOR_START Compile the original pattern, and use
- // a pcre anchored match.
- // ANCHOR_BOTH Tack a "\z" to the end of the original pattern
- // and use a pcre anchored match.
-
- const char* compile_error;
- int eoffset;
- pcre* re;
- if (anchor != ANCHOR_BOTH) {
- re = pcre_compile(pattern_.c_str(), pcre_options,
- &compile_error, &eoffset, NULL);
- } else {
- // Tack a '\z' at the end of RE. Parenthesize it first so that
- // the '\z' applies to all top-level alternatives in the regexp.
- string wrapped = "(?:"; // A non-counting grouping operator
- wrapped += pattern_;
- wrapped += ")\\z";
- re = pcre_compile(wrapped.c_str(), pcre_options,
- &compile_error, &eoffset, NULL);
- }
- if (re == NULL) {
- if (error_ == &empty_string) error_ = new string(compile_error);
- }
- return re;
-}
-
-/***** Matching interfaces *****/
-
-bool RE::FullMatch(const StringPiece& text,
- const Arg& ptr1,
- const Arg& ptr2,
- const Arg& ptr3,
- const Arg& ptr4,
- const Arg& ptr5,
- const Arg& ptr6,
- const Arg& ptr7,
- const Arg& ptr8,
- const Arg& ptr9,
- const Arg& ptr10,
- const Arg& ptr11,
- const Arg& ptr12,
- const Arg& ptr13,
- const Arg& ptr14,
- const Arg& ptr15,
- const Arg& ptr16) const {
- const Arg* args[kMaxArgs];
- int n = 0;
- if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1;
- if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2;
- if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3;
- if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4;
- if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5;
- if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6;
- if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7;
- if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8;
- if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9;
- if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
- if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
- if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
- if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
- if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
- if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
- if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
- done:
-
- int consumed;
- int vec[kVecSize];
- return DoMatchImpl(text, ANCHOR_BOTH, &consumed, args, n, vec, kVecSize);
-}
-
-bool RE::PartialMatch(const StringPiece& text,
- const Arg& ptr1,
- const Arg& ptr2,
- const Arg& ptr3,
- const Arg& ptr4,
- const Arg& ptr5,
- const Arg& ptr6,
- const Arg& ptr7,
- const Arg& ptr8,
- const Arg& ptr9,
- const Arg& ptr10,
- const Arg& ptr11,
- const Arg& ptr12,
- const Arg& ptr13,
- const Arg& ptr14,
- const Arg& ptr15,
- const Arg& ptr16) const {
- const Arg* args[kMaxArgs];
- int n = 0;
- if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1;
- if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2;
- if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3;
- if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4;
- if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5;
- if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6;
- if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7;
- if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8;
- if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9;
- if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
- if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
- if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
- if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
- if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
- if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
- if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
- done:
-
- int consumed;
- int vec[kVecSize];
- return DoMatchImpl(text, UNANCHORED, &consumed, args, n, vec, kVecSize);
-}
-
-bool RE::Consume(StringPiece* input,
- const Arg& ptr1,
- const Arg& ptr2,
- const Arg& ptr3,
- const Arg& ptr4,
- const Arg& ptr5,
- const Arg& ptr6,
- const Arg& ptr7,
- const Arg& ptr8,
- const Arg& ptr9,
- const Arg& ptr10,
- const Arg& ptr11,
- const Arg& ptr12,
- const Arg& ptr13,
- const Arg& ptr14,
- const Arg& ptr15,
- const Arg& ptr16) const {
- const Arg* args[kMaxArgs];
- int n = 0;
- if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1;
- if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2;
- if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3;
- if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4;
- if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5;
- if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6;
- if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7;
- if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8;
- if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9;
- if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
- if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
- if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
- if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
- if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
- if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
- if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
- done:
-
- int consumed;
- int vec[kVecSize];
- if (DoMatchImpl(*input, ANCHOR_START, &consumed,
- args, n, vec, kVecSize)) {
- input->remove_prefix(consumed);
- return true;
- } else {
- return false;
- }
-}
-
-bool RE::FindAndConsume(StringPiece* input,
- const Arg& ptr1,
- const Arg& ptr2,
- const Arg& ptr3,
- const Arg& ptr4,
- const Arg& ptr5,
- const Arg& ptr6,
- const Arg& ptr7,
- const Arg& ptr8,
- const Arg& ptr9,
- const Arg& ptr10,
- const Arg& ptr11,
- const Arg& ptr12,
- const Arg& ptr13,
- const Arg& ptr14,
- const Arg& ptr15,
- const Arg& ptr16) const {
- const Arg* args[kMaxArgs];
- int n = 0;
- if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1;
- if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2;
- if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3;
- if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4;
- if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5;
- if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6;
- if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7;
- if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8;
- if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9;
- if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
- if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
- if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
- if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
- if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
- if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
- if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
- done:
-
- int consumed;
- int vec[kVecSize];
- if (DoMatchImpl(*input, UNANCHORED, &consumed,
- args, n, vec, kVecSize)) {
- input->remove_prefix(consumed);
- return true;
- } else {
- return false;
- }
-}
-
-bool RE::Replace(const StringPiece& rewrite,
- string *str) const {
- int vec[kVecSize];
- int matches = TryMatch(*str, 0, UNANCHORED, true, vec, kVecSize);
- if (matches == 0)
- return false;
-
- string s;
- if (!Rewrite(&s, rewrite, *str, vec, matches))
- return false;
-
- assert(vec[0] >= 0);
- assert(vec[1] >= 0);
- str->replace(vec[0], vec[1] - vec[0], s);
- return true;
-}
-
-// Returns PCRE_NEWLINE_CRLF, PCRE_NEWLINE_CR, or PCRE_NEWLINE_LF.
-// Note that PCRE_NEWLINE_CRLF is defined to be P_N_CR | P_N_LF.
-// Modified by PH to add PCRE_NEWLINE_ANY and PCRE_NEWLINE_ANYCRLF.
-
-static int NewlineMode(int pcre_options) {
- // TODO: if we can make it threadsafe, cache this var
- int newline_mode = 0;
- /* if (newline_mode) return newline_mode; */ // do this once it's cached
- if (pcre_options & (PCRE_NEWLINE_CRLF|PCRE_NEWLINE_CR|PCRE_NEWLINE_LF|
- PCRE_NEWLINE_ANY|PCRE_NEWLINE_ANYCRLF)) {
- newline_mode = (pcre_options &
- (PCRE_NEWLINE_CRLF|PCRE_NEWLINE_CR|PCRE_NEWLINE_LF|
- PCRE_NEWLINE_ANY|PCRE_NEWLINE_ANYCRLF));
- } else {
- int newline;
- pcre_config(PCRE_CONFIG_NEWLINE, &newline);
- if (newline == 10)
- newline_mode = PCRE_NEWLINE_LF;
- else if (newline == 13)
- newline_mode = PCRE_NEWLINE_CR;
- else if (newline == 3338)
- newline_mode = PCRE_NEWLINE_CRLF;
- else if (newline == -1)
- newline_mode = PCRE_NEWLINE_ANY;
- else if (newline == -2)
- newline_mode = PCRE_NEWLINE_ANYCRLF;
- else
- assert(NULL == "Unexpected return value from pcre_config(NEWLINE)");
- }
- return newline_mode;
-}
-
-int RE::GlobalReplace(const StringPiece& rewrite,
- string *str) const {
- int count = 0;
- int vec[kVecSize];
- string out;
- int start = 0;
- bool last_match_was_empty_string = false;
-
- while (start <= static_cast<int>(str->length())) {
- // If the previous match was for the empty string, we shouldn't
- // just match again: we'll match in the same way and get an
- // infinite loop. Instead, we do the match in a special way:
- // anchored -- to force another try at the same position --
- // and with a flag saying that this time, ignore empty matches.
- // If this special match returns, that means there's a non-empty
- // match at this position as well, and we can continue. If not,
- // we do what perl does, and just advance by one.
- // Notice that perl prints '@@@' for this;
- // perl -le '$_ = "aa"; s/b*|aa/@/g; print'
- int matches;
- if (last_match_was_empty_string) {
- matches = TryMatch(*str, start, ANCHOR_START, false, vec, kVecSize);
- if (matches <= 0) {
- int matchend = start + 1; // advance one character.
- // If the current char is CR and we're in CRLF mode, skip LF too.
- // Note it's better to call pcre_fullinfo() than to examine
- // all_options(), since options_ could have changed bewteen
- // compile-time and now, but this is simpler and safe enough.
- // Modified by PH to add ANY and ANYCRLF.
- if (matchend < static_cast<int>(str->length()) &&
- (*str)[start] == '\r' && (*str)[matchend] == '\n' &&
- (NewlineMode(options_.all_options()) == PCRE_NEWLINE_CRLF ||
- NewlineMode(options_.all_options()) == PCRE_NEWLINE_ANY ||
- NewlineMode(options_.all_options()) == PCRE_NEWLINE_ANYCRLF)) {
- matchend++;
- }
- // We also need to advance more than one char if we're in utf8 mode.
-#ifdef SUPPORT_UTF8
- if (options_.utf8()) {
- while (matchend < static_cast<int>(str->length()) &&
- ((*str)[matchend] & 0xc0) == 0x80)
- matchend++;
- }
-#endif
- if (start < static_cast<int>(str->length()))
- out.append(*str, start, matchend - start);
- start = matchend;
- last_match_was_empty_string = false;
- continue;
- }
- } else {
- matches = TryMatch(*str, start, UNANCHORED, true, vec, kVecSize);
- if (matches <= 0)
- break;
- }
- int matchstart = vec[0], matchend = vec[1];
- assert(matchstart >= start);
- assert(matchend >= matchstart);
- out.append(*str, start, matchstart - start);
- Rewrite(&out, rewrite, *str, vec, matches);
- start = matchend;
- count++;
- last_match_was_empty_string = (matchstart == matchend);
- }
-
- if (count == 0)
- return 0;
-
- if (start < static_cast<int>(str->length()))
- out.append(*str, start, str->length() - start);
- swap(out, *str);
- return count;
-}
-
-bool RE::Extract(const StringPiece& rewrite,
- const StringPiece& text,
- string *out) const {
- int vec[kVecSize];
- int matches = TryMatch(text, 0, UNANCHORED, true, vec, kVecSize);
- if (matches == 0)
- return false;
- out->erase();
- return Rewrite(out, rewrite, text, vec, matches);
-}
-
-/*static*/ string RE::QuoteMeta(const StringPiece& unquoted) {
- string result;
-
- // Escape any ascii character not in [A-Za-z_0-9].
- //
- // Note that it's legal to escape a character even if it has no
- // special meaning in a regular expression -- so this function does
- // that. (This also makes it identical to the perl function of the
- // same name; see `perldoc -f quotemeta`.) The one exception is
- // escaping NUL: rather than doing backslash + NUL, like perl does,
- // we do '\0', because pcre itself doesn't take embedded NUL chars.
- for (int ii = 0; ii < unquoted.size(); ++ii) {
- // Note that using 'isalnum' here raises the benchmark time from
- // 32ns to 58ns:
- if (unquoted[ii] == '\0') {
- result += "\\0";
- } else if ((unquoted[ii] < 'a' || unquoted[ii] > 'z') &&
- (unquoted[ii] < 'A' || unquoted[ii] > 'Z') &&
- (unquoted[ii] < '0' || unquoted[ii] > '9') &&
- unquoted[ii] != '_' &&
- // If this is the part of a UTF8 or Latin1 character, we need
- // to copy this byte without escaping. Experimentally this is
- // what works correctly with the regexp library.
- !(unquoted[ii] & 128)) {
- result += '\\';
- result += unquoted[ii];
- } else {
- result += unquoted[ii];
- }
- }
-
- return result;
-}
-
-/***** Actual matching and rewriting code *****/
-
-int RE::TryMatch(const StringPiece& text,
- int startpos,
- Anchor anchor,
- bool empty_ok,
- int *vec,
- int vecsize) const {
- pcre* re = (anchor == ANCHOR_BOTH) ? re_full_ : re_partial_;
- if (re == NULL) {
- //fprintf(stderr, "Matching against invalid re: %s\n", error_->c_str());
- return 0;
- }
-
- pcre_extra extra = { 0, 0, 0, 0, 0, 0 };
- if (options_.match_limit() > 0) {
- extra.flags |= PCRE_EXTRA_MATCH_LIMIT;
- extra.match_limit = options_.match_limit();
- }
- if (options_.match_limit_recursion() > 0) {
- extra.flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
- extra.match_limit_recursion = options_.match_limit_recursion();
- }
-
- // int options = 0;
- // Changed by PH as a result of bugzilla #1288
- int options = (options_.all_options() & PCRE_NO_UTF8_CHECK);
-
- if (anchor != UNANCHORED)
- options |= PCRE_ANCHORED;
- if (!empty_ok)
- options |= PCRE_NOTEMPTY;
-
- int rc = pcre_exec(re, // The regular expression object
- &extra,
- (text.data() == NULL) ? "" : text.data(),
- text.size(),
- startpos,
- options,
- vec,
- vecsize);
-
- // Handle errors
- if (rc == PCRE_ERROR_NOMATCH) {
- return 0;
- } else if (rc < 0) {
- //fprintf(stderr, "Unexpected return code: %d when matching '%s'\n",
- // re, pattern_.c_str());
- return 0;
- } else if (rc == 0) {
- // pcre_exec() returns 0 as a special case when the number of
- // capturing subpatterns exceeds the size of the vector.
- // When this happens, there is a match and the output vector
- // is filled, but we miss out on the positions of the extra subpatterns.
- rc = vecsize / 2;
- }
-
- return rc;
-}
-
-bool RE::DoMatchImpl(const StringPiece& text,
- Anchor anchor,
- int* consumed,
- const Arg* const* args,
- int n,
- int* vec,
- int vecsize) const {
- assert((1 + n) * 3 <= vecsize); // results + PCRE workspace
- int matches = TryMatch(text, 0, anchor, true, vec, vecsize);
- assert(matches >= 0); // TryMatch never returns negatives
- if (matches == 0)
- return false;
-
- *consumed = vec[1];
-
- if (n == 0 || args == NULL) {
- // We are not interested in results
- return true;
- }
-
- if (NumberOfCapturingGroups() < n) {
- // RE has fewer capturing groups than number of arg pointers passed in
- return false;
- }
-
- // If we got here, we must have matched the whole pattern.
- // We do not need (can not do) any more checks on the value of 'matches' here
- // -- see the comment for TryMatch.
- for (int i = 0; i < n; i++) {
- const int start = vec[2*(i+1)];
- const int limit = vec[2*(i+1)+1];
- if (!args[i]->Parse(text.data() + start, limit-start)) {
- // TODO: Should we indicate what the error was?
- return false;
- }
- }
-
- return true;
-}
-
-bool RE::DoMatch(const StringPiece& text,
- Anchor anchor,
- int* consumed,
- const Arg* const args[],
- int n) const {
- assert(n >= 0);
- size_t const vecsize = (1 + n) * 3; // results + PCRE workspace
- // (as for kVecSize)
- int space[21]; // use stack allocation for small vecsize (common case)
- int* vec = vecsize <= 21 ? space : new int[vecsize];
- bool retval = DoMatchImpl(text, anchor, consumed, args, n, vec, (int)vecsize);
- if (vec != space) delete [] vec;
- return retval;
-}
-
-bool RE::Rewrite(string *out, const StringPiece &rewrite,
- const StringPiece &text, int *vec, int veclen) const {
- for (const char *s = rewrite.data(), *end = s + rewrite.size();
- s < end; s++) {
- int c = *s;
- if (c == '\\') {
- c = *++s;
- if (isdigit(c)) {
- int n = (c - '0');
- if (n >= veclen) {
- //fprintf(stderr, requested group %d in regexp %.*s\n",
- // n, rewrite.size(), rewrite.data());
- return false;
- }
- int start = vec[2 * n];
- if (start >= 0)
- out->append(text.data() + start, vec[2 * n + 1] - start);
- } else if (c == '\\') {
- *out += '\\';
- } else {
- //fprintf(stderr, "invalid rewrite pattern: %.*s\n",
- // rewrite.size(), rewrite.data());
- return false;
- }
- } else {
- *out += c;
- }
- }
- return true;
-}
-
-// Return the number of capturing subpatterns, or -1 if the
-// regexp wasn't valid on construction.
-int RE::NumberOfCapturingGroups() const {
- if (re_partial_ == NULL) return -1;
-
- int result;
- int pcre_retval = pcre_fullinfo(re_partial_, // The regular expression object
- NULL, // We did not study the pattern
- PCRE_INFO_CAPTURECOUNT,
- &result);
- assert(pcre_retval == 0);
- return result;
-}
-
-/***** Parsers for various types *****/
-
-bool Arg::parse_null(const char* str, int n, void* dest) {
- // We fail if somebody asked us to store into a non-NULL void* pointer
- return (dest == NULL);
-}
-
-bool Arg::parse_string(const char* str, int n, void* dest) {
- if (dest == NULL) return true;
- reinterpret_cast<string*>(dest)->assign(str, n);
- return true;
-}
-
-bool Arg::parse_stringpiece(const char* str, int n, void* dest) {
- if (dest == NULL) return true;
- reinterpret_cast<StringPiece*>(dest)->set(str, n);
- return true;
-}
-
-bool Arg::parse_char(const char* str, int n, void* dest) {
- if (n != 1) return false;
- if (dest == NULL) return true;
- *(reinterpret_cast<char*>(dest)) = str[0];
- return true;
-}
-
-bool Arg::parse_uchar(const char* str, int n, void* dest) {
- if (n != 1) return false;
- if (dest == NULL) return true;
- *(reinterpret_cast<unsigned char*>(dest)) = str[0];
- return true;
-}
-
-// Largest number spec that we are willing to parse
-static const int kMaxNumberLength = 32;
-
-// REQUIRES "buf" must have length at least kMaxNumberLength+1
-// REQUIRES "n > 0"
-// Copies "str" into "buf" and null-terminates if necessary.
-// Returns one of:
-// a. "str" if no termination is needed
-// b. "buf" if the string was copied and null-terminated
-// c. "" if the input was invalid and has no hope of being parsed
-static const char* TerminateNumber(char* buf, const char* str, int n) {
- if ((n > 0) && isspace(*str)) {
- // We are less forgiving than the strtoxxx() routines and do not
- // allow leading spaces.
- return "";
- }
-
- // See if the character right after the input text may potentially
- // look like a digit.
- if (isdigit(str[n]) ||
- ((str[n] >= 'a') && (str[n] <= 'f')) ||
- ((str[n] >= 'A') && (str[n] <= 'F'))) {
- if (n > kMaxNumberLength) return ""; // Input too big to be a valid number
- memcpy(buf, str, n);
- buf[n] = '\0';
- return buf;
- } else {
- // We can parse right out of the supplied string, so return it.
- return str;
- }
-}
-
-bool Arg::parse_long_radix(const char* str,
- int n,
- void* dest,
- int radix) {
- if (n == 0) return false;
- char buf[kMaxNumberLength+1];
- str = TerminateNumber(buf, str, n);
- char* end;
- errno = 0;
- long r = strtol(str, &end, radix);
- if (end != str + n) return false; // Leftover junk
- if (errno) return false;
- if (dest == NULL) return true;
- *(reinterpret_cast<long*>(dest)) = r;
- return true;
-}
-
-bool Arg::parse_ulong_radix(const char* str,
- int n,
- void* dest,
- int radix) {
- if (n == 0) return false;
- char buf[kMaxNumberLength+1];
- str = TerminateNumber(buf, str, n);
- if (str[0] == '-') return false; // strtoul() on a negative number?!
- char* end;
- errno = 0;
- unsigned long r = strtoul(str, &end, radix);
- if (end != str + n) return false; // Leftover junk
- if (errno) return false;
- if (dest == NULL) return true;
- *(reinterpret_cast<unsigned long*>(dest)) = r;
- return true;
-}
-
-bool Arg::parse_short_radix(const char* str,
- int n,
- void* dest,
- int radix) {
- long r;
- if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse
- if (r < SHRT_MIN || r > SHRT_MAX) return false; // Out of range
- if (dest == NULL) return true;
- *(reinterpret_cast<short*>(dest)) = static_cast<short>(r);
- return true;
-}
-
-bool Arg::parse_ushort_radix(const char* str,
- int n,
- void* dest,
- int radix) {
- unsigned long r;
- if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse
- if (r > USHRT_MAX) return false; // Out of range
- if (dest == NULL) return true;
- *(reinterpret_cast<unsigned short*>(dest)) = static_cast<unsigned short>(r);
- return true;
-}
-
-bool Arg::parse_int_radix(const char* str,
- int n,
- void* dest,
- int radix) {
- long r;
- if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse
- if (r < INT_MIN || r > INT_MAX) return false; // Out of range
- if (dest == NULL) return true;
- *(reinterpret_cast<int*>(dest)) = r;
- return true;
-}
-
-bool Arg::parse_uint_radix(const char* str,
- int n,
- void* dest,
- int radix) {
- unsigned long r;
- if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse
- if (r > UINT_MAX) return false; // Out of range
- if (dest == NULL) return true;
- *(reinterpret_cast<unsigned int*>(dest)) = r;
- return true;
-}
-
-bool Arg::parse_longlong_radix(const char* str,
- int n,
- void* dest,
- int radix) {
-#ifndef HAVE_LONG_LONG
- return false;
-#else
- if (n == 0) return false;
- char buf[kMaxNumberLength+1];
- str = TerminateNumber(buf, str, n);
- char* end;
- errno = 0;
-#if defined HAVE_STRTOQ
- long long r = strtoq(str, &end, radix);
-#elif defined HAVE_STRTOLL
- long long r = strtoll(str, &end, radix);
-#elif defined HAVE__STRTOI64
- long long r = _strtoi64(str, &end, radix);
-#elif defined HAVE_STRTOIMAX
- long long r = strtoimax(str, &end, radix);
-#else
-#error parse_longlong_radix: cannot convert input to a long-long
-#endif
- if (end != str + n) return false; // Leftover junk
- if (errno) return false;
- if (dest == NULL) return true;
- *(reinterpret_cast<long long*>(dest)) = r;
- return true;
-#endif /* HAVE_LONG_LONG */
-}
-
-bool Arg::parse_ulonglong_radix(const char* str,
- int n,
- void* dest,
- int radix) {
-#ifndef HAVE_UNSIGNED_LONG_LONG
- return false;
-#else
- if (n == 0) return false;
- char buf[kMaxNumberLength+1];
- str = TerminateNumber(buf, str, n);
- if (str[0] == '-') return false; // strtoull() on a negative number?!
- char* end;
- errno = 0;
-#if defined HAVE_STRTOQ
- unsigned long long r = strtouq(str, &end, radix);
-#elif defined HAVE_STRTOLL
- unsigned long long r = strtoull(str, &end, radix);
-#elif defined HAVE__STRTOI64
- unsigned long long r = _strtoui64(str, &end, radix);
-#elif defined HAVE_STRTOIMAX
- unsigned long long r = strtoumax(str, &end, radix);
-#else
-#error parse_ulonglong_radix: cannot convert input to a long-long
-#endif
- if (end != str + n) return false; // Leftover junk
- if (errno) return false;
- if (dest == NULL) return true;
- *(reinterpret_cast<unsigned long long*>(dest)) = r;
- return true;
-#endif /* HAVE_UNSIGNED_LONG_LONG */
-}
-
-bool Arg::parse_double(const char* str, int n, void* dest) {
- if (n == 0) return false;
- static const int kMaxLength = 200;
- char buf[kMaxLength];
- if (n >= kMaxLength) return false;
- memcpy(buf, str, n);
- buf[n] = '\0';
- errno = 0;
- char* end;
- double r = strtod(buf, &end);
- if (end != buf + n) return false; // Leftover junk
- if (errno) return false;
- if (dest == NULL) return true;
- *(reinterpret_cast<double*>(dest)) = r;
- return true;
-}
-
-bool Arg::parse_float(const char* str, int n, void* dest) {
- double r;
- if (!parse_double(str, n, &r)) return false;
- if (dest == NULL) return true;
- *(reinterpret_cast<float*>(dest)) = static_cast<float>(r);
- return true;
-}
-
-
-#define DEFINE_INTEGER_PARSERS(name) \
- bool Arg::parse_##name(const char* str, int n, void* dest) { \
- return parse_##name##_radix(str, n, dest, 10); \
- } \
- bool Arg::parse_##name##_hex(const char* str, int n, void* dest) { \
- return parse_##name##_radix(str, n, dest, 16); \
- } \
- bool Arg::parse_##name##_octal(const char* str, int n, void* dest) { \
- return parse_##name##_radix(str, n, dest, 8); \
- } \
- bool Arg::parse_##name##_cradix(const char* str, int n, void* dest) { \
- return parse_##name##_radix(str, n, dest, 0); \
- }
-
-DEFINE_INTEGER_PARSERS(short) /* */
-DEFINE_INTEGER_PARSERS(ushort) /* */
-DEFINE_INTEGER_PARSERS(int) /* Don't use semicolons after these */
-DEFINE_INTEGER_PARSERS(uint) /* statements because they can cause */
-DEFINE_INTEGER_PARSERS(long) /* compiler warnings if the checking */
-DEFINE_INTEGER_PARSERS(ulong) /* level is turned up high enough. */
-DEFINE_INTEGER_PARSERS(longlong) /* */
-DEFINE_INTEGER_PARSERS(ulonglong) /* */
-
-#undef DEFINE_INTEGER_PARSERS
-
-} // namespace pcrecpp
diff --git a/.pc/PCRE6_compatible_API.patch/pcrecpp.h b/.pc/PCRE6_compatible_API.patch/pcrecpp.h
deleted file mode 100644
index 3e594b0..0000000
--- a/.pc/PCRE6_compatible_API.patch/pcrecpp.h
+++ /dev/null
@@ -1,710 +0,0 @@
-// Copyright (c) 2005, Google Inc.
-// All rights reserved.
-//
-// 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 Google Inc. 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.
-//
-// Author: Sanjay Ghemawat
-// Support for PCRE_XXX modifiers added by Giuseppe Maxia, July 2005
-
-#ifndef _PCRECPP_H
-#define _PCRECPP_H
-
-// C++ interface to the pcre regular-expression library. RE supports
-// Perl-style regular expressions (with extensions like \d, \w, \s,
-// ...).
-//
-// -----------------------------------------------------------------------
-// REGEXP SYNTAX:
-//
-// This module is part of the pcre library and hence supports its syntax
-// for regular expressions.
-//
-// The syntax is pretty similar to Perl's. For those not familiar
-// with Perl's regular expressions, here are some examples of the most
-// commonly used extensions:
-//
-// "hello (\\w+) world" -- \w matches a "word" character
-// "version (\\d+)" -- \d matches a digit
-// "hello\\s+world" -- \s matches any whitespace character
-// "\\b(\\w+)\\b" -- \b matches empty string at a word boundary
-// "(?i)hello" -- (?i) turns on case-insensitive matching
-// "/\\*(.*?)\\*/" -- .*? matches . minimum no. of times possible
-//
-// -----------------------------------------------------------------------
-// MATCHING INTERFACE:
-//
-// The "FullMatch" operation checks that supplied text matches a
-// supplied pattern exactly.
-//
-// Example: successful match
-// pcrecpp::RE re("h.*o");
-// re.FullMatch("hello");
-//
-// Example: unsuccessful match (requires full match):
-// pcrecpp::RE re("e");
-// !re.FullMatch("hello");
-//
-// Example: creating a temporary RE object:
-// pcrecpp::RE("h.*o").FullMatch("hello");
-//
-// You can pass in a "const char*" or a "string" for "text". The
-// examples below tend to use a const char*.
-//
-// You can, as in the different examples above, store the RE object
-// explicitly in a variable or use a temporary RE object. The
-// examples below use one mode or the other arbitrarily. Either
-// could correctly be used for any of these examples.
-//
-// -----------------------------------------------------------------------
-// MATCHING WITH SUB-STRING EXTRACTION:
-//
-// You can supply extra pointer arguments to extract matched subpieces.
-//
-// Example: extracts "ruby" into "s" and 1234 into "i"
-// int i;
-// string s;
-// pcrecpp::RE re("(\\w+):(\\d+)");
-// re.FullMatch("ruby:1234", &s, &i);
-//
-// Example: does not try to extract any extra sub-patterns
-// re.FullMatch("ruby:1234", &s);
-//
-// Example: does not try to extract into NULL
-// re.FullMatch("ruby:1234", NULL, &i);
-//
-// Example: integer overflow causes failure
-// !re.FullMatch("ruby:1234567891234", NULL, &i);
-//
-// Example: fails because there aren't enough sub-patterns:
-// !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s);
-//
-// Example: fails because string cannot be stored in integer
-// !pcrecpp::RE("(.*)").FullMatch("ruby", &i);
-//
-// The provided pointer arguments can be pointers to any scalar numeric
-// type, or one of
-// string (matched piece is copied to string)
-// StringPiece (StringPiece is mutated to point to matched piece)
-// T (where "bool T::ParseFrom(const char*, int)" exists)
-// NULL (the corresponding matched sub-pattern is not copied)
-//
-// CAVEAT: An optional sub-pattern that does not exist in the matched
-// string is assigned the empty string. Therefore, the following will
-// return false (because the empty string is not a valid number):
-// int number;
-// pcrecpp::RE::FullMatch("abc", "[a-z]+(\\d+)?", &number);
-//
-// -----------------------------------------------------------------------
-// DO_MATCH
-//
-// The matching interface supports at most 16 arguments per call.
-// If you need more, consider using the more general interface
-// pcrecpp::RE::DoMatch(). See pcrecpp.h for the signature for DoMatch.
-//
-// -----------------------------------------------------------------------
-// PARTIAL MATCHES
-//
-// You can use the "PartialMatch" operation when you want the pattern
-// to match any substring of the text.
-//
-// Example: simple search for a string:
-// pcrecpp::RE("ell").PartialMatch("hello");
-//
-// Example: find first number in a string:
-// int number;
-// pcrecpp::RE re("(\\d+)");
-// re.PartialMatch("x*100 + 20", &number);
-// assert(number == 100);
-//
-// -----------------------------------------------------------------------
-// UTF-8 AND THE MATCHING INTERFACE:
-//
-// By default, pattern and text are plain text, one byte per character.
-// The UTF8 flag, passed to the constructor, causes both pattern
-// and string to be treated as UTF-8 text, still a byte stream but
-// potentially multiple bytes per character. In practice, the text
-// is likelier to be UTF-8 than the pattern, but the match returned
-// may depend on the UTF8 flag, so always use it when matching
-// UTF8 text. E.g., "." will match one byte normally but with UTF8
-// set may match up to three bytes of a multi-byte character.
-//
-// Example:
-// pcrecpp::RE_Options options;
-// options.set_utf8();
-// pcrecpp::RE re(utf8_pattern, options);
-// re.FullMatch(utf8_string);
-//
-// Example: using the convenience function UTF8():
-// pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8());
-// re.FullMatch(utf8_string);
-//
-// NOTE: The UTF8 option is ignored if pcre was not configured with the
-// --enable-utf8 flag.
-//
-// -----------------------------------------------------------------------
-// PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE
-//
-// PCRE defines some modifiers to change the behavior of the regular
-// expression engine.
-// The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle
-// to pass such modifiers to a RE class.
-//
-// Currently, the following modifiers are supported
-//
-// modifier description Perl corresponding
-//
-// PCRE_CASELESS case insensitive match /i
-// PCRE_MULTILINE multiple lines match /m
-// PCRE_DOTALL dot matches newlines /s
-// PCRE_DOLLAR_ENDONLY $ matches only at end N/A
-// PCRE_EXTRA strict escape parsing N/A
-// PCRE_EXTENDED ignore whitespaces /x
-// PCRE_UTF8 handles UTF8 chars built-in
-// PCRE_UNGREEDY reverses * and *? N/A
-// PCRE_NO_AUTO_CAPTURE disables matching parens N/A (*)
-//
-// (For a full account on how each modifier works, please check the
-// PCRE API reference manual).
-//
-// (*) Both Perl and PCRE allow non matching parentheses by means of the
-// "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not
-// capture, while (ab|cd) does.
-//
-// For each modifier, there are two member functions whose name is made
-// out of the modifier in lowercase, without the "PCRE_" prefix. For
-// instance, PCRE_CASELESS is handled by
-// bool caseless(),
-// which returns true if the modifier is set, and
-// RE_Options & set_caseless(bool),
-// which sets or unsets the modifier.
-//
-// Moreover, PCRE_EXTRA_MATCH_LIMIT can be accessed through the
-// set_match_limit() and match_limit() member functions.
-// Setting match_limit to a non-zero value will limit the executation of
-// pcre to keep it from doing bad things like blowing the stack or taking
-// an eternity to return a result. A value of 5000 is good enough to stop
-// stack blowup in a 2MB thread stack. Setting match_limit to zero will
-// disable match limiting. Alternately, you can set match_limit_recursion()
-// which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to limit how much pcre
-// recurses. match_limit() caps the number of matches pcre does;
-// match_limit_recrusion() caps the depth of recursion.
-//
-// Normally, to pass one or more modifiers to a RE class, you declare
-// a RE_Options object, set the appropriate options, and pass this
-// object to a RE constructor. Example:
-//
-// RE_options opt;
-// opt.set_caseless(true);
-//
-// if (RE("HELLO", opt).PartialMatch("hello world")) ...
-//
-// RE_options has two constructors. The default constructor takes no
-// arguments and creates a set of flags that are off by default.
-//
-// The optional parameter 'option_flags' is to facilitate transfer
-// of legacy code from C programs. This lets you do
-// RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str);
-//
-// But new code is better off doing
-// RE(pattern,
-// RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str);
-// (See below)
-//
-// If you are going to pass one of the most used modifiers, there are some
-// convenience functions that return a RE_Options class with the
-// appropriate modifier already set:
-// CASELESS(), UTF8(), MULTILINE(), DOTALL(), EXTENDED()
-//
-// If you need to set several options at once, and you don't want to go
-// through the pains of declaring a RE_Options object and setting several
-// options, there is a parallel method that give you such ability on the
-// fly. You can concatenate several set_xxxxx member functions, since each
-// of them returns a reference to its class object. e.g.: to pass
-// PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one
-// statement, you may write
-//
-// RE(" ^ xyz \\s+ .* blah$", RE_Options()
-// .set_caseless(true)
-// .set_extended(true)
-// .set_multiline(true)).PartialMatch(sometext);
-//
-// -----------------------------------------------------------------------
-// SCANNING TEXT INCREMENTALLY
-//
-// The "Consume" operation may be useful if you want to repeatedly
-// match regular expressions at the front of a string and skip over
-// them as they match. This requires use of the "StringPiece" type,
-// which represents a sub-range of a real string. Like RE, StringPiece
-// is defined in the pcrecpp namespace.
-//
-// Example: read lines of the form "var = value" from a string.
-// string contents = ...; // Fill string somehow
-// pcrecpp::StringPiece input(contents); // Wrap in a StringPiece
-//
-// string var;
-// int value;
-// pcrecpp::RE re("(\\w+) = (\\d+)\n");
-// while (re.Consume(&input, &var, &value)) {
-// ...;
-// }
-//
-// Each successful call to "Consume" will set "var/value", and also
-// advance "input" so it points past the matched text.
-//
-// The "FindAndConsume" operation is similar to "Consume" but does not
-// anchor your match at the beginning of the string. For example, you
-// could extract all words from a string by repeatedly calling
-// pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word)
-//
-// -----------------------------------------------------------------------
-// PARSING HEX/OCTAL/C-RADIX NUMBERS
-//
-// By default, if you pass a pointer to a numeric value, the
-// corresponding text is interpreted as a base-10 number. You can
-// instead wrap the pointer with a call to one of the operators Hex(),
-// Octal(), or CRadix() to interpret the text in another base. The
-// CRadix operator interprets C-style "0" (base-8) and "0x" (base-16)
-// prefixes, but defaults to base-10.
-//
-// Example:
-// int a, b, c, d;
-// pcrecpp::RE re("(.*) (.*) (.*) (.*)");
-// re.FullMatch("100 40 0100 0x40",
-// pcrecpp::Octal(&a), pcrecpp::Hex(&b),
-// pcrecpp::CRadix(&c), pcrecpp::CRadix(&d));
-// will leave 64 in a, b, c, and d.
-//
-// -----------------------------------------------------------------------
-// REPLACING PARTS OF STRINGS
-//
-// You can replace the first match of "pattern" in "str" with
-// "rewrite". Within "rewrite", backslash-escaped digits (\1 to \9)
-// can be used to insert text matching corresponding parenthesized
-// group from the pattern. \0 in "rewrite" refers to the entire
-// matching text. E.g.,
-//
-// string s = "yabba dabba doo";
-// pcrecpp::RE("b+").Replace("d", &s);
-//
-// will leave "s" containing "yada dabba doo". The result is true if
-// the pattern matches and a replacement occurs, or false otherwise.
-//
-// GlobalReplace() is like Replace(), except that it replaces all
-// occurrences of the pattern in the string with the rewrite.
-// Replacements are not subject to re-matching. E.g.,
-//
-// string s = "yabba dabba doo";
-// pcrecpp::RE("b+").GlobalReplace("d", &s);
-//
-// will leave "s" containing "yada dada doo". It returns the number
-// of replacements made.
-//
-// Extract() is like Replace(), except that if the pattern matches,
-// "rewrite" is copied into "out" (an additional argument) with
-// substitutions. The non-matching portions of "text" are ignored.
-// Returns true iff a match occurred and the extraction happened
-// successfully. If no match occurs, the string is left unaffected.
-
-
-#include <string>
-#include <pcre.h>
-#include <pcrecpparg.h> // defines the Arg class
-// This isn't technically needed here, but we include it
-// anyway so folks who include pcrecpp.h don't have to.
-#include <pcre_stringpiece.h>
-
-namespace pcrecpp {
-
-#define PCRE_SET_OR_CLEAR(b, o) \
- if (b) all_options_ |= (o); else all_options_ &= ~(o); \
- return *this
-
-#define PCRE_IS_SET(o) \
- (all_options_ & o) == o
-
-/***** Compiling regular expressions: the RE class *****/
-
-// RE_Options allow you to set options to be passed along to pcre,
-// along with other options we put on top of pcre.
-// Only 9 modifiers, plus match_limit and match_limit_recursion,
-// are supported now.
-class PCRECPP_EXP_DEFN RE_Options {
- public:
- // constructor
- RE_Options() : match_limit_(0), match_limit_recursion_(0), all_options_(0) {}
-
- // alternative constructor.
- // To facilitate transfer of legacy code from C programs
- //
- // This lets you do
- // RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str);
- // But new code is better off doing
- // RE(pattern,
- // RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str);
- RE_Options(int option_flags) : match_limit_(0), match_limit_recursion_(0),
- all_options_(option_flags) {}
- // we're fine with the default destructor, copy constructor, etc.
-
- // accessors and mutators
- int match_limit() const { return match_limit_; };
- RE_Options &set_match_limit(int limit) {
- match_limit_ = limit;
- return *this;
- }
-
- int match_limit_recursion() const { return match_limit_recursion_; };
- RE_Options &set_match_limit_recursion(int limit) {
- match_limit_recursion_ = limit;
- return *this;
- }
-
- bool caseless() const {
- return PCRE_IS_SET(PCRE_CASELESS);
- }
- RE_Options &set_caseless(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_CASELESS);
- }
-
- bool multiline() const {
- return PCRE_IS_SET(PCRE_MULTILINE);
- }
- RE_Options &set_multiline(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_MULTILINE);
- }
-
- bool dotall() const {
- return PCRE_IS_SET(PCRE_DOTALL);
- }
- RE_Options &set_dotall(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_DOTALL);
- }
-
- bool extended() const {
- return PCRE_IS_SET(PCRE_EXTENDED);
- }
- RE_Options &set_extended(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_EXTENDED);
- }
-
- bool dollar_endonly() const {
- return PCRE_IS_SET(PCRE_DOLLAR_ENDONLY);
- }
- RE_Options &set_dollar_endonly(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_DOLLAR_ENDONLY);
- }
-
- bool extra() const {
- return PCRE_IS_SET(PCRE_EXTRA);
- }
- RE_Options &set_extra(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_EXTRA);
- }
-
- bool ungreedy() const {
- return PCRE_IS_SET(PCRE_UNGREEDY);
- }
- RE_Options &set_ungreedy(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_UNGREEDY);
- }
-
- bool utf8() const {
- return PCRE_IS_SET(PCRE_UTF8);
- }
- RE_Options &set_utf8(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_UTF8);
- }
-
- bool no_auto_capture() const {
- return PCRE_IS_SET(PCRE_NO_AUTO_CAPTURE);
- }
- RE_Options &set_no_auto_capture(bool x) {
- PCRE_SET_OR_CLEAR(x, PCRE_NO_AUTO_CAPTURE);
- }
-
- RE_Options &set_all_options(int opt) {
- all_options_ = opt;
- return *this;
- }
- int all_options() const {
- return all_options_ ;
- }
-
- // TODO: add other pcre flags
-
- private:
- int match_limit_;
- int match_limit_recursion_;
- int all_options_;
-};
-
-// These functions return some common RE_Options
-static inline RE_Options UTF8() {
- return RE_Options().set_utf8(true);
-}
-
-static inline RE_Options CASELESS() {
- return RE_Options().set_caseless(true);
-}
-static inline RE_Options MULTILINE() {
- return RE_Options().set_multiline(true);
-}
-
-static inline RE_Options DOTALL() {
- return RE_Options().set_dotall(true);
-}
-
-static inline RE_Options EXTENDED() {
- return RE_Options().set_extended(true);
-}
-
-// Interface for regular expression matching. Also corresponds to a
-// pre-compiled regular expression. An "RE" object is safe for
-// concurrent use by multiple threads.
-class PCRECPP_EXP_DEFN RE {
- public:
- // We provide implicit conversions from strings so that users can
- // pass in a string or a "const char*" wherever an "RE" is expected.
- RE(const string& pat) { Init(pat, NULL); }
- RE(const string& pat, const RE_Options& option) { Init(pat, &option); }
- RE(const char* pat) { Init(pat, NULL); }
- RE(const char* pat, const RE_Options& option) { Init(pat, &option); }
- RE(const unsigned char* pat) {
- Init(reinterpret_cast<const char*>(pat), NULL);
- }
- RE(const unsigned char* pat, const RE_Options& option) {
- Init(reinterpret_cast<const char*>(pat), &option);
- }
-
- // Copy constructor & assignment - note that these are expensive
- // because they recompile the expression.
- RE(const RE& re) { Init(re.pattern_, &re.options_); }
- const RE& operator=(const RE& re) {
- if (this != &re) {
- Cleanup();
-
- // This is the code that originally came from Google
- // Init(re.pattern_.c_str(), &re.options_);
-
- // This is the replacement from Ari Pollak
- Init(re.pattern_, &re.options_);
- }
- return *this;
- }
-
-
- ~RE();
-
- // The string specification for this RE. E.g.
- // RE re("ab*c?d+");
- // re.pattern(); // "ab*c?d+"
- const string& pattern() const { return pattern_; }
-
- // If RE could not be created properly, returns an error string.
- // Else returns the empty string.
- const string& error() const { return *error_; }
-
- /***** The useful part: the matching interface *****/
-
- // This is provided so one can do pattern.ReplaceAll() just as
- // easily as ReplaceAll(pattern-text, ....)
-
- bool FullMatch(const StringPiece& text,
- const Arg& ptr1 = no_arg,
- const Arg& ptr2 = no_arg,
- const Arg& ptr3 = no_arg,
- const Arg& ptr4 = no_arg,
- const Arg& ptr5 = no_arg,
- const Arg& ptr6 = no_arg,
- const Arg& ptr7 = no_arg,
- const Arg& ptr8 = no_arg,
- const Arg& ptr9 = no_arg,
- const Arg& ptr10 = no_arg,
- const Arg& ptr11 = no_arg,
- const Arg& ptr12 = no_arg,
- const Arg& ptr13 = no_arg,
- const Arg& ptr14 = no_arg,
- const Arg& ptr15 = no_arg,
- const Arg& ptr16 = no_arg) const;
-
- bool PartialMatch(const StringPiece& text,
- const Arg& ptr1 = no_arg,
- const Arg& ptr2 = no_arg,
- const Arg& ptr3 = no_arg,
- const Arg& ptr4 = no_arg,
- const Arg& ptr5 = no_arg,
- const Arg& ptr6 = no_arg,
- const Arg& ptr7 = no_arg,
- const Arg& ptr8 = no_arg,
- const Arg& ptr9 = no_arg,
- const Arg& ptr10 = no_arg,
- const Arg& ptr11 = no_arg,
- const Arg& ptr12 = no_arg,
- const Arg& ptr13 = no_arg,
- const Arg& ptr14 = no_arg,
- const Arg& ptr15 = no_arg,
- const Arg& ptr16 = no_arg) const;
-
- bool Consume(StringPiece* input,
- const Arg& ptr1 = no_arg,
- const Arg& ptr2 = no_arg,
- const Arg& ptr3 = no_arg,
- const Arg& ptr4 = no_arg,
- const Arg& ptr5 = no_arg,
- const Arg& ptr6 = no_arg,
- const Arg& ptr7 = no_arg,
- const Arg& ptr8 = no_arg,
- const Arg& ptr9 = no_arg,
- const Arg& ptr10 = no_arg,
- const Arg& ptr11 = no_arg,
- const Arg& ptr12 = no_arg,
- const Arg& ptr13 = no_arg,
- const Arg& ptr14 = no_arg,
- const Arg& ptr15 = no_arg,
- const Arg& ptr16 = no_arg) const;
-
- bool FindAndConsume(StringPiece* input,
- const Arg& ptr1 = no_arg,
- const Arg& ptr2 = no_arg,
- const Arg& ptr3 = no_arg,
- const Arg& ptr4 = no_arg,
- const Arg& ptr5 = no_arg,
- const Arg& ptr6 = no_arg,
- const Arg& ptr7 = no_arg,
- const Arg& ptr8 = no_arg,
- const Arg& ptr9 = no_arg,
- const Arg& ptr10 = no_arg,
- const Arg& ptr11 = no_arg,
- const Arg& ptr12 = no_arg,
- const Arg& ptr13 = no_arg,
- const Arg& ptr14 = no_arg,
- const Arg& ptr15 = no_arg,
- const Arg& ptr16 = no_arg) const;
-
- bool Replace(const StringPiece& rewrite,
- string *str) const;
-
- int GlobalReplace(const StringPiece& rewrite,
- string *str) const;
-
- bool Extract(const StringPiece &rewrite,
- const StringPiece &text,
- string *out) const;
-
- // Escapes all potentially meaningful regexp characters in
- // 'unquoted'. The returned string, used as a regular expression,
- // will exactly match the original string. For example,
- // 1.5-2.0?
- // may become:
- // 1\.5\-2\.0\?
- // Note QuoteMeta behaves the same as perl's QuoteMeta function,
- // *except* that it escapes the NUL character (\0) as backslash + 0,
- // rather than backslash + NUL.
- static string QuoteMeta(const StringPiece& unquoted);
-
-
- /***** Generic matching interface *****/
-
- // Type of match (TODO: Should be restructured as part of RE_Options)
- enum Anchor {
- UNANCHORED, // No anchoring
- ANCHOR_START, // Anchor at start only
- ANCHOR_BOTH // Anchor at start and end
- };
-
- // General matching routine. Stores the length of the match in
- // "*consumed" if successful.
- bool DoMatch(const StringPiece& text,
- Anchor anchor,
- int* consumed,
- const Arg* const* args, int n) const;
-
- // Return the number of capturing subpatterns, or -1 if the
- // regexp wasn't valid on construction.
- int NumberOfCapturingGroups() const;
-
- // The default value for an argument, to indicate the end of the argument
- // list. This must be used only in optional argument defaults. It should NOT
- // be passed explicitly. Some people have tried to use it like this:
- //
- // FullMatch(x, y, &z, no_arg, &w);
- //
- // This is a mistake, and will not work.
- static Arg no_arg;
-
- private:
-
- void Init(const string& pattern, const RE_Options* options);
- void Cleanup();
-
- // Match against "text", filling in "vec" (up to "vecsize" * 2/3) with
- // pairs of integers for the beginning and end positions of matched
- // text. The first pair corresponds to the entire matched text;
- // subsequent pairs correspond, in order, to parentheses-captured
- // matches. Returns the number of pairs (one more than the number of
- // the last subpattern with a match) if matching was successful
- // and zero if the match failed.
- // I.e. for RE("(foo)|(bar)|(baz)") it will return 2, 3, and 4 when matching
- // against "foo", "bar", and "baz" respectively.
- // When matching RE("(foo)|hello") against "hello", it will return 1.
- // But the values for all subpattern are filled in into "vec".
- int TryMatch(const StringPiece& text,
- int startpos,
- Anchor anchor,
- bool empty_ok,
- int *vec,
- int vecsize) const;
-
- // Append the "rewrite" string, with backslash subsitutions from "text"
- // and "vec", to string "out".
- bool Rewrite(string *out,
- const StringPiece& rewrite,
- const StringPiece& text,
- int *vec,
- int veclen) const;
-
- // internal implementation for DoMatch
- bool DoMatchImpl(const StringPiece& text,
- Anchor anchor,
- int* consumed,
- const Arg* const args[],
- int n,
- int* vec,
- int vecsize) const;
-
- // Compile the regexp for the specified anchoring mode
- pcre* Compile(Anchor anchor);
-
- string pattern_;
- RE_Options options_;
- pcre* re_full_; // For full matches
- pcre* re_partial_; // For partial matches
- const string* error_; // Error indicator (or points to empty string)
-};
-
-} // namespace pcrecpp
-
-#endif /* _PCRECPP_H */
diff --git a/.pc/PCRE6_compatible_API.patch/pcretest.c b/.pc/PCRE6_compatible_API.patch/pcretest.c
deleted file mode 100644
index b8dc3c6..0000000
--- a/.pc/PCRE6_compatible_API.patch/pcretest.c
+++ /dev/null
@@ -1,5709 +0,0 @@
-/*************************************************
-* PCRE testing program *
-*************************************************/
-
-/* This program was hacked up as a tester for PCRE. I really should have
-written it more tidily in the first place. Will I ever learn? It has grown and
-been extended and consequently is now rather, er, *very* untidy in places. The
-addition of 16-bit support has made it even worse. :-(
-
------------------------------------------------------------------------------
-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 program now supports the testing of all of the 8-bit, 16-bit, and
-32-bit PCRE libraries in a single program. This is different from the modules
-such as pcre_compile.c in the library itself, which are compiled separately for
-each mode. If two modes are enabled, for example, pcre_compile.c is compiled
-twice. By contrast, pcretest.c is compiled only once. Therefore, it must not
-make use of any of the macros from pcre_internal.h that depend on
-COMPILE_PCRE8, COMPILE_PCRE16, or COMPILE_PCRE32. It does, however, make use of
-SUPPORT_PCRE8, SUPPORT_PCRE16, and SUPPORT_PCRE32 to ensure that it calls only
-supported library functions. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include <locale.h>
-#include <errno.h>
-
-/* Both libreadline and libedit are optionally supported. The user-supplied
-original patch uses readline/readline.h for libedit, but in at least one system
-it is installed as editline/readline.h, so the configuration code now looks for
-that first, falling back to readline/readline.h. */
-
-#if defined(SUPPORT_LIBREADLINE) || defined(SUPPORT_LIBEDIT)
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if defined(SUPPORT_LIBREADLINE)
-#include <readline/readline.h>
-#include <readline/history.h>
-#else
-#if defined(HAVE_EDITLINE_READLINE_H)
-#include <editline/readline.h>
-#else
-#include <readline/readline.h>
-#endif
-#endif
-#endif
-
-/* A number of things vary for Windows builds. Originally, pcretest opened its
-input and output without "b"; then I was told that "b" was needed in some
-environments, so it was added for release 5.0 to both the input and output. (It
-makes no difference on Unix-like systems.) Later I was told that it is wrong
-for the input on Windows. I've now abstracted the modes into two macros that
-are set here, to make it easier to fiddle with them, and removed "b" from the
-input mode under Windows. */
-
-#if defined(_WIN32) || defined(WIN32)
-#include <io.h> /* For _setmode() */
-#include <fcntl.h> /* For _O_BINARY */
-#define INPUT_MODE "r"
-#define OUTPUT_MODE "wb"
-
-#ifndef isatty
-#define isatty _isatty /* This is what Windows calls them, I'm told, */
-#endif /* though in some environments they seem to */
- /* be already defined, hence the #ifndefs. */
-#ifndef fileno
-#define fileno _fileno
-#endif
-
-/* A user sent this fix for Borland Builder 5 under Windows. */
-
-#ifdef __BORLANDC__
-#define _setmode(handle, mode) setmode(handle, mode)
-#endif
-
-/* Not Windows */
-
-#else
-#include <sys/time.h> /* These two includes are needed */
-#include <sys/resource.h> /* for setrlimit(). */
-#if defined NATIVE_ZOS /* z/OS uses non-binary I/O */
-#define INPUT_MODE "r"
-#define OUTPUT_MODE "w"
-#else
-#define INPUT_MODE "rb"
-#define OUTPUT_MODE "wb"
-#endif
-#endif
-
-#ifdef __VMS
-#include <ssdef.h>
-void vms_setsymbol( char *, char *, int );
-#endif
-
-
-#define PRIV(name) name
-
-/* We have to include pcre_internal.h because we need the internal info for
-displaying the results of pcre_study() and we also need to know about the
-internal macros, structures, and other internal data values; pcretest has
-"inside information" compared to a program that strictly follows the PCRE API.
-
-Although pcre_internal.h does itself include pcre.h, we explicitly include it
-here before pcre_internal.h so that the PCRE_EXP_xxx macros get set
-appropriately for an application, not for building PCRE. */
-
-#include "pcre.h"
-#include "pcre_internal.h"
-
-/* The pcre_printint() function, which prints the internal form of a compiled
-regex, is held in a separate file so that (a) it can be compiled in either
-8-, 16- or 32-bit mode, and (b) it can be #included directly in pcre_compile.c
-when that is compiled in debug mode. */
-
-#ifdef SUPPORT_PCRE8
-void pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths);
-#endif
-#ifdef SUPPORT_PCRE16
-void pcre16_printint(pcre *external_re, FILE *f, BOOL print_lengths);
-#endif
-#ifdef SUPPORT_PCRE32
-void pcre32_printint(pcre *external_re, FILE *f, BOOL print_lengths);
-#endif
-
-/* We need access to some of the data tables that PCRE uses. So as not to have
-to keep two copies, we include the source files here, changing the names of the
-external symbols to prevent clashes. */
-
-#define PCRE_INCLUDED
-
-#include "pcre_tables.c"
-#include "pcre_ucd.c"
-
-/* The definition of the macro PRINTABLE, which determines whether to print an
-output character as-is or as a hex value when showing compiled patterns, is
-the same as in the printint.src file. We uses it here in cases when the locale
-has not been explicitly changed, so as to get consistent output from systems
-that differ in their output from isprint() even in the "C" locale. */
-
-#ifdef EBCDIC
-#define PRINTABLE(c) ((c) >= 64 && (c) < 255)
-#else
-#define PRINTABLE(c) ((c) >= 32 && (c) < 127)
-#endif
-
-#define PRINTOK(c) (locale_set? isprint(c) : PRINTABLE(c))
-
-/* Posix support is disabled in 16 or 32 bit only mode. */
-#if !defined SUPPORT_PCRE8 && !defined NOPOSIX
-#define NOPOSIX
-#endif
-
-/* It is possible to compile this test program without including support for
-testing the POSIX interface, though this is not available via the standard
-Makefile. */
-
-#if !defined NOPOSIX
-#include "pcreposix.h"
-#endif
-
-/* It is also possible, originally for the benefit of a version that was
-imported into Exim, to build pcretest without support for UTF8 or UTF16 (define
-NOUTF), without the interface to the DFA matcher (NODFA). In fact, we
-automatically cut out the UTF support if PCRE is built without it. */
-
-#ifndef SUPPORT_UTF
-#ifndef NOUTF
-#define NOUTF
-#endif
-#endif
-
-/* To make the code a bit tidier for 8/16/32-bit support, we define macros
-for all the pcre[16]_xxx functions (except pcre16_fullinfo, which is called
-only from one place and is handled differently). I couldn't dream up any way of
-using a single macro to do this in a generic way, because of the many different
-argument requirements. We know that at least one of SUPPORT_PCRE8 and
-SUPPORT_PCRE16 must be set. First define macros for each individual mode; then
-use these in the definitions of generic macros.
-
-**** Special note about the PCHARSxxx macros: the address of the string to be
-printed is always given as two arguments: a base address followed by an offset.
-The base address is cast to the correct data size for 8 or 16 bit data; the
-offset is in units of this size. If the string were given as base+offset in one
-argument, the casting might be incorrectly applied. */
-
-#ifdef SUPPORT_PCRE8
-
-#define PCHARS8(lv, p, offset, len, f) \
- lv = pchars((pcre_uint8 *)(p) + offset, len, f)
-
-#define PCHARSV8(p, offset, len, f) \
- (void)pchars((pcre_uint8 *)(p) + offset, len, f)
-
-#define READ_CAPTURE_NAME8(p, cn8, cn16, cn32, re) \
- p = read_capture_name8(p, cn8, re)
-
-#define STRLEN8(p) ((int)strlen((char *)p))
-
-#define SET_PCRE_CALLOUT8(callout) \
- pcre_callout = callout
-
-#define SET_PCRE_STACK_GUARD8(stack_guard) \
- pcre_stack_guard = stack_guard
-
-#define PCRE_ASSIGN_JIT_STACK8(extra, callback, userdata) \
- pcre_assign_jit_stack(extra, callback, userdata)
-
-#define PCRE_COMPILE8(re, pat, options, error, erroffset, tables) \
- re = pcre_compile((char *)pat, options, error, erroffset, tables)
-
-#define PCRE_COPY_NAMED_SUBSTRING8(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size) \
- rc = pcre_copy_named_substring(re, (char *)bptr, offsets, count, \
- (char *)namesptr, cbuffer, size)
-
-#define PCRE_COPY_SUBSTRING8(rc, bptr, offsets, count, i, cbuffer, size) \
- rc = pcre_copy_substring((char *)bptr, offsets, count, i, cbuffer, size)
-
-#define PCRE_DFA_EXEC8(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace) \
- count = pcre_dfa_exec(re, extra, (char *)bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace)
-
-#define PCRE_EXEC8(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets) \
- count = pcre_exec(re, extra, (char *)bptr, len, start_offset, options, \
- offsets, size_offsets)
-
-#define PCRE_FREE_STUDY8(extra) \
- pcre_free_study(extra)
-
-#define PCRE_FREE_SUBSTRING8(substring) \
- pcre_free_substring(substring)
-
-#define PCRE_FREE_SUBSTRING_LIST8(listptr) \
- pcre_free_substring_list(listptr)
-
-#define PCRE_GET_NAMED_SUBSTRING8(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr) \
- rc = pcre_get_named_substring(re, (char *)bptr, offsets, count, \
- (char *)getnamesptr, subsptr)
-
-#define PCRE_GET_STRINGNUMBER8(n, rc, ptr) \
- n = pcre_get_stringnumber(re, (char *)ptr)
-
-#define PCRE_GET_SUBSTRING8(rc, bptr, offsets, count, i, subsptr) \
- rc = pcre_get_substring((char *)bptr, offsets, count, i, subsptr)
-
-#define PCRE_GET_SUBSTRING_LIST8(rc, bptr, offsets, count, listptr) \
- rc = pcre_get_substring_list((const char *)bptr, offsets, count, listptr)
-
-#define PCRE_PATTERN_TO_HOST_BYTE_ORDER8(rc, re, extra, tables) \
- rc = pcre_pattern_to_host_byte_order(re, extra, tables)
-
-#define PCRE_PRINTINT8(re, outfile, debug_lengths) \
- pcre_printint(re, outfile, debug_lengths)
-
-#define PCRE_STUDY8(extra, re, options, error) \
- extra = pcre_study(re, options, error)
-
-#define PCRE_JIT_STACK_ALLOC8(startsize, maxsize) \
- pcre_jit_stack_alloc(startsize, maxsize)
-
-#define PCRE_JIT_STACK_FREE8(stack) \
- pcre_jit_stack_free(stack)
-
-#define pcre8_maketables pcre_maketables
-
-#endif /* SUPPORT_PCRE8 */
-
-/* -----------------------------------------------------------*/
-
-#ifdef SUPPORT_PCRE16
-
-#define PCHARS16(lv, p, offset, len, f) \
- lv = pchars16((PCRE_SPTR16)(p) + offset, len, f)
-
-#define PCHARSV16(p, offset, len, f) \
- (void)pchars16((PCRE_SPTR16)(p) + offset, len, f)
-
-#define READ_CAPTURE_NAME16(p, cn8, cn16, cn32, re) \
- p = read_capture_name16(p, cn16, re)
-
-#define STRLEN16(p) ((int)strlen16((PCRE_SPTR16)p))
-
-#define SET_PCRE_CALLOUT16(callout) \
- pcre16_callout = (int (*)(pcre16_callout_block *))callout
-
-#define SET_PCRE_STACK_GUARD16(stack_guard) \
- pcre16_stack_guard = (int (*)(void))stack_guard
-
-#define PCRE_ASSIGN_JIT_STACK16(extra, callback, userdata) \
- pcre16_assign_jit_stack((pcre16_extra *)extra, \
- (pcre16_jit_callback)callback, userdata)
-
-#define PCRE_COMPILE16(re, pat, options, error, erroffset, tables) \
- re = (pcre *)pcre16_compile((PCRE_SPTR16)pat, options, error, erroffset, \
- tables)
-
-#define PCRE_COPY_NAMED_SUBSTRING16(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size) \
- rc = pcre16_copy_named_substring((pcre16 *)re, (PCRE_SPTR16)bptr, offsets, \
- count, (PCRE_SPTR16)namesptr, (PCRE_UCHAR16 *)cbuffer, size/2)
-
-#define PCRE_COPY_SUBSTRING16(rc, bptr, offsets, count, i, cbuffer, size) \
- rc = pcre16_copy_substring((PCRE_SPTR16)bptr, offsets, count, i, \
- (PCRE_UCHAR16 *)cbuffer, size/2)
-
-#define PCRE_DFA_EXEC16(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace) \
- count = pcre16_dfa_exec((pcre16 *)re, (pcre16_extra *)extra, \
- (PCRE_SPTR16)bptr, len, start_offset, options, offsets, size_offsets, \
- workspace, size_workspace)
-
-#define PCRE_EXEC16(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets) \
- count = pcre16_exec((pcre16 *)re, (pcre16_extra *)extra, (PCRE_SPTR16)bptr, \
- len, start_offset, options, offsets, size_offsets)
-
-#define PCRE_FREE_STUDY16(extra) \
- pcre16_free_study((pcre16_extra *)extra)
-
-#define PCRE_FREE_SUBSTRING16(substring) \
- pcre16_free_substring((PCRE_SPTR16)substring)
-
-#define PCRE_FREE_SUBSTRING_LIST16(listptr) \
- pcre16_free_substring_list((PCRE_SPTR16 *)listptr)
-
-#define PCRE_GET_NAMED_SUBSTRING16(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr) \
- rc = pcre16_get_named_substring((pcre16 *)re, (PCRE_SPTR16)bptr, offsets, \
- count, (PCRE_SPTR16)getnamesptr, (PCRE_SPTR16 *)(void*)subsptr)
-
-#define PCRE_GET_STRINGNUMBER16(n, rc, ptr) \
- n = pcre16_get_stringnumber(re, (PCRE_SPTR16)ptr)
-
-#define PCRE_GET_SUBSTRING16(rc, bptr, offsets, count, i, subsptr) \
- rc = pcre16_get_substring((PCRE_SPTR16)bptr, offsets, count, i, \
- (PCRE_SPTR16 *)(void*)subsptr)
-
-#define PCRE_GET_SUBSTRING_LIST16(rc, bptr, offsets, count, listptr) \
- rc = pcre16_get_substring_list((PCRE_SPTR16)bptr, offsets, count, \
- (PCRE_SPTR16 **)(void*)listptr)
-
-#define PCRE_PATTERN_TO_HOST_BYTE_ORDER16(rc, re, extra, tables) \
- rc = pcre16_pattern_to_host_byte_order((pcre16 *)re, (pcre16_extra *)extra, \
- tables)
-
-#define PCRE_PRINTINT16(re, outfile, debug_lengths) \
- pcre16_printint(re, outfile, debug_lengths)
-
-#define PCRE_STUDY16(extra, re, options, error) \
- extra = (pcre_extra *)pcre16_study((pcre16 *)re, options, error)
-
-#define PCRE_JIT_STACK_ALLOC16(startsize, maxsize) \
- (pcre_jit_stack *)pcre16_jit_stack_alloc(startsize, maxsize)
-
-#define PCRE_JIT_STACK_FREE16(stack) \
- pcre16_jit_stack_free((pcre16_jit_stack *)stack)
-
-#endif /* SUPPORT_PCRE16 */
-
-/* -----------------------------------------------------------*/
-
-#ifdef SUPPORT_PCRE32
-
-#define PCHARS32(lv, p, offset, len, f) \
- lv = pchars32((PCRE_SPTR32)(p) + offset, len, use_utf, f)
-
-#define PCHARSV32(p, offset, len, f) \
- (void)pchars32((PCRE_SPTR32)(p) + offset, len, use_utf, f)
-
-#define READ_CAPTURE_NAME32(p, cn8, cn16, cn32, re) \
- p = read_capture_name32(p, cn32, re)
-
-#define STRLEN32(p) ((int)strlen32((PCRE_SPTR32)p))
-
-#define SET_PCRE_CALLOUT32(callout) \
- pcre32_callout = (int (*)(pcre32_callout_block *))callout
-
-#define SET_PCRE_STACK_GUARD32(stack_guard) \
- pcre32_stack_guard = (int (*)(void))stack_guard
-
-#define PCRE_ASSIGN_JIT_STACK32(extra, callback, userdata) \
- pcre32_assign_jit_stack((pcre32_extra *)extra, \
- (pcre32_jit_callback)callback, userdata)
-
-#define PCRE_COMPILE32(re, pat, options, error, erroffset, tables) \
- re = (pcre *)pcre32_compile((PCRE_SPTR32)pat, options, error, erroffset, \
- tables)
-
-#define PCRE_COPY_NAMED_SUBSTRING32(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size) \
- rc = pcre32_copy_named_substring((pcre32 *)re, (PCRE_SPTR32)bptr, offsets, \
- count, (PCRE_SPTR32)namesptr, (PCRE_UCHAR32 *)cbuffer, size/2)
-
-#define PCRE_COPY_SUBSTRING32(rc, bptr, offsets, count, i, cbuffer, size) \
- rc = pcre32_copy_substring((PCRE_SPTR32)bptr, offsets, count, i, \
- (PCRE_UCHAR32 *)cbuffer, size/2)
-
-#define PCRE_DFA_EXEC32(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace) \
- count = pcre32_dfa_exec((pcre32 *)re, (pcre32_extra *)extra, \
- (PCRE_SPTR32)bptr, len, start_offset, options, offsets, size_offsets, \
- workspace, size_workspace)
-
-#define PCRE_EXEC32(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets) \
- count = pcre32_exec((pcre32 *)re, (pcre32_extra *)extra, (PCRE_SPTR32)bptr, \
- len, start_offset, options, offsets, size_offsets)
-
-#define PCRE_FREE_STUDY32(extra) \
- pcre32_free_study((pcre32_extra *)extra)
-
-#define PCRE_FREE_SUBSTRING32(substring) \
- pcre32_free_substring((PCRE_SPTR32)substring)
-
-#define PCRE_FREE_SUBSTRING_LIST32(listptr) \
- pcre32_free_substring_list((PCRE_SPTR32 *)listptr)
-
-#define PCRE_GET_NAMED_SUBSTRING32(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr) \
- rc = pcre32_get_named_substring((pcre32 *)re, (PCRE_SPTR32)bptr, offsets, \
- count, (PCRE_SPTR32)getnamesptr, (PCRE_SPTR32 *)(void*)subsptr)
-
-#define PCRE_GET_STRINGNUMBER32(n, rc, ptr) \
- n = pcre32_get_stringnumber(re, (PCRE_SPTR32)ptr)
-
-#define PCRE_GET_SUBSTRING32(rc, bptr, offsets, count, i, subsptr) \
- rc = pcre32_get_substring((PCRE_SPTR32)bptr, offsets, count, i, \
- (PCRE_SPTR32 *)(void*)subsptr)
-
-#define PCRE_GET_SUBSTRING_LIST32(rc, bptr, offsets, count, listptr) \
- rc = pcre32_get_substring_list((PCRE_SPTR32)bptr, offsets, count, \
- (PCRE_SPTR32 **)(void*)listptr)
-
-#define PCRE_PATTERN_TO_HOST_BYTE_ORDER32(rc, re, extra, tables) \
- rc = pcre32_pattern_to_host_byte_order((pcre32 *)re, (pcre32_extra *)extra, \
- tables)
-
-#define PCRE_PRINTINT32(re, outfile, debug_lengths) \
- pcre32_printint(re, outfile, debug_lengths)
-
-#define PCRE_STUDY32(extra, re, options, error) \
- extra = (pcre_extra *)pcre32_study((pcre32 *)re, options, error)
-
-#define PCRE_JIT_STACK_ALLOC32(startsize, maxsize) \
- (pcre_jit_stack *)pcre32_jit_stack_alloc(startsize, maxsize)
-
-#define PCRE_JIT_STACK_FREE32(stack) \
- pcre32_jit_stack_free((pcre32_jit_stack *)stack)
-
-#endif /* SUPPORT_PCRE32 */
-
-
-/* ----- More than one mode is supported; a runtime test is needed, except for
-pcre_config(), and the JIT stack functions, when it doesn't matter which
-available version is called. ----- */
-
-enum {
- PCRE8_MODE,
- PCRE16_MODE,
- PCRE32_MODE
-};
-
-#if (defined (SUPPORT_PCRE8) + defined (SUPPORT_PCRE16) + \
- defined (SUPPORT_PCRE32)) >= 2
-
-#define CHAR_SIZE (1 << pcre_mode)
-
-/* There doesn't seem to be an easy way of writing these macros that can cope
-with the 3 pairs of bit sizes plus all three bit sizes. So just handle all the
-cases separately. */
-
-/* ----- All three modes supported ----- */
-
-#if defined(SUPPORT_PCRE8) && defined(SUPPORT_PCRE16) && defined(SUPPORT_PCRE32)
-
-#define PCHARS(lv, p, offset, len, f) \
- if (pcre_mode == PCRE32_MODE) \
- PCHARS32(lv, p, offset, len, f); \
- else if (pcre_mode == PCRE16_MODE) \
- PCHARS16(lv, p, offset, len, f); \
- else \
- PCHARS8(lv, p, offset, len, f)
-
-#define PCHARSV(p, offset, len, f) \
- if (pcre_mode == PCRE32_MODE) \
- PCHARSV32(p, offset, len, f); \
- else if (pcre_mode == PCRE16_MODE) \
- PCHARSV16(p, offset, len, f); \
- else \
- PCHARSV8(p, offset, len, f)
-
-#define READ_CAPTURE_NAME(p, cn8, cn16, cn32, re) \
- if (pcre_mode == PCRE32_MODE) \
- READ_CAPTURE_NAME32(p, cn8, cn16, cn32, re); \
- else if (pcre_mode == PCRE16_MODE) \
- READ_CAPTURE_NAME16(p, cn8, cn16, cn32, re); \
- else \
- READ_CAPTURE_NAME8(p, cn8, cn16, cn32, re)
-
-#define SET_PCRE_CALLOUT(callout) \
- if (pcre_mode == PCRE32_MODE) \
- SET_PCRE_CALLOUT32(callout); \
- else if (pcre_mode == PCRE16_MODE) \
- SET_PCRE_CALLOUT16(callout); \
- else \
- SET_PCRE_CALLOUT8(callout)
-
-#define SET_PCRE_STACK_GUARD(stack_guard) \
- if (pcre_mode == PCRE32_MODE) \
- SET_PCRE_STACK_GUARD32(stack_guard); \
- else if (pcre_mode == PCRE16_MODE) \
- SET_PCRE_STACK_GUARD16(stack_guard); \
- else \
- SET_PCRE_STACK_GUARD8(stack_guard)
-
-#define STRLEN(p) (pcre_mode == PCRE32_MODE ? STRLEN32(p) : pcre_mode == PCRE16_MODE ? STRLEN16(p) : STRLEN8(p))
-
-#define PCRE_ASSIGN_JIT_STACK(extra, callback, userdata) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_ASSIGN_JIT_STACK32(extra, callback, userdata); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_ASSIGN_JIT_STACK16(extra, callback, userdata); \
- else \
- PCRE_ASSIGN_JIT_STACK8(extra, callback, userdata)
-
-#define PCRE_COMPILE(re, pat, options, error, erroffset, tables) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_COMPILE32(re, pat, options, error, erroffset, tables); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_COMPILE16(re, pat, options, error, erroffset, tables); \
- else \
- PCRE_COMPILE8(re, pat, options, error, erroffset, tables)
-
-#define PCRE_CONFIG pcre_config
-
-#define PCRE_COPY_NAMED_SUBSTRING(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_COPY_NAMED_SUBSTRING32(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_COPY_NAMED_SUBSTRING16(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size); \
- else \
- PCRE_COPY_NAMED_SUBSTRING8(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size)
-
-#define PCRE_COPY_SUBSTRING(rc, bptr, offsets, count, i, cbuffer, size) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_COPY_SUBSTRING32(rc, bptr, offsets, count, i, cbuffer, size); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_COPY_SUBSTRING16(rc, bptr, offsets, count, i, cbuffer, size); \
- else \
- PCRE_COPY_SUBSTRING8(rc, bptr, offsets, count, i, cbuffer, size)
-
-#define PCRE_DFA_EXEC(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_DFA_EXEC32(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_DFA_EXEC16(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace); \
- else \
- PCRE_DFA_EXEC8(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace)
-
-#define PCRE_EXEC(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_EXEC32(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_EXEC16(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets); \
- else \
- PCRE_EXEC8(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets)
-
-#define PCRE_FREE_STUDY(extra) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_FREE_STUDY32(extra); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_FREE_STUDY16(extra); \
- else \
- PCRE_FREE_STUDY8(extra)
-
-#define PCRE_FREE_SUBSTRING(substring) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_FREE_SUBSTRING32(substring); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_FREE_SUBSTRING16(substring); \
- else \
- PCRE_FREE_SUBSTRING8(substring)
-
-#define PCRE_FREE_SUBSTRING_LIST(listptr) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_FREE_SUBSTRING_LIST32(listptr); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_FREE_SUBSTRING_LIST16(listptr); \
- else \
- PCRE_FREE_SUBSTRING_LIST8(listptr)
-
-#define PCRE_GET_NAMED_SUBSTRING(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_GET_NAMED_SUBSTRING32(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_GET_NAMED_SUBSTRING16(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr); \
- else \
- PCRE_GET_NAMED_SUBSTRING8(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr)
-
-#define PCRE_GET_STRINGNUMBER(n, rc, ptr) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_GET_STRINGNUMBER32(n, rc, ptr); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_GET_STRINGNUMBER16(n, rc, ptr); \
- else \
- PCRE_GET_STRINGNUMBER8(n, rc, ptr)
-
-#define PCRE_GET_SUBSTRING(rc, bptr, use_offsets, count, i, subsptr) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_GET_SUBSTRING32(rc, bptr, use_offsets, count, i, subsptr); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_GET_SUBSTRING16(rc, bptr, use_offsets, count, i, subsptr); \
- else \
- PCRE_GET_SUBSTRING8(rc, bptr, use_offsets, count, i, subsptr)
-
-#define PCRE_GET_SUBSTRING_LIST(rc, bptr, offsets, count, listptr) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_GET_SUBSTRING_LIST32(rc, bptr, offsets, count, listptr); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_GET_SUBSTRING_LIST16(rc, bptr, offsets, count, listptr); \
- else \
- PCRE_GET_SUBSTRING_LIST8(rc, bptr, offsets, count, listptr)
-
-#define PCRE_JIT_STACK_ALLOC(startsize, maxsize) \
- (pcre_mode == PCRE32_MODE ? \
- PCRE_JIT_STACK_ALLOC32(startsize, maxsize) \
- : pcre_mode == PCRE16_MODE ? \
- PCRE_JIT_STACK_ALLOC16(startsize, maxsize) \
- : PCRE_JIT_STACK_ALLOC8(startsize, maxsize))
-
-#define PCRE_JIT_STACK_FREE(stack) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_JIT_STACK_FREE32(stack); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_JIT_STACK_FREE16(stack); \
- else \
- PCRE_JIT_STACK_FREE8(stack)
-
-#define PCRE_MAKETABLES \
- (pcre_mode == PCRE32_MODE ? pcre32_maketables() : pcre_mode == PCRE16_MODE ? pcre16_maketables() : pcre_maketables())
-
-#define PCRE_PATTERN_TO_HOST_BYTE_ORDER(rc, re, extra, tables) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_PATTERN_TO_HOST_BYTE_ORDER32(rc, re, extra, tables); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_PATTERN_TO_HOST_BYTE_ORDER16(rc, re, extra, tables); \
- else \
- PCRE_PATTERN_TO_HOST_BYTE_ORDER8(rc, re, extra, tables)
-
-#define PCRE_PRINTINT(re, outfile, debug_lengths) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_PRINTINT32(re, outfile, debug_lengths); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_PRINTINT16(re, outfile, debug_lengths); \
- else \
- PCRE_PRINTINT8(re, outfile, debug_lengths)
-
-#define PCRE_STUDY(extra, re, options, error) \
- if (pcre_mode == PCRE32_MODE) \
- PCRE_STUDY32(extra, re, options, error); \
- else if (pcre_mode == PCRE16_MODE) \
- PCRE_STUDY16(extra, re, options, error); \
- else \
- PCRE_STUDY8(extra, re, options, error)
-
-
-/* ----- Two out of three modes are supported ----- */
-
-#else
-
-/* We can use some macro trickery to make a single set of definitions work in
-the three different cases. */
-
-/* ----- 32-bit and 16-bit but not 8-bit supported ----- */
-
-#if defined(SUPPORT_PCRE32) && defined(SUPPORT_PCRE16)
-#define BITONE 32
-#define BITTWO 16
-
-/* ----- 32-bit and 8-bit but not 16-bit supported ----- */
-
-#elif defined(SUPPORT_PCRE32) && defined(SUPPORT_PCRE8)
-#define BITONE 32
-#define BITTWO 8
-
-/* ----- 16-bit and 8-bit but not 32-bit supported ----- */
-
-#else
-#define BITONE 16
-#define BITTWO 8
-#endif
-
-#define glue(a,b) a##b
-#define G(a,b) glue(a,b)
-
-
-/* ----- Common macros for two-mode cases ----- */
-
-#define PCHARS(lv, p, offset, len, f) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCHARS,BITONE)(lv, p, offset, len, f); \
- else \
- G(PCHARS,BITTWO)(lv, p, offset, len, f)
-
-#define PCHARSV(p, offset, len, f) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCHARSV,BITONE)(p, offset, len, f); \
- else \
- G(PCHARSV,BITTWO)(p, offset, len, f)
-
-#define READ_CAPTURE_NAME(p, cn8, cn16, cn32, re) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(READ_CAPTURE_NAME,BITONE)(p, cn8, cn16, cn32, re); \
- else \
- G(READ_CAPTURE_NAME,BITTWO)(p, cn8, cn16, cn32, re)
-
-#define SET_PCRE_CALLOUT(callout) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(SET_PCRE_CALLOUT,BITONE)(callout); \
- else \
- G(SET_PCRE_CALLOUT,BITTWO)(callout)
-
-#define SET_PCRE_STACK_GUARD(stack_guard) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(SET_PCRE_STACK_GUARD,BITONE)(stack_guard); \
- else \
- G(SET_PCRE_STACK_GUARD,BITTWO)(stack_guard)
-
-#define STRLEN(p) ((pcre_mode == G(G(PCRE,BITONE),_MODE)) ? \
- G(STRLEN,BITONE)(p) : G(STRLEN,BITTWO)(p))
-
-#define PCRE_ASSIGN_JIT_STACK(extra, callback, userdata) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_ASSIGN_JIT_STACK,BITONE)(extra, callback, userdata); \
- else \
- G(PCRE_ASSIGN_JIT_STACK,BITTWO)(extra, callback, userdata)
-
-#define PCRE_COMPILE(re, pat, options, error, erroffset, tables) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_COMPILE,BITONE)(re, pat, options, error, erroffset, tables); \
- else \
- G(PCRE_COMPILE,BITTWO)(re, pat, options, error, erroffset, tables)
-
-#define PCRE_CONFIG G(G(pcre,BITONE),_config)
-
-#define PCRE_COPY_NAMED_SUBSTRING(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_COPY_NAMED_SUBSTRING,BITONE)(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size); \
- else \
- G(PCRE_COPY_NAMED_SUBSTRING,BITTWO)(rc, re, bptr, offsets, count, \
- namesptr, cbuffer, size)
-
-#define PCRE_COPY_SUBSTRING(rc, bptr, offsets, count, i, cbuffer, size) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_COPY_SUBSTRING,BITONE)(rc, bptr, offsets, count, i, cbuffer, size); \
- else \
- G(PCRE_COPY_SUBSTRING,BITTWO)(rc, bptr, offsets, count, i, cbuffer, size)
-
-#define PCRE_DFA_EXEC(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_DFA_EXEC,BITONE)(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace); \
- else \
- G(PCRE_DFA_EXEC,BITTWO)(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets, workspace, size_workspace)
-
-#define PCRE_EXEC(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_EXEC,BITONE)(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets); \
- else \
- G(PCRE_EXEC,BITTWO)(count, re, extra, bptr, len, start_offset, options, \
- offsets, size_offsets)
-
-#define PCRE_FREE_STUDY(extra) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_FREE_STUDY,BITONE)(extra); \
- else \
- G(PCRE_FREE_STUDY,BITTWO)(extra)
-
-#define PCRE_FREE_SUBSTRING(substring) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_FREE_SUBSTRING,BITONE)(substring); \
- else \
- G(PCRE_FREE_SUBSTRING,BITTWO)(substring)
-
-#define PCRE_FREE_SUBSTRING_LIST(listptr) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_FREE_SUBSTRING_LIST,BITONE)(listptr); \
- else \
- G(PCRE_FREE_SUBSTRING_LIST,BITTWO)(listptr)
-
-#define PCRE_GET_NAMED_SUBSTRING(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_GET_NAMED_SUBSTRING,BITONE)(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr); \
- else \
- G(PCRE_GET_NAMED_SUBSTRING,BITTWO)(rc, re, bptr, offsets, count, \
- getnamesptr, subsptr)
-
-#define PCRE_GET_STRINGNUMBER(n, rc, ptr) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_GET_STRINGNUMBER,BITONE)(n, rc, ptr); \
- else \
- G(PCRE_GET_STRINGNUMBER,BITTWO)(n, rc, ptr)
-
-#define PCRE_GET_SUBSTRING(rc, bptr, use_offsets, count, i, subsptr) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_GET_SUBSTRING,BITONE)(rc, bptr, use_offsets, count, i, subsptr); \
- else \
- G(PCRE_GET_SUBSTRING,BITTWO)(rc, bptr, use_offsets, count, i, subsptr)
-
-#define PCRE_GET_SUBSTRING_LIST(rc, bptr, offsets, count, listptr) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_GET_SUBSTRING_LIST,BITONE)(rc, bptr, offsets, count, listptr); \
- else \
- G(PCRE_GET_SUBSTRING_LIST,BITTWO)(rc, bptr, offsets, count, listptr)
-
-#define PCRE_JIT_STACK_ALLOC(startsize, maxsize) \
- (pcre_mode == G(G(PCRE,BITONE),_MODE)) ? \
- G(PCRE_JIT_STACK_ALLOC,BITONE)(startsize, maxsize) \
- : G(PCRE_JIT_STACK_ALLOC,BITTWO)(startsize, maxsize)
-
-#define PCRE_JIT_STACK_FREE(stack) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_JIT_STACK_FREE,BITONE)(stack); \
- else \
- G(PCRE_JIT_STACK_FREE,BITTWO)(stack)
-
-#define PCRE_MAKETABLES \
- (pcre_mode == G(G(PCRE,BITONE),_MODE)) ? \
- G(G(pcre,BITONE),_maketables)() : G(G(pcre,BITTWO),_maketables)()
-
-#define PCRE_PATTERN_TO_HOST_BYTE_ORDER(rc, re, extra, tables) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_PATTERN_TO_HOST_BYTE_ORDER,BITONE)(rc, re, extra, tables); \
- else \
- G(PCRE_PATTERN_TO_HOST_BYTE_ORDER,BITTWO)(rc, re, extra, tables)
-
-#define PCRE_PRINTINT(re, outfile, debug_lengths) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_PRINTINT,BITONE)(re, outfile, debug_lengths); \
- else \
- G(PCRE_PRINTINT,BITTWO)(re, outfile, debug_lengths)
-
-#define PCRE_STUDY(extra, re, options, error) \
- if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
- G(PCRE_STUDY,BITONE)(extra, re, options, error); \
- else \
- G(PCRE_STUDY,BITTWO)(extra, re, options, error)
-
-#endif /* Two out of three modes */
-
-/* ----- End of cases where more than one mode is supported ----- */
-
-
-/* ----- Only 8-bit mode is supported ----- */
-
-#elif defined SUPPORT_PCRE8
-#define CHAR_SIZE 1
-#define PCHARS PCHARS8
-#define PCHARSV PCHARSV8
-#define READ_CAPTURE_NAME READ_CAPTURE_NAME8
-#define SET_PCRE_CALLOUT SET_PCRE_CALLOUT8
-#define SET_PCRE_STACK_GUARD SET_PCRE_STACK_GUARD8
-#define STRLEN STRLEN8
-#define PCRE_ASSIGN_JIT_STACK PCRE_ASSIGN_JIT_STACK8
-#define PCRE_COMPILE PCRE_COMPILE8
-#define PCRE_CONFIG pcre_config
-#define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING8
-#define PCRE_COPY_SUBSTRING PCRE_COPY_SUBSTRING8
-#define PCRE_DFA_EXEC PCRE_DFA_EXEC8
-#define PCRE_EXEC PCRE_EXEC8
-#define PCRE_FREE_STUDY PCRE_FREE_STUDY8
-#define PCRE_FREE_SUBSTRING PCRE_FREE_SUBSTRING8
-#define PCRE_FREE_SUBSTRING_LIST PCRE_FREE_SUBSTRING_LIST8
-#define PCRE_GET_NAMED_SUBSTRING PCRE_GET_NAMED_SUBSTRING8
-#define PCRE_GET_STRINGNUMBER PCRE_GET_STRINGNUMBER8
-#define PCRE_GET_SUBSTRING PCRE_GET_SUBSTRING8
-#define PCRE_GET_SUBSTRING_LIST PCRE_GET_SUBSTRING_LIST8
-#define PCRE_JIT_STACK_ALLOC PCRE_JIT_STACK_ALLOC8
-#define PCRE_JIT_STACK_FREE PCRE_JIT_STACK_FREE8
-#define PCRE_MAKETABLES pcre_maketables()
-#define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER8
-#define PCRE_PRINTINT PCRE_PRINTINT8
-#define PCRE_STUDY PCRE_STUDY8
-
-/* ----- Only 16-bit mode is supported ----- */
-
-#elif defined SUPPORT_PCRE16
-#define CHAR_SIZE 2
-#define PCHARS PCHARS16
-#define PCHARSV PCHARSV16
-#define READ_CAPTURE_NAME READ_CAPTURE_NAME16
-#define SET_PCRE_CALLOUT SET_PCRE_CALLOUT16
-#define SET_PCRE_STACK_GUARD SET_PCRE_STACK_GUARD16
-#define STRLEN STRLEN16
-#define PCRE_ASSIGN_JIT_STACK PCRE_ASSIGN_JIT_STACK16
-#define PCRE_COMPILE PCRE_COMPILE16
-#define PCRE_CONFIG pcre16_config
-#define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING16
-#define PCRE_COPY_SUBSTRING PCRE_COPY_SUBSTRING16
-#define PCRE_DFA_EXEC PCRE_DFA_EXEC16
-#define PCRE_EXEC PCRE_EXEC16
-#define PCRE_FREE_STUDY PCRE_FREE_STUDY16
-#define PCRE_FREE_SUBSTRING PCRE_FREE_SUBSTRING16
-#define PCRE_FREE_SUBSTRING_LIST PCRE_FREE_SUBSTRING_LIST16
-#define PCRE_GET_NAMED_SUBSTRING PCRE_GET_NAMED_SUBSTRING16
-#define PCRE_GET_STRINGNUMBER PCRE_GET_STRINGNUMBER16
-#define PCRE_GET_SUBSTRING PCRE_GET_SUBSTRING16
-#define PCRE_GET_SUBSTRING_LIST PCRE_GET_SUBSTRING_LIST16
-#define PCRE_JIT_STACK_ALLOC PCRE_JIT_STACK_ALLOC16
-#define PCRE_JIT_STACK_FREE PCRE_JIT_STACK_FREE16
-#define PCRE_MAKETABLES pcre16_maketables()
-#define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER16
-#define PCRE_PRINTINT PCRE_PRINTINT16
-#define PCRE_STUDY PCRE_STUDY16
-
-/* ----- Only 32-bit mode is supported ----- */
-
-#elif defined SUPPORT_PCRE32
-#define CHAR_SIZE 4
-#define PCHARS PCHARS32
-#define PCHARSV PCHARSV32
-#define READ_CAPTURE_NAME READ_CAPTURE_NAME32
-#define SET_PCRE_CALLOUT SET_PCRE_CALLOUT32
-#define SET_PCRE_STACK_GUARD SET_PCRE_STACK_GUARD32
-#define STRLEN STRLEN32
-#define PCRE_ASSIGN_JIT_STACK PCRE_ASSIGN_JIT_STACK32
-#define PCRE_COMPILE PCRE_COMPILE32
-#define PCRE_CONFIG pcre32_config
-#define PCRE_COPY_NAMED_SUBSTRING PCRE_COPY_NAMED_SUBSTRING32
-#define PCRE_COPY_SUBSTRING PCRE_COPY_SUBSTRING32
-#define PCRE_DFA_EXEC PCRE_DFA_EXEC32
-#define PCRE_EXEC PCRE_EXEC32
-#define PCRE_FREE_STUDY PCRE_FREE_STUDY32
-#define PCRE_FREE_SUBSTRING PCRE_FREE_SUBSTRING32
-#define PCRE_FREE_SUBSTRING_LIST PCRE_FREE_SUBSTRING_LIST32
-#define PCRE_GET_NAMED_SUBSTRING PCRE_GET_NAMED_SUBSTRING32
-#define PCRE_GET_STRINGNUMBER PCRE_GET_STRINGNUMBER32
-#define PCRE_GET_SUBSTRING PCRE_GET_SUBSTRING32
-#define PCRE_GET_SUBSTRING_LIST PCRE_GET_SUBSTRING_LIST32
-#define PCRE_JIT_STACK_ALLOC PCRE_JIT_STACK_ALLOC32
-#define PCRE_JIT_STACK_FREE PCRE_JIT_STACK_FREE32
-#define PCRE_MAKETABLES pcre32_maketables()
-#define PCRE_PATTERN_TO_HOST_BYTE_ORDER PCRE_PATTERN_TO_HOST_BYTE_ORDER32
-#define PCRE_PRINTINT PCRE_PRINTINT32
-#define PCRE_STUDY PCRE_STUDY32
-
-#endif
-
-/* ----- End of mode-specific function call macros ----- */
-
-
-/* Other parameters */
-
-#ifndef CLOCKS_PER_SEC
-#ifdef CLK_TCK
-#define CLOCKS_PER_SEC CLK_TCK
-#else
-#define CLOCKS_PER_SEC 100
-#endif
-#endif
-
-#if !defined NODFA
-#define DFA_WS_DIMENSION 1000
-#endif
-
-/* This is the default loop count for timing. */
-
-#define LOOPREPEAT 500000
-
-/* Static variables */
-
-static FILE *outfile;
-static int log_store = 0;
-static int callout_count;
-static int callout_extra;
-static int callout_fail_count;
-static int callout_fail_id;
-static int debug_lengths;
-static int first_callout;
-static int jit_was_used;
-static int locale_set = 0;
-static int show_malloc;
-static int stack_guard_return;
-static int use_utf;
-static const unsigned char *last_callout_mark = NULL;
-
-/* The buffers grow automatically if very long input lines are encountered. */
-
-static int buffer_size = 50000;
-static pcre_uint8 *buffer = NULL;
-static pcre_uint8 *pbuffer = NULL;
-
-/* Just as a safety check, make sure that COMPILE_PCRE[16|32] are *not* set. */
-
-#ifdef COMPILE_PCRE16
-#error COMPILE_PCRE16 must not be set when compiling pcretest.c
-#endif
-
-#ifdef COMPILE_PCRE32
-#error COMPILE_PCRE32 must not be set when compiling pcretest.c
-#endif
-
-/* We need buffers for building 16/32-bit strings, and the tables of operator
-lengths that are used for 16/32-bit compiling, in order to swap bytes in a
-pattern for saving/reloading testing. Luckily, the data for these tables is
-defined as a macro. However, we must ensure that LINK_SIZE and IMM2_SIZE (which
-are used in the tables) are adjusted appropriately for the 16/32-bit world.
-LINK_SIZE is also used later in this program. */
-
-#ifdef SUPPORT_PCRE16
-#undef IMM2_SIZE
-#define IMM2_SIZE 1
-
-#if LINK_SIZE == 2
-#undef LINK_SIZE
-#define LINK_SIZE 1
-#elif LINK_SIZE == 3 || LINK_SIZE == 4
-#undef LINK_SIZE
-#define LINK_SIZE 2
-#else
-#error LINK_SIZE must be either 2, 3, or 4
-#endif
-
-static int buffer16_size = 0;
-static pcre_uint16 *buffer16 = NULL;
-static const pcre_uint16 OP_lengths16[] = { OP_LENGTHS };
-#endif /* SUPPORT_PCRE16 */
-
-#ifdef SUPPORT_PCRE32
-#undef IMM2_SIZE
-#define IMM2_SIZE 1
-#undef LINK_SIZE
-#define LINK_SIZE 1
-
-static int buffer32_size = 0;
-static pcre_uint32 *buffer32 = NULL;
-static const pcre_uint32 OP_lengths32[] = { OP_LENGTHS };
-#endif /* SUPPORT_PCRE32 */
-
-/* If we have 8-bit support, default to it; if there is also 16-or 32-bit
-support, it can be changed by an option. If there is no 8-bit support, there
-must be 16-or 32-bit support, so default it to 1. */
-
-#if defined SUPPORT_PCRE8
-static int pcre_mode = PCRE8_MODE;
-#elif defined SUPPORT_PCRE16
-static int pcre_mode = PCRE16_MODE;
-#elif defined SUPPORT_PCRE32
-static int pcre_mode = PCRE32_MODE;
-#endif
-
-/* JIT study options for -s+n and /S+n where '1' <= n <= '7'. */
-
-static int jit_study_bits[] =
- {
- PCRE_STUDY_JIT_COMPILE,
- PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE,
- PCRE_STUDY_JIT_COMPILE + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE,
- PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE,
- PCRE_STUDY_JIT_COMPILE + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE,
- PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE,
- PCRE_STUDY_JIT_COMPILE + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE +
- PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE
-};
-
-#define PCRE_STUDY_ALLJIT (PCRE_STUDY_JIT_COMPILE | \
- PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE | PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE)
-
-/* Textual explanations for runtime error codes */
-
-static const char *errtexts[] = {
- NULL, /* 0 is no error */
- NULL, /* NOMATCH is handled specially */
- "NULL argument passed",
- "bad option value",
- "magic number missing",
- "unknown opcode - pattern overwritten?",
- "no more memory",
- NULL, /* never returned by pcre_exec() or pcre_dfa_exec() */
- "match limit exceeded",
- "callout error code",
- NULL, /* BADUTF8/16 is handled specially */
- NULL, /* BADUTF8/16 offset is handled specially */
- NULL, /* PARTIAL is handled specially */
- "not used - internal error",
- "internal error - pattern overwritten?",
- "bad count value",
- "item unsupported for DFA matching",
- "backreference condition or recursion test not supported for DFA matching",
- "match limit not supported for DFA matching",
- "workspace size exceeded in DFA matching",
- "too much recursion for DFA matching",
- "recursion limit exceeded",
- "not used - internal error",
- "invalid combination of newline options",
- "bad offset value",
- NULL, /* SHORTUTF8/16 is handled specially */
- "nested recursion at the same subject position",
- "JIT stack limit reached",
- "pattern compiled in wrong mode: 8-bit/16-bit error",
- "pattern compiled with other endianness",
- "invalid data in workspace for DFA restart",
- "bad JIT option",
- "bad length"
-};
-
-
-/*************************************************
-* Alternate character tables *
-*************************************************/
-
-/* By default, the "tables" pointer when calling PCRE is set to NULL, thereby
-using the default tables of the library. However, the T option can be used to
-select alternate sets of tables, for different kinds of testing. Note also that
-the L (locale) option also adjusts the tables. */
-
-/* This is the set of tables distributed as default with PCRE. It recognizes
-only ASCII characters. */
-
-static const pcre_uint8 tables0[] = {
-
-/* This table is a lower casing table. */
-
- 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, 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, 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,
-
-/* This table is a case flipping table. */
-
- 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, 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, 91, 92, 93, 94, 95,
- 96, 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,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,
-
-/* This table contains bit maps for various character classes. Each map is 32
-bytes long and the bits run from the least significant end of each byte. The
-classes that have their own maps are: space, xdigit, digit, upper, lower, word,
-graph, print, punct, and cntrl. Other classes are built from combinations. */
-
- 0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
- 0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
- 0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc,
- 0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
- 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-
-/* This table identifies various classes of character by individual bits:
- 0x01 white space character
- 0x02 letter
- 0x04 decimal digit
- 0x08 hexadecimal digit
- 0x10 alphanumeric or '_'
- 0x80 regular expression metacharacter or binary zero
-*/
-
- 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
- 0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */
- 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */
- 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
- 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */
- 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,0x80,0x80,0x00,0x80,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,0x80,0x80,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 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
-
-/* This is a set of tables that came originally from a Windows user. It seems
-to be at least an approximation of ISO 8859. In particular, there are
-characters greater than 128 that are marked as spaces, letters, etc. */
-
-static const pcre_uint8 tables1[] = {
-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,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,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,
-224,225,226,227,228,229,230,231,
-232,233,234,235,236,237,238,239,
-240,241,242,243,244,245,246,215,
-248,249,250,251,252,253,254,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,
-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,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,91,92,93,94,95,
-96,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,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,
-224,225,226,227,228,229,230,231,
-232,233,234,235,236,237,238,239,
-240,241,242,243,244,245,246,215,
-248,249,250,251,252,253,254,223,
-192,193,194,195,196,197,198,199,
-200,201,202,203,204,205,206,207,
-208,209,210,211,212,213,214,247,
-216,217,218,219,220,221,222,255,
-0,62,0,0,1,0,0,0,
-0,0,0,0,0,0,0,0,
-32,0,0,0,1,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,255,3,
-126,0,0,0,126,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,255,3,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,12,2,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-254,255,255,7,0,0,0,0,
-0,0,0,0,0,0,0,0,
-255,255,127,127,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,254,255,255,7,
-0,0,0,0,0,4,32,4,
-0,0,0,128,255,255,127,255,
-0,0,0,0,0,0,255,3,
-254,255,255,135,254,255,255,7,
-0,0,0,0,0,4,44,6,
-255,255,127,255,255,255,127,255,
-0,0,0,0,254,255,255,255,
-255,255,255,255,255,255,255,127,
-0,0,0,0,254,255,255,255,
-255,255,255,255,255,255,255,255,
-0,2,0,0,255,255,255,255,
-255,255,255,255,255,255,255,127,
-0,0,0,0,255,255,255,255,
-255,255,255,255,255,255,255,255,
-0,0,0,0,254,255,0,252,
-1,0,0,248,1,0,0,120,
-0,0,0,0,254,255,255,255,
-0,0,128,0,0,0,128,0,
-255,255,255,255,0,0,0,0,
-0,0,0,0,0,0,0,128,
-255,255,255,255,0,0,0,0,
-0,0,0,0,0,0,0,0,
-128,0,0,0,0,0,0,0,
-0,1,1,0,1,1,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-1,0,0,0,128,0,0,0,
-128,128,128,128,0,0,128,0,
-28,28,28,28,28,28,28,28,
-28,28,0,0,0,0,0,128,
-0,26,26,26,26,26,26,18,
-18,18,18,18,18,18,18,18,
-18,18,18,18,18,18,18,18,
-18,18,18,128,128,0,128,16,
-0,26,26,26,26,26,26,18,
-18,18,18,18,18,18,18,18,
-18,18,18,18,18,18,18,18,
-18,18,18,128,128,0,0,0,
-0,0,0,0,0,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,
-1,0,0,0,0,0,0,0,
-0,0,18,0,0,0,0,0,
-0,0,20,20,0,18,0,0,
-0,20,18,0,0,0,0,0,
-18,18,18,18,18,18,18,18,
-18,18,18,18,18,18,18,18,
-18,18,18,18,18,18,18,0,
-18,18,18,18,18,18,18,18,
-18,18,18,18,18,18,18,18,
-18,18,18,18,18,18,18,18,
-18,18,18,18,18,18,18,0,
-18,18,18,18,18,18,18,18
-};
-
-
-
-
-#ifndef HAVE_STRERROR
-/*************************************************
-* Provide strerror() for non-ANSI libraries *
-*************************************************/
-
-/* Some old-fashioned systems still around (e.g. SunOS4) don't have strerror()
-in their libraries, but can provide the same facility by this simple
-alternative function. */
-
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-char *
-strerror(int n)
-{
-if (n < 0 || n >= sys_nerr) return "unknown error number";
-return sys_errlist[n];
-}
-#endif /* HAVE_STRERROR */
-
-
-
-/*************************************************
-* Print newline configuration *
-*************************************************/
-
-/*
-Arguments:
- rc the return code from PCRE_CONFIG_NEWLINE
- isc TRUE if called from "-C newline"
-Returns: nothing
-*/
-
-static void
-print_newline_config(int rc, BOOL isc)
-{
-const char *s = NULL;
-if (!isc) printf(" Newline sequence is ");
-switch(rc)
- {
- case CHAR_CR: s = "CR"; break;
- case CHAR_LF: s = "LF"; break;
- case (CHAR_CR<<8 | CHAR_LF): s = "CRLF"; break;
- case -1: s = "ANY"; break;
- case -2: s = "ANYCRLF"; break;
-
- default:
- printf("a non-standard value: 0x%04x\n", rc);
- return;
- }
-
-printf("%s\n", s);
-}
-
-
-
-/*************************************************
-* JIT memory callback *
-*************************************************/
-
-static pcre_jit_stack* jit_callback(void *arg)
-{
-jit_was_used = TRUE;
-return (pcre_jit_stack *)arg;
-}
-
-
-#if !defined NOUTF || defined SUPPORT_PCRE16 || defined SUPPORT_PCRE32
-/*************************************************
-* Convert UTF-8 string to value *
-*************************************************/
-
-/* This function takes one or more bytes that represents a UTF-8 character,
-and returns the value of the character.
-
-Argument:
- utf8bytes a pointer to the byte vector
- vptr a pointer to an int to receive the value
-
-Returns: > 0 => the number of bytes consumed
- -6 to 0 => malformed UTF-8 character at offset = (-return)
-*/
-
-static int
-utf82ord(pcre_uint8 *utf8bytes, pcre_uint32 *vptr)
-{
-pcre_uint32 c = *utf8bytes++;
-pcre_uint32 d = c;
-int i, j, s;
-
-for (i = -1; i < 6; i++) /* i is number of additional bytes */
- {
- if ((d & 0x80) == 0) break;
- d <<= 1;
- }
-
-if (i == -1) { *vptr = c; return 1; } /* ascii character */
-if (i == 0 || i == 6) return 0; /* invalid UTF-8 */
-
-/* i now has a value in the range 1-5 */
-
-s = 6*i;
-d = (c & utf8_table3[i]) << s;
-
-for (j = 0; j < i; j++)
- {
- c = *utf8bytes++;
- if ((c & 0xc0) != 0x80) return -(j+1);
- s -= 6;
- d |= (c & 0x3f) << s;
- }
-
-/* Check that encoding was the correct unique one */
-
-for (j = 0; j < utf8_table1_size; j++)
- if (d <= (pcre_uint32)utf8_table1[j]) break;
-if (j != i) return -(i+1);
-
-/* Valid value */
-
-*vptr = d;
-return i+1;
-}
-#endif /* NOUTF || SUPPORT_PCRE16 */
-
-
-
-#if defined SUPPORT_PCRE8 && !defined NOUTF
-/*************************************************
-* 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.
-
-Arguments:
- cvalue the character value
- utf8bytes pointer to buffer for result - at least 6 bytes long
-
-Returns: number of characters placed in the buffer
-*/
-
-static int
-ord2utf8(pcre_uint32 cvalue, pcre_uint8 *utf8bytes)
-{
-register int i, j;
-if (cvalue > 0x7fffffffu)
- return -1;
-for (i = 0; i < utf8_table1_size; i++)
- if (cvalue <= (pcre_uint32)utf8_table1[i]) break;
-utf8bytes += i;
-for (j = i; j > 0; j--)
- {
- *utf8bytes-- = 0x80 | (cvalue & 0x3f);
- cvalue >>= 6;
- }
-*utf8bytes = utf8_table2[i] | cvalue;
-return i + 1;
-}
-#endif
-
-
-#ifdef SUPPORT_PCRE16
-/*************************************************
-* Convert a string to 16-bit *
-*************************************************/
-
-/* In non-UTF mode, the space needed for a 16-bit string is exactly double the
-8-bit size. For a UTF-8 string, the size needed for UTF-16 is no more than
-double, because up to 0xffff uses no more than 3 bytes in UTF-8 but possibly 4
-in UTF-16. Higher values use 4 bytes in UTF-8 and up to 4 bytes in UTF-16. The
-result is always left in buffer16.
-
-Note that this function does not object to surrogate values. This is
-deliberate; it makes it possible to construct UTF-16 strings that are invalid,
-for the purpose of testing that they are correctly faulted.
-
-Patterns to be converted are either plain ASCII or UTF-8; data lines are always
-in UTF-8 so that values greater than 255 can be handled.
-
-Arguments:
- data TRUE if converting a data line; FALSE for a regex
- p points to a byte string
- utf true if UTF-8 (to be converted to UTF-16)
- len number of bytes in the string (excluding trailing zero)
-
-Returns: number of 16-bit data items used (excluding trailing zero)
- OR -1 if a UTF-8 string is malformed
- OR -2 if a value > 0x10ffff is encountered
- OR -3 if a value > 0xffff is encountered when not in UTF mode
-*/
-
-static int
-to16(int data, pcre_uint8 *p, int utf, int len)
-{
-pcre_uint16 *pp;
-
-if (buffer16_size < 2*len + 2)
- {
- if (buffer16 != NULL) free(buffer16);
- buffer16_size = 2*len + 2;
- buffer16 = (pcre_uint16 *)malloc(buffer16_size);
- if (buffer16 == NULL)
- {
- fprintf(stderr, "pcretest: malloc(%d) failed for buffer16\n", buffer16_size);
- exit(1);
- }
- }
-
-pp = buffer16;
-
-if (!utf && !data)
- {
- while (len-- > 0) *pp++ = *p++;
- }
-
-else
- {
- pcre_uint32 c = 0;
- while (len > 0)
- {
- int chlen = utf82ord(p, &c);
- if (chlen <= 0) return -1;
- if (c > 0x10ffff) return -2;
- p += chlen;
- len -= chlen;
- if (c < 0x10000) *pp++ = c; else
- {
- if (!utf) return -3;
- c -= 0x10000;
- *pp++ = 0xD800 | (c >> 10);
- *pp++ = 0xDC00 | (c & 0x3ff);
- }
- }
- }
-
-*pp = 0;
-return pp - buffer16;
-}
-#endif
-
-#ifdef SUPPORT_PCRE32
-/*************************************************
-* Convert a string to 32-bit *
-*************************************************/
-
-/* In non-UTF mode, the space needed for a 32-bit string is exactly four times the
-8-bit size. For a UTF-8 string, the size needed for UTF-32 is no more than four
-times, because up to 0xffff uses no more than 3 bytes in UTF-8 but possibly 4
-in UTF-32. Higher values use 4 bytes in UTF-8 and up to 4 bytes in UTF-32. The
-result is always left in buffer32.
-
-Note that this function does not object to surrogate values. This is
-deliberate; it makes it possible to construct UTF-32 strings that are invalid,
-for the purpose of testing that they are correctly faulted.
-
-Patterns to be converted are either plain ASCII or UTF-8; data lines are always
-in UTF-8 so that values greater than 255 can be handled.
-
-Arguments:
- data TRUE if converting a data line; FALSE for a regex
- p points to a byte string
- utf true if UTF-8 (to be converted to UTF-32)
- len number of bytes in the string (excluding trailing zero)
-
-Returns: number of 32-bit data items used (excluding trailing zero)
- OR -1 if a UTF-8 string is malformed
- OR -2 if a value > 0x10ffff is encountered
- OR -3 if an ill-formed value is encountered (i.e. a surrogate)
-*/
-
-static int
-to32(int data, pcre_uint8 *p, int utf, int len)
-{
-pcre_uint32 *pp;
-
-if (buffer32_size < 4*len + 4)
- {
- if (buffer32 != NULL) free(buffer32);
- buffer32_size = 4*len + 4;
- buffer32 = (pcre_uint32 *)malloc(buffer32_size);
- if (buffer32 == NULL)
- {
- fprintf(stderr, "pcretest: malloc(%d) failed for buffer32\n", buffer32_size);
- exit(1);
- }
- }
-
-pp = buffer32;
-
-if (!utf && !data)
- {
- while (len-- > 0) *pp++ = *p++;
- }
-
-else
- {
- pcre_uint32 c = 0;
- while (len > 0)
- {
- int chlen = utf82ord(p, &c);
- if (chlen <= 0) return -1;
- if (utf)
- {
- if (c > 0x10ffff) return -2;
- if (!data && (c & 0xfffff800u) == 0xd800u) return -3;
- }
-
- p += chlen;
- len -= chlen;
- *pp++ = c;
- }
- }
-
-*pp = 0;
-return pp - buffer32;
-}
-
-/* Check that a 32-bit character string is valid UTF-32.
-
-Arguments:
- string points to the string
- length length of string, or -1 if the string is zero-terminated
-
-Returns: TRUE if the string is a valid UTF-32 string
- FALSE otherwise
-*/
-
-#ifdef NEVER /* Not used */
-#ifdef SUPPORT_UTF
-static BOOL
-valid_utf32(pcre_uint32 *string, int length)
-{
-register pcre_uint32 *p;
-register pcre_uint32 c;
-
-for (p = string; length-- > 0; p++)
- {
- c = *p;
- if (c > 0x10ffffu) return FALSE; /* Too big */
- if ((c & 0xfffff800u) == 0xd800u) return FALSE; /* Surrogate */
- }
-
-return TRUE;
-}
-#endif /* SUPPORT_UTF */
-#endif /* NEVER */
-#endif /* SUPPORT_PCRE32 */
-
-
-/*************************************************
-* Read or extend an input line *
-*************************************************/
-
-/* Input lines are read into buffer, but both patterns and data lines can be
-continued over multiple input lines. In addition, if the buffer fills up, we
-want to automatically expand it so as to be able to handle extremely large
-lines that are needed for certain stress tests. When the input buffer is
-expanded, the other two buffers must also be expanded likewise, and the
-contents of pbuffer, which are a copy of the input for callouts, must be
-preserved (for when expansion happens for a data line). This is not the most
-optimal way of handling this, but hey, this is just a test program!
-
-Arguments:
- f the file to read
- start where in buffer to start (this *must* be within buffer)
- prompt for stdin or readline()
-
-Returns: pointer to the start of new data
- could be a copy of start, or could be moved
- NULL if no data read and EOF reached
-*/
-
-static pcre_uint8 *
-extend_inputline(FILE *f, pcre_uint8 *start, const char *prompt)
-{
-pcre_uint8 *here = start;
-
-for (;;)
- {
- size_t rlen = (size_t)(buffer_size - (here - buffer));
-
- if (rlen > 1000)
- {
- int dlen;
-
- /* If libreadline or libedit support is required, use readline() to read a
- line if the input is a terminal. Note that readline() removes the trailing
- newline, so we must put it back again, to be compatible with fgets(). */
-
-#if defined(SUPPORT_LIBREADLINE) || defined(SUPPORT_LIBEDIT)
- if (isatty(fileno(f)))
- {
- size_t len;
- char *s = readline(prompt);
- if (s == NULL) return (here == start)? NULL : start;
- len = strlen(s);
- if (len > 0) add_history(s);
- if (len > rlen - 1) len = rlen - 1;
- memcpy(here, s, len);
- here[len] = '\n';
- here[len+1] = 0;
- free(s);
- }
- else
-#endif
-
- /* Read the next line by normal means, prompting if the file is stdin. */
-
- {
- if (f == stdin) printf("%s", prompt);
- if (fgets((char *)here, rlen, f) == NULL)
- return (here == start)? NULL : start;
- }
-
- dlen = (int)strlen((char *)here);
- if (dlen > 0 && here[dlen - 1] == '\n') return start;
- here += dlen;
- }
-
- else
- {
- int new_buffer_size = 2*buffer_size;
- pcre_uint8 *new_buffer = (pcre_uint8 *)malloc(new_buffer_size);
- pcre_uint8 *new_pbuffer = (pcre_uint8 *)malloc(new_buffer_size);
-
- if (new_buffer == NULL || new_pbuffer == NULL)
- {
- fprintf(stderr, "pcretest: malloc(%d) failed\n", new_buffer_size);
- exit(1);
- }
-
- memcpy(new_buffer, buffer, buffer_size);
- memcpy(new_pbuffer, pbuffer, buffer_size);
-
- buffer_size = new_buffer_size;
-
- start = new_buffer + (start - buffer);
- here = new_buffer + (here - buffer);
-
- free(buffer);
- free(pbuffer);
-
- buffer = new_buffer;
- pbuffer = new_pbuffer;
- }
- }
-
-/* Control never gets here */
-}
-
-
-
-/*************************************************
-* Read number from string *
-*************************************************/
-
-/* We don't use strtoul() because SunOS4 doesn't have it. Rather than mess
-around with conditional compilation, just do the job by hand. It is only used
-for unpicking arguments, so just keep it simple.
-
-Arguments:
- str string to be converted
- endptr where to put the end pointer
-
-Returns: the unsigned long
-*/
-
-static int
-get_value(pcre_uint8 *str, pcre_uint8 **endptr)
-{
-int result = 0;
-while(*str != 0 && isspace(*str)) str++;
-while (isdigit(*str)) result = result * 10 + (int)(*str++ - '0');
-*endptr = str;
-return(result);
-}
-
-
-
-/*************************************************
-* Print one character *
-*************************************************/
-
-/* Print a single character either literally, or as a hex escape. */
-
-static int pchar(pcre_uint32 c, FILE *f)
-{
-int n = 0;
-if (PRINTOK(c))
- {
- if (f != NULL) fprintf(f, "%c", c);
- return 1;
- }
-
-if (c < 0x100)
- {
- if (use_utf)
- {
- if (f != NULL) fprintf(f, "\\x{%02x}", c);
- return 6;
- }
- else
- {
- if (f != NULL) fprintf(f, "\\x%02x", c);
- return 4;
- }
- }
-
-if (f != NULL) n = fprintf(f, "\\x{%02x}", c);
-return n >= 0 ? n : 0;
-}
-
-
-
-#ifdef SUPPORT_PCRE8
-/*************************************************
-* Print 8-bit character string *
-*************************************************/
-
-/* Must handle UTF-8 strings in utf8 mode. Yields number of characters printed.
-If handed a NULL file, just counts chars without printing. */
-
-static int pchars(pcre_uint8 *p, int length, FILE *f)
-{
-pcre_uint32 c = 0;
-int yield = 0;
-
-if (length < 0)
- length = strlen((char *)p);
-
-while (length-- > 0)
- {
-#if !defined NOUTF
- if (use_utf)
- {
- int rc = utf82ord(p, &c);
- if (rc > 0 && rc <= length + 1) /* Mustn't run over the end */
- {
- length -= rc - 1;
- p += rc;
- yield += pchar(c, f);
- continue;
- }
- }
-#endif
- c = *p++;
- yield += pchar(c, f);
- }
-
-return yield;
-}
-#endif
-
-
-
-#ifdef SUPPORT_PCRE16
-/*************************************************
-* Find length of 0-terminated 16-bit string *
-*************************************************/
-
-static int strlen16(PCRE_SPTR16 p)
-{
-PCRE_SPTR16 pp = p;
-while (*pp != 0) pp++;
-return (int)(pp - p);
-}
-#endif /* SUPPORT_PCRE16 */
-
-
-
-#ifdef SUPPORT_PCRE32
-/*************************************************
-* Find length of 0-terminated 32-bit string *
-*************************************************/
-
-static int strlen32(PCRE_SPTR32 p)
-{
-PCRE_SPTR32 pp = p;
-while (*pp != 0) pp++;
-return (int)(pp - p);
-}
-#endif /* SUPPORT_PCRE32 */
-
-
-
-#ifdef SUPPORT_PCRE16
-/*************************************************
-* Print 16-bit character string *
-*************************************************/
-
-/* Must handle UTF-16 strings in utf mode. Yields number of characters printed.
-If handed a NULL file, just counts chars without printing. */
-
-static int pchars16(PCRE_SPTR16 p, int length, FILE *f)
-{
-int yield = 0;
-
-if (length < 0)
- length = strlen16(p);
-
-while (length-- > 0)
- {
- pcre_uint32 c = *p++ & 0xffff;
-#if !defined NOUTF
- if (use_utf && c >= 0xD800 && c < 0xDC00 && length > 0)
- {
- int d = *p & 0xffff;
- if (d >= 0xDC00 && d <= 0xDFFF)
- {
- c = ((c & 0x3ff) << 10) + (d & 0x3ff) + 0x10000;
- length--;
- p++;
- }
- }
-#endif
- yield += pchar(c, f);
- }
-
-return yield;
-}
-#endif /* SUPPORT_PCRE16 */
-
-
-
-#ifdef SUPPORT_PCRE32
-/*************************************************
-* Print 32-bit character string *
-*************************************************/
-
-/* Must handle UTF-32 strings in utf mode. Yields number of characters printed.
-If handed a NULL file, just counts chars without printing. */
-
-static int pchars32(PCRE_SPTR32 p, int length, BOOL utf, FILE *f)
-{
-int yield = 0;
-
-(void)(utf); /* Avoid compiler warning */
-
-if (length < 0)
- length = strlen32(p);
-
-while (length-- > 0)
- {
- pcre_uint32 c = *p++;
- yield += pchar(c, f);
- }
-
-return yield;
-}
-#endif /* SUPPORT_PCRE32 */
-
-
-
-#ifdef SUPPORT_PCRE8
-/*************************************************
-* Read a capture name (8-bit) and check it *
-*************************************************/
-
-static pcre_uint8 *
-read_capture_name8(pcre_uint8 *p, pcre_uint8 **pp, pcre *re)
-{
-pcre_uint8 *npp = *pp;
-while (isalnum(*p)) *npp++ = *p++;
-*npp++ = 0;
-*npp = 0;
-if (pcre_get_stringnumber(re, (char *)(*pp)) < 0)
- {
- fprintf(outfile, "no parentheses with name \"");
- PCHARSV(*pp, 0, -1, outfile);
- fprintf(outfile, "\"\n");
- }
-
-*pp = npp;
-return p;
-}
-#endif /* SUPPORT_PCRE8 */
-
-
-
-#ifdef SUPPORT_PCRE16
-/*************************************************
-* Read a capture name (16-bit) and check it *
-*************************************************/
-
-/* Note that the text being read is 8-bit. */
-
-static pcre_uint8 *
-read_capture_name16(pcre_uint8 *p, pcre_uint16 **pp, pcre *re)
-{
-pcre_uint16 *npp = *pp;
-while (isalnum(*p)) *npp++ = *p++;
-*npp++ = 0;
-*npp = 0;
-if (pcre16_get_stringnumber((pcre16 *)re, (PCRE_SPTR16)(*pp)) < 0)
- {
- fprintf(outfile, "no parentheses with name \"");
- PCHARSV(*pp, 0, -1, outfile);
- fprintf(outfile, "\"\n");
- }
-*pp = npp;
-return p;
-}
-#endif /* SUPPORT_PCRE16 */
-
-
-
-#ifdef SUPPORT_PCRE32
-/*************************************************
-* Read a capture name (32-bit) and check it *
-*************************************************/
-
-/* Note that the text being read is 8-bit. */
-
-static pcre_uint8 *
-read_capture_name32(pcre_uint8 *p, pcre_uint32 **pp, pcre *re)
-{
-pcre_uint32 *npp = *pp;
-while (isalnum(*p)) *npp++ = *p++;
-*npp++ = 0;
-*npp = 0;
-if (pcre32_get_stringnumber((pcre32 *)re, (PCRE_SPTR32)(*pp)) < 0)
- {
- fprintf(outfile, "no parentheses with name \"");
- PCHARSV(*pp, 0, -1, outfile);
- fprintf(outfile, "\"\n");
- }
-*pp = npp;
-return p;
-}
-#endif /* SUPPORT_PCRE32 */
-
-
-
-/*************************************************
-* Stack guard function *
-*************************************************/
-
-/* Called from PCRE when set in pcre_stack_guard. We give an error (non-zero)
-return when a count overflows. */
-
-static int stack_guard(void)
-{
-return stack_guard_return;
-}
-
-/*************************************************
-* Callout function *
-*************************************************/
-
-/* Called from PCRE as a result of the (?C) item. We print out where we are in
-the match. Yield zero unless more callouts than the fail count, or the callout
-data is not zero. */
-
-static int callout(pcre_callout_block *cb)
-{
-FILE *f = (first_callout | callout_extra)? outfile : NULL;
-int i, pre_start, post_start, subject_length;
-
-if (callout_extra)
- {
- fprintf(f, "Callout %d: last capture = %d\n",
- cb->callout_number, cb->capture_last);
-
- for (i = 0; i < cb->capture_top * 2; i += 2)
- {
- if (cb->offset_vector[i] < 0)
- fprintf(f, "%2d: <unset>\n", i/2);
- else
- {
- fprintf(f, "%2d: ", i/2);
- PCHARSV(cb->subject, cb->offset_vector[i],
- cb->offset_vector[i+1] - cb->offset_vector[i], f);
- fprintf(f, "\n");
- }
- }
- }
-
-/* Re-print the subject in canonical form, the first time or if giving full
-datails. On subsequent calls in the same match, we use pchars just to find the
-printed lengths of the substrings. */
-
-if (f != NULL) fprintf(f, "--->");
-
-PCHARS(pre_start, cb->subject, 0, cb->start_match, f);
-PCHARS(post_start, cb->subject, cb->start_match,
- cb->current_position - cb->start_match, f);
-
-PCHARS(subject_length, cb->subject, 0, cb->subject_length, NULL);
-
-PCHARSV(cb->subject, cb->current_position,
- cb->subject_length - cb->current_position, f);
-
-if (f != NULL) fprintf(f, "\n");
-
-/* Always print appropriate indicators, with callout number if not already
-shown. For automatic callouts, show the pattern offset. */
-
-if (cb->callout_number == 255)
- {
- fprintf(outfile, "%+3d ", cb->pattern_position);
- if (cb->pattern_position > 99) fprintf(outfile, "\n ");
- }
-else
- {
- if (callout_extra) fprintf(outfile, " ");
- else fprintf(outfile, "%3d ", cb->callout_number);
- }
-
-for (i = 0; i < pre_start; i++) fprintf(outfile, " ");
-fprintf(outfile, "^");
-
-if (post_start > 0)
- {
- for (i = 0; i < post_start - 1; i++) fprintf(outfile, " ");
- fprintf(outfile, "^");
- }
-
-for (i = 0; i < subject_length - pre_start - post_start + 4; i++)
- fprintf(outfile, " ");
-
-fprintf(outfile, "%.*s", (cb->next_item_length == 0)? 1 : cb->next_item_length,
- pbuffer + cb->pattern_position);
-
-fprintf(outfile, "\n");
-first_callout = 0;
-
-if (cb->mark != last_callout_mark)
- {
- if (cb->mark == NULL)
- fprintf(outfile, "Latest Mark: <unset>\n");
- else
- {
- fprintf(outfile, "Latest Mark: ");
- PCHARSV(cb->mark, 0, -1, outfile);
- putc('\n', outfile);
- }
- last_callout_mark = cb->mark;
- }
-
-if (cb->callout_data != NULL)
- {
- int callout_data = *((int *)(cb->callout_data));
- if (callout_data != 0)
- {
- fprintf(outfile, "Callout data = %d\n", callout_data);
- return callout_data;
- }
- }
-
-return (cb->callout_number != callout_fail_id)? 0 :
- (++callout_count >= callout_fail_count)? 1 : 0;
-}
-
-
-/*************************************************
-* Local malloc functions *
-*************************************************/
-
-/* Alternative malloc function, to test functionality and save the size of a
-compiled re, which is the first store request that pcre_compile() makes. The
-show_malloc variable is set only during matching. */
-
-static void *new_malloc(size_t size)
-{
-void *block = malloc(size);
-if (show_malloc)
- fprintf(outfile, "malloc %3d %p\n", (int)size, block);
-return block;
-}
-
-static void new_free(void *block)
-{
-if (show_malloc)
- fprintf(outfile, "free %p\n", block);
-free(block);
-}
-
-/* For recursion malloc/free, to test stacking calls */
-
-static void *stack_malloc(size_t size)
-{
-void *block = malloc(size);
-if (show_malloc)
- fprintf(outfile, "stack_malloc %3d %p\n", (int)size, block);
-return block;
-}
-
-static void stack_free(void *block)
-{
-if (show_malloc)
- fprintf(outfile, "stack_free %p\n", block);
-free(block);
-}
-
-
-/*************************************************
-* Call pcre_fullinfo() *
-*************************************************/
-
-/* Get one piece of information from the pcre_fullinfo() function. When only
-one of 8-, 16- or 32-bit is supported, pcre_mode should always have the correct
-value, but the code is defensive.
-
-Arguments:
- re compiled regex
- study study data
- option PCRE_INFO_xxx option
- ptr where to put the data
-
-Returns: 0 when OK, < 0 on error
-*/
-
-static int
-new_info(pcre *re, pcre_extra *study, int option, void *ptr)
-{
-int rc;
-
-if (pcre_mode == PCRE32_MODE)
-#ifdef SUPPORT_PCRE32
- rc = pcre32_fullinfo((pcre32 *)re, (pcre32_extra *)study, option, ptr);
-#else
- rc = PCRE_ERROR_BADMODE;
-#endif
-else if (pcre_mode == PCRE16_MODE)
-#ifdef SUPPORT_PCRE16
- rc = pcre16_fullinfo((pcre16 *)re, (pcre16_extra *)study, option, ptr);
-#else
- rc = PCRE_ERROR_BADMODE;
-#endif
-else
-#ifdef SUPPORT_PCRE8
- rc = pcre_fullinfo(re, study, option, ptr);
-#else
- rc = PCRE_ERROR_BADMODE;
-#endif
-
-if (rc < 0 && rc != PCRE_ERROR_UNSET)
- {
- fprintf(outfile, "Error %d from pcre%s_fullinfo(%d)\n", rc,
- pcre_mode == PCRE32_MODE ? "32" : pcre_mode == PCRE16_MODE ? "16" : "", option);
- if (rc == PCRE_ERROR_BADMODE)
- fprintf(outfile, "Running in %d-bit mode but pattern was compiled in "
- "%d-bit mode\n", 8 * CHAR_SIZE,
- 8 * (REAL_PCRE_FLAGS(re) & PCRE_MODE_MASK));
- }
-
-return rc;
-}
-
-
-
-/*************************************************
-* Swap byte functions *
-*************************************************/
-
-/* The following functions swap the bytes of a pcre_uint16 and pcre_uint32
-value, respectively.
-
-Arguments:
- value any number
-
-Returns: the byte swapped value
-*/
-
-static pcre_uint32
-swap_uint32(pcre_uint32 value)
-{
-return ((value & 0x000000ff) << 24) |
- ((value & 0x0000ff00) << 8) |
- ((value & 0x00ff0000) >> 8) |
- (value >> 24);
-}
-
-static pcre_uint16
-swap_uint16(pcre_uint16 value)
-{
-return (value >> 8) | (value << 8);
-}
-
-
-
-/*************************************************
-* Flip bytes in a compiled pattern *
-*************************************************/
-
-/* This function is called if the 'F' option was present on a pattern that is
-to be written to a file. We flip the bytes of all the integer fields in the
-regex data block and the study block. In 16-bit mode this also flips relevant
-bytes in the pattern itself. This is to make it possible to test PCRE's
-ability to reload byte-flipped patterns, e.g. those compiled on a different
-architecture. */
-
-#if defined SUPPORT_PCRE8 || defined SUPPORT_PCRE16
-static void
-regexflip8_or_16(pcre *ere, pcre_extra *extra)
-{
-real_pcre8_or_16 *re = (real_pcre8_or_16 *)ere;
-#ifdef SUPPORT_PCRE16
-int op;
-pcre_uint16 *ptr = (pcre_uint16 *)re + re->name_table_offset;
-int length = re->name_count * re->name_entry_size;
-#ifdef SUPPORT_UTF
-BOOL utf = (re->options & PCRE_UTF16) != 0;
-BOOL utf16_char = FALSE;
-#endif /* SUPPORT_UTF */
-#endif /* SUPPORT_PCRE16 */
-
-/* Always flip the bytes in the main data block and study blocks. */
-
-re->magic_number = REVERSED_MAGIC_NUMBER;
-re->size = swap_uint32(re->size);
-re->options = swap_uint32(re->options);
-re->flags = swap_uint32(re->flags);
-re->limit_match = swap_uint32(re->limit_match);
-re->limit_recursion = swap_uint32(re->limit_recursion);
-re->first_char = swap_uint16(re->first_char);
-re->req_char = swap_uint16(re->req_char);
-re->max_lookbehind = swap_uint16(re->max_lookbehind);
-re->top_bracket = swap_uint16(re->top_bracket);
-re->top_backref = swap_uint16(re->top_backref);
-re->name_table_offset = swap_uint16(re->name_table_offset);
-re->name_entry_size = swap_uint16(re->name_entry_size);
-re->name_count = swap_uint16(re->name_count);
-re->ref_count = swap_uint16(re->ref_count);
-
-if (extra != NULL)
- {
- pcre_study_data *rsd = (pcre_study_data *)(extra->study_data);
- rsd->size = swap_uint32(rsd->size);
- rsd->flags = swap_uint32(rsd->flags);
- rsd->minlength = swap_uint32(rsd->minlength);
- }
-
-/* In 8-bit mode, that is all we need to do. In 16-bit mode we must swap bytes
-in the name table, if present, and then in the pattern itself. */
-
-#ifdef SUPPORT_PCRE16
-if (pcre_mode != PCRE16_MODE) return;
-
-while(TRUE)
- {
- /* Swap previous characters. */
- while (length-- > 0)
- {
- *ptr = swap_uint16(*ptr);
- ptr++;
- }
-#ifdef SUPPORT_UTF
- if (utf16_char)
- {
- if ((ptr[-1] & 0xfc00) == 0xd800)
- {
- /* We know that there is only one extra character in UTF-16. */
- *ptr = swap_uint16(*ptr);
- ptr++;
- }
- }
- utf16_char = FALSE;
-#endif /* SUPPORT_UTF */
-
- /* Get next opcode. */
-
- length = 0;
- op = *ptr;
- *ptr++ = swap_uint16(op);
-
- switch (op)
- {
- case OP_END:
- return;
-
-#ifdef SUPPORT_UTF
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_STAR:
- case OP_MINSTAR:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_QUERY:
- case OP_MINQUERY:
- case OP_UPTO:
- case OP_MINUPTO:
- case OP_EXACT:
- case OP_POSSTAR:
- case OP_POSPLUS:
- case OP_POSQUERY:
- case OP_POSUPTO:
- case OP_STARI:
- case OP_MINSTARI:
- case OP_PLUSI:
- case OP_MINPLUSI:
- case OP_QUERYI:
- case OP_MINQUERYI:
- case OP_UPTOI:
- case OP_MINUPTOI:
- case OP_EXACTI:
- case OP_POSSTARI:
- case OP_POSPLUSI:
- case OP_POSQUERYI:
- case OP_POSUPTOI:
- case OP_NOTSTAR:
- case OP_NOTMINSTAR:
- case OP_NOTPLUS:
- case OP_NOTMINPLUS:
- case OP_NOTQUERY:
- case OP_NOTMINQUERY:
- case OP_NOTUPTO:
- case OP_NOTMINUPTO:
- case OP_NOTEXACT:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSUPTO:
- case OP_NOTSTARI:
- case OP_NOTMINSTARI:
- case OP_NOTPLUSI:
- case OP_NOTMINPLUSI:
- case OP_NOTQUERYI:
- case OP_NOTMINQUERYI:
- case OP_NOTUPTOI:
- case OP_NOTMINUPTOI:
- case OP_NOTEXACTI:
- case OP_NOTPOSSTARI:
- case OP_NOTPOSPLUSI:
- case OP_NOTPOSQUERYI:
- case OP_NOTPOSUPTOI:
- if (utf) utf16_char = TRUE;
-#endif
- /* Fall through. */
-
- default:
- length = OP_lengths16[op] - 1;
- break;
-
- case OP_CLASS:
- case OP_NCLASS:
- /* Skip the character bit map. */
- ptr += 32/sizeof(pcre_uint16);
- length = 0;
- break;
-
- case OP_XCLASS:
- /* LINK_SIZE can be 1 or 2 in 16 bit mode. */
- if (LINK_SIZE > 1)
- length = (int)((((unsigned int)(ptr[0]) << 16) | (unsigned int)(ptr[1]))
- - (1 + LINK_SIZE + 1));
- else
- length = (int)((unsigned int)(ptr[0]) - (1 + LINK_SIZE + 1));
-
- /* Reverse the size of the XCLASS instance. */
- *ptr = swap_uint16(*ptr);
- ptr++;
- if (LINK_SIZE > 1)
- {
- *ptr = swap_uint16(*ptr);
- ptr++;
- }
-
- op = *ptr;
- *ptr = swap_uint16(op);
- ptr++;
- if ((op & XCL_MAP) != 0)
- {
- /* Skip the character bit map. */
- ptr += 32/sizeof(pcre_uint16);
- length -= 32/sizeof(pcre_uint16);
- }
- break;
- }
- }
-/* Control should never reach here in 16 bit mode. */
-#endif /* SUPPORT_PCRE16 */
-}
-#endif /* SUPPORT_PCRE[8|16] */
-
-
-
-#if defined SUPPORT_PCRE32
-static void
-regexflip_32(pcre *ere, pcre_extra *extra)
-{
-real_pcre32 *re = (real_pcre32 *)ere;
-int op;
-pcre_uint32 *ptr = (pcre_uint32 *)re + re->name_table_offset;
-int length = re->name_count * re->name_entry_size;
-
-/* Always flip the bytes in the main data block and study blocks. */
-
-re->magic_number = REVERSED_MAGIC_NUMBER;
-re->size = swap_uint32(re->size);
-re->options = swap_uint32(re->options);
-re->flags = swap_uint32(re->flags);
-re->limit_match = swap_uint32(re->limit_match);
-re->limit_recursion = swap_uint32(re->limit_recursion);
-re->first_char = swap_uint32(re->first_char);
-re->req_char = swap_uint32(re->req_char);
-re->max_lookbehind = swap_uint16(re->max_lookbehind);
-re->top_bracket = swap_uint16(re->top_bracket);
-re->top_backref = swap_uint16(re->top_backref);
-re->name_table_offset = swap_uint16(re->name_table_offset);
-re->name_entry_size = swap_uint16(re->name_entry_size);
-re->name_count = swap_uint16(re->name_count);
-re->ref_count = swap_uint16(re->ref_count);
-
-if (extra != NULL)
- {
- pcre_study_data *rsd = (pcre_study_data *)(extra->study_data);
- rsd->size = swap_uint32(rsd->size);
- rsd->flags = swap_uint32(rsd->flags);
- rsd->minlength = swap_uint32(rsd->minlength);
- }
-
-/* In 32-bit mode we must swap bytes in the name table, if present, and then in
-the pattern itself. */
-
-while(TRUE)
- {
- /* Swap previous characters. */
- while (length-- > 0)
- {
- *ptr = swap_uint32(*ptr);
- ptr++;
- }
-
- /* Get next opcode. */
-
- length = 0;
- op = *ptr;
- *ptr++ = swap_uint32(op);
-
- switch (op)
- {
- case OP_END:
- return;
-
- default:
- length = OP_lengths32[op] - 1;
- break;
-
- case OP_CLASS:
- case OP_NCLASS:
- /* Skip the character bit map. */
- ptr += 32/sizeof(pcre_uint32);
- length = 0;
- break;
-
- case OP_XCLASS:
- /* LINK_SIZE can only be 1 in 32-bit mode. */
- length = (int)((unsigned int)(ptr[0]) - (1 + LINK_SIZE + 1));
-
- /* Reverse the size of the XCLASS instance. */
- *ptr = swap_uint32(*ptr);
- ptr++;
-
- op = *ptr;
- *ptr = swap_uint32(op);
- ptr++;
- if ((op & XCL_MAP) != 0)
- {
- /* Skip the character bit map. */
- ptr += 32/sizeof(pcre_uint32);
- length -= 32/sizeof(pcre_uint32);
- }
- break;
- }
- }
-/* Control should never reach here in 32 bit mode. */
-}
-
-#endif /* SUPPORT_PCRE32 */
-
-
-
-static void
-regexflip(pcre *ere, pcre_extra *extra)
-{
-#if defined SUPPORT_PCRE32
- if (REAL_PCRE_FLAGS(ere) & PCRE_MODE32)
- regexflip_32(ere, extra);
-#endif
-#if defined SUPPORT_PCRE8 || defined SUPPORT_PCRE16
- if (REAL_PCRE_FLAGS(ere) & (PCRE_MODE8 | PCRE_MODE16))
- regexflip8_or_16(ere, extra);
-#endif
-}
-
-
-
-/*************************************************
-* Check match or recursion limit *
-*************************************************/
-
-static int
-check_match_limit(pcre *re, pcre_extra *extra, pcre_uint8 *bptr, int len,
- int start_offset, int options, int *use_offsets, int use_size_offsets,
- int flag, unsigned long int *limit, int errnumber, const char *msg)
-{
-int count;
-int min = 0;
-int mid = 64;
-int max = -1;
-
-extra->flags |= flag;
-
-for (;;)
- {
- *limit = mid;
-
- PCRE_EXEC(count, re, extra, bptr, len, start_offset, options,
- use_offsets, use_size_offsets);
-
- if (count == errnumber)
- {
- /* fprintf(outfile, "Testing %s limit = %d\n", msg, mid); */
- min = mid;
- mid = (mid == max - 1)? max : (max > 0)? (min + max)/2 : mid*2;
- }
-
- else if (count >= 0 || count == PCRE_ERROR_NOMATCH ||
- count == PCRE_ERROR_PARTIAL)
- {
- if (mid == min + 1)
- {
- fprintf(outfile, "Minimum %s limit = %d\n", msg, mid);
- break;
- }
- /* fprintf(outfile, "Testing %s limit = %d\n", msg, mid); */
- max = mid;
- mid = (min + mid)/2;
- }
- else break; /* Some other error */
- }
-
-extra->flags &= ~flag;
-return count;
-}
-
-
-
-/*************************************************
-* Case-independent strncmp() function *
-*************************************************/
-
-/*
-Arguments:
- s first string
- t second string
- n number of characters to compare
-
-Returns: < 0, = 0, or > 0, according to the comparison
-*/
-
-static int
-strncmpic(pcre_uint8 *s, pcre_uint8 *t, int n)
-{
-while (n--)
- {
- int c = tolower(*s++) - tolower(*t++);
- if (c) return c;
- }
-return 0;
-}
-
-
-
-/*************************************************
-* Check multicharacter option *
-*************************************************/
-
-/* This is used both at compile and run-time to check for <xxx> escapes. Print
-a message and return 0 if there is no match.
-
-Arguments:
- p points after the leading '<'
- f file for error message
- nl TRUE to check only for newline settings
- stype "modifier" or "escape sequence"
-
-Returns: appropriate PCRE_NEWLINE_xxx flags, or 0
-*/
-
-static int
-check_mc_option(pcre_uint8 *p, FILE *f, BOOL nl, const char *stype)
-{
-if (strncmpic(p, (pcre_uint8 *)"cr>", 3) == 0) return PCRE_NEWLINE_CR;
-if (strncmpic(p, (pcre_uint8 *)"lf>", 3) == 0) return PCRE_NEWLINE_LF;
-if (strncmpic(p, (pcre_uint8 *)"crlf>", 5) == 0) return PCRE_NEWLINE_CRLF;
-if (strncmpic(p, (pcre_uint8 *)"anycrlf>", 8) == 0) return PCRE_NEWLINE_ANYCRLF;
-if (strncmpic(p, (pcre_uint8 *)"any>", 4) == 0) return PCRE_NEWLINE_ANY;
-if (strncmpic(p, (pcre_uint8 *)"bsr_anycrlf>", 12) == 0) return PCRE_BSR_ANYCRLF;
-if (strncmpic(p, (pcre_uint8 *)"bsr_unicode>", 12) == 0) return PCRE_BSR_UNICODE;
-
-if (!nl)
- {
- if (strncmpic(p, (pcre_uint8 *)"JS>", 3) == 0) return PCRE_JAVASCRIPT_COMPAT;
- }
-
-fprintf(f, "Unknown %s at: <%s\n", stype, p);
-return 0;
-}
-
-
-
-/*************************************************
-* Usage function *
-*************************************************/
-
-static void
-usage(void)
-{
-printf("Usage: pcretest [options] [<input file> [<output file>]]\n\n");
-printf("Input and output default to stdin and stdout.\n");
-#if defined(SUPPORT_LIBREADLINE) || defined(SUPPORT_LIBEDIT)
-printf("If input is a terminal, readline() is used to read from it.\n");
-#else
-printf("This version of pcretest is not linked with readline().\n");
-#endif
-printf("\nOptions:\n");
-#ifdef SUPPORT_PCRE16
-printf(" -16 use the 16-bit library\n");
-#endif
-#ifdef SUPPORT_PCRE32
-printf(" -32 use the 32-bit library\n");
-#endif
-printf(" -b show compiled code\n");
-printf(" -C show PCRE compile-time options and exit\n");
-printf(" -C arg show a specific compile-time option and exit\n");
-printf(" with its value if numeric (else 0). The arg can be:\n");
-printf(" linksize internal link size [2, 3, 4]\n");
-printf(" pcre8 8 bit library support enabled [0, 1]\n");
-printf(" pcre16 16 bit library support enabled [0, 1]\n");
-printf(" pcre32 32 bit library support enabled [0, 1]\n");
-printf(" utf Unicode Transformation Format supported [0, 1]\n");
-printf(" ucp Unicode Properties supported [0, 1]\n");
-printf(" jit Just-in-time compiler supported [0, 1]\n");
-printf(" newline Newline type [CR, LF, CRLF, ANYCRLF, ANY]\n");
-printf(" bsr \\R type [ANYCRLF, ANY]\n");
-printf(" -d debug: show compiled code and information (-b and -i)\n");
-#if !defined NODFA
-printf(" -dfa force DFA matching for all subjects\n");
-#endif
-printf(" -help show usage information\n");
-printf(" -i show information about compiled patterns\n"
- " -M find MATCH_LIMIT minimum for each subject\n"
- " -m output memory used information\n"
- " -O set PCRE_NO_AUTO_POSSESS on each pattern\n"
- " -o <n> set size of offsets vector to <n>\n");
-#if !defined NOPOSIX
-printf(" -p use POSIX interface\n");
-#endif
-printf(" -q quiet: do not output PCRE version number at start\n");
-printf(" -S <n> set stack size to <n> megabytes\n");
-printf(" -s force each pattern to be studied at basic level\n"
- " -s+ force each pattern to be studied, using JIT if available\n"
- " -s++ ditto, verifying when JIT was actually used\n"
- " -s+n force each pattern to be studied, using JIT if available,\n"
- " where 1 <= n <= 7 selects JIT options\n"
- " -s++n ditto, verifying when JIT was actually used\n"
- " -t time compilation and execution\n");
-printf(" -t <n> time compilation and execution, repeating <n> times\n");
-printf(" -tm time execution (matching) only\n");
-printf(" -tm <n> time execution (matching) only, repeating <n> times\n");
-printf(" -T same as -t, but show total times at the end\n");
-printf(" -TM same as -tm, but show total time at the end\n");
-}
-
-
-
-/*************************************************
-* Main Program *
-*************************************************/
-
-/* Read lines from named file or stdin and write to named file or stdout; lines
-consist of a regular expression, in delimiters and optionally followed by
-options, followed by a set of test data, terminated by an empty line. */
-
-int main(int argc, char **argv)
-{
-FILE *infile = stdin;
-const char *version;
-int options = 0;
-int study_options = 0;
-int default_find_match_limit = FALSE;
-pcre_uint32 default_options = 0;
-int op = 1;
-int timeit = 0;
-int timeitm = 0;
-int showtotaltimes = 0;
-int showinfo = 0;
-int showstore = 0;
-int force_study = -1;
-int force_study_options = 0;
-int quiet = 0;
-int size_offsets = 45;
-int size_offsets_max;
-int *offsets = NULL;
-int debug = 0;
-int done = 0;
-int all_use_dfa = 0;
-int verify_jit = 0;
-int yield = 0;
-int stack_size;
-pcre_uint8 *dbuffer = NULL;
-pcre_uint8 lockout[24] = { 0 };
-size_t dbuffer_size = 1u << 14;
-clock_t total_compile_time = 0;
-clock_t total_study_time = 0;
-clock_t total_match_time = 0;
-
-#if !defined NOPOSIX
-int posix = 0;
-#endif
-#if !defined NODFA
-int *dfa_workspace = NULL;
-#endif
-
-pcre_jit_stack *jit_stack = NULL;
-
-/* These vectors store, end-to-end, a list of zero-terminated captured
-substring names, each list itself being terminated by an empty name. Assume
-that 1024 is plenty long enough for the few names we'll be testing. It is
-easiest to keep separate 8-, 16- and 32-bit versions, using the 32-bit version
-for the actual memory, to ensure alignment. */
-
-pcre_uint32 copynames[1024];
-pcre_uint32 getnames[1024];
-
-#ifdef SUPPORT_PCRE32
-pcre_uint32 *cn32ptr;
-pcre_uint32 *gn32ptr;
-#endif
-
-#ifdef SUPPORT_PCRE16
-pcre_uint16 *copynames16 = (pcre_uint16 *)copynames;
-pcre_uint16 *getnames16 = (pcre_uint16 *)getnames;
-pcre_uint16 *cn16ptr;
-pcre_uint16 *gn16ptr;
-#endif
-
-#ifdef SUPPORT_PCRE8
-pcre_uint8 *copynames8 = (pcre_uint8 *)copynames;
-pcre_uint8 *getnames8 = (pcre_uint8 *)getnames;
-pcre_uint8 *cn8ptr;
-pcre_uint8 *gn8ptr;
-#endif
-
-/* Get buffers from malloc() so that valgrind will check their misuse when
-debugging. They grow automatically when very long lines are read. The 16-
-and 32-bit buffers (buffer16, buffer32) are obtained only if needed. */
-
-buffer = (pcre_uint8 *)malloc(buffer_size);
-pbuffer = (pcre_uint8 *)malloc(buffer_size);
-
-/* The outfile variable is static so that new_malloc can use it. */
-
-outfile = stdout;
-
-/* The following _setmode() stuff is some Windows magic that tells its runtime
-library to translate CRLF into a single LF character. At least, that's what
-I've been told: never having used Windows I take this all on trust. Originally
-it set 0x8000, but then I was advised that _O_BINARY was better. */
-
-#if defined(_WIN32) || defined(WIN32)
-_setmode( _fileno( stdout ), _O_BINARY );
-#endif
-
-/* Get the version number: both pcre_version() and pcre16_version() give the
-same answer. We just need to ensure that we call one that is available. */
-
-#if defined SUPPORT_PCRE8
-version = pcre_version();
-#elif defined SUPPORT_PCRE16
-version = pcre16_version();
-#elif defined SUPPORT_PCRE32
-version = pcre32_version();
-#endif
-
-/* Scan options */
-
-while (argc > 1 && argv[op][0] == '-')
- {
- pcre_uint8 *endptr;
- char *arg = argv[op];
-
- if (strcmp(arg, "-m") == 0) showstore = 1;
- else if (strcmp(arg, "-s") == 0) force_study = 0;
-
- else if (strncmp(arg, "-s+", 3) == 0)
- {
- arg += 3;
- if (*arg == '+') { arg++; verify_jit = TRUE; }
- force_study = 1;
- if (*arg == 0)
- force_study_options = jit_study_bits[6];
- else if (*arg >= '1' && *arg <= '7')
- force_study_options = jit_study_bits[*arg - '1'];
- else goto BAD_ARG;
- }
- else if (strcmp(arg, "-8") == 0)
- {
-#ifdef SUPPORT_PCRE8
- pcre_mode = PCRE8_MODE;
-#else
- printf("** This version of PCRE was built without 8-bit support\n");
- exit(1);
-#endif
- }
- else if (strcmp(arg, "-16") == 0)
- {
-#ifdef SUPPORT_PCRE16
- pcre_mode = PCRE16_MODE;
-#else
- printf("** This version of PCRE was built without 16-bit support\n");
- exit(1);
-#endif
- }
- else if (strcmp(arg, "-32") == 0)
- {
-#ifdef SUPPORT_PCRE32
- pcre_mode = PCRE32_MODE;
-#else
- printf("** This version of PCRE was built without 32-bit support\n");
- exit(1);
-#endif
- }
- else if (strcmp(arg, "-q") == 0) quiet = 1;
- else if (strcmp(arg, "-b") == 0) debug = 1;
- else if (strcmp(arg, "-i") == 0) showinfo = 1;
- else if (strcmp(arg, "-d") == 0) showinfo = debug = 1;
- else if (strcmp(arg, "-M") == 0) default_find_match_limit = TRUE;
- else if (strcmp(arg, "-O") == 0) default_options |= PCRE_NO_AUTO_POSSESS;
-#if !defined NODFA
- else if (strcmp(arg, "-dfa") == 0) all_use_dfa = 1;
-#endif
- else if (strcmp(arg, "-o") == 0 && argc > 2 &&
- ((size_offsets = get_value((pcre_uint8 *)argv[op+1], &endptr)),
- *endptr == 0))
- {
- op++;
- argc--;
- }
- else if (strcmp(arg, "-t") == 0 || strcmp(arg, "-tm") == 0 ||
- strcmp(arg, "-T") == 0 || strcmp(arg, "-TM") == 0)
- {
- int temp;
- int both = arg[2] == 0;
- showtotaltimes = arg[1] == 'T';
- if (argc > 2 && (temp = get_value((pcre_uint8 *)argv[op+1], &endptr),
- *endptr == 0))
- {
- timeitm = temp;
- op++;
- argc--;
- }
- else timeitm = LOOPREPEAT;
- if (both) timeit = timeitm;
- }
- else if (strcmp(arg, "-S") == 0 && argc > 2 &&
- ((stack_size = get_value((pcre_uint8 *)argv[op+1], &endptr)),
- *endptr == 0))
- {
-#if defined(_WIN32) || defined(WIN32) || defined(__minix) || defined(NATIVE_ZOS) || defined(__VMS)
- printf("PCRE: -S not supported on this OS\n");
- exit(1);
-#else
- int rc;
- struct rlimit rlim;
- getrlimit(RLIMIT_STACK, &rlim);
- rlim.rlim_cur = stack_size * 1024 * 1024;
- rc = setrlimit(RLIMIT_STACK, &rlim);
- if (rc != 0)
- {
- printf("PCRE: setrlimit() failed with error %d\n", rc);
- exit(1);
- }
- op++;
- argc--;
-#endif
- }
-#if !defined NOPOSIX
- else if (strcmp(arg, "-p") == 0) posix = 1;
-#endif
- else if (strcmp(arg, "-C") == 0)
- {
- int rc;
- unsigned long int lrc;
-
- if (argc > 2)
- {
- if (strcmp(argv[op + 1], "linksize") == 0)
- {
- (void)PCRE_CONFIG(PCRE_CONFIG_LINK_SIZE, &rc);
- printf("%d\n", rc);
- yield = rc;
-
-#ifdef __VMS
- vms_setsymbol("LINKSIZE",0,yield );
-#endif
- }
- else if (strcmp(argv[op + 1], "pcre8") == 0)
- {
-#ifdef SUPPORT_PCRE8
- printf("1\n");
- yield = 1;
-#else
- printf("0\n");
- yield = 0;
-#endif
-#ifdef __VMS
- vms_setsymbol("PCRE8",0,yield );
-#endif
- }
- else if (strcmp(argv[op + 1], "pcre16") == 0)
- {
-#ifdef SUPPORT_PCRE16
- printf("1\n");
- yield = 1;
-#else
- printf("0\n");
- yield = 0;
-#endif
-#ifdef __VMS
- vms_setsymbol("PCRE16",0,yield );
-#endif
- }
- else if (strcmp(argv[op + 1], "pcre32") == 0)
- {
-#ifdef SUPPORT_PCRE32
- printf("1\n");
- yield = 1;
-#else
- printf("0\n");
- yield = 0;
-#endif
-#ifdef __VMS
- vms_setsymbol("PCRE32",0,yield );
-#endif
- }
- else if (strcmp(argv[op + 1], "utf") == 0)
- {
-#ifdef SUPPORT_PCRE8
- if (pcre_mode == PCRE8_MODE)
- (void)pcre_config(PCRE_CONFIG_UTF8, &rc);
-#endif
-#ifdef SUPPORT_PCRE16
- if (pcre_mode == PCRE16_MODE)
- (void)pcre16_config(PCRE_CONFIG_UTF16, &rc);
-#endif
-#ifdef SUPPORT_PCRE32
- if (pcre_mode == PCRE32_MODE)
- (void)pcre32_config(PCRE_CONFIG_UTF32, &rc);
-#endif
- printf("%d\n", rc);
- yield = rc;
-#ifdef __VMS
- vms_setsymbol("UTF",0,yield );
-#endif
- }
- else if (strcmp(argv[op + 1], "ucp") == 0)
- {
- (void)PCRE_CONFIG(PCRE_CONFIG_UNICODE_PROPERTIES, &rc);
- printf("%d\n", rc);
- yield = rc;
- }
- else if (strcmp(argv[op + 1], "jit") == 0)
- {
- (void)PCRE_CONFIG(PCRE_CONFIG_JIT, &rc);
- printf("%d\n", rc);
- yield = rc;
- }
- else if (strcmp(argv[op + 1], "newline") == 0)
- {
- (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);
- print_newline_config(rc, TRUE);
- }
- else if (strcmp(argv[op + 1], "bsr") == 0)
- {
- (void)PCRE_CONFIG(PCRE_CONFIG_BSR, &rc);
- printf("%s\n", rc? "ANYCRLF" : "ANY");
- }
- else if (strcmp(argv[op + 1], "ebcdic") == 0)
- {
-#ifdef EBCDIC
- printf("1\n");
- yield = 1;
-#else
- printf("0\n");
-#endif
- }
- else if (strcmp(argv[op + 1], "ebcdic-nl") == 0)
- {
-#ifdef EBCDIC
- printf("0x%02x\n", CHAR_LF);
-#else
- printf("0\n");
-#endif
- }
- else
- {
- printf("Unknown -C option: %s\n", argv[op + 1]);
- }
- goto EXIT;
- }
-
- /* No argument for -C: output all configuration information. */
-
- printf("PCRE version %s\n", version);
- printf("Compiled with\n");
-
-#ifdef EBCDIC
- printf(" EBCDIC code support: LF is 0x%02x\n", CHAR_LF);
-#endif
-
-/* At least one of SUPPORT_PCRE8 and SUPPORT_PCRE16 will be set. If both
-are set, either both UTFs are supported or both are not supported. */
-
-#ifdef SUPPORT_PCRE8
- printf(" 8-bit support\n");
- (void)pcre_config(PCRE_CONFIG_UTF8, &rc);
- printf (" %sUTF-8 support\n", rc ? "" : "No ");
-#endif
-#ifdef SUPPORT_PCRE16
- printf(" 16-bit support\n");
- (void)pcre16_config(PCRE_CONFIG_UTF16, &rc);
- printf (" %sUTF-16 support\n", rc ? "" : "No ");
-#endif
-#ifdef SUPPORT_PCRE32
- printf(" 32-bit support\n");
- (void)pcre32_config(PCRE_CONFIG_UTF32, &rc);
- printf (" %sUTF-32 support\n", rc ? "" : "No ");
-#endif
-
- (void)PCRE_CONFIG(PCRE_CONFIG_UNICODE_PROPERTIES, &rc);
- printf(" %sUnicode properties support\n", rc? "" : "No ");
- (void)PCRE_CONFIG(PCRE_CONFIG_JIT, &rc);
- if (rc)
- {
- const char *arch;
- (void)PCRE_CONFIG(PCRE_CONFIG_JITTARGET, (void *)(&arch));
- printf(" Just-in-time compiler support: %s\n", arch);
- }
- else
- printf(" No just-in-time compiler support\n");
- (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);
- print_newline_config(rc, FALSE);
- (void)PCRE_CONFIG(PCRE_CONFIG_BSR, &rc);
- printf(" \\R matches %s\n", rc? "CR, LF, or CRLF only" :
- "all Unicode newlines");
- (void)PCRE_CONFIG(PCRE_CONFIG_LINK_SIZE, &rc);
- printf(" Internal link size = %d\n", rc);
- (void)PCRE_CONFIG(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, &rc);
- printf(" POSIX malloc threshold = %d\n", rc);
- (void)PCRE_CONFIG(PCRE_CONFIG_PARENS_LIMIT, &lrc);
- printf(" Parentheses nest limit = %ld\n", lrc);
- (void)PCRE_CONFIG(PCRE_CONFIG_MATCH_LIMIT, &lrc);
- printf(" Default match limit = %ld\n", lrc);
- (void)PCRE_CONFIG(PCRE_CONFIG_MATCH_LIMIT_RECURSION, &lrc);
- printf(" Default recursion depth limit = %ld\n", lrc);
- (void)PCRE_CONFIG(PCRE_CONFIG_STACKRECURSE, &rc);
- printf(" Match recursion uses %s", rc? "stack" : "heap");
- if (showstore)
- {
- PCRE_EXEC(stack_size, NULL, NULL, NULL, -999, -999, 0, NULL, 0);
- printf(": %sframe size = %d bytes", rc? "approximate " : "", -stack_size);
- }
- printf("\n");
- goto EXIT;
- }
- else if (strcmp(arg, "-help") == 0 ||
- strcmp(arg, "--help") == 0)
- {
- usage();
- goto EXIT;
- }
- else
- {
- BAD_ARG:
- printf("** Unknown or malformed option %s\n", arg);
- usage();
- yield = 1;
- goto EXIT;
- }
- op++;
- argc--;
- }
-
-/* Get the store for the offsets vector, and remember what it was */
-
-size_offsets_max = size_offsets;
-offsets = (int *)malloc(size_offsets_max * sizeof(int));
-if (offsets == NULL)
- {
- printf("** Failed to get %d bytes of memory for offsets vector\n",
- (int)(size_offsets_max * sizeof(int)));
- yield = 1;
- goto EXIT;
- }
-
-/* Sort out the input and output files */
-
-if (argc > 1)
- {
- infile = fopen(argv[op], INPUT_MODE);
- if (infile == NULL)
- {
- printf("** Failed to open %s\n", argv[op]);
- yield = 1;
- goto EXIT;
- }
- }
-
-if (argc > 2)
- {
- outfile = fopen(argv[op+1], OUTPUT_MODE);
- if (outfile == NULL)
- {
- printf("** Failed to open %s\n", argv[op+1]);
- yield = 1;
- goto EXIT;
- }
- }
-
-/* Set alternative malloc function */
-
-#ifdef SUPPORT_PCRE8
-pcre_malloc = new_malloc;
-pcre_free = new_free;
-pcre_stack_malloc = stack_malloc;
-pcre_stack_free = stack_free;
-#endif
-
-#ifdef SUPPORT_PCRE16
-pcre16_malloc = new_malloc;
-pcre16_free = new_free;
-pcre16_stack_malloc = stack_malloc;
-pcre16_stack_free = stack_free;
-#endif
-
-#ifdef SUPPORT_PCRE32
-pcre32_malloc = new_malloc;
-pcre32_free = new_free;
-pcre32_stack_malloc = stack_malloc;
-pcre32_stack_free = stack_free;
-#endif
-
-/* Heading line unless quiet */
-
-if (!quiet) fprintf(outfile, "PCRE version %s\n\n", version);
-
-/* Main loop */
-
-while (!done)
- {
- pcre *re = NULL;
- pcre_extra *extra = NULL;
-
-#if !defined NOPOSIX /* There are still compilers that require no indent */
- regex_t preg;
- int do_posix = 0;
-#endif
-
- const char *error;
- pcre_uint8 *markptr;
- pcre_uint8 *p, *pp, *ppp;
- pcre_uint8 *to_file = NULL;
- const pcre_uint8 *tables = NULL;
- unsigned long int get_options;
- unsigned long int true_size, true_study_size = 0;
- size_t size;
- int do_allcaps = 0;
- int do_mark = 0;
- int do_study = 0;
- int no_force_study = 0;
- int do_debug = debug;
- int do_G = 0;
- int do_g = 0;
- int do_showinfo = showinfo;
- int do_showrest = 0;
- int do_showcaprest = 0;
- int do_flip = 0;
- int erroroffset, len, delimiter, poffset;
-
-#if !defined NODFA
- int dfa_matched = 0;
-#endif
-
- use_utf = 0;
- debug_lengths = 1;
- SET_PCRE_STACK_GUARD(NULL);
-
- if (extend_inputline(infile, buffer, " re> ") == NULL) break;
- if (infile != stdin) fprintf(outfile, "%s", (char *)buffer);
- fflush(outfile);
-
- p = buffer;
- while (isspace(*p)) p++;
- if (*p == 0) continue;
-
- /* Handle option lock-out setting */
-
- if (*p == '<' && p[1] == ' ')
- {
- p += 2;
- while (isspace(*p)) p++;
- if (strncmp((char *)p, "forbid ", 7) == 0)
- {
- p += 7;
- while (isspace(*p)) p++;
- pp = lockout;
- while (!isspace(*p) && pp < lockout + sizeof(lockout) - 1)
- *pp++ = *p++;
- *pp = 0;
- }
- else
- {
- printf("** Unrecognized special command '%s'\n", p);
- yield = 1;
- goto EXIT;
- }
- continue;
- }
-
- /* See if the pattern is to be loaded pre-compiled from a file. */
-
- if (*p == '<' && strchr((char *)(p+1), '<') == NULL)
- {
- pcre_uint32 magic;
- pcre_uint8 sbuf[8];
- FILE *f;
-
- p++;
- if (*p == '!')
- {
- do_debug = TRUE;
- do_showinfo = TRUE;
- p++;
- }
-
- pp = p + (int)strlen((char *)p);
- while (isspace(pp[-1])) pp--;
- *pp = 0;
-
- f = fopen((char *)p, "rb");
- if (f == NULL)
- {
- fprintf(outfile, "Failed to open %s: %s\n", p, strerror(errno));
- continue;
- }
- if (fread(sbuf, 1, 8, f) != 8) goto FAIL_READ;
-
- true_size =
- (sbuf[0] << 24) | (sbuf[1] << 16) | (sbuf[2] << 8) | sbuf[3];
- true_study_size =
- (sbuf[4] << 24) | (sbuf[5] << 16) | (sbuf[6] << 8) | sbuf[7];
-
- re = (pcre *)new_malloc(true_size);
- if (re == NULL)
- {
- printf("** Failed to get %d bytes of memory for pcre object\n",
- (int)true_size);
- yield = 1;
- goto EXIT;
- }
- if (fread(re, 1, true_size, f) != true_size) goto FAIL_READ;
-
- magic = REAL_PCRE_MAGIC(re);
- if (magic != MAGIC_NUMBER)
- {
- if (swap_uint32(magic) == MAGIC_NUMBER)
- {
- do_flip = 1;
- }
- else
- {
- fprintf(outfile, "Data in %s is not a compiled PCRE regex\n", p);
- new_free(re);
- fclose(f);
- continue;
- }
- }
-
- /* We hide the byte-invert info for little and big endian tests. */
- fprintf(outfile, "Compiled pattern%s loaded from %s\n",
- do_flip && (p[-1] == '<') ? " (byte-inverted)" : "", p);
-
- /* Now see if there is any following study data. */
-
- if (true_study_size != 0)
- {
- pcre_study_data *psd;
-
- extra = (pcre_extra *)new_malloc(sizeof(pcre_extra) + true_study_size);
- extra->flags = PCRE_EXTRA_STUDY_DATA;
-
- psd = (pcre_study_data *)(((char *)extra) + sizeof(pcre_extra));
- extra->study_data = psd;
-
- if (fread(psd, 1, true_study_size, f) != true_study_size)
- {
- FAIL_READ:
- fprintf(outfile, "Failed to read data from %s\n", p);
- if (extra != NULL)
- {
- PCRE_FREE_STUDY(extra);
- }
- new_free(re);
- fclose(f);
- continue;
- }
- fprintf(outfile, "Study data loaded from %s\n", p);
- do_study = 1; /* To get the data output if requested */
- }
- else fprintf(outfile, "No study data\n");
-
- /* Flip the necessary bytes. */
- if (do_flip)
- {
- int rc;
- PCRE_PATTERN_TO_HOST_BYTE_ORDER(rc, re, extra, NULL);
- if (rc == PCRE_ERROR_BADMODE)
- {
- pcre_uint32 flags_in_host_byte_order;
- if (REAL_PCRE_MAGIC(re) == MAGIC_NUMBER)
- flags_in_host_byte_order = REAL_PCRE_FLAGS(re);
- else
- flags_in_host_byte_order = swap_uint32(REAL_PCRE_FLAGS(re));
- /* Simulate the result of the function call below. */
- fprintf(outfile, "Error %d from pcre%s_fullinfo(%d)\n", rc,
- pcre_mode == PCRE32_MODE ? "32" : pcre_mode == PCRE16_MODE ? "16" : "",
- PCRE_INFO_OPTIONS);
- fprintf(outfile, "Running in %d-bit mode but pattern was compiled in "
- "%d-bit mode\n", 8 * CHAR_SIZE, 8 * (flags_in_host_byte_order & PCRE_MODE_MASK));
- new_free(re);
- fclose(f);
- continue;
- }
- }
-
- /* Need to know if UTF-8 for printing data strings. */
-
- if (new_info(re, NULL, PCRE_INFO_OPTIONS, &get_options) < 0)
- {
- new_free(re);
- fclose(f);
- continue;
- }
- use_utf = (get_options & PCRE_UTF8) != 0;
-
- fclose(f);
- goto SHOW_INFO;
- }
-
- /* In-line pattern (the usual case). Get the delimiter and seek the end of
- the pattern; if it isn't complete, read more. */
-
- delimiter = *p++;
-
- if (isalnum(delimiter) || delimiter == '\\')
- {
- fprintf(outfile, "** Delimiter must not be alphanumeric or \\\n");
- goto SKIP_DATA;
- }
-
- pp = p;
- poffset = (int)(p - buffer);
-
- for(;;)
- {
- while (*pp != 0)
- {
- if (*pp == '\\' && pp[1] != 0) pp++;
- else if (*pp == delimiter) break;
- pp++;
- }
- if (*pp != 0) break;
- if ((pp = extend_inputline(infile, pp, " > ")) == NULL)
- {
- fprintf(outfile, "** Unexpected EOF\n");
- done = 1;
- goto CONTINUE;
- }
- if (infile != stdin) fprintf(outfile, "%s", (char *)pp);
- }
-
- /* The buffer may have moved while being extended; reset the start of data
- pointer to the correct relative point in the buffer. */
-
- p = buffer + poffset;
-
- /* If the first character after the delimiter is backslash, make
- the pattern end with backslash. This is purely to provide a way
- of testing for the error message when a pattern ends with backslash. */
-
- if (pp[1] == '\\') *pp++ = '\\';
-
- /* Terminate the pattern at the delimiter, and save a copy of the pattern
- for callouts. */
-
- *pp++ = 0;
- strcpy((char *)pbuffer, (char *)p);
-
- /* Look for modifiers and options after the final delimiter. */
-
- options = default_options;
- study_options = force_study_options;
- log_store = showstore; /* default from command line */
-
- while (*pp != 0)
- {
- /* Check to see whether this modifier has been locked out for this file.
- This is complicated for the multi-character options that begin with '<'.
- If there is no '>' in the lockout string, all multi-character modifiers are
- locked out. */
-
- if (strchr((char *)lockout, *pp) != NULL)
- {
- if (*pp == '<' && strchr((char *)lockout, '>') != NULL)
- {
- int x = check_mc_option(pp+1, outfile, FALSE, "modifier");
- if (x == 0) goto SKIP_DATA;
-
- for (ppp = lockout; *ppp != 0; ppp++)
- {
- if (*ppp == '<')
- {
- int y = check_mc_option(ppp+1, outfile, FALSE, "modifier");
- if (y == 0)
- {
- printf("** Error in modifier forbid data - giving up.\n");
- yield = 1;
- goto EXIT;
- }
- if (x == y)
- {
- ppp = pp;
- while (*ppp != '>') ppp++;
- printf("** The %.*s modifier is locked out - giving up.\n",
- (int)(ppp - pp + 1), pp);
- yield = 1;
- goto EXIT;
- }
- }
- }
- }
-
- /* The single-character modifiers are straightforward. */
-
- else
- {
- printf("** The /%c modifier is locked out - giving up.\n", *pp);
- yield = 1;
- goto EXIT;
- }
- }
-
- /* The modifier is not locked out; handle it. */
-
- switch (*pp++)
- {
- case 'f': options |= PCRE_FIRSTLINE; break;
- case 'g': do_g = 1; break;
- case 'i': options |= PCRE_CASELESS; break;
- case 'm': options |= PCRE_MULTILINE; break;
- case 's': options |= PCRE_DOTALL; break;
- case 'x': options |= PCRE_EXTENDED; break;
-
- case '+':
- if (do_showrest) do_showcaprest = 1; else do_showrest = 1;
- break;
-
- case '=': do_allcaps = 1; break;
- case 'A': options |= PCRE_ANCHORED; break;
- case 'B': do_debug = 1; break;
- case 'C': options |= PCRE_AUTO_CALLOUT; break;
- case 'D': do_debug = do_showinfo = 1; break;
- case 'E': options |= PCRE_DOLLAR_ENDONLY; break;
- case 'F': do_flip = 1; break;
- case 'G': do_G = 1; break;
- case 'I': do_showinfo = 1; break;
- case 'J': options |= PCRE_DUPNAMES; break;
- case 'K': do_mark = 1; break;
- case 'M': log_store = 1; break;
- case 'N': options |= PCRE_NO_AUTO_CAPTURE; break;
- case 'O': options |= PCRE_NO_AUTO_POSSESS; break;
-
-#if !defined NOPOSIX
- case 'P': do_posix = 1; break;
-#endif
-
- case 'Q':
- switch (*pp)
- {
- case '0':
- case '1':
- stack_guard_return = *pp++ - '0';
- break;
-
- default:
- fprintf(outfile, "** Missing 0 or 1 after /Q\n");
- goto SKIP_DATA;
- }
- SET_PCRE_STACK_GUARD(stack_guard);
- break;
-
- case 'S':
- do_study = 1;
- for (;;)
- {
- switch (*pp++)
- {
- case 'S':
- do_study = 0;
- no_force_study = 1;
- break;
-
- case '!':
- study_options |= PCRE_STUDY_EXTRA_NEEDED;
- break;
-
- case '+':
- if (*pp == '+')
- {
- verify_jit = TRUE;
- pp++;
- }
- if (*pp >= '1' && *pp <= '7')
- study_options |= jit_study_bits[*pp++ - '1'];
- else
- study_options |= jit_study_bits[6];
- break;
-
- case '-':
- study_options &= ~PCRE_STUDY_ALLJIT;
- break;
-
- default:
- pp--;
- goto ENDLOOP;
- }
- }
- ENDLOOP:
- break;
-
- case 'U': options |= PCRE_UNGREEDY; break;
- case 'W': options |= PCRE_UCP; break;
- case 'X': options |= PCRE_EXTRA; break;
- case 'Y': options |= PCRE_NO_START_OPTIMISE; break;
- case 'Z': debug_lengths = 0; break;
- case '8': options |= PCRE_UTF8; use_utf = 1; break;
- case '9': options |= PCRE_NEVER_UTF; break;
- case '?': options |= PCRE_NO_UTF8_CHECK; break;
-
- case 'T':
- switch (*pp++)
- {
- case '0': tables = tables0; break;
- case '1': tables = tables1; break;
-
- case '\r':
- case '\n':
- case ' ':
- case 0:
- fprintf(outfile, "** Missing table number after /T\n");
- goto SKIP_DATA;
-
- default:
- fprintf(outfile, "** Bad table number \"%c\" after /T\n", pp[-1]);
- goto SKIP_DATA;
- }
- break;
-
- case 'L':
- ppp = pp;
- /* The '\r' test here is so that it works on Windows. */
- /* The '0' test is just in case this is an unterminated line. */
- while (*ppp != 0 && *ppp != '\n' && *ppp != '\r' && *ppp != ' ') ppp++;
- *ppp = 0;
- if (setlocale(LC_CTYPE, (const char *)pp) == NULL)
- {
- fprintf(outfile, "** Failed to set locale \"%s\"\n", pp);
- goto SKIP_DATA;
- }
- locale_set = 1;
- tables = PCRE_MAKETABLES;
- pp = ppp;
- break;
-
- case '>':
- to_file = pp;
- while (*pp != 0) pp++;
- while (isspace(pp[-1])) pp--;
- *pp = 0;
- break;
-
- case '<':
- {
- int x = check_mc_option(pp, outfile, FALSE, "modifier");
- if (x == 0) goto SKIP_DATA;
- options |= x;
- while (*pp++ != '>');
- }
- break;
-
- case '\r': /* So that it works in Windows */
- case '\n':
- case ' ':
- break;
-
- default:
- fprintf(outfile, "** Unknown modifier '%c'\n", pp[-1]);
- goto SKIP_DATA;
- }
- }
-
- /* Handle compiling via the POSIX interface, which doesn't support the
- timing, showing, or debugging options, nor the ability to pass over
- local character tables. Neither does it have 16-bit support. */
-
-#if !defined NOPOSIX
- if (posix || do_posix)
- {
- int rc;
- int cflags = 0;
-
- if ((options & PCRE_CASELESS) != 0) cflags |= REG_ICASE;
- if ((options & PCRE_MULTILINE) != 0) cflags |= REG_NEWLINE;
- if ((options & PCRE_DOTALL) != 0) cflags |= REG_DOTALL;
- if ((options & PCRE_NO_AUTO_CAPTURE) != 0) cflags |= REG_NOSUB;
- if ((options & PCRE_UTF8) != 0) cflags |= REG_UTF8;
- if ((options & PCRE_UCP) != 0) cflags |= REG_UCP;
- if ((options & PCRE_UNGREEDY) != 0) cflags |= REG_UNGREEDY;
-
- rc = regcomp(&preg, (char *)p, cflags);
-
- /* Compilation failed; go back for another re, skipping to blank line
- if non-interactive. */
-
- if (rc != 0)
- {
- (void)regerror(rc, &preg, (char *)buffer, buffer_size);
- fprintf(outfile, "Failed: POSIX code %d: %s\n", rc, buffer);
- goto SKIP_DATA;
- }
- }
-
- /* Handle compiling via the native interface */
-
- else
-#endif /* !defined NOPOSIX */
-
- {
- /* In 16- or 32-bit mode, convert the input. */
-
-#ifdef SUPPORT_PCRE16
- if (pcre_mode == PCRE16_MODE)
- {
- switch(to16(FALSE, p, options & PCRE_UTF8, (int)strlen((char *)p)))
- {
- case -1:
- fprintf(outfile, "**Failed: invalid UTF-8 string cannot be "
- "converted to UTF-16\n");
- goto SKIP_DATA;
-
- case -2:
- fprintf(outfile, "**Failed: character value greater than 0x10ffff "
- "cannot be converted to UTF-16\n");
- goto SKIP_DATA;
-
- case -3: /* "Impossible error" when to16 is called arg1 FALSE */
- fprintf(outfile, "**Failed: character value greater than 0xffff "
- "cannot be converted to 16-bit in non-UTF mode\n");
- goto SKIP_DATA;
-
- default:
- break;
- }
- p = (pcre_uint8 *)buffer16;
- }
-#endif
-
-#ifdef SUPPORT_PCRE32
- if (pcre_mode == PCRE32_MODE)
- {
- switch(to32(FALSE, p, options & PCRE_UTF32, (int)strlen((char *)p)))
- {
- case -1:
- fprintf(outfile, "**Failed: invalid UTF-8 string cannot be "
- "converted to UTF-32\n");
- goto SKIP_DATA;
-
- case -2:
- fprintf(outfile, "**Failed: character value greater than 0x10ffff "
- "cannot be converted to UTF-32\n");
- goto SKIP_DATA;
-
- case -3:
- fprintf(outfile, "**Failed: character value is ill-formed UTF-32\n");
- goto SKIP_DATA;
-
- default:
- break;
- }
- p = (pcre_uint8 *)buffer32;
- }
-#endif
-
- /* Compile many times when timing */
-
- if (timeit > 0)
- {
- register int i;
- clock_t time_taken;
- clock_t start_time = clock();
- for (i = 0; i < timeit; i++)
- {
- PCRE_COMPILE(re, p, options, &error, &erroroffset, tables);
- if (re != NULL) free(re);
- }
- total_compile_time += (time_taken = clock() - start_time);
- fprintf(outfile, "Compile time %.4f milliseconds\n",
- (((double)time_taken * 1000.0) / (double)timeit) /
- (double)CLOCKS_PER_SEC);
- }
-
- PCRE_COMPILE(re, p, options, &error, &erroroffset, tables);
-
- /* Compilation failed; go back for another re, skipping to blank line
- if non-interactive. */
-
- if (re == NULL)
- {
- fprintf(outfile, "Failed: %s at offset %d\n", error, erroroffset);
- SKIP_DATA:
- if (infile != stdin)
- {
- for (;;)
- {
- if (extend_inputline(infile, buffer, NULL) == NULL)
- {
- done = 1;
- goto CONTINUE;
- }
- len = (int)strlen((char *)buffer);
- while (len > 0 && isspace(buffer[len-1])) len--;
- if (len == 0) break;
- }
- fprintf(outfile, "\n");
- }
- goto CONTINUE;
- }
-
- /* Compilation succeeded. It is now possible to set the UTF-8 option from
- within the regex; check for this so that we know how to process the data
- lines. */
-
- if (new_info(re, NULL, PCRE_INFO_OPTIONS, &get_options) < 0)
- goto SKIP_DATA;
- if ((get_options & PCRE_UTF8) != 0) use_utf = 1;
-
- /* Extract the size for possible writing before possibly flipping it,
- and remember the store that was got. */
-
- true_size = REAL_PCRE_SIZE(re);
-
- /* Output code size information if requested */
-
- if (log_store)
- {
- int name_count, name_entry_size, real_pcre_size;
-
- new_info(re, NULL, PCRE_INFO_NAMECOUNT, &name_count);
- new_info(re, NULL, PCRE_INFO_NAMEENTRYSIZE, &name_entry_size);
- real_pcre_size = 0;
-#ifdef SUPPORT_PCRE8
- if (REAL_PCRE_FLAGS(re) & PCRE_MODE8)
- real_pcre_size = sizeof(real_pcre);
-#endif
-#ifdef SUPPORT_PCRE16
- if (REAL_PCRE_FLAGS(re) & PCRE_MODE16)
- real_pcre_size = sizeof(real_pcre16);
-#endif
-#ifdef SUPPORT_PCRE32
- if (REAL_PCRE_FLAGS(re) & PCRE_MODE32)
- real_pcre_size = sizeof(real_pcre32);
-#endif
- new_info(re, NULL, PCRE_INFO_SIZE, &size);
- fprintf(outfile, "Memory allocation (code space): %d\n",
- (int)(size - real_pcre_size - name_count * name_entry_size));
- }
-
- /* If -s or /S was present, study the regex to generate additional info to
- help with the matching, unless the pattern has the SS option, which
- suppresses the effect of /S (used for a few test patterns where studying is
- never sensible). */
-
- if (do_study || (force_study >= 0 && !no_force_study))
- {
- if (timeit > 0)
- {
- register int i;
- clock_t time_taken;
- clock_t start_time = clock();
- for (i = 0; i < timeit; i++)
- {
- PCRE_STUDY(extra, re, study_options, &error);
- }
- total_study_time = (time_taken = clock() - start_time);
- if (extra != NULL)
- {
- PCRE_FREE_STUDY(extra);
- }
- fprintf(outfile, " Study time %.4f milliseconds\n",
- (((double)time_taken * 1000.0) / (double)timeit) /
- (double)CLOCKS_PER_SEC);
- }
- PCRE_STUDY(extra, re, study_options, &error);
- if (error != NULL)
- fprintf(outfile, "Failed to study: %s\n", error);
- else if (extra != NULL)
- {
- true_study_size = ((pcre_study_data *)(extra->study_data))->size;
- if (log_store)
- {
- size_t jitsize;
- if (new_info(re, extra, PCRE_INFO_JITSIZE, &jitsize) == 0 &&
- jitsize != 0)
- fprintf(outfile, "Memory allocation (JIT code): %d\n", (int)jitsize);
- }
- }
- }
-
- /* If /K was present, we set up for handling MARK data. */
-
- if (do_mark)
- {
- if (extra == NULL)
- {
- extra = (pcre_extra *)malloc(sizeof(pcre_extra));
- extra->flags = 0;
- }
- extra->mark = &markptr;
- extra->flags |= PCRE_EXTRA_MARK;
- }
-
- /* Extract and display information from the compiled data if required. */
-
- SHOW_INFO:
-
- if (do_debug)
- {
- fprintf(outfile, "------------------------------------------------------------------\n");
- PCRE_PRINTINT(re, outfile, debug_lengths);
- }
-
- /* We already have the options in get_options (see above) */
-
- if (do_showinfo)
- {
- unsigned long int all_options;
- pcre_uint32 first_char, need_char;
- pcre_uint32 match_limit, recursion_limit;
- int count, backrefmax, first_char_set, need_char_set, okpartial, jchanged,
- hascrorlf, maxlookbehind, match_empty;
- int nameentrysize, namecount;
- const pcre_uint8 *nametable;
-
- if (new_info(re, NULL, PCRE_INFO_CAPTURECOUNT, &count) +
- new_info(re, NULL, PCRE_INFO_BACKREFMAX, &backrefmax) +
- new_info(re, NULL, PCRE_INFO_FIRSTCHARACTER, &first_char) +
- new_info(re, NULL, PCRE_INFO_FIRSTCHARACTERFLAGS, &first_char_set) +
- new_info(re, NULL, PCRE_INFO_REQUIREDCHAR, &need_char) +
- new_info(re, NULL, PCRE_INFO_REQUIREDCHARFLAGS, &need_char_set) +
- new_info(re, NULL, PCRE_INFO_NAMEENTRYSIZE, &nameentrysize) +
- new_info(re, NULL, PCRE_INFO_NAMECOUNT, &namecount) +
- new_info(re, NULL, PCRE_INFO_NAMETABLE, (void *)&nametable) +
- new_info(re, NULL, PCRE_INFO_OKPARTIAL, &okpartial) +
- new_info(re, NULL, PCRE_INFO_JCHANGED, &jchanged) +
- new_info(re, NULL, PCRE_INFO_HASCRORLF, &hascrorlf) +
- new_info(re, NULL, PCRE_INFO_MATCH_EMPTY, &match_empty) +
- new_info(re, NULL, PCRE_INFO_MAXLOOKBEHIND, &maxlookbehind)
- != 0)
- goto SKIP_DATA;
-
- fprintf(outfile, "Capturing subpattern count = %d\n", count);
-
- if (backrefmax > 0)
- fprintf(outfile, "Max back reference = %d\n", backrefmax);
-
- if (maxlookbehind > 0)
- fprintf(outfile, "Max lookbehind = %d\n", maxlookbehind);
-
- if (new_info(re, NULL, PCRE_INFO_MATCHLIMIT, &match_limit) == 0)
- fprintf(outfile, "Match limit = %u\n", match_limit);
-
- if (new_info(re, NULL, PCRE_INFO_RECURSIONLIMIT, &recursion_limit) == 0)
- fprintf(outfile, "Recursion limit = %u\n", recursion_limit);
-
- if (namecount > 0)
- {
- fprintf(outfile, "Named capturing subpatterns:\n");
- while (namecount-- > 0)
- {
- int imm2_size = pcre_mode == PCRE8_MODE ? 2 : 1;
- int length = (int)STRLEN(nametable + imm2_size);
- fprintf(outfile, " ");
- PCHARSV(nametable, imm2_size, length, outfile);
- while (length++ < nameentrysize - imm2_size) putc(' ', outfile);
-#ifdef SUPPORT_PCRE32
- if (pcre_mode == PCRE32_MODE)
- fprintf(outfile, "%3d\n", (int)(((PCRE_SPTR32)nametable)[0]));
-#endif
-#ifdef SUPPORT_PCRE16
- if (pcre_mode == PCRE16_MODE)
- fprintf(outfile, "%3d\n", (int)(((PCRE_SPTR16)nametable)[0]));
-#endif
-#ifdef SUPPORT_PCRE8
- if (pcre_mode == PCRE8_MODE)
- fprintf(outfile, "%3d\n", ((int)nametable[0] << 8) | (int)nametable[1]);
-#endif
- nametable += nameentrysize * CHAR_SIZE;
- }
- }
-
- if (!okpartial) fprintf(outfile, "Partial matching not supported\n");
- if (hascrorlf) fprintf(outfile, "Contains explicit CR or LF match\n");
- if (match_empty) fprintf(outfile, "May match empty string\n");
-
- all_options = REAL_PCRE_OPTIONS(re);
- if (do_flip) all_options = swap_uint32(all_options);
-
- if (get_options == 0) fprintf(outfile, "No options\n");
- else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
- ((get_options & PCRE_ANCHORED) != 0)? " anchored" : "",
- ((get_options & PCRE_CASELESS) != 0)? " caseless" : "",
- ((get_options & PCRE_EXTENDED) != 0)? " extended" : "",
- ((get_options & PCRE_MULTILINE) != 0)? " multiline" : "",
- ((get_options & PCRE_FIRSTLINE) != 0)? " firstline" : "",
- ((get_options & PCRE_DOTALL) != 0)? " dotall" : "",
- ((get_options & PCRE_BSR_ANYCRLF) != 0)? " bsr_anycrlf" : "",
- ((get_options & PCRE_BSR_UNICODE) != 0)? " bsr_unicode" : "",
- ((get_options & PCRE_DOLLAR_ENDONLY) != 0)? " dollar_endonly" : "",
- ((get_options & PCRE_EXTRA) != 0)? " extra" : "",
- ((get_options & PCRE_UNGREEDY) != 0)? " ungreedy" : "",
- ((get_options & PCRE_NO_AUTO_CAPTURE) != 0)? " no_auto_capture" : "",
- ((get_options & PCRE_NO_AUTO_POSSESS) != 0)? " no_auto_possessify" : "",
- ((get_options & PCRE_UTF8) != 0)? " utf" : "",
- ((get_options & PCRE_UCP) != 0)? " ucp" : "",
- ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf_check" : "",
- ((get_options & PCRE_NO_START_OPTIMIZE) != 0)? " no_start_optimize" : "",
- ((get_options & PCRE_DUPNAMES) != 0)? " dupnames" : "",
- ((get_options & PCRE_NEVER_UTF) != 0)? " never_utf" : "");
-
- if (jchanged) fprintf(outfile, "Duplicate name status changes\n");
-
- switch (get_options & PCRE_NEWLINE_BITS)
- {
- case PCRE_NEWLINE_CR:
- fprintf(outfile, "Forced newline sequence: CR\n");
- break;
-
- case PCRE_NEWLINE_LF:
- fprintf(outfile, "Forced newline sequence: LF\n");
- break;
-
- case PCRE_NEWLINE_CRLF:
- fprintf(outfile, "Forced newline sequence: CRLF\n");
- break;
-
- case PCRE_NEWLINE_ANYCRLF:
- fprintf(outfile, "Forced newline sequence: ANYCRLF\n");
- break;
-
- case PCRE_NEWLINE_ANY:
- fprintf(outfile, "Forced newline sequence: ANY\n");
- break;
-
- default:
- break;
- }
-
- if (first_char_set == 2)
- {
- fprintf(outfile, "First char at start or follows newline\n");
- }
- else if (first_char_set == 1)
- {
- const char *caseless =
- ((REAL_PCRE_FLAGS(re) & PCRE_FCH_CASELESS) == 0)?
- "" : " (caseless)";
-
- if (PRINTOK(first_char))
- fprintf(outfile, "First char = \'%c\'%s\n", first_char, caseless);
- else
- {
- fprintf(outfile, "First char = ");
- pchar(first_char, outfile);
- fprintf(outfile, "%s\n", caseless);
- }
- }
- else
- {
- fprintf(outfile, "No first char\n");
- }
-
- if (need_char_set == 0)
- {
- fprintf(outfile, "No need char\n");
- }
- else
- {
- const char *caseless =
- ((REAL_PCRE_FLAGS(re) & PCRE_RCH_CASELESS) == 0)?
- "" : " (caseless)";
-
- if (PRINTOK(need_char))
- fprintf(outfile, "Need char = \'%c\'%s\n", need_char, caseless);
- else
- {
- fprintf(outfile, "Need char = ");
- pchar(need_char, outfile);
- fprintf(outfile, "%s\n", caseless);
- }
- }
-
- /* Don't output study size; at present it is in any case a fixed
- value, but it varies, depending on the computer architecture, and
- so messes up the test suite. (And with the /F option, it might be
- flipped.) If study was forced by an external -s, don't show this
- information unless -i or -d was also present. This means that, except
- when auto-callouts are involved, the output from runs with and without
- -s should be identical. */
-
- if (do_study || (force_study >= 0 && showinfo && !no_force_study))
- {
- if (extra == NULL)
- fprintf(outfile, "Study returned NULL\n");
- else
- {
- pcre_uint8 *start_bits = NULL;
- int minlength;
-
- if (new_info(re, extra, PCRE_INFO_MINLENGTH, &minlength) == 0)
- fprintf(outfile, "Subject length lower bound = %d\n", minlength);
-
- if (new_info(re, extra, PCRE_INFO_FIRSTTABLE, &start_bits) == 0)
- {
- if (start_bits == NULL)
- fprintf(outfile, "No starting char list\n");
- else
- {
- int i;
- int c = 24;
- fprintf(outfile, "Starting chars: ");
- for (i = 0; i < 256; i++)
- {
- if ((start_bits[i/8] & (1<<(i&7))) != 0)
- {
- if (c > 75)
- {
- fprintf(outfile, "\n ");
- c = 2;
- }
- if (PRINTOK(i) && i != ' ')
- {
- fprintf(outfile, "%c ", i);
- c += 2;
- }
- else
- {
- fprintf(outfile, "\\x%02x ", i);
- c += 5;
- }
- }
- }
- fprintf(outfile, "\n");
- }
- }
- }
-
- /* Show this only if the JIT was set by /S, not by -s. */
-
- if ((study_options & PCRE_STUDY_ALLJIT) != 0 &&
- (force_study_options & PCRE_STUDY_ALLJIT) == 0)
- {
- int jit;
- if (new_info(re, extra, PCRE_INFO_JIT, &jit) == 0)
- {
- if (jit)
- fprintf(outfile, "JIT study was successful\n");
- else
-#ifdef SUPPORT_JIT
- fprintf(outfile, "JIT study was not successful\n");
-#else
- fprintf(outfile, "JIT support is not available in this version of PCRE\n");
-#endif
- }
- }
- }
- }
-
- /* If the '>' option was present, we write out the regex to a file, and
- that is all. The first 8 bytes of the file are the regex length and then
- the study length, in big-endian order. */
-
- if (to_file != NULL)
- {
- FILE *f = fopen((char *)to_file, "wb");
- if (f == NULL)
- {
- fprintf(outfile, "Unable to open %s: %s\n", to_file, strerror(errno));
- }
- else
- {
- pcre_uint8 sbuf[8];
-
- if (do_flip) regexflip(re, extra);
- sbuf[0] = (pcre_uint8)((true_size >> 24) & 255);
- sbuf[1] = (pcre_uint8)((true_size >> 16) & 255);
- sbuf[2] = (pcre_uint8)((true_size >> 8) & 255);
- sbuf[3] = (pcre_uint8)((true_size) & 255);
- sbuf[4] = (pcre_uint8)((true_study_size >> 24) & 255);
- sbuf[5] = (pcre_uint8)((true_study_size >> 16) & 255);
- sbuf[6] = (pcre_uint8)((true_study_size >> 8) & 255);
- sbuf[7] = (pcre_uint8)((true_study_size) & 255);
-
- if (fwrite(sbuf, 1, 8, f) < 8 ||
- fwrite(re, 1, true_size, f) < true_size)
- {
- fprintf(outfile, "Write error on %s: %s\n", to_file, strerror(errno));
- }
- else
- {
- fprintf(outfile, "Compiled pattern written to %s\n", to_file);
-
- /* If there is study data, write it. */
-
- if (extra != NULL)
- {
- if (fwrite(extra->study_data, 1, true_study_size, f) <
- true_study_size)
- {
- fprintf(outfile, "Write error on %s: %s\n", to_file,
- strerror(errno));
- }
- else fprintf(outfile, "Study data written to %s\n", to_file);
- }
- }
- fclose(f);
- }
-
- new_free(re);
- if (extra != NULL)
- {
- PCRE_FREE_STUDY(extra);
- }
- if (locale_set)
- {
- new_free((void *)tables);
- setlocale(LC_CTYPE, "C");
- locale_set = 0;
- }
- continue; /* With next regex */
- }
- } /* End of non-POSIX compile */
-
- /* Read data lines and test them */
-
- for (;;)
- {
-#ifdef SUPPORT_PCRE8
- pcre_uint8 *q8;
-#endif
-#ifdef SUPPORT_PCRE16
- pcre_uint16 *q16;
-#endif
-#ifdef SUPPORT_PCRE32
- pcre_uint32 *q32;
-#endif
- pcre_uint8 *bptr;
- int *use_offsets = offsets;
- int use_size_offsets = size_offsets;
- int callout_data = 0;
- int callout_data_set = 0;
- int count;
- pcre_uint32 c;
- int copystrings = 0;
- int find_match_limit = default_find_match_limit;
- int getstrings = 0;
- int getlist = 0;
- int gmatched = 0;
- int start_offset = 0;
- int start_offset_sign = 1;
- int g_notempty = 0;
- int use_dfa = 0;
-
- *copynames = 0;
- *getnames = 0;
-
-#ifdef SUPPORT_PCRE32
- cn32ptr = copynames;
- gn32ptr = getnames;
-#endif
-#ifdef SUPPORT_PCRE16
- cn16ptr = copynames16;
- gn16ptr = getnames16;
-#endif
-#ifdef SUPPORT_PCRE8
- cn8ptr = copynames8;
- gn8ptr = getnames8;
-#endif
-
- SET_PCRE_CALLOUT(callout);
- first_callout = 1;
- last_callout_mark = NULL;
- callout_extra = 0;
- callout_count = 0;
- callout_fail_count = 999999;
- callout_fail_id = -1;
- show_malloc = 0;
- options = 0;
-
- if (extra != NULL) extra->flags &=
- ~(PCRE_EXTRA_MATCH_LIMIT|PCRE_EXTRA_MATCH_LIMIT_RECURSION);
-
- len = 0;
- for (;;)
- {
- if (extend_inputline(infile, buffer + len, "data> ") == NULL)
- {
- if (len > 0) /* Reached EOF without hitting a newline */
- {
- fprintf(outfile, "\n");
- break;
- }
- done = 1;
- goto CONTINUE;
- }
- if (infile != stdin) fprintf(outfile, "%s", (char *)buffer);
- len = (int)strlen((char *)buffer);
- if (buffer[len-1] == '\n') break;
- }
-
- while (len > 0 && isspace(buffer[len-1])) len--;
- buffer[len] = 0;
- if (len == 0) break;
-
- p = buffer;
- while (isspace(*p)) p++;
-
-#ifndef NOUTF
- /* Check that the data is well-formed UTF-8 if we're in UTF mode. To create
- invalid input to pcre_exec, you must use \x?? or \x{} sequences. */
-
- if (use_utf)
- {
- pcre_uint8 *q;
- pcre_uint32 cc;
- int n = 1;
-
- for (q = p; n > 0 && *q; q += n) n = utf82ord(q, &cc);
- if (n <= 0)
- {
- fprintf(outfile, "**Failed: invalid UTF-8 string cannot be used as input in UTF mode\n");
- goto NEXT_DATA;
- }
- }
-#endif
-
-#ifdef SUPPORT_VALGRIND
- /* Mark the dbuffer as addressable but undefined again. */
-
- if (dbuffer != NULL)
- {
- VALGRIND_MAKE_MEM_UNDEFINED(dbuffer, dbuffer_size * CHAR_SIZE);
- }
-#endif
-
- /* Allocate a buffer to hold the data line; len+1 is an upper bound on
- the number of pcre_uchar units that will be needed. */
-
- while (dbuffer == NULL || (size_t)len >= dbuffer_size)
- {
- dbuffer_size *= 2;
- dbuffer = (pcre_uint8 *)realloc(dbuffer, dbuffer_size * CHAR_SIZE);
- if (dbuffer == NULL)
- {
- fprintf(stderr, "pcretest: realloc(%d) failed\n", (int)dbuffer_size);
- exit(1);
- }
- }
-
-#ifdef SUPPORT_PCRE8
- q8 = (pcre_uint8 *) dbuffer;
-#endif
-#ifdef SUPPORT_PCRE16
- q16 = (pcre_uint16 *) dbuffer;
-#endif
-#ifdef SUPPORT_PCRE32
- q32 = (pcre_uint32 *) dbuffer;
-#endif
-
- while ((c = *p++) != 0)
- {
- int i = 0;
- int n = 0;
-
- /* In UTF mode, input can be UTF-8, so just copy all non-backslash bytes.
- In non-UTF mode, allow the value of the byte to fall through to later,
- where values greater than 127 are turned into UTF-8 when running in
- 16-bit or 32-bit mode. */
-
- if (c != '\\')
- {
-#ifndef NOUTF
- if (use_utf && HASUTF8EXTRALEN(c)) { GETUTF8INC(c, p); }
-#endif
- }
-
- /* Handle backslash escapes */
-
- else switch ((c = *p++))
- {
- case 'a': c = 7; break;
- case 'b': c = '\b'; break;
- case 'e': c = 27; break;
- case 'f': c = '\f'; break;
- case 'n': c = '\n'; break;
- case 'r': c = '\r'; break;
- case 't': c = '\t'; break;
- case 'v': c = '\v'; break;
-
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- c -= '0';
- while (i++ < 2 && isdigit(*p) && *p != '8' && *p != '9')
- c = c * 8 + *p++ - '0';
- break;
-
- case 'o':
- if (*p == '{')
- {
- pcre_uint8 *pt = p;
- c = 0;
- for (pt++; isdigit(*pt) && *pt != '8' && *pt != '9'; pt++)
- {
- if (++i == 12)
- fprintf(outfile, "** Too many octal digits in \\o{...} item; "
- "using only the first twelve.\n");
- else c = c * 8 + *pt - '0';
- }
- if (*pt == '}') p = pt + 1;
- else fprintf(outfile, "** Missing } after \\o{ (assumed)\n");
- }
- break;
-
- case 'x':
- if (*p == '{')
- {
- pcre_uint8 *pt = p;
- c = 0;
-
- /* We used to have "while (isxdigit(*(++pt)))" here, but it fails
- when isxdigit() is a macro that refers to its argument more than
- once. This is banned by the C Standard, but apparently happens in at
- least one MacOS environment. */
-
- for (pt++; isxdigit(*pt); pt++)
- {
- if (++i == 9)
- fprintf(outfile, "** Too many hex digits in \\x{...} item; "
- "using only the first eight.\n");
- else c = c * 16 + tolower(*pt) - ((isdigit(*pt))? '0' : 'a' - 10);
- }
- if (*pt == '}')
- {
- p = pt + 1;
- break;
- }
- /* Not correct form for \x{...}; fall through */
- }
-
- /* \x without {} always defines just one byte in 8-bit mode. This
- allows UTF-8 characters to be constructed byte by byte, and also allows
- invalid UTF-8 sequences to be made. Just copy the byte in UTF mode.
- Otherwise, pass it down to later code so that it can be turned into
- UTF-8 when running in 16/32-bit mode. */
-
- c = 0;
- while (i++ < 2 && isxdigit(*p))
- {
- c = c * 16 + tolower(*p) - ((isdigit(*p))? '0' : 'a' - 10);
- p++;
- }
-#if !defined NOUTF && defined SUPPORT_PCRE8
- if (use_utf && (pcre_mode == PCRE8_MODE))
- {
- *q8++ = c;
- continue;
- }
-#endif
- break;
-
- case 0: /* \ followed by EOF allows for an empty line */
- p--;
- continue;
-
- case '>':
- if (*p == '-')
- {
- start_offset_sign = -1;
- p++;
- }
- while(isdigit(*p)) start_offset = start_offset * 10 + *p++ - '0';
- start_offset *= start_offset_sign;
- continue;
-
- case 'A': /* Option setting */
- options |= PCRE_ANCHORED;
- continue;
-
- case 'B':
- options |= PCRE_NOTBOL;
- continue;
-
- case 'C':
- if (isdigit(*p)) /* Set copy string */
- {
- while(isdigit(*p)) n = n * 10 + *p++ - '0';
- copystrings |= 1 << n;
- }
- else if (isalnum(*p))
- {
- READ_CAPTURE_NAME(p, &cn8ptr, &cn16ptr, &cn32ptr, re);
- }
- else if (*p == '+')
- {
- callout_extra = 1;
- p++;
- }
- else if (*p == '-')
- {
- SET_PCRE_CALLOUT(NULL);
- p++;
- }
- else if (*p == '!')
- {
- callout_fail_id = 0;
- p++;
- while(isdigit(*p))
- callout_fail_id = callout_fail_id * 10 + *p++ - '0';
- callout_fail_count = 0;
- if (*p == '!')
- {
- p++;
- while(isdigit(*p))
- callout_fail_count = callout_fail_count * 10 + *p++ - '0';
- }
- }
- else if (*p == '*')
- {
- int sign = 1;
- callout_data = 0;
- if (*(++p) == '-') { sign = -1; p++; }
- while(isdigit(*p))
- callout_data = callout_data * 10 + *p++ - '0';
- callout_data *= sign;
- callout_data_set = 1;
- }
- continue;
-
-#if !defined NODFA
- case 'D':
-#if !defined NOPOSIX
- if (posix || do_posix)
- printf("** Can't use dfa matching in POSIX mode: \\D ignored\n");
- else
-#endif
- use_dfa = 1;
- continue;
-#endif
-
-#if !defined NODFA
- case 'F':
- options |= PCRE_DFA_SHORTEST;
- continue;
-#endif
-
- case 'G':
- if (isdigit(*p))
- {
- while(isdigit(*p)) n = n * 10 + *p++ - '0';
- getstrings |= 1 << n;
- }
- else if (isalnum(*p))
- {
- READ_CAPTURE_NAME(p, &gn8ptr, &gn16ptr, &gn32ptr, re);
- }
- continue;
-
- case 'J':
- while(isdigit(*p)) n = n * 10 + *p++ - '0';
- if (extra != NULL
- && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0
- && extra->executable_jit != NULL)
- {
- if (jit_stack != NULL) { PCRE_JIT_STACK_FREE(jit_stack); }
- jit_stack = PCRE_JIT_STACK_ALLOC(1, n * 1024);
- PCRE_ASSIGN_JIT_STACK(extra, jit_callback, jit_stack);
- }
- continue;
-
- case 'L':
- getlist = 1;
- continue;
-
- case 'M':
- find_match_limit = 1;
- continue;
-
- case 'N':
- if ((options & PCRE_NOTEMPTY) != 0)
- options = (options & ~PCRE_NOTEMPTY) | PCRE_NOTEMPTY_ATSTART;
- else
- options |= PCRE_NOTEMPTY;
- continue;
-
- case 'O':
- while(isdigit(*p)) n = n * 10 + *p++ - '0';
- if (n > size_offsets_max)
- {
- size_offsets_max = n;
- free(offsets);
- use_offsets = offsets = (int *)malloc(size_offsets_max * sizeof(int));
- if (offsets == NULL)
- {
- printf("** Failed to get %d bytes of memory for offsets vector\n",
- (int)(size_offsets_max * sizeof(int)));
- yield = 1;
- goto EXIT;
- }
- }
- use_size_offsets = n;
- if (n == 0) use_offsets = NULL; /* Ensures it can't write to it */
- else use_offsets = offsets + size_offsets_max - n; /* To catch overruns */
- continue;
-
- case 'P':
- options |= ((options & PCRE_PARTIAL_SOFT) == 0)?
- PCRE_PARTIAL_SOFT : PCRE_PARTIAL_HARD;
- continue;
-
- case 'Q':
- while(isdigit(*p)) n = n * 10 + *p++ - '0';
- if (extra == NULL)
- {
- extra = (pcre_extra *)malloc(sizeof(pcre_extra));
- extra->flags = 0;
- }
- extra->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
- extra->match_limit_recursion = n;
- continue;
-
- case 'q':
- while(isdigit(*p)) n = n * 10 + *p++ - '0';
- if (extra == NULL)
- {
- extra = (pcre_extra *)malloc(sizeof(pcre_extra));
- extra->flags = 0;
- }
- extra->flags |= PCRE_EXTRA_MATCH_LIMIT;
- extra->match_limit = n;
- continue;
-
-#if !defined NODFA
- case 'R':
- options |= PCRE_DFA_RESTART;
- continue;
-#endif
-
- case 'S':
- show_malloc = 1;
- continue;
-
- case 'Y':
- options |= PCRE_NO_START_OPTIMIZE;
- continue;
-
- case 'Z':
- options |= PCRE_NOTEOL;
- continue;
-
- case '?':
- options |= PCRE_NO_UTF8_CHECK;
- continue;
-
- case '<':
- {
- int x = check_mc_option(p, outfile, TRUE, "escape sequence");
- if (x == 0) goto NEXT_DATA;
- options |= x;
- while (*p++ != '>');
- }
- continue;
- }
-
- /* We now have a character value in c that may be greater than 255.
- In 8-bit mode we convert to UTF-8 if we are in UTF mode. Values greater
- than 127 in UTF mode must have come from \x{...} or octal constructs
- because values from \x.. get this far only in non-UTF mode. */
-
-#ifdef SUPPORT_PCRE8
- if (pcre_mode == PCRE8_MODE)
- {
-#ifndef NOUTF
- if (use_utf)
- {
- if (c > 0x7fffffff)
- {
- fprintf(outfile, "** Character \\x{%x} is greater than 0x7fffffff "
- "and so cannot be converted to UTF-8\n", c);
- goto NEXT_DATA;
- }
- q8 += ord2utf8(c, q8);
- }
- else
-#endif
- {
- if (c > 0xffu)
- {
- fprintf(outfile, "** Character \\x{%x} is greater than 255 "
- "and UTF-8 mode is not enabled.\n", c);
- fprintf(outfile, "** Truncation will probably give the wrong "
- "result.\n");
- }
- *q8++ = c;
- }
- }
-#endif
-#ifdef SUPPORT_PCRE16
- if (pcre_mode == PCRE16_MODE)
- {
-#ifndef NOUTF
- if (use_utf)
- {
- if (c > 0x10ffffu)
- {
- fprintf(outfile, "** Failed: character \\x{%x} is greater than "
- "0x10ffff and so cannot be converted to UTF-16\n", c);
- goto NEXT_DATA;
- }
- else if (c >= 0x10000u)
- {
- c-= 0x10000u;
- *q16++ = 0xD800 | (c >> 10);
- *q16++ = 0xDC00 | (c & 0x3ff);
- }
- else
- *q16++ = c;
- }
- else
-#endif
- {
- if (c > 0xffffu)
- {
- fprintf(outfile, "** Character \\x{%x} is greater than 0xffff "
- "and UTF-16 mode is not enabled.\n", c);
- fprintf(outfile, "** Truncation will probably give the wrong "
- "result.\n");
- }
-
- *q16++ = c;
- }
- }
-#endif
-#ifdef SUPPORT_PCRE32
- if (pcre_mode == PCRE32_MODE)
- {
- *q32++ = c;
- }
-#endif
-
- }
-
- /* Reached end of subject string */
-
-#ifdef SUPPORT_PCRE8
- if (pcre_mode == PCRE8_MODE)
- {
- *q8 = 0;
- len = (int)(q8 - (pcre_uint8 *)dbuffer);
- }
-#endif
-#ifdef SUPPORT_PCRE16
- if (pcre_mode == PCRE16_MODE)
- {
- *q16 = 0;
- len = (int)(q16 - (pcre_uint16 *)dbuffer);
- }
-#endif
-#ifdef SUPPORT_PCRE32
- if (pcre_mode == PCRE32_MODE)
- {
- *q32 = 0;
- len = (int)(q32 - (pcre_uint32 *)dbuffer);
- }
-#endif
-
- /* If we're compiling with explicit valgrind support, Mark the data from after
- its end to the end of the buffer as unaddressable, so that a read over the end
- of the buffer will be seen by valgrind, even if it doesn't cause a crash.
- If we're not building with valgrind support, at least move the data to the end
- of the buffer so that it might at least cause a crash.
- If we are using the POSIX interface, we must include the terminating zero. */
-
- bptr = dbuffer;
-
-#if !defined NOPOSIX
- if (posix || do_posix)
- {
-#ifdef SUPPORT_VALGRIND
- VALGRIND_MAKE_MEM_NOACCESS(dbuffer + len + 1, dbuffer_size - (len + 1));
-#else
- memmove(bptr + dbuffer_size - len - 1, bptr, len + 1);
- bptr += dbuffer_size - len - 1;
-#endif
- }
- else
-#endif
- {
-#ifdef SUPPORT_VALGRIND
- VALGRIND_MAKE_MEM_NOACCESS(dbuffer + len * CHAR_SIZE, (dbuffer_size - len) * CHAR_SIZE);
-#else
- bptr = memmove(bptr + (dbuffer_size - len) * CHAR_SIZE, bptr, len * CHAR_SIZE);
-#endif
- }
-
- if ((all_use_dfa || use_dfa) && find_match_limit)
- {
- printf("**Match limit not relevant for DFA matching: ignored\n");
- find_match_limit = 0;
- }
-
- /* Handle matching via the POSIX interface, which does not
- support timing or playing with the match limit or callout data. */
-
-#if !defined NOPOSIX
- if (posix || do_posix)
- {
- int rc;
- int eflags = 0;
- regmatch_t *pmatch = NULL;
- if (use_size_offsets > 0)
- pmatch = (regmatch_t *)malloc(sizeof(regmatch_t) * use_size_offsets);
- if ((options & PCRE_NOTBOL) != 0) eflags |= REG_NOTBOL;
- if ((options & PCRE_NOTEOL) != 0) eflags |= REG_NOTEOL;
- if ((options & PCRE_NOTEMPTY) != 0) eflags |= REG_NOTEMPTY;
-
- rc = regexec(&preg, (const char *)bptr, use_size_offsets, pmatch, eflags);
-
- if (rc != 0)
- {
- (void)regerror(rc, &preg, (char *)buffer, buffer_size);
- fprintf(outfile, "No match: POSIX code %d: %s\n", rc, buffer);
- }
- else if ((REAL_PCRE_OPTIONS(preg.re_pcre) & PCRE_NO_AUTO_CAPTURE) != 0)
- {
- fprintf(outfile, "Matched with REG_NOSUB\n");
- }
- else
- {
- size_t i;
- for (i = 0; i < (size_t)use_size_offsets; i++)
- {
- if (pmatch[i].rm_so >= 0)
- {
- fprintf(outfile, "%2d: ", (int)i);
- PCHARSV(dbuffer, pmatch[i].rm_so,
- pmatch[i].rm_eo - pmatch[i].rm_so, outfile);
- fprintf(outfile, "\n");
- if (do_showcaprest || (i == 0 && do_showrest))
- {
- fprintf(outfile, "%2d+ ", (int)i);
- PCHARSV(dbuffer, pmatch[i].rm_eo, len - pmatch[i].rm_eo,
- outfile);
- fprintf(outfile, "\n");
- }
- }
- }
- }
- free(pmatch);
- goto NEXT_DATA;
- }
-
-#endif /* !defined NOPOSIX */
-
- /* Handle matching via the native interface - repeats for /g and /G */
-
- /* Ensure that there is a JIT callback if we want to verify that JIT was
- actually used. If jit_stack == NULL, no stack has yet been assigned. */
-
- if (verify_jit && jit_stack == NULL && extra != NULL)
- { PCRE_ASSIGN_JIT_STACK(extra, jit_callback, jit_stack); }
-
- for (;; gmatched++) /* Loop for /g or /G */
- {
- markptr = NULL;
- jit_was_used = FALSE;
-
- if (timeitm > 0)
- {
- register int i;
- clock_t time_taken;
- clock_t start_time = clock();
-
-#if !defined NODFA
- if (all_use_dfa || use_dfa)
- {
- if ((options & PCRE_DFA_RESTART) != 0)
- {
- fprintf(outfile, "Timing DFA restarts is not supported\n");
- break;
- }
- if (dfa_workspace == NULL)
- dfa_workspace = (int *)malloc(DFA_WS_DIMENSION*sizeof(int));
- for (i = 0; i < timeitm; i++)
- {
- PCRE_DFA_EXEC(count, re, extra, bptr, len, start_offset,
- (options | g_notempty), use_offsets, use_size_offsets,
- dfa_workspace, DFA_WS_DIMENSION);
- }
- }
- else
-#endif
-
- for (i = 0; i < timeitm; i++)
- {
- PCRE_EXEC(count, re, extra, bptr, len, start_offset,
- (options | g_notempty), use_offsets, use_size_offsets);
- }
- total_match_time += (time_taken = clock() - start_time);
- fprintf(outfile, "Execute time %.4f milliseconds\n",
- (((double)time_taken * 1000.0) / (double)timeitm) /
- (double)CLOCKS_PER_SEC);
- }
-
- /* If find_match_limit is set, we want to do repeated matches with
- varying limits in order to find the minimum value for the match limit and
- for the recursion limit. The match limits are relevant only to the normal
- running of pcre_exec(), so disable the JIT optimization. This makes it
- possible to run the same set of tests with and without JIT externally
- requested. */
-
- if (find_match_limit)
- {
- if (extra != NULL) { PCRE_FREE_STUDY(extra); }
- extra = (pcre_extra *)malloc(sizeof(pcre_extra));
- extra->flags = 0;
-
- (void)check_match_limit(re, extra, bptr, len, start_offset,
- options|g_notempty, use_offsets, use_size_offsets,
- PCRE_EXTRA_MATCH_LIMIT, &(extra->match_limit),
- PCRE_ERROR_MATCHLIMIT, "match()");
-
- count = check_match_limit(re, extra, bptr, len, start_offset,
- options|g_notempty, use_offsets, use_size_offsets,
- PCRE_EXTRA_MATCH_LIMIT_RECURSION, &(extra->match_limit_recursion),
- PCRE_ERROR_RECURSIONLIMIT, "match() recursion");
- }
-
- /* If callout_data is set, use the interface with additional data */
-
- else if (callout_data_set)
- {
- if (extra == NULL)
- {
- extra = (pcre_extra *)malloc(sizeof(pcre_extra));
- extra->flags = 0;
- }
- extra->flags |= PCRE_EXTRA_CALLOUT_DATA;
- extra->callout_data = &callout_data;
- PCRE_EXEC(count, re, extra, bptr, len, start_offset,
- options | g_notempty, use_offsets, use_size_offsets);
- extra->flags &= ~PCRE_EXTRA_CALLOUT_DATA;
- }
-
- /* The normal case is just to do the match once, with the default
- value of match_limit. */
-
-#if !defined NODFA
- else if (all_use_dfa || use_dfa)
- {
- if (dfa_workspace == NULL)
- dfa_workspace = (int *)malloc(DFA_WS_DIMENSION*sizeof(int));
- if (dfa_matched++ == 0)
- dfa_workspace[0] = -1; /* To catch bad restart */
- PCRE_DFA_EXEC(count, re, extra, bptr, len, start_offset,
- (options | g_notempty), use_offsets, use_size_offsets, dfa_workspace,
- DFA_WS_DIMENSION);
- if (count == 0)
- {
- fprintf(outfile, "Matched, but offsets vector is too small to show all matches\n");
- count = use_size_offsets/2;
- }
- }
-#endif
-
- else
- {
- PCRE_EXEC(count, re, extra, bptr, len, start_offset,
- options | g_notempty, use_offsets, use_size_offsets);
- if (count == 0)
- {
- fprintf(outfile, "Matched, but too many substrings\n");
- /* 2 is a special case; match can be returned */
- count = (use_size_offsets == 2)? 1 : use_size_offsets/3;
- }
- }
-
- /* Matched */
-
- if (count >= 0)
- {
- int i, maxcount;
- void *cnptr, *gnptr;
-
-#if !defined NODFA
- if (all_use_dfa || use_dfa) maxcount = use_size_offsets/2; else
-#endif
- /* 2 is a special case; match can be returned */
- maxcount = (use_size_offsets == 2)? 1 : use_size_offsets/3;
-
- /* This is a check against a lunatic return value. */
-
- if (count > maxcount)
- {
- fprintf(outfile,
- "** PCRE error: returned count %d is too big for offset size %d\n",
- count, use_size_offsets);
- count = use_size_offsets/3;
- if (do_g || do_G)
- {
- fprintf(outfile, "** /%c loop abandoned\n", do_g? 'g' : 'G');
- do_g = do_G = FALSE; /* Break g/G loop */
- }
- }
-
- /* do_allcaps requests showing of all captures in the pattern, to check
- unset ones at the end. */
-
- if (do_allcaps)
- {
- if (new_info(re, NULL, PCRE_INFO_CAPTURECOUNT, &count) < 0)
- goto SKIP_DATA;
- count++; /* Allow for full match */
- if (count * 2 > use_size_offsets) count = use_size_offsets/2;
- }
-
- /* 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. */
-
- for (i = 0; i < count * 2; i += 2)
- {
- if (use_offsets[i] < 0)
- {
- if (use_offsets[i] != -1)
- fprintf(outfile, "ERROR: bad negative value %d for offset %d\n",
- use_offsets[i], i);
- if (use_offsets[i+1] != -1)
- fprintf(outfile, "ERROR: bad negative value %d for offset %d\n",
- use_offsets[i+1], i+1);
- fprintf(outfile, "%2d: <unset>\n", i/2);
- }
- else
- {
- int start = use_offsets[i];
- int end = use_offsets[i+1];
-
- if (start > end)
- {
- start = use_offsets[i+1];
- end = use_offsets[i];
- fprintf(outfile, "Start of matched string is beyond its end - "
- "displaying from end to start.\n");
- }
-
- fprintf(outfile, "%2d: ", i/2);
- PCHARSV(bptr, start, end - start, outfile);
- if (verify_jit && jit_was_used) fprintf(outfile, " (JIT)");
- fprintf(outfile, "\n");
-
- /* Note: don't use the start/end variables here because we want to
- show the text from what is reported as the end. */
-
- if (do_showcaprest || (i == 0 && do_showrest))
- {
- fprintf(outfile, "%2d+ ", i/2);
- PCHARSV(bptr, use_offsets[i+1], len - use_offsets[i+1],
- outfile);
- fprintf(outfile, "\n");
- }
- }
- }
-
- if (markptr != NULL)
- {
- fprintf(outfile, "MK: ");
- PCHARSV(markptr, 0, -1, outfile);
- fprintf(outfile, "\n");
- }
-
- for (i = 0; i < 32; i++)
- {
- if ((copystrings & (1 << i)) != 0)
- {
- int rc;
- char copybuffer[256];
- PCRE_COPY_SUBSTRING(rc, bptr, use_offsets, count, i,
- copybuffer, sizeof(copybuffer));
- if (rc < 0)
- fprintf(outfile, "copy substring %d failed %d\n", i, rc);
- else
- {
- fprintf(outfile, "%2dC ", i);
- PCHARSV(copybuffer, 0, rc, outfile);
- fprintf(outfile, " (%d)\n", rc);
- }
- }
- }
-
- cnptr = copynames;
- for (;;)
- {
- int rc;
- char copybuffer[256];
-
-#ifdef SUPPORT_PCRE32
- if (pcre_mode == PCRE32_MODE)
- {
- if (*(pcre_uint32 *)cnptr == 0) break;
- }
-#endif
-#ifdef SUPPORT_PCRE16
- if (pcre_mode == PCRE16_MODE)
- {
- if (*(pcre_uint16 *)cnptr == 0) break;
- }
-#endif
-#ifdef SUPPORT_PCRE8
- if (pcre_mode == PCRE8_MODE)
- {
- if (*(pcre_uint8 *)cnptr == 0) break;
- }
-#endif
-
- PCRE_COPY_NAMED_SUBSTRING(rc, re, bptr, use_offsets, count,
- cnptr, copybuffer, sizeof(copybuffer));
-
- if (rc < 0)
- {
- fprintf(outfile, "copy substring ");
- PCHARSV(cnptr, 0, -1, outfile);
- fprintf(outfile, " failed %d\n", rc);
- }
- else
- {
- fprintf(outfile, " C ");
- PCHARSV(copybuffer, 0, rc, outfile);
- fprintf(outfile, " (%d) ", rc);
- PCHARSV(cnptr, 0, -1, outfile);
- putc('\n', outfile);
- }
-
- cnptr = (char *)cnptr + (STRLEN(cnptr) + 1) * CHAR_SIZE;
- }
-
- for (i = 0; i < 32; i++)
- {
- if ((getstrings & (1 << i)) != 0)
- {
- int rc;
- const char *substring;
- PCRE_GET_SUBSTRING(rc, bptr, use_offsets, count, i, &substring);
- if (rc < 0)
- fprintf(outfile, "get substring %d failed %d\n", i, rc);
- else
- {
- fprintf(outfile, "%2dG ", i);
- PCHARSV(substring, 0, rc, outfile);
- fprintf(outfile, " (%d)\n", rc);
- PCRE_FREE_SUBSTRING(substring);
- }
- }
- }
-
- gnptr = getnames;
- for (;;)
- {
- int rc;
- const char *substring;
-
-#ifdef SUPPORT_PCRE32
- if (pcre_mode == PCRE32_MODE)
- {
- if (*(pcre_uint32 *)gnptr == 0) break;
- }
-#endif
-#ifdef SUPPORT_PCRE16
- if (pcre_mode == PCRE16_MODE)
- {
- if (*(pcre_uint16 *)gnptr == 0) break;
- }
-#endif
-#ifdef SUPPORT_PCRE8
- if (pcre_mode == PCRE8_MODE)
- {
- if (*(pcre_uint8 *)gnptr == 0) break;
- }
-#endif
-
- PCRE_GET_NAMED_SUBSTRING(rc, re, bptr, use_offsets, count,
- gnptr, &substring);
- if (rc < 0)
- {
- fprintf(outfile, "get substring ");
- PCHARSV(gnptr, 0, -1, outfile);
- fprintf(outfile, " failed %d\n", rc);
- }
- else
- {
- fprintf(outfile, " G ");
- PCHARSV(substring, 0, rc, outfile);
- fprintf(outfile, " (%d) ", rc);
- PCHARSV(gnptr, 0, -1, outfile);
- PCRE_FREE_SUBSTRING(substring);
- putc('\n', outfile);
- }
-
- gnptr = (char *)gnptr + (STRLEN(gnptr) + 1) * CHAR_SIZE;
- }
-
- if (getlist)
- {
- int rc;
- const char **stringlist;
- PCRE_GET_SUBSTRING_LIST(rc, bptr, use_offsets, count, &stringlist);
- if (rc < 0)
- fprintf(outfile, "get substring list failed %d\n", rc);
- else
- {
- for (i = 0; i < count; i++)
- {
- fprintf(outfile, "%2dL ", i);
- PCHARSV(stringlist[i], 0, -1, outfile);
- putc('\n', outfile);
- }
- if (stringlist[i] != NULL)
- fprintf(outfile, "string list not terminated by NULL\n");
- PCRE_FREE_SUBSTRING_LIST(stringlist);
- }
- }
- }
-
- /* There was a partial match. If the bumpalong point is not the same as
- the first inspected character, show the offset explicitly. */
-
- else if (count == PCRE_ERROR_PARTIAL)
- {
- fprintf(outfile, "Partial match");
- if (use_size_offsets > 2 && use_offsets[0] != use_offsets[2])
- fprintf(outfile, " at offset %d", use_offsets[2]);
- if (markptr != NULL)
- {
- fprintf(outfile, ", mark=");
- PCHARSV(markptr, 0, -1, outfile);
- }
- if (use_size_offsets > 1)
- {
- fprintf(outfile, ": ");
- PCHARSV(bptr, use_offsets[0], use_offsets[1] - use_offsets[0],
- outfile);
- }
- if (verify_jit && jit_was_used) fprintf(outfile, " (JIT)");
- fprintf(outfile, "\n");
- break; /* Out of the /g loop */
- }
-
- /* Failed to match. If this is a /g or /G loop and we previously set
- g_notempty after a null match, this is not necessarily the end. We want
- to advance the start offset, and continue. We won't be at the end of the
- string - that was checked before setting g_notempty.
-
- Complication arises in the case when the newline convention is "any",
- "crlf", or "anycrlf". If the previous match was at the end of a line
- terminated by CRLF, an advance of one character just passes the \r,
- whereas we should prefer the longer newline sequence, as does the code in
- pcre_exec(). Fudge the offset value to achieve this. We check for a
- newline setting in the pattern; if none was set, use PCRE_CONFIG() to
- find the default.
-
- Otherwise, in the case of UTF-8 matching, the advance must be one
- character, not one byte. */
-
- else
- {
- if (g_notempty != 0)
- {
- int onechar = 1;
- unsigned int obits = REAL_PCRE_OPTIONS(re);
- use_offsets[0] = start_offset;
- if ((obits & PCRE_NEWLINE_BITS) == 0)
- {
- int d;
- (void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &d);
- /* Note that these values are always the ASCII ones, even in
- EBCDIC environments. CR = 13, NL = 10. */
- obits = (d == 13)? PCRE_NEWLINE_CR :
- (d == 10)? PCRE_NEWLINE_LF :
- (d == (13<<8 | 10))? PCRE_NEWLINE_CRLF :
- (d == -2)? PCRE_NEWLINE_ANYCRLF :
- (d == -1)? PCRE_NEWLINE_ANY : 0;
- }
- if (((obits & PCRE_NEWLINE_BITS) == PCRE_NEWLINE_ANY ||
- (obits & PCRE_NEWLINE_BITS) == PCRE_NEWLINE_CRLF ||
- (obits & PCRE_NEWLINE_BITS) == PCRE_NEWLINE_ANYCRLF)
- &&
- start_offset < len - 1 && (
-#ifdef SUPPORT_PCRE8
- (pcre_mode == PCRE8_MODE &&
- bptr[start_offset] == '\r' &&
- bptr[start_offset + 1] == '\n') ||
-#endif
-#ifdef SUPPORT_PCRE16
- (pcre_mode == PCRE16_MODE &&
- ((PCRE_SPTR16)bptr)[start_offset] == '\r' &&
- ((PCRE_SPTR16)bptr)[start_offset + 1] == '\n') ||
-#endif
-#ifdef SUPPORT_PCRE32
- (pcre_mode == PCRE32_MODE &&
- ((PCRE_SPTR32)bptr)[start_offset] == '\r' &&
- ((PCRE_SPTR32)bptr)[start_offset + 1] == '\n') ||
-#endif
- 0))
- onechar++;
- else if (use_utf)
- {
- while (start_offset + onechar < len)
- {
- if ((bptr[start_offset+onechar] & 0xc0) != 0x80) break;
- onechar++;
- }
- }
- use_offsets[1] = start_offset + onechar;
- }
- else
- {
- switch(count)
- {
- case PCRE_ERROR_NOMATCH:
- if (gmatched == 0)
- {
- if (markptr == NULL)
- {
- fprintf(outfile, "No match");
- }
- else
- {
- fprintf(outfile, "No match, mark = ");
- PCHARSV(markptr, 0, -1, outfile);
- }
- if (verify_jit && jit_was_used) fprintf(outfile, " (JIT)");
- putc('\n', outfile);
- }
- break;
-
- case PCRE_ERROR_BADUTF8:
- case PCRE_ERROR_SHORTUTF8:
- fprintf(outfile, "Error %d (%s UTF-%d string)", count,
- (count == PCRE_ERROR_BADUTF8)? "bad" : "short",
- 8 * CHAR_SIZE);
- if (use_size_offsets >= 2)
- fprintf(outfile, " offset=%d reason=%d", use_offsets[0],
- use_offsets[1]);
- fprintf(outfile, "\n");
- break;
-
- case PCRE_ERROR_BADUTF8_OFFSET:
- fprintf(outfile, "Error %d (bad UTF-%d offset)\n", count,
- 8 * CHAR_SIZE);
- break;
-
- default:
- if (count < 0 &&
- (-count) < (int)(sizeof(errtexts)/sizeof(const char *)))
- fprintf(outfile, "Error %d (%s)\n", count, errtexts[-count]);
- else
- fprintf(outfile, "Error %d (Unexpected value)\n", count);
- break;
- }
-
- break; /* Out of the /g loop */
- }
- }
-
- /* If not /g or /G we are done */
-
- if (!do_g && !do_G) break;
-
- /* If we have matched an empty string, first check to see if we are at
- the end of the subject. If so, the /g loop is over. Otherwise, mimic what
- Perl's /g options does. This turns out to be rather cunning. First we set
- PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED and try the match again at the
- same point. If this fails (picked up above) we advance to the next
- character. */
-
- g_notempty = 0;
-
- if (use_offsets[0] == use_offsets[1])
- {
- if (use_offsets[0] == len) break;
- g_notempty = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED;
- }
-
- /* For /g, update the start offset, leaving the rest alone */
-
- if (do_g) start_offset = use_offsets[1];
-
- /* For /G, update the pointer and length */
-
- else
- {
- bptr += use_offsets[1] * CHAR_SIZE;
- len -= use_offsets[1];
- }
- } /* End of loop for /g and /G */
-
- NEXT_DATA: continue;
- } /* End of loop for data lines */
-
- CONTINUE:
-
-#if !defined NOPOSIX
- if (posix || do_posix) regfree(&preg);
-#endif
-
- if (re != NULL) new_free(re);
- if (extra != NULL)
- {
- PCRE_FREE_STUDY(extra);
- }
- if (locale_set)
- {
- new_free((void *)tables);
- setlocale(LC_CTYPE, "C");
- locale_set = 0;
- }
- if (jit_stack != NULL)
- {
- PCRE_JIT_STACK_FREE(jit_stack);
- jit_stack = NULL;
- }
- }
-
-if (infile == stdin) fprintf(outfile, "\n");
-
-if (showtotaltimes)
- {
- fprintf(outfile, "--------------------------------------\n");
- if (timeit > 0)
- {
- fprintf(outfile, "Total compile time %.4f milliseconds\n",
- (((double)total_compile_time * 1000.0) / (double)timeit) /
- (double)CLOCKS_PER_SEC);
- fprintf(outfile, "Total study time %.4f milliseconds\n",
- (((double)total_study_time * 1000.0) / (double)timeit) /
- (double)CLOCKS_PER_SEC);
- }
- fprintf(outfile, "Total execute time %.4f milliseconds\n",
- (((double)total_match_time * 1000.0) / (double)timeitm) /
- (double)CLOCKS_PER_SEC);
- }
-
-EXIT:
-
-if (infile != NULL && infile != stdin) fclose(infile);
-if (outfile != NULL && outfile != stdout) fclose(outfile);
-
-free(buffer);
-free(dbuffer);
-free(pbuffer);
-free(offsets);
-
-#ifdef SUPPORT_PCRE16
-if (buffer16 != NULL) free(buffer16);
-#endif
-#ifdef SUPPORT_PCRE32
-if (buffer32 != NULL) free(buffer32);
-#endif
-
-#if !defined NODFA
-if (dfa_workspace != NULL)
- free(dfa_workspace);
-#endif
-
-#if defined(__VMS)
- yield = SS$_NORMAL; /* Return values via DCL symbols */
-#endif
-
-return yield;
-}
-
-/* End of pcretest.c */
diff --git a/.pc/applied-patches b/.pc/applied-patches
deleted file mode 100644
index c30b0d0..0000000
--- a/.pc/applied-patches
+++ /dev/null
@@ -1,9 +0,0 @@
-PCRE6_compatible_API.patch
-pcreposix.patch
-pcre_info.patch
-pcregrep.1-patch
-soname.patch
-Fix-silly-quantifier-size-check.patch
-cve-2014-8964.patch
-no_jit_x32_powerpcspe.patch
-fix_find_fixedlength.patch
diff --git a/.pc/cve-2014-8964.patch/pcre_exec.c b/.pc/cve-2014-8964.patch/pcre_exec.c
deleted file mode 100644
index 5dec992..0000000
--- a/.pc/cve-2014-8964.patch/pcre_exec.c
+++ /dev/null
@@ -1,7178 +0,0 @@
-/*************************************************
-* 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
- Copyright (c) 1997-2014 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 pcre_exec(), the externally visible function that does
-pattern matching using an NFA algorithm, trying to mimic Perl as closely as
-possible. There are also some static supporting functions. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define NLBLOCK md /* Block containing newline information */
-#define PSSTART start_subject /* Field containing processed string start */
-#define PSEND end_subject /* Field containing processed string end */
-
-#include "pcre_internal.h"
-
-/* Undefine some potentially clashing cpp symbols */
-
-#undef min
-#undef max
-
-/* The md->capture_last field uses the lower 16 bits for the last captured
-substring (which can never be greater than 65535) and a bit in the top half
-to mean "capture vector overflowed". This odd way of doing things was
-implemented when it was realized that preserving and restoring the overflow bit
-whenever the last capture number was saved/restored made for a neater
-interface, and doing it this way saved on (a) another variable, which would
-have increased the stack frame size (a big NO-NO in PCRE) and (b) another
-separate set of save/restore instructions. The following defines are used in
-implementing this. */
-
-#define CAPLMASK 0x0000ffff /* The bits used for last_capture */
-#define OVFLMASK 0xffff0000 /* The bits used for the overflow flag */
-#define OVFLBIT 0x00010000 /* The bit that is set for overflow */
-
-/* Values for setting in md->match_function_type to indicate two special types
-of call to match(). We do it this way to save on using another stack variable,
-as stack usage is to be discouraged. */
-
-#define MATCH_CONDASSERT 1 /* Called to check a condition assertion */
-#define MATCH_CBEGROUP 2 /* Could-be-empty unlimited repeat group */
-
-/* Non-error returns from the match() function. Error returns are externally
-defined PCRE_ERROR_xxx codes, which are all negative. */
-
-#define MATCH_MATCH 1
-#define MATCH_NOMATCH 0
-
-/* Special internal returns from the match() function. Make them sufficiently
-negative to avoid the external error codes. */
-
-#define MATCH_ACCEPT (-999)
-#define MATCH_KETRPOS (-998)
-#define MATCH_ONCE (-997)
-/* The next 5 must be kept together and in sequence so that a test that checks
-for any one of them can use a range. */
-#define MATCH_COMMIT (-996)
-#define MATCH_PRUNE (-995)
-#define MATCH_SKIP (-994)
-#define MATCH_SKIP_ARG (-993)
-#define MATCH_THEN (-992)
-#define MATCH_BACKTRACK_MAX MATCH_THEN
-#define MATCH_BACKTRACK_MIN MATCH_COMMIT
-
-/* Maximum number of ints of offset to save on the stack for recursive calls.
-If the offset vector is bigger, malloc is used. This should be a multiple of 3,
-because the offset vector is always a multiple of 3 long. */
-
-#define REC_STACK_SAVE_MAX 30
-
-/* Min and max values for the common repeats; for the maxima, 0 => infinity */
-
-static const char rep_min[] = { 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, };
-static const char rep_max[] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, };
-
-#ifdef PCRE_DEBUG
-/*************************************************
-* Debugging function to print chars *
-*************************************************/
-
-/* Print a sequence of chars in printable format, stopping at the end of the
-subject if the requested.
-
-Arguments:
- p points to characters
- length number to print
- is_subject TRUE if printing from within md->start_subject
- md pointer to matching data block, if is_subject is TRUE
-
-Returns: nothing
-*/
-
-static void
-pchars(const pcre_uchar *p, int length, BOOL is_subject, match_data *md)
-{
-pcre_uint32 c;
-BOOL utf = md->utf;
-if (is_subject && length > md->end_subject - p) length = md->end_subject - p;
-while (length-- > 0)
- if (isprint(c = UCHAR21INCTEST(p))) printf("%c", (char)c); else printf("\\x{%02x}", c);
-}
-#endif
-
-
-
-/*************************************************
-* Match a back-reference *
-*************************************************/
-
-/* Normally, if a back reference hasn't been set, the length that is passed is
-negative, so the match always fails. However, in JavaScript compatibility mode,
-the length passed is zero. Note that in caseless UTF-8 mode, the number of
-subject bytes matched may be different to the number of reference bytes.
-
-Arguments:
- offset index into the offset vector
- eptr pointer into the subject
- length length of reference to be matched (number of bytes)
- md points to match data block
- caseless TRUE if caseless
-
-Returns: >= 0 the number of subject bytes matched
- -1 no match
- -2 partial match; always given if at end subject
-*/
-
-static int
-match_ref(int offset, register PCRE_PUCHAR eptr, int length, match_data *md,
- BOOL caseless)
-{
-PCRE_PUCHAR eptr_start = eptr;
-register PCRE_PUCHAR p = md->start_subject + md->offset_vector[offset];
-#if defined SUPPORT_UTF && defined SUPPORT_UCP
-BOOL utf = md->utf;
-#endif
-
-#ifdef PCRE_DEBUG
-if (eptr >= md->end_subject)
- printf("matching subject <null>");
-else
- {
- printf("matching subject ");
- pchars(eptr, length, TRUE, md);
- }
-printf(" against backref ");
-pchars(p, length, FALSE, md);
-printf("\n");
-#endif
-
-/* Always fail if reference not set (and not JavaScript compatible - in that
-case the length is passed as zero). */
-
-if (length < 0) return -1;
-
-/* Separate the caseless case for speed. In UTF-8 mode we can only do this
-properly if Unicode properties are supported. Otherwise, we can check only
-ASCII characters. */
-
-if (caseless)
- {
-#if defined SUPPORT_UTF && defined SUPPORT_UCP
- if (utf)
- {
- /* Match characters up to the end of the reference. NOTE: the number of
- data units matched may differ, because in UTF-8 there are some characters
- whose upper and lower case versions code have different numbers of bytes.
- For example, U+023A (2 bytes in UTF-8) is the upper case version of U+2C65
- (3 bytes in UTF-8); a sequence of 3 of the former uses 6 bytes, as does a
- sequence of two of the latter. It is important, therefore, to check the
- length along the reference, not along the subject (earlier code did this
- wrong). */
-
- PCRE_PUCHAR endptr = p + length;
- while (p < endptr)
- {
- pcre_uint32 c, d;
- const ucd_record *ur;
- if (eptr >= md->end_subject) return -2; /* Partial match */
- GETCHARINC(c, eptr);
- GETCHARINC(d, p);
- ur = GET_UCD(d);
- if (c != d && c != d + ur->other_case)
- {
- const pcre_uint32 *pp = PRIV(ucd_caseless_sets) + ur->caseset;
- for (;;)
- {
- if (c < *pp) return -1;
- if (c == *pp++) break;
- }
- }
- }
- }
- else
-#endif
-
- /* The same code works when not in UTF-8 mode and in UTF-8 mode when there
- is no UCP support. */
- {
- while (length-- > 0)
- {
- pcre_uint32 cc, cp;
- if (eptr >= md->end_subject) return -2; /* Partial match */
- cc = UCHAR21TEST(eptr);
- cp = UCHAR21TEST(p);
- if (TABLE_GET(cp, md->lcc, cp) != TABLE_GET(cc, md->lcc, cc)) return -1;
- p++;
- eptr++;
- }
- }
- }
-
-/* In the caseful case, we can just compare the bytes, whether or not we
-are in UTF-8 mode. */
-
-else
- {
- while (length-- > 0)
- {
- if (eptr >= md->end_subject) return -2; /* Partial match */
- if (UCHAR21INCTEST(p) != UCHAR21INCTEST(eptr)) return -1;
- }
- }
-
-return (int)(eptr - eptr_start);
-}
-
-
-
-/***************************************************************************
-****************************************************************************
- RECURSION IN THE match() FUNCTION
-
-The match() function is highly recursive, though not every recursive call
-increases the recursive depth. Nevertheless, some regular expressions can cause
-it to recurse to a great depth. I was writing for Unix, so I just let it call
-itself recursively. This uses the stack for saving everything that has to be
-saved for a recursive call. On Unix, the stack can be large, and this works
-fine.
-
-It turns out that on some non-Unix-like systems there are problems with
-programs that use a lot of stack. (This despite the fact that every last chip
-has oodles of memory these days, and techniques for extending the stack have
-been known for decades.) So....
-
-There is a fudge, triggered by defining NO_RECURSE, which avoids recursive
-calls by keeping local variables that need to be preserved in blocks of memory
-obtained from malloc() instead instead of on the stack. Macros are used to
-achieve this so that the actual code doesn't look very different to what it
-always used to.
-
-The original heap-recursive code used longjmp(). However, it seems that this
-can be very slow on some operating systems. Following a suggestion from Stan
-Switzer, the use of longjmp() has been abolished, at the cost of having to
-provide a unique number for each call to RMATCH. There is no way of generating
-a sequence of numbers at compile time in C. I have given them names, to make
-them stand out more clearly.
-
-Crude tests on x86 Linux show a small speedup of around 5-8%. However, on
-FreeBSD, avoiding longjmp() more than halves the time taken to run the standard
-tests. Furthermore, not using longjmp() means that local dynamic variables
-don't have indeterminate values; this has meant that the frame size can be
-reduced because the result can be "passed back" by straight setting of the
-variable instead of being passed in the frame.
-****************************************************************************
-***************************************************************************/
-
-/* Numbers for RMATCH calls. When this list is changed, the code at HEAP_RETURN
-below must be updated in sync. */
-
-enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10,
- RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20,
- RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,
- RM31, RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
- RM41, RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,
- RM51, RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,
- RM61, RM62, RM63, RM64, RM65, RM66, RM67 };
-
-/* These versions of the macros use the stack, as normal. There are debugging
-versions and production versions. Note that the "rw" argument of RMATCH isn't
-actually used in this definition. */
-
-#ifndef NO_RECURSE
-#define REGISTER register
-
-#ifdef PCRE_DEBUG
-#define RMATCH(ra,rb,rc,rd,re,rw) \
- { \
- printf("match() called in line %d\n", __LINE__); \
- rrc = match(ra,rb,mstart,rc,rd,re,rdepth+1); \
- printf("to line %d\n", __LINE__); \
- }
-#define RRETURN(ra) \
- { \
- printf("match() returned %d from line %d\n", ra, __LINE__); \
- return ra; \
- }
-#else
-#define RMATCH(ra,rb,rc,rd,re,rw) \
- rrc = match(ra,rb,mstart,rc,rd,re,rdepth+1)
-#define RRETURN(ra) return ra
-#endif
-
-#else
-
-
-/* These versions of the macros manage a private stack on the heap. Note that
-the "rd" argument of RMATCH isn't actually used in this definition. It's the md
-argument of match(), which never changes. */
-
-#define REGISTER
-
-#define RMATCH(ra,rb,rc,rd,re,rw)\
- {\
- heapframe *newframe = frame->Xnextframe;\
- if (newframe == NULL)\
- {\
- newframe = (heapframe *)(PUBL(stack_malloc))(sizeof(heapframe));\
- if (newframe == NULL) RRETURN(PCRE_ERROR_NOMEMORY);\
- newframe->Xnextframe = NULL;\
- frame->Xnextframe = newframe;\
- }\
- frame->Xwhere = rw;\
- newframe->Xeptr = ra;\
- newframe->Xecode = rb;\
- newframe->Xmstart = mstart;\
- newframe->Xoffset_top = rc;\
- newframe->Xeptrb = re;\
- newframe->Xrdepth = frame->Xrdepth + 1;\
- newframe->Xprevframe = frame;\
- frame = newframe;\
- DPRINTF(("restarting from line %d\n", __LINE__));\
- goto HEAP_RECURSE;\
- L_##rw:\
- DPRINTF(("jumped back to line %d\n", __LINE__));\
- }
-
-#define RRETURN(ra)\
- {\
- heapframe *oldframe = frame;\
- frame = oldframe->Xprevframe;\
- if (frame != NULL)\
- {\
- rrc = ra;\
- goto HEAP_RETURN;\
- }\
- return ra;\
- }
-
-
-/* Structure for remembering the local variables in a private frame */
-
-typedef struct heapframe {
- struct heapframe *Xprevframe;
- struct heapframe *Xnextframe;
-
- /* Function arguments that may change */
-
- PCRE_PUCHAR Xeptr;
- const pcre_uchar *Xecode;
- PCRE_PUCHAR Xmstart;
- int Xoffset_top;
- eptrblock *Xeptrb;
- unsigned int Xrdepth;
-
- /* Function local variables */
-
- PCRE_PUCHAR Xcallpat;
-#ifdef SUPPORT_UTF
- PCRE_PUCHAR Xcharptr;
-#endif
- PCRE_PUCHAR Xdata;
- PCRE_PUCHAR Xnext;
- PCRE_PUCHAR Xpp;
- PCRE_PUCHAR Xprev;
- PCRE_PUCHAR Xsaved_eptr;
-
- recursion_info Xnew_recursive;
-
- BOOL Xcur_is_word;
- BOOL Xcondition;
- BOOL Xprev_is_word;
-
-#ifdef SUPPORT_UCP
- int Xprop_type;
- unsigned int Xprop_value;
- int Xprop_fail_result;
- int Xoclength;
- pcre_uchar Xocchars[6];
-#endif
-
- int Xcodelink;
- int Xctype;
- unsigned int Xfc;
- int Xfi;
- int Xlength;
- int Xmax;
- int Xmin;
- unsigned int Xnumber;
- int Xoffset;
- unsigned int Xop;
- pcre_int32 Xsave_capture_last;
- int Xsave_offset1, Xsave_offset2, Xsave_offset3;
- int Xstacksave[REC_STACK_SAVE_MAX];
-
- eptrblock Xnewptrb;
-
- /* Where to jump back to */
-
- int Xwhere;
-
-} heapframe;
-
-#endif
-
-
-/***************************************************************************
-***************************************************************************/
-
-
-
-/*************************************************
-* Match from current position *
-*************************************************/
-
-/* This function is called recursively in many circumstances. Whenever it
-returns a negative (error) response, the outer incarnation must also return the
-same response. */
-
-/* These macros pack up tests that are used for partial matching, and which
-appear 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 start of the subject (i.e.
-something has been matched). 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. */
-
-#define CHECK_PARTIAL()\
- if (md->partial != 0 && eptr >= md->end_subject && \
- eptr > md->start_used_ptr) \
- { \
- md->hitend = TRUE; \
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); \
- }
-
-#define SCHECK_PARTIAL()\
- if (md->partial != 0 && eptr > md->start_used_ptr) \
- { \
- md->hitend = TRUE; \
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); \
- }
-
-
-/* Performance note: It might be tempting to extract commonly used fields from
-the md structure (e.g. utf, end_subject) into individual variables to improve
-performance. Tests using gcc on a SPARC disproved this; in the first case, it
-made performance worse.
-
-Arguments:
- eptr pointer to current character in subject
- ecode pointer to current position in compiled code
- mstart pointer to the current match start position (can be modified
- by encountering \K)
- offset_top current top pointer
- md pointer to "static" info for the match
- eptrb pointer to chain of blocks containing eptr at start of
- brackets - for testing for empty matches
- rdepth the recursion depth
-
-Returns: MATCH_MATCH if matched ) these values are >= 0
- MATCH_NOMATCH if failed to match )
- a negative MATCH_xxx value for PRUNE, SKIP, etc
- a negative PCRE_ERROR_xxx value if aborted by an error condition
- (e.g. stopped by repeated call or recursion limit)
-*/
-
-static int
-match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
- PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
- unsigned int rdepth)
-{
-/* These variables do not need to be preserved over recursion in this function,
-so they can be ordinary variables in all cases. Mark some of them with
-"register" because they are used a lot in loops. */
-
-register int rrc; /* Returns from recursive calls */
-register int i; /* Used for loops not involving calls to RMATCH() */
-register pcre_uint32 c; /* Character values not kept over RMATCH() calls */
-register BOOL utf; /* Local copy of UTF flag for speed */
-
-BOOL minimize, possessive; /* Quantifier options */
-BOOL caseless;
-int condcode;
-
-/* When recursion is not being used, all "local" variables that have to be
-preserved over calls to RMATCH() are part of a "frame". We set up the top-level
-frame on the stack here; subsequent instantiations are obtained from the heap
-whenever RMATCH() does a "recursion". See the macro definitions above. Putting
-the top-level on the stack rather than malloc-ing them all gives a performance
-boost in many cases where there is not much "recursion". */
-
-#ifdef NO_RECURSE
-heapframe *frame = (heapframe *)md->match_frames_base;
-
-/* Copy in the original argument variables */
-
-frame->Xeptr = eptr;
-frame->Xecode = ecode;
-frame->Xmstart = mstart;
-frame->Xoffset_top = offset_top;
-frame->Xeptrb = eptrb;
-frame->Xrdepth = rdepth;
-
-/* This is where control jumps back to to effect "recursion" */
-
-HEAP_RECURSE:
-
-/* Macros make the argument variables come from the current frame */
-
-#define eptr frame->Xeptr
-#define ecode frame->Xecode
-#define mstart frame->Xmstart
-#define offset_top frame->Xoffset_top
-#define eptrb frame->Xeptrb
-#define rdepth frame->Xrdepth
-
-/* Ditto for the local variables */
-
-#ifdef SUPPORT_UTF
-#define charptr frame->Xcharptr
-#endif
-#define callpat frame->Xcallpat
-#define codelink frame->Xcodelink
-#define data frame->Xdata
-#define next frame->Xnext
-#define pp frame->Xpp
-#define prev frame->Xprev
-#define saved_eptr frame->Xsaved_eptr
-
-#define new_recursive frame->Xnew_recursive
-
-#define cur_is_word frame->Xcur_is_word
-#define condition frame->Xcondition
-#define prev_is_word frame->Xprev_is_word
-
-#ifdef SUPPORT_UCP
-#define prop_type frame->Xprop_type
-#define prop_value frame->Xprop_value
-#define prop_fail_result frame->Xprop_fail_result
-#define oclength frame->Xoclength
-#define occhars frame->Xocchars
-#endif
-
-#define ctype frame->Xctype
-#define fc frame->Xfc
-#define fi frame->Xfi
-#define length frame->Xlength
-#define max frame->Xmax
-#define min frame->Xmin
-#define number frame->Xnumber
-#define offset frame->Xoffset
-#define op frame->Xop
-#define save_capture_last frame->Xsave_capture_last
-#define save_offset1 frame->Xsave_offset1
-#define save_offset2 frame->Xsave_offset2
-#define save_offset3 frame->Xsave_offset3
-#define stacksave frame->Xstacksave
-
-#define newptrb frame->Xnewptrb
-
-/* When recursion is being used, local variables are allocated on the stack and
-get preserved during recursion in the normal way. In this environment, fi and
-i, and fc and c, can be the same variables. */
-
-#else /* NO_RECURSE not defined */
-#define fi i
-#define fc c
-
-/* Many of the following variables are used only in small blocks of the code.
-My normal style of coding would have declared them within each of those blocks.
-However, in order to accommodate the version of this code that uses an external
-"stack" implemented on the heap, it is easier to declare them all here, so the
-declarations can be cut out in a block. The only declarations within blocks
-below are for variables that do not have to be preserved over a recursive call
-to RMATCH(). */
-
-#ifdef SUPPORT_UTF
-const pcre_uchar *charptr;
-#endif
-const pcre_uchar *callpat;
-const pcre_uchar *data;
-const pcre_uchar *next;
-PCRE_PUCHAR pp;
-const pcre_uchar *prev;
-PCRE_PUCHAR saved_eptr;
-
-recursion_info new_recursive;
-
-BOOL cur_is_word;
-BOOL condition;
-BOOL prev_is_word;
-
-#ifdef SUPPORT_UCP
-int prop_type;
-unsigned int prop_value;
-int prop_fail_result;
-int oclength;
-pcre_uchar occhars[6];
-#endif
-
-int codelink;
-int ctype;
-int length;
-int max;
-int min;
-unsigned int number;
-int offset;
-unsigned int op;
-pcre_int32 save_capture_last;
-int save_offset1, save_offset2, save_offset3;
-int stacksave[REC_STACK_SAVE_MAX];
-
-eptrblock newptrb;
-
-/* There is a special fudge for calling match() in a way that causes it to
-measure the size of its basic stack frame when the stack is being used for
-recursion. The second argument (ecode) being NULL triggers this behaviour. It
-cannot normally ever be NULL. The return is the negated value of the frame
-size. */
-
-if (ecode == NULL)
- {
- if (rdepth == 0)
- return match((PCRE_PUCHAR)&rdepth, NULL, NULL, 0, NULL, NULL, 1);
- else
- {
- int len = (char *)&rdepth - (char *)eptr;
- return (len > 0)? -len : len;
- }
- }
-#endif /* NO_RECURSE */
-
-/* To save space on the stack and in the heap frame, I have doubled up on some
-of the local variables that are used only in localised parts of the code, but
-still need to be preserved over recursive calls of match(). These macros define
-the alternative names that are used. */
-
-#define allow_zero cur_is_word
-#define cbegroup condition
-#define code_offset codelink
-#define condassert condition
-#define matched_once prev_is_word
-#define foc number
-#define save_mark data
-
-/* These statements are here to stop the compiler complaining about unitialized
-variables. */
-
-#ifdef SUPPORT_UCP
-prop_value = 0;
-prop_fail_result = 0;
-#endif
-
-
-/* This label is used for tail recursion, which is used in a few cases even
-when NO_RECURSE is not defined, in order to reduce the amount of stack that is
-used. Thanks to Ian Taylor for noticing this possibility and sending the
-original patch. */
-
-TAIL_RECURSE:
-
-/* OK, now we can get on with the real code of the function. Recursive calls
-are specified by the macro RMATCH and RRETURN is used to return. When
-NO_RECURSE is *not* defined, these just turn into a recursive call to match()
-and a "return", respectively (possibly with some debugging if PCRE_DEBUG is
-defined). However, RMATCH isn't like a function call because it's quite a
-complicated macro. It has to be used in one particular way. This shouldn't,
-however, impact performance when true recursion is being used. */
-
-#ifdef SUPPORT_UTF
-utf = md->utf; /* Local copy of the flag */
-#else
-utf = FALSE;
-#endif
-
-/* First check that we haven't called match() too many times, or that we
-haven't exceeded the recursive call limit. */
-
-if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT);
-if (rdepth >= md->match_limit_recursion) RRETURN(PCRE_ERROR_RECURSIONLIMIT);
-
-/* At the start of a group with an unlimited repeat that may match an empty
-string, the variable md->match_function_type is set to MATCH_CBEGROUP. It is
-done this way to save having to use another function argument, which would take
-up space on the stack. See also MATCH_CONDASSERT below.
-
-When MATCH_CBEGROUP is set, add the current subject pointer to the chain of
-such remembered pointers, to be checked when we hit the closing ket, in order
-to break infinite loops that match no characters. When match() is called in
-other circumstances, don't add to the chain. The MATCH_CBEGROUP feature must
-NOT be used with tail recursion, because the memory block that is used is on
-the stack, so a new one may be required for each match(). */
-
-if (md->match_function_type == MATCH_CBEGROUP)
- {
- newptrb.epb_saved_eptr = eptr;
- newptrb.epb_prev = eptrb;
- eptrb = &newptrb;
- md->match_function_type = 0;
- }
-
-/* Now start processing the opcodes. */
-
-for (;;)
- {
- minimize = possessive = FALSE;
- op = *ecode;
-
- switch(op)
- {
- case OP_MARK:
- md->nomatch_mark = ecode + 2;
- md->mark = NULL; /* In case previously set by assertion */
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
- eptrb, RM55);
- if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
- md->mark == NULL) md->mark = ecode + 2;
-
- /* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an
- argument, and we must check whether that argument matches this MARK's
- argument. It is passed back in md->start_match_ptr (an overloading of that
- variable). If it does match, we reset that variable to the current subject
- position and return MATCH_SKIP. Otherwise, pass back the return code
- unaltered. */
-
- else if (rrc == MATCH_SKIP_ARG &&
- STRCMP_UC_UC_TEST(ecode + 2, md->start_match_ptr) == 0)
- {
- md->start_match_ptr = eptr;
- RRETURN(MATCH_SKIP);
- }
- RRETURN(rrc);
-
- case OP_FAIL:
- RRETURN(MATCH_NOMATCH);
-
- case OP_COMMIT:
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
- eptrb, RM52);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_COMMIT);
-
- case OP_PRUNE:
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
- eptrb, RM51);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_PRUNE);
-
- case OP_PRUNE_ARG:
- md->nomatch_mark = ecode + 2;
- md->mark = NULL; /* In case previously set by assertion */
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
- eptrb, RM56);
- if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
- md->mark == NULL) md->mark = ecode + 2;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- RRETURN(MATCH_PRUNE);
-
- case OP_SKIP:
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
- eptrb, RM53);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->start_match_ptr = eptr; /* Pass back current position */
- RRETURN(MATCH_SKIP);
-
- /* Note that, for Perl compatibility, SKIP with an argument does NOT set
- nomatch_mark. When a pattern match ends with a SKIP_ARG for which there was
- not a matching mark, we have to re-run the match, ignoring the SKIP_ARG
- that failed and any that precede it (either they also failed, or were not
- triggered). To do this, we maintain a count of executed SKIP_ARGs. If a
- SKIP_ARG gets to top level, the match is re-run with md->ignore_skip_arg
- set to the count of the one that failed. */
-
- case OP_SKIP_ARG:
- md->skip_arg_count++;
- if (md->skip_arg_count <= md->ignore_skip_arg)
- {
- ecode += PRIV(OP_lengths)[*ecode] + ecode[1];
- break;
- }
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
- eptrb, RM57);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
-
- /* Pass back the current skip name by overloading md->start_match_ptr and
- returning the special MATCH_SKIP_ARG return code. This will either be
- caught by a matching MARK, or get to the top, where it causes a rematch
- with md->ignore_skip_arg set to the value of md->skip_arg_count. */
-
- md->start_match_ptr = ecode + 2;
- RRETURN(MATCH_SKIP_ARG);
-
- /* For THEN (and THEN_ARG) we pass back the address of the opcode, so that
- the branch in which it occurs can be determined. Overload the start of
- match pointer to do this. */
-
- case OP_THEN:
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
- eptrb, RM54);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->start_match_ptr = ecode;
- RRETURN(MATCH_THEN);
-
- case OP_THEN_ARG:
- md->nomatch_mark = ecode + 2;
- md->mark = NULL; /* In case previously set by assertion */
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top,
- md, eptrb, RM58);
- if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
- md->mark == NULL) md->mark = ecode + 2;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->start_match_ptr = ecode;
- RRETURN(MATCH_THEN);
-
- /* Handle an atomic group that does not contain any capturing parentheses.
- This can be handled like an assertion. Prior to 8.13, all atomic groups
- were handled this way. In 8.13, the code was changed as below for ONCE, so
- that backups pass through the group and thereby reset captured values.
- However, this uses a lot more stack, so in 8.20, atomic groups that do not
- contain any captures generate OP_ONCE_NC, which can be handled in the old,
- less stack intensive way.
-
- Check the alternative branches in turn - the matching won't pass the KET
- for this kind of subpattern. If any one branch matches, we carry on as at
- the end of a normal bracket, leaving the subject pointer, but resetting
- the start-of-match value in case it was changed by \K. */
-
- case OP_ONCE_NC:
- prev = ecode;
- saved_eptr = eptr;
- save_mark = md->mark;
- do
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM64);
- if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */
- {
- mstart = md->start_match_ptr;
- break;
- }
- if (rrc == MATCH_THEN)
- {
- next = ecode + GET(ecode,1);
- if (md->start_match_ptr < next &&
- (*ecode == OP_ALT || *next == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
-
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += GET(ecode,1);
- md->mark = save_mark;
- }
- while (*ecode == OP_ALT);
-
- /* If hit the end of the group (which could be repeated), fail */
-
- if (*ecode != OP_ONCE_NC && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH);
-
- /* Continue as from after the group, updating the offsets high water
- mark, since extracts may have been taken. */
-
- do ecode += GET(ecode, 1); while (*ecode == OP_ALT);
-
- offset_top = md->end_offset_top;
- eptr = md->end_match_ptr;
-
- /* For a non-repeating ket, just continue at this level. This also
- happens for a repeating ket if no characters were matched in the group.
- This is the forcible breaking of infinite loops as implemented in Perl
- 5.005. */
-
- if (*ecode == OP_KET || eptr == saved_eptr)
- {
- ecode += 1+LINK_SIZE;
- break;
- }
-
- /* The repeating kets try the rest of the pattern or restart from the
- preceding bracket, in the appropriate order. The second "call" of match()
- uses tail recursion, to avoid using another stack frame. */
-
- if (*ecode == OP_KETRMIN)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM65);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode = prev;
- goto TAIL_RECURSE;
- }
- else /* OP_KETRMAX */
- {
- RMATCH(eptr, prev, offset_top, md, eptrb, RM66);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += 1 + LINK_SIZE;
- goto TAIL_RECURSE;
- }
- /* Control never gets here */
-
- /* Handle a capturing bracket, other than those that are possessive with an
- unlimited repeat. If there is space in the offset vector, save the current
- subject position in the working slot at the top of the vector. We mustn't
- change the current values of the data slot, because they may be set from a
- previous iteration of this group, and be referred to by a reference inside
- the group. A failure to match might occur after the group has succeeded,
- if something later on doesn't match. For this reason, we need to restore
- the working value and also the values of the final offsets, in case they
- were set by a previous iteration of the same bracket.
-
- If there isn't enough space in the offset vector, treat this as if it were
- a non-capturing bracket. Don't worry about setting the flag for the error
- case here; that is handled in the code for KET. */
-
- case OP_CBRA:
- case OP_SCBRA:
- number = GET2(ecode, 1+LINK_SIZE);
- offset = number << 1;
-
-#ifdef PCRE_DEBUG
- printf("start bracket %d\n", number);
- printf("subject=");
- pchars(eptr, 16, TRUE, md);
- printf("\n");
-#endif
-
- if (offset < md->offset_max)
- {
- save_offset1 = md->offset_vector[offset];
- save_offset2 = md->offset_vector[offset+1];
- save_offset3 = md->offset_vector[md->offset_end - number];
- save_capture_last = md->capture_last;
- save_mark = md->mark;
-
- DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3));
- md->offset_vector[md->offset_end - number] =
- (int)(eptr - md->start_subject);
-
- for (;;)
- {
- if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
- eptrb, RM1);
- if (rrc == MATCH_ONCE) break; /* Backing up through an atomic group */
-
- /* If we backed up to a THEN, check whether it is within the current
- branch by comparing the address of the THEN that is passed back with
- the end of the branch. If it is within the current branch, and the
- branch is one of two or more alternatives (it either starts or ends
- with OP_ALT), we have reached the limit of THEN's action, so convert
- the return code to NOMATCH, which will cause normal backtracking to
- happen from now on. Otherwise, THEN is passed back to an outer
- alternative. This implements Perl's treatment of parenthesized groups,
- where a group not containing | does not affect the current alternative,
- that is, (X) is NOT the same as (X|(*F)). */
-
- if (rrc == MATCH_THEN)
- {
- next = ecode + GET(ecode,1);
- if (md->start_match_ptr < next &&
- (*ecode == OP_ALT || *next == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
-
- /* Anything other than NOMATCH is passed back. */
-
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->capture_last = save_capture_last;
- ecode += GET(ecode, 1);
- md->mark = save_mark;
- if (*ecode != OP_ALT) break;
- }
-
- DPRINTF(("bracket %d failed\n", number));
- md->offset_vector[offset] = save_offset1;
- md->offset_vector[offset+1] = save_offset2;
- md->offset_vector[md->offset_end - number] = save_offset3;
-
- /* At this point, rrc will be one of MATCH_ONCE or MATCH_NOMATCH. */
-
- RRETURN(rrc);
- }
-
- /* FALL THROUGH ... Insufficient room for saving captured contents. Treat
- as a non-capturing bracket. */
-
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
-
- DPRINTF(("insufficient capture room: treat as non-capturing\n"));
-
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
-
- /* Non-capturing or atomic group, except for possessive with unlimited
- repeat and ONCE group with no captures. Loop for all the alternatives.
-
- When we get to the final alternative within the brackets, we used to return
- the result of a recursive call to match() whatever happened so it was
- possible to reduce stack usage by turning this into a tail recursion,
- except in the case of a possibly empty group. However, now that there is
- the possiblity of (*THEN) occurring in the final alternative, this
- optimization is no longer always possible.
-
- We can optimize if we know there are no (*THEN)s in the pattern; at present
- this is the best that can be done.
-
- MATCH_ONCE is returned when the end of an atomic group is successfully
- reached, but subsequent matching fails. It passes back up the tree (causing
- captured values to be reset) until the original atomic group level is
- reached. This is tested by comparing md->once_target with the start of the
- group. At this point, the return is converted into MATCH_NOMATCH so that
- previous backup points can be taken. */
-
- case OP_ONCE:
- case OP_BRA:
- case OP_SBRA:
- DPRINTF(("start non-capturing bracket\n"));
-
- for (;;)
- {
- if (op >= OP_SBRA || op == OP_ONCE)
- md->match_function_type = MATCH_CBEGROUP;
-
- /* If this is not a possibly empty group, and there are no (*THEN)s in
- the pattern, and this is the final alternative, optimize as described
- above. */
-
- else if (!md->hasthen && ecode[GET(ecode, 1)] != OP_ALT)
- {
- ecode += PRIV(OP_lengths)[*ecode];
- goto TAIL_RECURSE;
- }
-
- /* In all other cases, we have to make another call to match(). */
-
- save_mark = md->mark;
- save_capture_last = md->capture_last;
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, eptrb,
- RM2);
-
- /* See comment in the code for capturing groups above about handling
- THEN. */
-
- if (rrc == MATCH_THEN)
- {
- next = ecode + GET(ecode,1);
- if (md->start_match_ptr < next &&
- (*ecode == OP_ALT || *next == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
-
- if (rrc != MATCH_NOMATCH)
- {
- if (rrc == MATCH_ONCE)
- {
- const pcre_uchar *scode = ecode;
- if (*scode != OP_ONCE) /* If not at start, find it */
- {
- while (*scode == OP_ALT) scode += GET(scode, 1);
- scode -= GET(scode, 1);
- }
- if (md->once_target == scode) rrc = MATCH_NOMATCH;
- }
- RRETURN(rrc);
- }
- ecode += GET(ecode, 1);
- md->mark = save_mark;
- if (*ecode != OP_ALT) break;
- md->capture_last = save_capture_last;
- }
-
- RRETURN(MATCH_NOMATCH);
-
- /* Handle possessive capturing brackets with an unlimited repeat. We come
- here from BRAZERO with allow_zero set TRUE. The offset_vector values are
- handled similarly to the normal case above. However, the matching is
- different. The end of these brackets will always be OP_KETRPOS, which
- returns MATCH_KETRPOS without going further in the pattern. By this means
- we can handle the group by iteration rather than recursion, thereby
- reducing the amount of stack needed. */
-
- case OP_CBRAPOS:
- case OP_SCBRAPOS:
- allow_zero = FALSE;
-
- POSSESSIVE_CAPTURE:
- number = GET2(ecode, 1+LINK_SIZE);
- offset = number << 1;
-
-#ifdef PCRE_DEBUG
- printf("start possessive bracket %d\n", number);
- printf("subject=");
- pchars(eptr, 16, TRUE, md);
- printf("\n");
-#endif
-
- if (offset < md->offset_max)
- {
- matched_once = FALSE;
- code_offset = (int)(ecode - md->start_code);
-
- save_offset1 = md->offset_vector[offset];
- save_offset2 = md->offset_vector[offset+1];
- save_offset3 = md->offset_vector[md->offset_end - number];
- save_capture_last = md->capture_last;
-
- DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3));
-
- /* Each time round the loop, save the current subject position for use
- when the group matches. For MATCH_MATCH, the group has matched, so we
- restart it with a new subject starting position, remembering that we had
- at least one match. For MATCH_NOMATCH, carry on with the alternatives, as
- usual. If we haven't matched any alternatives in any iteration, check to
- see if a previous iteration matched. If so, the group has matched;
- continue from afterwards. Otherwise it has failed; restore the previous
- capture values before returning NOMATCH. */
-
- for (;;)
- {
- md->offset_vector[md->offset_end - number] =
- (int)(eptr - md->start_subject);
- if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
- eptrb, RM63);
- if (rrc == MATCH_KETRPOS)
- {
- offset_top = md->end_offset_top;
- eptr = md->end_match_ptr;
- ecode = md->start_code + code_offset;
- save_capture_last = md->capture_last;
- matched_once = TRUE;
- mstart = md->start_match_ptr; /* In case \K changed it */
- continue;
- }
-
- /* See comment in the code for capturing groups above about handling
- THEN. */
-
- if (rrc == MATCH_THEN)
- {
- next = ecode + GET(ecode,1);
- if (md->start_match_ptr < next &&
- (*ecode == OP_ALT || *next == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
-
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->capture_last = save_capture_last;
- ecode += GET(ecode, 1);
- if (*ecode != OP_ALT) break;
- }
-
- if (!matched_once)
- {
- md->offset_vector[offset] = save_offset1;
- md->offset_vector[offset+1] = save_offset2;
- md->offset_vector[md->offset_end - number] = save_offset3;
- }
-
- if (allow_zero || matched_once)
- {
- ecode += 1 + LINK_SIZE;
- break;
- }
-
- RRETURN(MATCH_NOMATCH);
- }
-
- /* FALL THROUGH ... Insufficient room for saving captured contents. Treat
- as a non-capturing bracket. */
-
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
-
- DPRINTF(("insufficient capture room: treat as non-capturing\n"));
-
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
- /* VVVVVVVVVVVVVVVVVVVVVVVVV */
-
- /* Non-capturing possessive bracket with unlimited repeat. We come here
- from BRAZERO with allow_zero = TRUE. The code is similar to the above,
- without the capturing complication. It is written out separately for speed
- and cleanliness. */
-
- case OP_BRAPOS:
- case OP_SBRAPOS:
- allow_zero = FALSE;
-
- POSSESSIVE_NON_CAPTURE:
- matched_once = FALSE;
- code_offset = (int)(ecode - md->start_code);
- save_capture_last = md->capture_last;
-
- for (;;)
- {
- if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
- eptrb, RM48);
- if (rrc == MATCH_KETRPOS)
- {
- offset_top = md->end_offset_top;
- eptr = md->end_match_ptr;
- ecode = md->start_code + code_offset;
- matched_once = TRUE;
- mstart = md->start_match_ptr; /* In case \K reset it */
- continue;
- }
-
- /* See comment in the code for capturing groups above about handling
- THEN. */
-
- if (rrc == MATCH_THEN)
- {
- next = ecode + GET(ecode,1);
- if (md->start_match_ptr < next &&
- (*ecode == OP_ALT || *next == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
-
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += GET(ecode, 1);
- if (*ecode != OP_ALT) break;
- md->capture_last = save_capture_last;
- }
-
- if (matched_once || allow_zero)
- {
- ecode += 1 + LINK_SIZE;
- break;
- }
- RRETURN(MATCH_NOMATCH);
-
- /* Control never reaches here. */
-
- /* Conditional group: compilation checked that there are no more than two
- branches. If the condition is false, skipping the first branch takes us
- past the end of the item if there is only one branch, but that's exactly
- what we want. */
-
- case OP_COND:
- case OP_SCOND:
-
- /* The variable codelink will be added to ecode when the condition is
- false, to get to the second branch. Setting it to the offset to the ALT
- or KET, then incrementing ecode achieves this effect. We now have ecode
- pointing to the condition or callout. */
-
- codelink = GET(ecode, 1); /* Offset to the second branch */
- ecode += 1 + LINK_SIZE; /* From this opcode */
-
- /* Because of the way auto-callout works during compile, a callout item is
- inserted between OP_COND and an assertion condition. */
-
- if (*ecode == OP_CALLOUT)
- {
- if (PUBL(callout) != NULL)
- {
- PUBL(callout_block) cb;
- cb.version = 2; /* Version 1 of the callout block */
- cb.callout_number = ecode[1];
- cb.offset_vector = md->offset_vector;
-#if defined COMPILE_PCRE8
- cb.subject = (PCRE_SPTR)md->start_subject;
-#elif defined COMPILE_PCRE16
- cb.subject = (PCRE_SPTR16)md->start_subject;
-#elif defined COMPILE_PCRE32
- cb.subject = (PCRE_SPTR32)md->start_subject;
-#endif
- cb.subject_length = (int)(md->end_subject - md->start_subject);
- cb.start_match = (int)(mstart - md->start_subject);
- cb.current_position = (int)(eptr - md->start_subject);
- cb.pattern_position = GET(ecode, 2);
- cb.next_item_length = GET(ecode, 2 + LINK_SIZE);
- cb.capture_top = offset_top/2;
- cb.capture_last = md->capture_last & CAPLMASK;
- /* Internal change requires this for API compatibility. */
- if (cb.capture_last == 0) cb.capture_last = -1;
- cb.callout_data = md->callout_data;
- cb.mark = md->nomatch_mark;
- if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH);
- if (rrc < 0) RRETURN(rrc);
- }
-
- /* Advance ecode past the callout, so it now points to the condition. We
- must adjust codelink so that the value of ecode+codelink is unchanged. */
-
- ecode += PRIV(OP_lengths)[OP_CALLOUT];
- codelink -= PRIV(OP_lengths)[OP_CALLOUT];
- }
-
- /* Test the various possible conditions */
-
- condition = FALSE;
- switch(condcode = *ecode)
- {
- case OP_RREF: /* Numbered group recursion test */
- if (md->recursive != NULL) /* Not recursing => FALSE */
- {
- unsigned int recno = GET2(ecode, 1); /* Recursion group number*/
- condition = (recno == RREF_ANY || recno == md->recursive->group_num);
- }
- break;
-
- case OP_DNRREF: /* Duplicate named group recursion test */
- if (md->recursive != NULL)
- {
- int count = GET2(ecode, 1 + IMM2_SIZE);
- pcre_uchar *slot = md->name_table + GET2(ecode, 1) * md->name_entry_size;
- while (count-- > 0)
- {
- unsigned int recno = GET2(slot, 0);
- condition = recno == md->recursive->group_num;
- if (condition) break;
- slot += md->name_entry_size;
- }
- }
- break;
-
- case OP_CREF: /* Numbered group used test */
- offset = GET2(ecode, 1) << 1; /* Doubled ref number */
- condition = offset < offset_top && md->offset_vector[offset] >= 0;
- break;
-
- case OP_DNCREF: /* Duplicate named group used test */
- {
- int count = GET2(ecode, 1 + IMM2_SIZE);
- pcre_uchar *slot = md->name_table + GET2(ecode, 1) * md->name_entry_size;
- while (count-- > 0)
- {
- offset = GET2(slot, 0) << 1;
- condition = offset < offset_top && md->offset_vector[offset] >= 0;
- if (condition) break;
- slot += md->name_entry_size;
- }
- }
- break;
-
- case OP_DEF: /* DEFINE - always false */
- break;
-
- /* The condition is an assertion. Call match() to evaluate it - setting
- md->match_function_type to MATCH_CONDASSERT causes it to stop at the end
- of an assertion. */
-
- default:
- md->match_function_type = MATCH_CONDASSERT;
- RMATCH(eptr, ecode, offset_top, md, NULL, RM3);
- if (rrc == MATCH_MATCH)
- {
- if (md->end_offset_top > offset_top)
- offset_top = md->end_offset_top; /* Captures may have happened */
- condition = TRUE;
-
- /* Advance ecode past the assertion to the start of the first branch,
- but adjust it so that the general choosing code below works. */
-
- ecode += GET(ecode, 1);
- while (*ecode == OP_ALT) ecode += GET(ecode, 1);
- ecode += 1 + LINK_SIZE - PRIV(OP_lengths)[condcode];
- }
-
- /* PCRE doesn't allow the effect of (*THEN) to escape beyond an
- assertion; it is therefore treated as NOMATCH. Any other return is an
- error. */
-
- else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN)
- {
- RRETURN(rrc); /* Need braces because of following else */
- }
- break;
- }
-
- /* Choose branch according to the condition */
-
- ecode += condition? PRIV(OP_lengths)[condcode] : codelink;
-
- /* We are now at the branch that is to be obeyed. As there is only one, we
- can use tail recursion to avoid using another stack frame, except when
- there is unlimited repeat of a possibly empty group. In the latter case, a
- recursive call to match() is always required, unless the second alternative
- doesn't exist, in which case we can just plough on. Note that, for
- compatibility with Perl, the | in a conditional group is NOT treated as
- creating two alternatives. If a THEN is encountered in the branch, it
- propagates out to the enclosing alternative (unless nested in a deeper set
- of alternatives, of course). */
-
- if (condition || ecode[-(1+LINK_SIZE)] == OP_ALT)
- {
- if (op != OP_SCOND)
- {
- goto TAIL_RECURSE;
- }
-
- md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM49);
- RRETURN(rrc);
- }
-
- /* Condition false & no alternative; continue after the group. */
-
- else
- {
- }
- break;
-
-
- /* Before OP_ACCEPT there may be any number of OP_CLOSE opcodes,
- to close any currently open capturing brackets. */
-
- case OP_CLOSE:
- number = GET2(ecode, 1); /* Must be less than 65536 */
- offset = number << 1;
-
-#ifdef PCRE_DEBUG
- printf("end bracket %d at *ACCEPT", number);
- printf("\n");
-#endif
-
- md->capture_last = (md->capture_last & OVFLMASK) | number;
- if (offset >= md->offset_max) md->capture_last |= OVFLBIT; else
- {
- md->offset_vector[offset] =
- md->offset_vector[md->offset_end - number];
- md->offset_vector[offset+1] = (int)(eptr - md->start_subject);
- if (offset_top <= offset) offset_top = offset + 2;
- }
- ecode += 1 + IMM2_SIZE;
- break;
-
-
- /* End of the pattern, either real or forced. */
-
- case OP_END:
- case OP_ACCEPT:
- case OP_ASSERT_ACCEPT:
-
- /* If we have matched an empty string, fail if not in an assertion and not
- in a recursion if either PCRE_NOTEMPTY is set, or if PCRE_NOTEMPTY_ATSTART
- is set and we have matched at the start of the subject. In both cases,
- backtracking will then try other alternatives, if any. */
-
- if (eptr == mstart && op != OP_ASSERT_ACCEPT &&
- md->recursive == NULL &&
- (md->notempty ||
- (md->notempty_atstart &&
- mstart == md->start_subject + md->start_offset)))
- RRETURN(MATCH_NOMATCH);
-
- /* Otherwise, we have a match. */
-
- md->end_match_ptr = eptr; /* Record where we ended */
- md->end_offset_top = offset_top; /* and how many extracts were taken */
- md->start_match_ptr = mstart; /* and the start (\K can modify) */
-
- /* For some reason, the macros don't work properly if an expression is
- given as the argument to RRETURN when the heap is in use. */
-
- rrc = (op == OP_END)? MATCH_MATCH : MATCH_ACCEPT;
- RRETURN(rrc);
-
- /* Assertion brackets. Check the alternative branches in turn - the
- matching won't pass the KET for an assertion. If any one branch matches,
- the assertion is true. Lookbehind assertions have an OP_REVERSE item at the
- start of each branch to move the current point backwards, so the code at
- this level is identical to the lookahead case. When the assertion is part
- of a condition, we want to return immediately afterwards. The caller of
- this incarnation of the match() function will have set MATCH_CONDASSERT in
- md->match_function type, and one of these opcodes will be the first opcode
- that is processed. We use a local variable that is preserved over calls to
- match() to remember this case. */
-
- case OP_ASSERT:
- case OP_ASSERTBACK:
- save_mark = md->mark;
- if (md->match_function_type == MATCH_CONDASSERT)
- {
- condassert = TRUE;
- md->match_function_type = 0;
- }
- else condassert = FALSE;
-
- /* Loop for each branch */
-
- do
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM4);
-
- /* A match means that the assertion is true; break out of the loop
- that matches its alternatives. */
-
- if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT)
- {
- mstart = md->start_match_ptr; /* In case \K reset it */
- break;
- }
-
- /* If not matched, restore the previous mark setting. */
-
- md->mark = save_mark;
-
- /* See comment in the code for capturing groups above about handling
- THEN. */
-
- if (rrc == MATCH_THEN)
- {
- next = ecode + GET(ecode,1);
- if (md->start_match_ptr < next &&
- (*ecode == OP_ALT || *next == OP_ALT))
- rrc = MATCH_NOMATCH;
- }
-
- /* Anything other than NOMATCH causes the entire assertion to fail,
- passing back the return code. This includes COMMIT, SKIP, PRUNE and an
- uncaptured THEN, which means they take their normal effect. This
- consistent approach does not always have exactly the same effect as in
- Perl. */
-
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode += GET(ecode, 1);
- }
- while (*ecode == OP_ALT); /* Continue for next alternative */
-
- /* If we have tried all the alternative branches, the assertion has
- failed. If not, we broke out after a match. */
-
- if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH);
-
- /* If checking an assertion for a condition, return MATCH_MATCH. */
-
- if (condassert) RRETURN(MATCH_MATCH);
-
- /* Continue from after a successful assertion, updating the offsets high
- water mark, since extracts may have been taken during the assertion. */
-
- do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- ecode += 1 + LINK_SIZE;
- offset_top = md->end_offset_top;
- continue;
-
- /* Negative assertion: all branches must fail to match for the assertion to
- succeed. */
-
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK_NOT:
- save_mark = md->mark;
- if (md->match_function_type == MATCH_CONDASSERT)
- {
- condassert = TRUE;
- md->match_function_type = 0;
- }
- else condassert = FALSE;
-
- /* Loop for each alternative branch. */
-
- do
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM5);
- md->mark = save_mark; /* Always restore the mark setting */
-
- switch(rrc)
- {
- case MATCH_MATCH: /* A successful match means */
- case MATCH_ACCEPT: /* the assertion has failed. */
- RRETURN(MATCH_NOMATCH);
-
- case MATCH_NOMATCH: /* Carry on with next branch */
- break;
-
- /* See comment in the code for capturing groups above about handling
- THEN. */
-
- case MATCH_THEN:
- next = ecode + GET(ecode,1);
- if (md->start_match_ptr < next &&
- (*ecode == OP_ALT || *next == OP_ALT))
- {
- rrc = MATCH_NOMATCH;
- break;
- }
- /* Otherwise fall through. */
-
- /* COMMIT, SKIP, PRUNE, and an uncaptured THEN cause the whole
- assertion to fail to match, without considering any more alternatives.
- Failing to match means the assertion is true. This is a consistent
- approach, but does not always have the same effect as in Perl. */
-
- case MATCH_COMMIT:
- case MATCH_SKIP:
- case MATCH_SKIP_ARG:
- case MATCH_PRUNE:
- do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- goto NEG_ASSERT_TRUE; /* Break out of alternation loop */
-
- /* Anything else is an error */
-
- default:
- RRETURN(rrc);
- }
-
- /* Continue with next branch */
-
- ecode += GET(ecode,1);
- }
- while (*ecode == OP_ALT);
-
- /* All branches in the assertion failed to match. */
-
- NEG_ASSERT_TRUE:
- if (condassert) RRETURN(MATCH_MATCH); /* Condition assertion */
- ecode += 1 + LINK_SIZE; /* Continue with current branch */
- continue;
-
- /* Move the subject pointer back. This occurs only at the start of
- each branch of a lookbehind assertion. If we are too close to the start to
- move back, this match function fails. When working with UTF-8 we move
- back a number of characters, not bytes. */
-
- case OP_REVERSE:
-#ifdef SUPPORT_UTF
- if (utf)
- {
- i = GET(ecode, 1);
- while (i-- > 0)
- {
- eptr--;
- if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH);
- BACKCHAR(eptr);
- }
- }
- else
-#endif
-
- /* No UTF-8 support, or not in UTF-8 mode: count is byte count */
-
- {
- eptr -= GET(ecode, 1);
- if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH);
- }
-
- /* Save the earliest consulted character, then skip to next op code */
-
- if (eptr < md->start_used_ptr) md->start_used_ptr = eptr;
- ecode += 1 + LINK_SIZE;
- break;
-
- /* The callout item calls an external function, if one is provided, passing
- details of the match so far. This is mainly for debugging, though the
- function is able to force a failure. */
-
- case OP_CALLOUT:
- if (PUBL(callout) != NULL)
- {
- PUBL(callout_block) cb;
- cb.version = 2; /* Version 1 of the callout block */
- cb.callout_number = ecode[1];
- cb.offset_vector = md->offset_vector;
-#if defined COMPILE_PCRE8
- cb.subject = (PCRE_SPTR)md->start_subject;
-#elif defined COMPILE_PCRE16
- cb.subject = (PCRE_SPTR16)md->start_subject;
-#elif defined COMPILE_PCRE32
- cb.subject = (PCRE_SPTR32)md->start_subject;
-#endif
- cb.subject_length = (int)(md->end_subject - md->start_subject);
- cb.start_match = (int)(mstart - md->start_subject);
- cb.current_position = (int)(eptr - md->start_subject);
- cb.pattern_position = GET(ecode, 2);
- cb.next_item_length = GET(ecode, 2 + LINK_SIZE);
- cb.capture_top = offset_top/2;
- cb.capture_last = md->capture_last & CAPLMASK;
- /* Internal change requires this for API compatibility. */
- if (cb.capture_last == 0) cb.capture_last = -1;
- cb.callout_data = md->callout_data;
- cb.mark = md->nomatch_mark;
- if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH);
- if (rrc < 0) RRETURN(rrc);
- }
- ecode += 2 + 2*LINK_SIZE;
- break;
-
- /* Recursion either matches the current regex, or some subexpression. The
- offset data is the offset to the starting bracket from the start of the
- whole pattern. (This is so that it works from duplicated subpatterns.)
-
- The state of the capturing groups is preserved over recursion, and
- re-instated afterwards. We don't know how many are started and not yet
- finished (offset_top records the completed total) so we just have to save
- all the potential data. There may be up to 65535 such values, which is too
- large to put on the stack, but using malloc for small numbers seems
- expensive. As a compromise, the stack is used when there are no more than
- REC_STACK_SAVE_MAX values to store; otherwise malloc is used.
-
- There are also other values that have to be saved. We use a chained
- sequence of blocks that actually live on the stack. Thanks to Robin Houston
- for the original version of this logic. It has, however, been hacked around
- a lot, so he is not to blame for the current way it works. */
-
- case OP_RECURSE:
- {
- recursion_info *ri;
- unsigned int recno;
-
- callpat = md->start_code + GET(ecode, 1);
- recno = (callpat == md->start_code)? 0 :
- GET2(callpat, 1 + LINK_SIZE);
-
- /* Check for repeating a recursion without advancing the subject pointer.
- This should catch convoluted mutual recursions. (Some simple cases are
- caught at compile time.) */
-
- for (ri = md->recursive; ri != NULL; ri = ri->prevrec)
- if (recno == ri->group_num && eptr == ri->subject_position)
- RRETURN(PCRE_ERROR_RECURSELOOP);
-
- /* Add to "recursing stack" */
-
- new_recursive.group_num = recno;
- new_recursive.saved_capture_last = md->capture_last;
- new_recursive.subject_position = eptr;
- new_recursive.prevrec = md->recursive;
- md->recursive = &new_recursive;
-
- /* Where to continue from afterwards */
-
- ecode += 1 + LINK_SIZE;
-
- /* Now save the offset data */
-
- new_recursive.saved_max = md->offset_end;
- if (new_recursive.saved_max <= REC_STACK_SAVE_MAX)
- new_recursive.offset_save = stacksave;
- else
- {
- new_recursive.offset_save =
- (int *)(PUBL(malloc))(new_recursive.saved_max * sizeof(int));
- if (new_recursive.offset_save == NULL) RRETURN(PCRE_ERROR_NOMEMORY);
- }
- memcpy(new_recursive.offset_save, md->offset_vector,
- new_recursive.saved_max * sizeof(int));
-
- /* OK, now we can do the recursion. After processing each alternative,
- restore the offset data and the last captured value. If there were nested
- recursions, md->recursive might be changed, so reset it before looping.
- */
-
- DPRINTF(("Recursing into group %d\n", new_recursive.group_num));
- cbegroup = (*callpat >= OP_SBRA);
- do
- {
- if (cbegroup) md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, callpat + PRIV(OP_lengths)[*callpat], offset_top,
- md, eptrb, RM6);
- memcpy(md->offset_vector, new_recursive.offset_save,
- new_recursive.saved_max * sizeof(int));
- md->capture_last = new_recursive.saved_capture_last;
- md->recursive = new_recursive.prevrec;
- if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT)
- {
- DPRINTF(("Recursion matched\n"));
- if (new_recursive.offset_save != stacksave)
- (PUBL(free))(new_recursive.offset_save);
-
- /* Set where we got to in the subject, and reset the start in case
- it was changed by \K. This *is* propagated back out of a recursion,
- for Perl compatibility. */
-
- eptr = md->end_match_ptr;
- mstart = md->start_match_ptr;
- goto RECURSION_MATCHED; /* Exit loop; end processing */
- }
-
- /* PCRE does not allow THEN, SKIP, PRUNE or COMMIT to escape beyond a
- recursion; they cause a NOMATCH for the entire recursion. These codes
- are defined in a range that can be tested for. */
-
- if (rrc >= MATCH_BACKTRACK_MIN && rrc <= MATCH_BACKTRACK_MAX)
- RRETURN(MATCH_NOMATCH);
-
- /* Any return code other than NOMATCH is an error. */
-
- if (rrc != MATCH_NOMATCH)
- {
- DPRINTF(("Recursion gave error %d\n", rrc));
- if (new_recursive.offset_save != stacksave)
- (PUBL(free))(new_recursive.offset_save);
- RRETURN(rrc);
- }
-
- md->recursive = &new_recursive;
- callpat += GET(callpat, 1);
- }
- while (*callpat == OP_ALT);
-
- DPRINTF(("Recursion didn't match\n"));
- md->recursive = new_recursive.prevrec;
- if (new_recursive.offset_save != stacksave)
- (PUBL(free))(new_recursive.offset_save);
- RRETURN(MATCH_NOMATCH);
- }
-
- RECURSION_MATCHED:
- break;
-
- /* An alternation is the end of a branch; scan along to find the end of the
- bracketed group and go to there. */
-
- case OP_ALT:
- do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- break;
-
- /* BRAZERO, BRAMINZERO and SKIPZERO occur just before a bracket group,
- indicating that it may occur zero times. It may repeat infinitely, or not
- at all - i.e. it could be ()* or ()? or even (){0} in the pattern. Brackets
- with fixed upper repeat limits are compiled as a number of copies, with the
- optional ones preceded by BRAZERO or BRAMINZERO. */
-
- case OP_BRAZERO:
- next = ecode + 1;
- RMATCH(eptr, next, offset_top, md, eptrb, RM10);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- do next += GET(next, 1); while (*next == OP_ALT);
- ecode = next + 1 + LINK_SIZE;
- break;
-
- case OP_BRAMINZERO:
- next = ecode + 1;
- do next += GET(next, 1); while (*next == OP_ALT);
- RMATCH(eptr, next + 1+LINK_SIZE, offset_top, md, eptrb, RM11);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- ecode++;
- break;
-
- case OP_SKIPZERO:
- next = ecode+1;
- do next += GET(next,1); while (*next == OP_ALT);
- ecode = next + 1 + LINK_SIZE;
- break;
-
- /* BRAPOSZERO occurs before a possessive bracket group. Don't do anything
- here; just jump to the group, with allow_zero set TRUE. */
-
- case OP_BRAPOSZERO:
- op = *(++ecode);
- allow_zero = TRUE;
- if (op == OP_CBRAPOS || op == OP_SCBRAPOS) goto POSSESSIVE_CAPTURE;
- goto POSSESSIVE_NON_CAPTURE;
-
- /* End of a group, repeated or non-repeating. */
-
- case OP_KET:
- case OP_KETRMIN:
- case OP_KETRMAX:
- case OP_KETRPOS:
- prev = ecode - GET(ecode, 1);
-
- /* If this was a group that remembered the subject start, in order to break
- infinite repeats of empty string matches, retrieve the subject start from
- the chain. Otherwise, set it NULL. */
-
- if (*prev >= OP_SBRA || *prev == OP_ONCE)
- {
- saved_eptr = eptrb->epb_saved_eptr; /* Value at start of group */
- eptrb = eptrb->epb_prev; /* Backup to previous group */
- }
- else saved_eptr = NULL;
-
- /* If we are at the end of an assertion group or a non-capturing atomic
- group, stop matching and return MATCH_MATCH, but record the current high
- water mark for use by positive assertions. We also need to record the match
- start in case it was changed by \K. */
-
- if ((*prev >= OP_ASSERT && *prev <= OP_ASSERTBACK_NOT) ||
- *prev == OP_ONCE_NC)
- {
- md->end_match_ptr = eptr; /* For ONCE_NC */
- md->end_offset_top = offset_top;
- md->start_match_ptr = mstart;
- RRETURN(MATCH_MATCH); /* Sets md->mark */
- }
-
- /* For capturing groups we have to check the group number back at the start
- and if necessary complete handling an extraction by setting the offsets and
- bumping the high water mark. 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. We just have to record
- the current subject position and start match pointer and give a MATCH
- return. */
-
- if (*prev == OP_CBRA || *prev == OP_SCBRA ||
- *prev == OP_CBRAPOS || *prev == OP_SCBRAPOS)
- {
- number = GET2(prev, 1+LINK_SIZE);
- offset = number << 1;
-
-#ifdef PCRE_DEBUG
- printf("end bracket %d", number);
- printf("\n");
-#endif
-
- /* Handle a recursively called group. */
-
- if (md->recursive != NULL && md->recursive->group_num == number)
- {
- md->end_match_ptr = eptr;
- md->start_match_ptr = mstart;
- RRETURN(MATCH_MATCH);
- }
-
- /* Deal with capturing */
-
- md->capture_last = (md->capture_last & OVFLMASK) | number;
- if (offset >= md->offset_max) md->capture_last |= OVFLBIT; else
- {
- /* If offset is greater than offset_top, it means that we are
- "skipping" a capturing group, and that group's offsets must be marked
- unset. In earlier versions of PCRE, all the offsets were unset at the
- start of matching, but this doesn't work because atomic groups and
- assertions can cause a value to be set that should later be unset.
- Example: matching /(?>(a))b|(a)c/ against "ac". This sets group 1 as
- part of the atomic group, but this is not on the final matching path,
- so must be unset when 2 is set. (If there is no group 2, there is no
- problem, because offset_top will then be 2, indicating no capture.) */
-
- if (offset > offset_top)
- {
- register int *iptr = md->offset_vector + offset_top;
- register int *iend = md->offset_vector + offset;
- while (iptr < iend) *iptr++ = -1;
- }
-
- /* Now make the extraction */
-
- md->offset_vector[offset] =
- md->offset_vector[md->offset_end - number];
- md->offset_vector[offset+1] = (int)(eptr - md->start_subject);
- if (offset_top <= offset) offset_top = offset + 2;
- }
- }
-
- /* For an ordinary non-repeating ket, just continue at this level. This
- also happens for a repeating ket if no characters were matched in the
- group. This is the forcible breaking of infinite loops as implemented in
- Perl 5.005. For a non-repeating atomic group that includes captures,
- establish a backup point by processing the rest of the pattern at a lower
- level. If this results in a NOMATCH return, pass MATCH_ONCE back to the
- original OP_ONCE level, thereby bypassing intermediate backup points, but
- resetting any captures that happened along the way. */
-
- if (*ecode == OP_KET || eptr == saved_eptr)
- {
- if (*prev == OP_ONCE)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM12);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->once_target = prev; /* Level at which to change to MATCH_NOMATCH */
- RRETURN(MATCH_ONCE);
- }
- ecode += 1 + LINK_SIZE; /* Carry on at this level */
- break;
- }
-
- /* OP_KETRPOS is a possessive repeating ket. Remember the current position,
- and return the MATCH_KETRPOS. This makes it possible to do the repeats one
- at a time from the outer level, thus saving stack. */
-
- if (*ecode == OP_KETRPOS)
- {
- md->start_match_ptr = mstart; /* In case \K reset it */
- md->end_match_ptr = eptr;
- md->end_offset_top = offset_top;
- RRETURN(MATCH_KETRPOS);
- }
-
- /* The normal repeating kets try the rest of the pattern or restart from
- the preceding bracket, in the appropriate order. In the second case, we can
- use tail recursion to avoid using another stack frame, unless we have an
- an atomic group or an unlimited repeat of a group that can match an empty
- string. */
-
- if (*ecode == OP_KETRMIN)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM7);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (*prev == OP_ONCE)
- {
- RMATCH(eptr, prev, offset_top, md, eptrb, RM8);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->once_target = prev; /* Level at which to change to MATCH_NOMATCH */
- RRETURN(MATCH_ONCE);
- }
- if (*prev >= OP_SBRA) /* Could match an empty string */
- {
- RMATCH(eptr, prev, offset_top, md, eptrb, RM50);
- RRETURN(rrc);
- }
- ecode = prev;
- goto TAIL_RECURSE;
- }
- else /* OP_KETRMAX */
- {
- RMATCH(eptr, prev, offset_top, md, eptrb, RM13);
- if (rrc == MATCH_ONCE && md->once_target == prev) rrc = MATCH_NOMATCH;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (*prev == OP_ONCE)
- {
- RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM9);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- md->once_target = prev;
- RRETURN(MATCH_ONCE);
- }
- ecode += 1 + LINK_SIZE;
- goto TAIL_RECURSE;
- }
- /* Control never gets here */
-
- /* Not multiline mode: start of subject assertion, unless notbol. */
-
- case OP_CIRC:
- if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH);
-
- /* Start of subject assertion */
-
- case OP_SOD:
- if (eptr != md->start_subject) RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Multiline mode: start of subject unless notbol, or after any newline. */
-
- case OP_CIRCM:
- if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH);
- if (eptr != md->start_subject &&
- (eptr == md->end_subject || !WAS_NEWLINE(eptr)))
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Start of match assertion */
-
- case OP_SOM:
- if (eptr != md->start_subject + md->start_offset) RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- /* Reset the start of match point */
-
- case OP_SET_SOM:
- mstart = eptr;
- ecode++;
- break;
-
- /* Multiline mode: assert before any newline, or before end of subject
- unless noteol is set. */
-
- case OP_DOLLM:
- if (eptr < md->end_subject)
- {
- if (!IS_NEWLINE(eptr))
- {
- if (md->partial != 0 &&
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21TEST(eptr) == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- RRETURN(MATCH_NOMATCH);
- }
- }
- else
- {
- if (md->noteol) RRETURN(MATCH_NOMATCH);
- SCHECK_PARTIAL();
- }
- ecode++;
- break;
-
- /* Not multiline mode: assert before a terminating newline or before end of
- subject unless noteol is set. */
-
- case OP_DOLL:
- if (md->noteol) RRETURN(MATCH_NOMATCH);
- if (!md->endonly) goto ASSERT_NL_OR_EOS;
-
- /* ... else fall through for endonly */
-
- /* End of subject assertion (\z) */
-
- case OP_EOD:
- if (eptr < md->end_subject) RRETURN(MATCH_NOMATCH);
- SCHECK_PARTIAL();
- ecode++;
- break;
-
- /* End of subject or ending \n assertion (\Z) */
-
- case OP_EODN:
- ASSERT_NL_OR_EOS:
- if (eptr < md->end_subject &&
- (!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen))
- {
- if (md->partial != 0 &&
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21TEST(eptr) == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- RRETURN(MATCH_NOMATCH);
- }
-
- /* Either at end of string or \n before end. */
-
- SCHECK_PARTIAL();
- ecode++;
- break;
-
- /* Word boundary assertions */
-
- case OP_NOT_WORD_BOUNDARY:
- case OP_WORD_BOUNDARY:
- {
-
- /* Find out if the previous and current characters are "word" characters.
- It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to
- be "non-word" characters. Remember the earliest consulted character for
- partial matching. */
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- /* Get status of previous character */
-
- if (eptr == md->start_subject) prev_is_word = FALSE; else
- {
- PCRE_PUCHAR lastptr = eptr - 1;
- BACKCHAR(lastptr);
- if (lastptr < md->start_used_ptr) md->start_used_ptr = lastptr;
- GETCHAR(c, lastptr);
-#ifdef SUPPORT_UCP
- if (md->use_ucp)
- {
- if (c == '_') prev_is_word = TRUE; else
- {
- int cat = UCD_CATEGORY(c);
- prev_is_word = (cat == ucp_L || cat == ucp_N);
- }
- }
- else
-#endif
- prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;
- }
-
- /* Get status of next character */
-
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- cur_is_word = FALSE;
- }
- else
- {
- GETCHAR(c, eptr);
-#ifdef SUPPORT_UCP
- if (md->use_ucp)
- {
- if (c == '_') cur_is_word = TRUE; else
- {
- int cat = UCD_CATEGORY(c);
- cur_is_word = (cat == ucp_L || cat == ucp_N);
- }
- }
- else
-#endif
- cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;
- }
- }
- else
-#endif
-
- /* Not in UTF-8 mode, but we may still have PCRE_UCP set, and for
- consistency with the behaviour of \w we do use it in this case. */
-
- {
- /* Get status of previous character */
-
- if (eptr == md->start_subject) prev_is_word = FALSE; else
- {
- if (eptr <= md->start_used_ptr) md->start_used_ptr = eptr - 1;
-#ifdef SUPPORT_UCP
- if (md->use_ucp)
- {
- c = eptr[-1];
- if (c == '_') prev_is_word = TRUE; else
- {
- int cat = UCD_CATEGORY(c);
- prev_is_word = (cat == ucp_L || cat == ucp_N);
- }
- }
- else
-#endif
- prev_is_word = MAX_255(eptr[-1])
- && ((md->ctypes[eptr[-1]] & ctype_word) != 0);
- }
-
- /* Get status of next character */
-
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- cur_is_word = FALSE;
- }
- else
-#ifdef SUPPORT_UCP
- if (md->use_ucp)
- {
- c = *eptr;
- if (c == '_') cur_is_word = TRUE; else
- {
- int cat = UCD_CATEGORY(c);
- cur_is_word = (cat == ucp_L || cat == ucp_N);
- }
- }
- else
-#endif
- cur_is_word = MAX_255(*eptr)
- && ((md->ctypes[*eptr] & ctype_word) != 0);
- }
-
- /* Now see if the situation is what we want */
-
- if ((*ecode++ == OP_WORD_BOUNDARY)?
- cur_is_word == prev_is_word : cur_is_word != prev_is_word)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- /* Match any single character type except newline; have to take care with
- CRLF newlines and partial matching. */
-
- case OP_ANY:
- if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH);
- if (md->partial != 0 &&
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21TEST(eptr) == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
-
- /* Fall through */
-
- /* Match any single character whatsoever. */
-
- case OP_ALLANY:
- if (eptr >= md->end_subject) /* DO NOT merge the eptr++ here; it must */
- { /* not be updated before SCHECK_PARTIAL. */
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr++;
-#ifdef SUPPORT_UTF
- if (utf) ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
-#endif
- ecode++;
- break;
-
- /* Match a single byte, even in UTF-8 mode. This opcode really does match
- any byte, even newline, independent of the setting of PCRE_DOTALL. */
-
- case OP_ANYBYTE:
- if (eptr >= md->end_subject) /* DO NOT merge the eptr++ here; it must */
- { /* not be updated before SCHECK_PARTIAL. */
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr++;
- ecode++;
- break;
-
- case OP_NOT_DIGIT:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8)
- c < 256 &&
-#endif
- (md->ctypes[c] & ctype_digit) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_DIGIT:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8)
- c > 255 ||
-#endif
- (md->ctypes[c] & ctype_digit) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_NOT_WHITESPACE:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8)
- c < 256 &&
-#endif
- (md->ctypes[c] & ctype_space) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_WHITESPACE:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8)
- c > 255 ||
-#endif
- (md->ctypes[c] & ctype_space) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_NOT_WORDCHAR:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8)
- c < 256 &&
-#endif
- (md->ctypes[c] & ctype_word) != 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_WORDCHAR:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (
-#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8)
- c > 255 ||
-#endif
- (md->ctypes[c] & ctype_word) == 0
- )
- RRETURN(MATCH_NOMATCH);
- ecode++;
- break;
-
- case OP_ANYNL:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
-
- case CHAR_CR:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- }
- else if (UCHAR21TEST(eptr) == CHAR_LF) eptr++;
- break;
-
- case CHAR_LF:
- break;
-
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_NEL:
-#ifndef EBCDIC
- case 0x2028:
- case 0x2029:
-#endif /* Not EBCDIC */
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- ecode++;
- break;
-
- case OP_NOT_HSPACE:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- HSPACE_CASES: RRETURN(MATCH_NOMATCH); /* Byte and multibyte cases */
- default: break;
- }
- ecode++;
- break;
-
- case OP_HSPACE:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- HSPACE_CASES: break; /* Byte and multibyte cases */
- default: RRETURN(MATCH_NOMATCH);
- }
- ecode++;
- break;
-
- case OP_NOT_VSPACE:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- VSPACE_CASES: RRETURN(MATCH_NOMATCH);
- default: break;
- }
- ecode++;
- break;
-
- case OP_VSPACE:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- VSPACE_CASES: break;
- default: RRETURN(MATCH_NOMATCH);
- }
- ecode++;
- break;
-
-#ifdef SUPPORT_UCP
- /* Check the next character by Unicode property. We will get here only
- if the support is in the binary; otherwise a compile-time error occurs. */
-
- case OP_PROP:
- case OP_NOTPROP:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- {
- const pcre_uint32 *cp;
- const ucd_record *prop = GET_UCD(c);
-
- switch(ecode[1])
- {
- case PT_ANY:
- if (op == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_LAMP:
- if ((prop->chartype == ucp_Lu ||
- prop->chartype == ucp_Ll ||
- prop->chartype == ucp_Lt) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_GC:
- if ((ecode[2] != PRIV(ucp_gentype)[prop->chartype]) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_PC:
- if ((ecode[2] != prop->chartype) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_SC:
- if ((ecode[2] != prop->script) == (op == OP_PROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- /* These are specials */
-
- case PT_ALNUM:
- if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
- PRIV(ucp_gentype)[prop->chartype] == ucp_N) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- /* Perl space used to exclude VT, but from Perl 5.18 it is included,
- which means that Perl space and POSIX space are now identical. PCRE
- was changed at release 8.34. */
-
- case PT_SPACE: /* Perl space */
- case PT_PXSPACE: /* POSIX space */
- switch(c)
- {
- HSPACE_CASES:
- VSPACE_CASES:
- if (op == OP_NOTPROP) RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z) ==
- (op == OP_NOTPROP)) RRETURN(MATCH_NOMATCH);
- break;
- }
- break;
-
- case PT_WORD:
- if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
- PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
- c == CHAR_UNDERSCORE) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- case PT_CLIST:
- cp = PRIV(ucd_caseless_sets) + ecode[2];
- for (;;)
- {
- if (c < *cp)
- { if (op == OP_PROP) { RRETURN(MATCH_NOMATCH); } else break; }
- if (c == *cp++)
- { if (op == OP_PROP) break; else { RRETURN(MATCH_NOMATCH); } }
- }
- break;
-
- case PT_UCNC:
- if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
- c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
- c >= 0xe000) == (op == OP_NOTPROP))
- RRETURN(MATCH_NOMATCH);
- break;
-
- /* This should never occur */
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
-
- ecode += 3;
- }
- break;
-
- /* Match an extended Unicode sequence. We will get here only if the support
- is in the binary; otherwise a compile-time error occurs. */
-
- case OP_EXTUNI:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- else
- {
- int lgb, rgb;
- GETCHARINCTEST(c, eptr);
- lgb = UCD_GRAPHBREAK(c);
- while (eptr < md->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;
- lgb = rgb;
- eptr += len;
- }
- }
- CHECK_PARTIAL();
- ecode++;
- break;
-#endif /* SUPPORT_UCP */
-
-
- /* Match a back reference, possibly repeatedly. Look past the end of the
- item to see if there is repeat information following. The code is similar
- to that for character classes, but repeated for efficiency. Then obey
- similar code to character type repeats - written out again for speed.
- However, if the referenced string is the empty string, always treat
- it as matched, any number of times (otherwise there could be infinite
- loops). If the reference is unset, there are two possibilities:
-
- (a) In the default, Perl-compatible state, set the length negative;
- this ensures that every attempt at a match fails. We can't just fail
- here, because of the possibility of quantifiers with zero minima.
-
- (b) If the JavaScript compatibility flag is set, set the length to zero
- so that the back reference matches an empty string.
-
- Otherwise, set the length to the length of what was matched by the
- referenced subpattern.
-
- The OP_REF and OP_REFI opcodes are used for a reference to a numbered group
- or to a non-duplicated named group. For a duplicated named group, OP_DNREF
- and OP_DNREFI are used. In this case we must scan the list of groups to
- which the name refers, and use the first one that is set. */
-
- case OP_DNREF:
- case OP_DNREFI:
- caseless = op == OP_DNREFI;
- {
- int count = GET2(ecode, 1+IMM2_SIZE);
- pcre_uchar *slot = md->name_table + GET2(ecode, 1) * md->name_entry_size;
- ecode += 1 + 2*IMM2_SIZE;
-
- /* Setting the default length first and initializing 'offset' avoids
- compiler warnings in the REF_REPEAT code. */
-
- length = (md->jscript_compat)? 0 : -1;
- offset = 0;
-
- while (count-- > 0)
- {
- offset = GET2(slot, 0) << 1;
- if (offset < offset_top && md->offset_vector[offset] >= 0)
- {
- length = md->offset_vector[offset+1] - md->offset_vector[offset];
- break;
- }
- slot += md->name_entry_size;
- }
- }
- goto REF_REPEAT;
-
- case OP_REF:
- case OP_REFI:
- caseless = op == OP_REFI;
- offset = GET2(ecode, 1) << 1; /* Doubled ref number */
- ecode += 1 + IMM2_SIZE;
- if (offset >= offset_top || md->offset_vector[offset] < 0)
- length = (md->jscript_compat)? 0 : -1;
- else
- length = md->offset_vector[offset+1] - md->offset_vector[offset];
-
- /* Set up for repetition, or handle the non-repeated case */
-
- REF_REPEAT:
- switch (*ecode)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- c = *ecode++ - OP_CRSTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 1 + IMM2_SIZE);
- if (max == 0) max = INT_MAX;
- ecode += 1 + 2 * IMM2_SIZE;
- break;
-
- default: /* No repeat follows */
- if ((length = match_ref(offset, eptr, length, md, caseless)) < 0)
- {
- if (length == -2) eptr = md->end_subject; /* Partial match */
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr += length;
- continue; /* With the main loop */
- }
-
- /* Handle repeated back references. If the length of the reference is
- zero, just continue with the main loop. If the length is negative, it
- means the reference is unset in non-Java-compatible mode. If the minimum is
- zero, we can continue at the same level without recursion. For any other
- minimum, carrying on will result in NOMATCH. */
-
- if (length == 0) continue;
- if (length < 0 && min == 0) continue;
-
- /* First, ensure the minimum number of matches are present. We get back
- the length of the reference string explicitly rather than passing the
- address of eptr, so that eptr can be a register variable. */
-
- for (i = 1; i <= min; i++)
- {
- int slength;
- if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0)
- {
- if (slength == -2) eptr = md->end_subject; /* Partial match */
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr += slength;
- }
-
- /* If min = max, continue at the same level without recursion.
- They are not both allowed to be zero. */
-
- if (min == max) continue;
-
- /* If minimizing, keep trying and advancing the pointer */
-
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- int slength;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM14);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0)
- {
- if (slength == -2) eptr = md->end_subject; /* Partial match */
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr += slength;
- }
- /* Control never gets here */
- }
-
- /* If maximizing, find the longest string and work backwards */
-
- else
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- int slength;
- if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0)
- {
- /* Can't use CHECK_PARTIAL because we don't want to update eptr in
- the soft partial matching case. */
-
- if (slength == -2 && md->partial != 0 &&
- md->end_subject > md->start_used_ptr)
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- break;
- }
- eptr += slength;
- }
-
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM15);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr -= length;
- }
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- /* Match a bit-mapped character class, possibly repeatedly. This op code is
- used when all the characters in the class have values in the range 0-255,
- and either the matching is caseful, or the characters are in the range
- 0-127 when UTF-8 processing is enabled. The only difference between
- OP_CLASS and OP_NCLASS occurs when a data character outside the range is
- encountered.
-
- First, look past the end of the item to see if there is repeat information
- following. Then obey similar code to character type repeats - written out
- again for speed. */
-
- case OP_NCLASS:
- case OP_CLASS:
- {
- /* The data variable is saved across frames, so the byte map needs to
- be stored there. */
-#define BYTE_MAP ((pcre_uint8 *)data)
- data = ecode + 1; /* Save for matching */
- ecode += 1 + (32 / sizeof(pcre_uchar)); /* Advance past the item */
-
- switch (*ecode)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSPLUS:
- case OP_CRPOSQUERY:
- c = *ecode++ - OP_CRSTAR;
- if (c < OP_CRPOSSTAR - OP_CRSTAR) minimize = (c & 1) != 0;
- else possessive = TRUE;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- possessive = (*ecode == OP_CRPOSRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 1 + IMM2_SIZE);
- if (max == 0) max = INT_MAX;
- ecode += 1 + 2 * IMM2_SIZE;
- break;
-
- default: /* No repeat follows */
- min = max = 1;
- break;
- }
-
- /* First, ensure the minimum number of matches are present. */
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(c, eptr);
- if (c > 255)
- {
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
- }
- else
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
- /* Not UTF mode */
- {
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- c = *eptr++;
-#ifndef COMPILE_PCRE8
- if (c > 255)
- {
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
- }
- else
-#endif
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
- }
- }
-
- /* If max == min we can continue with the main loop without the
- need to recurse. */
-
- if (min == max) continue;
-
- /* If minimizing, keep testing the rest of the expression and advancing
- the pointer while it matches the class. */
-
- if (minimize)
- {
-#ifdef SUPPORT_UTF
- if (utf)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM16);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(c, eptr);
- if (c > 255)
- {
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
- }
- else
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
- /* Not UTF mode */
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM17);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- c = *eptr++;
-#ifndef COMPILE_PCRE8
- if (c > 255)
- {
- if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);
- }
- else
-#endif
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
- }
-
- /* If maximizing, find the longest possible run, then work backwards. */
-
- else
- {
- pp = eptr;
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- if (c > 255)
- {
- if (op == OP_CLASS) break;
- }
- else
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break;
- eptr += len;
- }
-
- if (possessive) continue; /* No backtracking */
-
- for (;;)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM18);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
- BACKCHAR(eptr);
- }
- }
- else
-#endif
- /* Not UTF mode */
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- c = *eptr;
-#ifndef COMPILE_PCRE8
- if (c > 255)
- {
- if (op == OP_CLASS) break;
- }
- else
-#endif
- if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break;
- eptr++;
- }
-
- if (possessive) continue; /* No backtracking */
-
- while (eptr >= pp)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM19);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- }
- }
-
- RRETURN(MATCH_NOMATCH);
- }
-#undef BYTE_MAP
- }
- /* Control never gets here */
-
-
- /* Match an extended character class. In the 8-bit library, this opcode is
- encountered only when UTF-8 mode mode is supported. In the 16-bit and
- 32-bit libraries, codepoints greater than 255 may be encountered even when
- UTF is not supported. */
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- {
- data = ecode + 1 + LINK_SIZE; /* Save for matching */
- ecode += GET(ecode, 1); /* Advance past the item */
-
- switch (*ecode)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSPLUS:
- case OP_CRPOSQUERY:
- c = *ecode++ - OP_CRSTAR;
- if (c < OP_CRPOSSTAR - OP_CRSTAR) minimize = (c & 1) != 0;
- else possessive = TRUE;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- minimize = (*ecode == OP_CRMINRANGE);
- possessive = (*ecode == OP_CRPOSRANGE);
- min = GET2(ecode, 1);
- max = GET2(ecode, 1 + IMM2_SIZE);
- if (max == 0) max = INT_MAX;
- ecode += 1 + 2 * IMM2_SIZE;
- break;
-
- default: /* No repeat follows */
- min = max = 1;
- break;
- }
-
- /* First, ensure the minimum number of matches are present. */
-
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (!PRIV(xclass)(c, data, utf)) RRETURN(MATCH_NOMATCH);
- }
-
- /* If max == min we can continue with the main loop without the
- need to recurse. */
-
- if (min == max) continue;
-
- /* If minimizing, keep testing the rest of the expression and advancing
- the pointer while it matches the class. */
-
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM20);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (!PRIV(xclass)(c, data, utf)) RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
- }
-
- /* If maximizing, find the longest possible run, then work backwards. */
-
- else
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
-#ifdef SUPPORT_UTF
- GETCHARLENTEST(c, eptr, len);
-#else
- c = *eptr;
-#endif
- if (!PRIV(xclass)(c, data, utf)) break;
- eptr += len;
- }
-
- if (possessive) continue; /* No backtracking */
-
- for(;;)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM21);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (eptr-- == pp) break; /* Stop if tried at original pos */
-#ifdef SUPPORT_UTF
- if (utf) BACKCHAR(eptr);
-#endif
- }
- RRETURN(MATCH_NOMATCH);
- }
-
- /* Control never gets here */
- }
-#endif /* End of XCLASS */
-
- /* Match a single character, casefully */
-
- case OP_CHAR:
-#ifdef SUPPORT_UTF
- if (utf)
- {
- length = 1;
- ecode++;
- GETCHARLEN(fc, ecode, length);
- if (length > md->end_subject - eptr)
- {
- CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */
- RRETURN(MATCH_NOMATCH);
- }
- while (length-- > 0) if (*ecode++ != UCHAR21INC(eptr)) RRETURN(MATCH_NOMATCH);
- }
- else
-#endif
- /* Not UTF mode */
- {
- if (md->end_subject - eptr < 1)
- {
- SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */
- RRETURN(MATCH_NOMATCH);
- }
- if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH);
- ecode += 2;
- }
- break;
-
- /* Match a single character, caselessly. If we are at the end of the
- subject, give up immediately. */
-
- case OP_CHARI:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- length = 1;
- ecode++;
- GETCHARLEN(fc, ecode, length);
-
- /* If the pattern character's value is < 128, we have only one byte, and
- we know that its other case must also be one byte long, so we can use the
- fast lookup table. We know that there is at least one byte left in the
- subject. */
-
- if (fc < 128)
- {
- pcre_uint32 cc = UCHAR21(eptr);
- if (md->lcc[fc] != TABLE_GET(cc, md->lcc, cc)) RRETURN(MATCH_NOMATCH);
- ecode++;
- eptr++;
- }
-
- /* Otherwise we must pick up the subject character. Note that we cannot
- use the value of "length" to check for sufficient bytes left, because the
- other case of the character may have more or fewer bytes. */
-
- else
- {
- pcre_uint32 dc;
- GETCHARINC(dc, eptr);
- ecode += length;
-
- /* If we have Unicode property support, we can use it to test the other
- case of the character, if there is one. */
-
- if (fc != dc)
- {
-#ifdef SUPPORT_UCP
- if (dc != UCD_OTHERCASE(fc))
-#endif
- RRETURN(MATCH_NOMATCH);
- }
- }
- }
- else
-#endif /* SUPPORT_UTF */
-
- /* Not UTF mode */
- {
- if (TABLE_GET(ecode[1], md->lcc, ecode[1])
- != TABLE_GET(*eptr, md->lcc, *eptr)) RRETURN(MATCH_NOMATCH);
- eptr++;
- ecode += 2;
- }
- break;
-
- /* Match a single character repeatedly. */
-
- case OP_EXACT:
- case OP_EXACTI:
- min = max = GET2(ecode, 1);
- ecode += 1 + IMM2_SIZE;
- goto REPEATCHAR;
-
- case OP_POSUPTO:
- case OP_POSUPTOI:
- possessive = TRUE;
- /* Fall through */
-
- case OP_UPTO:
- case OP_UPTOI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_MINUPTO || *ecode == OP_MINUPTOI;
- ecode += 1 + IMM2_SIZE;
- goto REPEATCHAR;
-
- case OP_POSSTAR:
- case OP_POSSTARI:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
- goto REPEATCHAR;
-
- case OP_POSPLUS:
- case OP_POSPLUSI:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
- goto REPEATCHAR;
-
- case OP_POSQUERY:
- case OP_POSQUERYI:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
- goto REPEATCHAR;
-
- case OP_STAR:
- case OP_STARI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- c = *ecode++ - ((op < OP_STARI)? OP_STAR : OP_STARI);
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
-
- /* Common code for all repeated single-character matches. We first check
- for the minimum number of characters. If the minimum equals the maximum, we
- are done. Otherwise, if minimizing, check the rest of the pattern for a
- match; if there isn't one, advance up to the maximum, one character at a
- time.
-
- If maximizing, advance up to the maximum number of matching characters,
- until eptr is past the end of the maximum run. If possessive, we are
- then done (no backing up). Otherwise, match at this position; anything
- other than no match is immediately returned. For nomatch, back up one
- character, unless we are matching \R and the last thing matched was
- \r\n, in which case, back up two bytes. When we reach the first optional
- character position, we can save stack by doing a tail recurse.
-
- The various UTF/non-UTF and caseful/caseless cases are handled separately,
- for speed. */
-
- REPEATCHAR:
-#ifdef SUPPORT_UTF
- if (utf)
- {
- length = 1;
- charptr = ecode;
- GETCHARLEN(fc, ecode, length);
- ecode += length;
-
- /* Handle multibyte character matching specially here. There is
- support for caseless matching if UCP support is present. */
-
- if (length > 1)
- {
-#ifdef SUPPORT_UCP
- pcre_uint32 othercase;
- if (op >= OP_STARI && /* Caseless */
- (othercase = UCD_OTHERCASE(fc)) != fc)
- oclength = PRIV(ord2utf)(othercase, occhars);
- else oclength = 0;
-#endif /* SUPPORT_UCP */
-
- for (i = 1; i <= min; i++)
- {
- if (eptr <= md->end_subject - length &&
- memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length;
-#ifdef SUPPORT_UCP
- else if (oclength > 0 &&
- eptr <= md->end_subject - oclength &&
- memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength;
-#endif /* SUPPORT_UCP */
- else
- {
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- }
-
- if (min == max) continue;
-
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM22);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr <= md->end_subject - length &&
- memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length;
-#ifdef SUPPORT_UCP
- else if (oclength > 0 &&
- eptr <= md->end_subject - oclength &&
- memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength;
-#endif /* SUPPORT_UCP */
- else
- {
- CHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
- }
-
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- if (eptr <= md->end_subject - length &&
- memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length;
-#ifdef SUPPORT_UCP
- else if (oclength > 0 &&
- eptr <= md->end_subject - oclength &&
- memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength;
-#endif /* SUPPORT_UCP */
- else
- {
- CHECK_PARTIAL();
- break;
- }
- }
-
- if (possessive) continue; /* No backtracking */
- for(;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM23);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
-#ifdef SUPPORT_UCP
- eptr--;
- BACKCHAR(eptr);
-#else /* without SUPPORT_UCP */
- eptr -= length;
-#endif /* SUPPORT_UCP */
- }
- }
- /* Control never gets here */
- }
-
- /* If the length of a UTF-8 character is 1, we fall through here, and
- obey the code as for non-UTF-8 characters below, though in this case the
- value of fc will always be < 128. */
- }
- else
-#endif /* SUPPORT_UTF */
- /* When not in UTF-8 mode, load a single-byte character. */
- fc = *ecode++;
-
- /* The value of fc at this point is always one character, though we may
- or may not be in UTF mode. The code is duplicated for the caseless and
- caseful cases, for speed, since matching characters is likely to be quite
- common. First, ensure the minimum number of matches are present. If min =
- max, continue at the same level without recursing. Otherwise, if
- minimizing, keep trying the rest of the expression and advancing one
- matching character if failing, up to the maximum. Alternatively, if
- maximizing, find the maximum number of characters and work backwards. */
-
- DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max,
- max, (char *)eptr));
-
- if (op >= OP_STARI) /* Caseless */
- {
-#ifdef COMPILE_PCRE8
- /* fc must be < 128 if UTF is enabled. */
- foc = md->fcc[fc];
-#else
-#ifdef SUPPORT_UTF
-#ifdef SUPPORT_UCP
- if (utf && fc > 127)
- foc = UCD_OTHERCASE(fc);
-#else
- if (utf && fc > 127)
- foc = fc;
-#endif /* SUPPORT_UCP */
- else
-#endif /* SUPPORT_UTF */
- foc = TABLE_GET(fc, md->fcc, fc);
-#endif /* COMPILE_PCRE8 */
-
- for (i = 1; i <= min; i++)
- {
- pcre_uint32 cc; /* Faster than pcre_uchar */
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21TEST(eptr);
- if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- if (min == max) continue;
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- pcre_uint32 cc; /* Faster than pcre_uchar */
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM24);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21TEST(eptr);
- if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- /* Control never gets here */
- }
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- pcre_uint32 cc; /* Faster than pcre_uchar */
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- cc = UCHAR21TEST(eptr);
- if (fc != cc && foc != cc) break;
- eptr++;
- }
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM25);
- eptr--;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- }
- /* Control never gets here */
- }
- }
-
- /* Caseful comparisons (includes all multi-byte characters) */
-
- else
- {
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc != UCHAR21INCTEST(eptr)) RRETURN(MATCH_NOMATCH);
- }
-
- if (min == max) continue;
-
- if (minimize)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM26);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc != UCHAR21INCTEST(eptr)) RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
- }
- else /* Maximize */
- {
- pp = eptr;
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (fc != UCHAR21TEST(eptr)) break;
- eptr++;
- }
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM27);
- eptr--;
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- }
- /* Control never gets here */
- }
- }
- /* Control never gets here */
-
- /* Match a negated single one-byte character. The character we are
- checking can be multibyte. */
-
- case OP_NOT:
- case OP_NOTI:
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
-#ifdef SUPPORT_UTF
- if (utf)
- {
- register pcre_uint32 ch, och;
-
- ecode++;
- GETCHARINC(ch, ecode);
- GETCHARINC(c, eptr);
-
- if (op == OP_NOT)
- {
- if (ch == c) RRETURN(MATCH_NOMATCH);
- }
- else
- {
-#ifdef SUPPORT_UCP
- if (ch > 127)
- och = UCD_OTHERCASE(ch);
-#else
- if (ch > 127)
- och = ch;
-#endif /* SUPPORT_UCP */
- else
- och = TABLE_GET(ch, md->fcc, ch);
- if (ch == c || och == c) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
- {
- register pcre_uint32 ch = ecode[1];
- c = *eptr++;
- if (ch == c || (op == OP_NOTI && TABLE_GET(ch, md->fcc, ch) == c))
- RRETURN(MATCH_NOMATCH);
- ecode += 2;
- }
- break;
-
- /* Match a negated single one-byte character repeatedly. This is almost a
- repeat of the code for a repeated single character, but I haven't found a
- nice way of commoning these up that doesn't require a test of the
- positive/negative option for each character match. Maybe that wouldn't add
- very much to the time taken, but character matching *is* what this is all
- about... */
-
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- min = max = GET2(ecode, 1);
- ecode += 1 + IMM2_SIZE;
- goto REPEATNOTCHAR;
-
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_NOTMINUPTO || *ecode == OP_NOTMINUPTOI;
- ecode += 1 + IMM2_SIZE;
- goto REPEATNOTCHAR;
-
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
- goto REPEATNOTCHAR;
-
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
- goto REPEATNOTCHAR;
-
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
- goto REPEATNOTCHAR;
-
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- possessive = TRUE;
- min = 0;
- max = GET2(ecode, 1);
- ecode += 1 + IMM2_SIZE;
- goto REPEATNOTCHAR;
-
- case OP_NOTSTAR:
- case OP_NOTSTARI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
- c = *ecode++ - ((op >= OP_NOTSTARI)? OP_NOTSTARI: OP_NOTSTAR);
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
-
- /* Common code for all repeated single-byte matches. */
-
- REPEATNOTCHAR:
- GETCHARINCTEST(fc, ecode);
-
- /* The code is duplicated for the caseless and caseful cases, for speed,
- since matching characters is likely to be quite common. First, ensure the
- minimum number of matches are present. If min = max, continue at the same
- level without recursing. Otherwise, if minimizing, keep trying the rest of
- the expression and advancing one matching character if failing, up to the
- maximum. Alternatively, if maximizing, find the maximum number of
- characters and work backwards. */
-
- DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max,
- max, (char *)eptr));
-
- if (op >= OP_NOTSTARI) /* Caseless */
- {
-#ifdef SUPPORT_UTF
-#ifdef SUPPORT_UCP
- if (utf && fc > 127)
- foc = UCD_OTHERCASE(fc);
-#else
- if (utf && fc > 127)
- foc = fc;
-#endif /* SUPPORT_UCP */
- else
-#endif /* SUPPORT_UTF */
- foc = TABLE_GET(fc, md->fcc, fc);
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- register pcre_uint32 d;
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(d, eptr);
- if (fc == d || (unsigned int)foc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif /* SUPPORT_UTF */
- /* Not UTF mode */
- {
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc == *eptr || foc == *eptr) RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- }
-
- if (min == max) continue;
-
- if (minimize)
- {
-#ifdef SUPPORT_UTF
- if (utf)
- {
- register pcre_uint32 d;
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM28);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(d, eptr);
- if (fc == d || (unsigned int)foc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif /*SUPPORT_UTF */
- /* Not UTF mode */
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM29);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc == *eptr || foc == *eptr) RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- }
- /* Control never gets here */
- }
-
- /* Maximize case */
-
- else
- {
- pp = eptr;
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- register pcre_uint32 d;
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(d, eptr, len);
- if (fc == d || (unsigned int)foc == d) break;
- eptr += len;
- }
- if (possessive) continue; /* No backtracking */
- for(;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM30);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- BACKCHAR(eptr);
- }
- }
- else
-#endif /* SUPPORT_UTF */
- /* Not UTF mode */
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (fc == *eptr || foc == *eptr) break;
- eptr++;
- }
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM31);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- }
- }
- /* Control never gets here */
- }
- }
-
- /* Caseful comparisons */
-
- else
- {
-#ifdef SUPPORT_UTF
- if (utf)
- {
- register pcre_uint32 d;
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(d, eptr);
- if (fc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
- /* Not UTF mode */
- {
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc == *eptr++) RRETURN(MATCH_NOMATCH);
- }
- }
-
- if (min == max) continue;
-
- if (minimize)
- {
-#ifdef SUPPORT_UTF
- if (utf)
- {
- register pcre_uint32 d;
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM32);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(d, eptr);
- if (fc == d) RRETURN(MATCH_NOMATCH);
- }
- }
- else
-#endif
- /* Not UTF mode */
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM33);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (fc == *eptr++) RRETURN(MATCH_NOMATCH);
- }
- }
- /* Control never gets here */
- }
-
- /* Maximize case */
-
- else
- {
- pp = eptr;
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- register pcre_uint32 d;
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(d, eptr, len);
- if (fc == d) break;
- eptr += len;
- }
- if (possessive) continue; /* No backtracking */
- for(;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM34);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- BACKCHAR(eptr);
- }
- }
- else
-#endif
- /* Not UTF mode */
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (fc == *eptr) break;
- eptr++;
- }
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM35);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- }
- }
- /* Control never gets here */
- }
- }
- /* Control never gets here */
-
- /* Match a single character type repeatedly; several different opcodes
- share code. This is very similar to the code for single characters, but we
- repeat it in the interests of efficiency. */
-
- case OP_TYPEEXACT:
- min = max = GET2(ecode, 1);
- minimize = TRUE;
- ecode += 1 + IMM2_SIZE;
- goto REPEATTYPE;
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- min = 0;
- max = GET2(ecode, 1);
- minimize = *ecode == OP_TYPEMINUPTO;
- ecode += 1 + IMM2_SIZE;
- goto REPEATTYPE;
-
- case OP_TYPEPOSSTAR:
- possessive = TRUE;
- min = 0;
- max = INT_MAX;
- ecode++;
- goto REPEATTYPE;
-
- case OP_TYPEPOSPLUS:
- possessive = TRUE;
- min = 1;
- max = INT_MAX;
- ecode++;
- goto REPEATTYPE;
-
- case OP_TYPEPOSQUERY:
- possessive = TRUE;
- min = 0;
- max = 1;
- ecode++;
- goto REPEATTYPE;
-
- case OP_TYPEPOSUPTO:
- possessive = TRUE;
- min = 0;
- max = GET2(ecode, 1);
- ecode += 1 + IMM2_SIZE;
- goto REPEATTYPE;
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- c = *ecode++ - OP_TYPESTAR;
- minimize = (c & 1) != 0;
- min = rep_min[c]; /* Pick up values from tables; */
- max = rep_max[c]; /* zero for max => infinity */
- if (max == 0) max = INT_MAX;
-
- /* Common code for all repeated single character type matches. Note that
- in UTF-8 mode, '.' matches a character of any length, but for the other
- character types, the valid characters are all one-byte long. */
-
- REPEATTYPE:
- ctype = *ecode++; /* Code for the character type */
-
-#ifdef SUPPORT_UCP
- if (ctype == OP_PROP || ctype == OP_NOTPROP)
- {
- prop_fail_result = ctype == OP_NOTPROP;
- prop_type = *ecode++;
- prop_value = *ecode++;
- }
- else prop_type = -1;
-#endif
-
- /* First, ensure the minimum number of matches are present. Use inline
- code for maximizing the speed, and do the type test once at the start
- (i.e. keep it out of the loop). Separate the UTF-8 code completely as that
- is tidier. Also separate the UCP code, which can be the same for both UTF-8
- and single-bytes. */
-
- if (min > 0)
- {
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- switch(prop_type)
- {
- case PT_ANY:
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- }
- break;
-
- case PT_LAMP:
- for (i = 1; i <= min; i++)
- {
- int chartype;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- chartype = UCD_CHARTYPE(c);
- if ((chartype == ucp_Lu ||
- chartype == ucp_Ll ||
- chartype == ucp_Lt) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case PT_GC:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case PT_PC:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case PT_SC:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case PT_ALNUM:
- for (i = 1; i <= min; i++)
- {
- int category;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- /* Perl space used to exclude VT, but from Perl 5.18 it is included,
- which means that Perl space and POSIX space are now identical. PCRE
- was changed at release 8.34. */
-
- case PT_SPACE: /* Perl space */
- case PT_PXSPACE: /* POSIX space */
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- HSPACE_CASES:
- VSPACE_CASES:
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- if ((UCD_CATEGORY(c) == ucp_Z) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- break;
- }
- }
- break;
-
- case PT_WORD:
- for (i = 1; i <= min; i++)
- {
- int category;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N || c == CHAR_UNDERSCORE)
- == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case PT_CLIST:
- for (i = 1; i <= min; i++)
- {
- const pcre_uint32 *cp;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- cp = PRIV(ucd_caseless_sets) + prop_value;
- for (;;)
- {
- if (c < *cp)
- { if (prop_fail_result) break; else { RRETURN(MATCH_NOMATCH); } }
- if (c == *cp++)
- { if (prop_fail_result) { RRETURN(MATCH_NOMATCH); } else break; }
- }
- }
- break;
-
- case PT_UCNC:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
- c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
- c >= 0xe000) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- /* This should not occur */
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
-
- /* Match extended Unicode sequences. We will get here only if the
- support is in the binary; otherwise a compile-time error occurs. */
-
- else if (ctype == OP_EXTUNI)
- {
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- else
- {
- int lgb, rgb;
- GETCHARINCTEST(c, eptr);
- lgb = UCD_GRAPHBREAK(c);
- while (eptr < md->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;
- lgb = rgb;
- eptr += len;
- }
- }
- CHECK_PARTIAL();
- }
- }
-
- else
-#endif /* SUPPORT_UCP */
-
-/* Handle all other cases when the coding is UTF-8 */
-
-#ifdef SUPPORT_UTF
- if (utf) switch(ctype)
- {
- case OP_ANY:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH);
- if (md->partial != 0 &&
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21(eptr) == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
- }
- break;
-
- case OP_ALLANY:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
- }
- break;
-
- case OP_ANYBYTE:
- if (eptr > md->end_subject - min) RRETURN(MATCH_NOMATCH);
- eptr += min;
- break;
-
- case OP_ANYNL:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(c, eptr);
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
-
- case CHAR_CR:
- if (eptr < md->end_subject && UCHAR21(eptr) == CHAR_LF) eptr++;
- break;
-
- case CHAR_LF:
- break;
-
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_NEL:
-#ifndef EBCDIC
- case 0x2028:
- case 0x2029:
-#endif /* Not EBCDIC */
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- }
- break;
-
- case OP_NOT_HSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(c, eptr);
- switch(c)
- {
- HSPACE_CASES: RRETURN(MATCH_NOMATCH); /* Byte and multibyte cases */
- default: break;
- }
- }
- break;
-
- case OP_HSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(c, eptr);
- switch(c)
- {
- HSPACE_CASES: break; /* Byte and multibyte cases */
- default: RRETURN(MATCH_NOMATCH);
- }
- }
- break;
-
- case OP_NOT_VSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(c, eptr);
- switch(c)
- {
- VSPACE_CASES: RRETURN(MATCH_NOMATCH);
- default: break;
- }
- }
- break;
-
- case OP_VSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(c, eptr);
- switch(c)
- {
- VSPACE_CASES: break;
- default: RRETURN(MATCH_NOMATCH);
- }
- }
- break;
-
- case OP_NOT_DIGIT:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINC(c, eptr);
- if (c < 128 && (md->ctypes[c] & ctype_digit) != 0)
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_DIGIT:
- for (i = 1; i <= min; i++)
- {
- pcre_uint32 cc;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21(eptr);
- if (cc >= 128 || (md->ctypes[cc] & ctype_digit) == 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- /* No need to skip more bytes - we know it's a 1-byte character */
- }
- break;
-
- case OP_NOT_WHITESPACE:
- for (i = 1; i <= min; i++)
- {
- pcre_uint32 cc;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21(eptr);
- if (cc < 128 && (md->ctypes[cc] & ctype_space) != 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
- }
- break;
-
- case OP_WHITESPACE:
- for (i = 1; i <= min; i++)
- {
- pcre_uint32 cc;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21(eptr);
- if (cc >= 128 || (md->ctypes[cc] & ctype_space) == 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- /* No need to skip more bytes - we know it's a 1-byte character */
- }
- break;
-
- case OP_NOT_WORDCHAR:
- for (i = 1; i <= min; i++)
- {
- pcre_uint32 cc;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21(eptr);
- if (cc < 128 && (md->ctypes[cc] & ctype_word) != 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
- }
- break;
-
- case OP_WORDCHAR:
- for (i = 1; i <= min; i++)
- {
- pcre_uint32 cc;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- cc = UCHAR21(eptr);
- if (cc >= 128 || (md->ctypes[cc] & ctype_word) == 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- /* No need to skip more bytes - we know it's a 1-byte character */
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- } /* End switch(ctype) */
-
- else
-#endif /* SUPPORT_UTF */
-
- /* Code for the non-UTF-8 case for minimum matching of operators other
- than OP_PROP and OP_NOTPROP. */
-
- switch(ctype)
- {
- case OP_ANY:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH);
- if (md->partial != 0 &&
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- *eptr == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- eptr++;
- }
- break;
-
- case OP_ALLANY:
- if (eptr > md->end_subject - min)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr += min;
- break;
-
- case OP_ANYBYTE:
- if (eptr > md->end_subject - min)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- eptr += min;
- break;
-
- case OP_ANYNL:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- switch(*eptr++)
- {
- default: RRETURN(MATCH_NOMATCH);
-
- case CHAR_CR:
- if (eptr < md->end_subject && *eptr == CHAR_LF) eptr++;
- break;
-
- case CHAR_LF:
- break;
-
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_NEL:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- case 0x2028:
- case 0x2029:
-#endif
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- }
- break;
-
- case OP_NOT_HSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- switch(*eptr++)
- {
- default: break;
- HSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- HSPACE_MULTIBYTE_CASES:
-#endif
- RRETURN(MATCH_NOMATCH);
- }
- }
- break;
-
- case OP_HSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- switch(*eptr++)
- {
- default: RRETURN(MATCH_NOMATCH);
- HSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- HSPACE_MULTIBYTE_CASES:
-#endif
- break;
- }
- }
- break;
-
- case OP_NOT_VSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- switch(*eptr++)
- {
- VSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- VSPACE_MULTIBYTE_CASES:
-#endif
- RRETURN(MATCH_NOMATCH);
- default: break;
- }
- }
- break;
-
- case OP_VSPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- switch(*eptr++)
- {
- default: RRETURN(MATCH_NOMATCH);
- VSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- VSPACE_MULTIBYTE_CASES:
-#endif
- break;
- }
- }
- break;
-
- case OP_NOT_DIGIT:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_digit) != 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- break;
-
- case OP_DIGIT:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_digit) == 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- break;
-
- case OP_NOT_WHITESPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_space) != 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- break;
-
- case OP_WHITESPACE:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_space) == 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- break;
-
- case OP_NOT_WORDCHAR:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_word) != 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- break;
-
- case OP_WORDCHAR:
- for (i = 1; i <= min; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_word) == 0)
- RRETURN(MATCH_NOMATCH);
- eptr++;
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
-
- /* If min = max, continue at the same level without recursing */
-
- if (min == max) continue;
-
- /* If minimizing, we have to test the rest of the pattern before each
- subsequent match. Again, separate the UTF-8 case for speed, and also
- separate the UCP cases. */
-
- if (minimize)
- {
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- switch(prop_type)
- {
- case PT_ANY:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM36);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_LAMP:
- for (fi = min;; fi++)
- {
- int chartype;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM37);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- chartype = UCD_CHARTYPE(c);
- if ((chartype == ucp_Lu ||
- chartype == ucp_Ll ||
- chartype == ucp_Lt) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_GC:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM38);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_PC:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM39);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_SC:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM40);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_ALNUM:
- for (fi = min;; fi++)
- {
- int category;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM59);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- /* Perl space used to exclude VT, but from Perl 5.18 it is included,
- which means that Perl space and POSIX space are now identical. PCRE
- was changed at release 8.34. */
-
- case PT_SPACE: /* Perl space */
- case PT_PXSPACE: /* POSIX space */
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM61);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- switch(c)
- {
- HSPACE_CASES:
- VSPACE_CASES:
- if (prop_fail_result) RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- if ((UCD_CATEGORY(c) == ucp_Z) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- break;
- }
- }
- /* Control never gets here */
-
- case PT_WORD:
- for (fi = min;; fi++)
- {
- int category;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM62);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L ||
- category == ucp_N ||
- c == CHAR_UNDERSCORE)
- == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- case PT_CLIST:
- for (fi = min;; fi++)
- {
- const pcre_uint32 *cp;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM67);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- cp = PRIV(ucd_caseless_sets) + prop_value;
- for (;;)
- {
- if (c < *cp)
- { if (prop_fail_result) break; else { RRETURN(MATCH_NOMATCH); } }
- if (c == *cp++)
- { if (prop_fail_result) { RRETURN(MATCH_NOMATCH); } else break; }
- }
- }
- /* Control never gets here */
-
- case PT_UCNC:
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM60);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- GETCHARINCTEST(c, eptr);
- if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
- c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
- c >= 0xe000) == prop_fail_result)
- RRETURN(MATCH_NOMATCH);
- }
- /* Control never gets here */
-
- /* This should never occur */
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
-
- /* Match extended Unicode sequences. We will get here only if the
- support is in the binary; otherwise a compile-time error occurs. */
-
- else if (ctype == OP_EXTUNI)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM41);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- else
- {
- int lgb, rgb;
- GETCHARINCTEST(c, eptr);
- lgb = UCD_GRAPHBREAK(c);
- while (eptr < md->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;
- lgb = rgb;
- eptr += len;
- }
- }
- CHECK_PARTIAL();
- }
- }
- else
-#endif /* SUPPORT_UCP */
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM42);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (ctype == OP_ANY && IS_NEWLINE(eptr))
- RRETURN(MATCH_NOMATCH);
- GETCHARINC(c, eptr);
- switch(ctype)
- {
- case OP_ANY: /* This is the non-NL case */
- if (md->partial != 0 && /* Take care with CRLF partial */
- eptr >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- c == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- break;
-
- case OP_ALLANY:
- case OP_ANYBYTE:
- break;
-
- case OP_ANYNL:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case CHAR_CR:
- if (eptr < md->end_subject && UCHAR21(eptr) == CHAR_LF) eptr++;
- break;
-
- case CHAR_LF:
- break;
-
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_NEL:
-#ifndef EBCDIC
- case 0x2028:
- case 0x2029:
-#endif /* Not EBCDIC */
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- break;
-
- case OP_NOT_HSPACE:
- switch(c)
- {
- HSPACE_CASES: RRETURN(MATCH_NOMATCH);
- default: break;
- }
- break;
-
- case OP_HSPACE:
- switch(c)
- {
- HSPACE_CASES: break;
- default: RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_NOT_VSPACE:
- switch(c)
- {
- VSPACE_CASES: RRETURN(MATCH_NOMATCH);
- default: break;
- }
- break;
-
- case OP_VSPACE:
- switch(c)
- {
- VSPACE_CASES: break;
- default: RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_NOT_DIGIT:
- if (c < 256 && (md->ctypes[c] & ctype_digit) != 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_DIGIT:
- if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WHITESPACE:
- if (c < 256 && (md->ctypes[c] & ctype_space) != 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WHITESPACE:
- if (c >= 256 || (md->ctypes[c] & ctype_space) == 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WORDCHAR:
- if (c < 256 && (md->ctypes[c] & ctype_word) != 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WORDCHAR:
- if (c >= 256 || (md->ctypes[c] & ctype_word) == 0)
- RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
- }
- else
-#endif
- /* Not UTF mode */
- {
- for (fi = min;; fi++)
- {
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM43);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- if (fi >= max) RRETURN(MATCH_NOMATCH);
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- RRETURN(MATCH_NOMATCH);
- }
- if (ctype == OP_ANY && IS_NEWLINE(eptr))
- RRETURN(MATCH_NOMATCH);
- c = *eptr++;
- switch(ctype)
- {
- case OP_ANY: /* This is the non-NL case */
- if (md->partial != 0 && /* Take care with CRLF partial */
- eptr >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- c == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- break;
-
- case OP_ALLANY:
- case OP_ANYBYTE:
- break;
-
- case OP_ANYNL:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- case CHAR_CR:
- if (eptr < md->end_subject && *eptr == CHAR_LF) eptr++;
- break;
-
- case CHAR_LF:
- break;
-
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_NEL:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- case 0x2028:
- case 0x2029:
-#endif
- if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH);
- break;
- }
- break;
-
- case OP_NOT_HSPACE:
- switch(c)
- {
- default: break;
- HSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- HSPACE_MULTIBYTE_CASES:
-#endif
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_HSPACE:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- HSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- HSPACE_MULTIBYTE_CASES:
-#endif
- break;
- }
- break;
-
- case OP_NOT_VSPACE:
- switch(c)
- {
- default: break;
- VSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- VSPACE_MULTIBYTE_CASES:
-#endif
- RRETURN(MATCH_NOMATCH);
- }
- break;
-
- case OP_VSPACE:
- switch(c)
- {
- default: RRETURN(MATCH_NOMATCH);
- VSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- VSPACE_MULTIBYTE_CASES:
-#endif
- break;
- }
- break;
-
- case OP_NOT_DIGIT:
- if (MAX_255(c) && (md->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_DIGIT:
- if (!MAX_255(c) || (md->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WHITESPACE:
- if (MAX_255(c) && (md->ctypes[c] & ctype_space) != 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WHITESPACE:
- if (!MAX_255(c) || (md->ctypes[c] & ctype_space) == 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_NOT_WORDCHAR:
- if (MAX_255(c) && (md->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH);
- break;
-
- case OP_WORDCHAR:
- if (!MAX_255(c) || (md->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH);
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
- }
- }
- /* Control never gets here */
- }
-
- /* If maximizing, it is worth using inline code for speed, doing the type
- test once at the start (i.e. keep it out of the loop). Again, keep the
- UTF-8 and UCP stuff separate. */
-
- else
- {
- pp = eptr; /* Remember where we started */
-
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- switch(prop_type)
- {
- case PT_ANY:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- if (prop_fail_result) break;
- eptr+= len;
- }
- break;
-
- case PT_LAMP:
- for (i = min; i < max; i++)
- {
- int chartype;
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- chartype = UCD_CHARTYPE(c);
- if ((chartype == ucp_Lu ||
- chartype == ucp_Ll ||
- chartype == ucp_Lt) == prop_fail_result)
- break;
- eptr+= len;
- }
- break;
-
- case PT_GC:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result) break;
- eptr+= len;
- }
- break;
-
- case PT_PC:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result) break;
- eptr+= len;
- }
- break;
-
- case PT_SC:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result) break;
- eptr+= len;
- }
- break;
-
- case PT_ALNUM:
- for (i = min; i < max; i++)
- {
- int category;
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N) == prop_fail_result)
- break;
- eptr+= len;
- }
- break;
-
- /* Perl space used to exclude VT, but from Perl 5.18 it is included,
- which means that Perl space and POSIX space are now identical. PCRE
- was changed at release 8.34. */
-
- case PT_SPACE: /* Perl space */
- case PT_PXSPACE: /* POSIX space */
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- switch(c)
- {
- HSPACE_CASES:
- VSPACE_CASES:
- if (prop_fail_result) goto ENDLOOP99; /* Break the loop */
- break;
-
- default:
- if ((UCD_CATEGORY(c) == ucp_Z) == prop_fail_result)
- goto ENDLOOP99; /* Break the loop */
- break;
- }
- eptr+= len;
- }
- ENDLOOP99:
- break;
-
- case PT_WORD:
- for (i = min; i < max; i++)
- {
- int category;
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- category = UCD_CATEGORY(c);
- if ((category == ucp_L || category == ucp_N ||
- c == CHAR_UNDERSCORE) == prop_fail_result)
- break;
- eptr+= len;
- }
- break;
-
- case PT_CLIST:
- for (i = min; i < max; i++)
- {
- const pcre_uint32 *cp;
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- cp = PRIV(ucd_caseless_sets) + prop_value;
- for (;;)
- {
- if (c < *cp)
- { if (prop_fail_result) break; else goto GOT_MAX; }
- if (c == *cp++)
- { if (prop_fail_result) goto GOT_MAX; else break; }
- }
- eptr += len;
- }
- GOT_MAX:
- break;
-
- case PT_UCNC:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLENTEST(c, eptr, len);
- if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
- c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
- c >= 0xe000) == prop_fail_result)
- break;
- eptr += len;
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
-
- /* eptr is now past the end of the maximum run */
-
- if (possessive) continue; /* No backtracking */
- for(;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM44);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- if (utf) BACKCHAR(eptr);
- }
- }
-
- /* Match extended Unicode grapheme clusters. We will get here only if the
- support is in the binary; otherwise a compile-time error occurs. */
-
- else if (ctype == OP_EXTUNI)
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- else
- {
- int lgb, rgb;
- GETCHARINCTEST(c, eptr);
- lgb = UCD_GRAPHBREAK(c);
- while (eptr < md->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;
- lgb = rgb;
- eptr += len;
- }
- }
- CHECK_PARTIAL();
- }
-
- /* eptr is now past the end of the maximum run */
-
- if (possessive) continue; /* No backtracking */
-
- for(;;)
- {
- int lgb, rgb;
- PCRE_PUCHAR fptr;
-
- if (eptr == pp) goto TAIL_RECURSE; /* At start of char run */
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM45);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
-
- /* Backtracking over an extended grapheme cluster involves inspecting
- the previous two characters (if present) to see if a break is
- permitted between them. */
-
- eptr--;
- if (!utf) c = *eptr; else
- {
- BACKCHAR(eptr);
- GETCHAR(c, eptr);
- }
- rgb = UCD_GRAPHBREAK(c);
-
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE; /* At start of char run */
- fptr = eptr - 1;
- if (!utf) c = *fptr; else
- {
- BACKCHAR(fptr);
- GETCHAR(c, fptr);
- }
- lgb = UCD_GRAPHBREAK(c);
- if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
- eptr = fptr;
- rgb = lgb;
- }
- }
- }
-
- else
-#endif /* SUPPORT_UCP */
-
-#ifdef SUPPORT_UTF
- if (utf)
- {
- switch(ctype)
- {
- case OP_ANY:
- if (max < INT_MAX)
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (IS_NEWLINE(eptr)) break;
- if (md->partial != 0 && /* Take care with CRLF partial */
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21(eptr) == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
- }
- }
-
- /* Handle unlimited UTF-8 repeat */
-
- else
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (IS_NEWLINE(eptr)) break;
- if (md->partial != 0 && /* Take care with CRLF partial */
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- UCHAR21(eptr) == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
- }
- }
- break;
-
- case OP_ALLANY:
- if (max < INT_MAX)
- {
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- eptr++;
- ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++);
- }
- }
- else
- {
- eptr = md->end_subject; /* Unlimited UTF-8 repeat */
- SCHECK_PARTIAL();
- }
- break;
-
- /* The byte case is the same as non-UTF8 */
-
- case OP_ANYBYTE:
- c = max - min;
- if (c > (unsigned int)(md->end_subject - eptr))
- {
- eptr = md->end_subject;
- SCHECK_PARTIAL();
- }
- else eptr += c;
- break;
-
- case OP_ANYNL:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- if (c == CHAR_CR)
- {
- if (++eptr >= md->end_subject) break;
- if (UCHAR21(eptr) == CHAR_LF) eptr++;
- }
- else
- {
- if (c != CHAR_LF &&
- (md->bsr_anycrlf ||
- (c != CHAR_VT && c != CHAR_FF && c != CHAR_NEL
-#ifndef EBCDIC
- && c != 0x2028 && c != 0x2029
-#endif /* Not EBCDIC */
- )))
- break;
- eptr += len;
- }
- }
- break;
-
- case OP_NOT_HSPACE:
- case OP_HSPACE:
- for (i = min; i < max; i++)
- {
- BOOL gotspace;
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- switch(c)
- {
- HSPACE_CASES: gotspace = TRUE; break;
- default: gotspace = FALSE; break;
- }
- if (gotspace == (ctype == OP_NOT_HSPACE)) break;
- eptr += len;
- }
- break;
-
- case OP_NOT_VSPACE:
- case OP_VSPACE:
- for (i = min; i < max; i++)
- {
- BOOL gotspace;
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- switch(c)
- {
- VSPACE_CASES: gotspace = TRUE; break;
- default: gotspace = FALSE; break;
- }
- if (gotspace == (ctype == OP_NOT_VSPACE)) break;
- eptr += len;
- }
- break;
-
- case OP_NOT_DIGIT:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) break;
- eptr+= len;
- }
- break;
-
- case OP_DIGIT:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- if (c >= 256 ||(md->ctypes[c] & ctype_digit) == 0) break;
- eptr+= len;
- }
- break;
-
- case OP_NOT_WHITESPACE:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (md->ctypes[c] & ctype_space) != 0) break;
- eptr+= len;
- }
- break;
-
- case OP_WHITESPACE:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- if (c >= 256 ||(md->ctypes[c] & ctype_space) == 0) break;
- eptr+= len;
- }
- break;
-
- case OP_NOT_WORDCHAR:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- if (c < 256 && (md->ctypes[c] & ctype_word) != 0) break;
- eptr+= len;
- }
- break;
-
- case OP_WORDCHAR:
- for (i = min; i < max; i++)
- {
- int len = 1;
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- GETCHARLEN(c, eptr, len);
- if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) break;
- eptr+= len;
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
-
- if (possessive) continue; /* No backtracking */
- for(;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM46);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- BACKCHAR(eptr);
- if (ctype == OP_ANYNL && eptr > pp && UCHAR21(eptr) == CHAR_NL &&
- UCHAR21(eptr - 1) == CHAR_CR) eptr--;
- }
- }
- else
-#endif /* SUPPORT_UTF */
- /* Not UTF mode */
- {
- switch(ctype)
- {
- case OP_ANY:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (IS_NEWLINE(eptr)) break;
- if (md->partial != 0 && /* Take care with CRLF partial */
- eptr + 1 >= md->end_subject &&
- NLBLOCK->nltype == NLTYPE_FIXED &&
- NLBLOCK->nllen == 2 &&
- *eptr == NLBLOCK->nl[0])
- {
- md->hitend = TRUE;
- if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
- }
- eptr++;
- }
- break;
-
- case OP_ALLANY:
- case OP_ANYBYTE:
- c = max - min;
- if (c > (unsigned int)(md->end_subject - eptr))
- {
- eptr = md->end_subject;
- SCHECK_PARTIAL();
- }
- else eptr += c;
- break;
-
- case OP_ANYNL:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- c = *eptr;
- if (c == CHAR_CR)
- {
- if (++eptr >= md->end_subject) break;
- if (*eptr == CHAR_LF) eptr++;
- }
- else
- {
- if (c != CHAR_LF && (md->bsr_anycrlf ||
- (c != CHAR_VT && c != CHAR_FF && c != CHAR_NEL
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- && c != 0x2028 && c != 0x2029
-#endif
- ))) break;
- eptr++;
- }
- }
- break;
-
- case OP_NOT_HSPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- switch(*eptr)
- {
- default: eptr++; break;
- HSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- HSPACE_MULTIBYTE_CASES:
-#endif
- goto ENDLOOP00;
- }
- }
- ENDLOOP00:
- break;
-
- case OP_HSPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- switch(*eptr)
- {
- default: goto ENDLOOP01;
- HSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- HSPACE_MULTIBYTE_CASES:
-#endif
- eptr++; break;
- }
- }
- ENDLOOP01:
- break;
-
- case OP_NOT_VSPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- switch(*eptr)
- {
- default: eptr++; break;
- VSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- VSPACE_MULTIBYTE_CASES:
-#endif
- goto ENDLOOP02;
- }
- }
- ENDLOOP02:
- break;
-
- case OP_VSPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- switch(*eptr)
- {
- default: goto ENDLOOP03;
- VSPACE_BYTE_CASES:
-#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- VSPACE_MULTIBYTE_CASES:
-#endif
- eptr++; break;
- }
- }
- ENDLOOP03:
- break;
-
- case OP_NOT_DIGIT:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_digit) != 0) break;
- eptr++;
- }
- break;
-
- case OP_DIGIT:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_digit) == 0) break;
- eptr++;
- }
- break;
-
- case OP_NOT_WHITESPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_space) != 0) break;
- eptr++;
- }
- break;
-
- case OP_WHITESPACE:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_space) == 0) break;
- eptr++;
- }
- break;
-
- case OP_NOT_WORDCHAR:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_word) != 0) break;
- eptr++;
- }
- break;
-
- case OP_WORDCHAR:
- for (i = min; i < max; i++)
- {
- if (eptr >= md->end_subject)
- {
- SCHECK_PARTIAL();
- break;
- }
- if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_word) == 0) break;
- eptr++;
- }
- break;
-
- default:
- RRETURN(PCRE_ERROR_INTERNAL);
- }
-
- if (possessive) continue; /* No backtracking */
- for (;;)
- {
- if (eptr == pp) goto TAIL_RECURSE;
- RMATCH(eptr, ecode, offset_top, md, eptrb, RM47);
- if (rrc != MATCH_NOMATCH) RRETURN(rrc);
- eptr--;
- if (ctype == OP_ANYNL && eptr > pp && *eptr == CHAR_LF &&
- eptr[-1] == CHAR_CR) eptr--;
- }
- }
-
- /* Control never gets here */
- }
-
- /* There's been some horrible disaster. Arrival here can only mean there is
- something seriously wrong in the code above or the OP_xxx definitions. */
-
- default:
- DPRINTF(("Unknown opcode %d\n", *ecode));
- RRETURN(PCRE_ERROR_UNKNOWN_OPCODE);
- }
-
- /* Do not stick any code in here without much thought; it is assumed
- that "continue" in the code above comes out to here to repeat the main
- loop. */
-
- } /* End of main loop */
-/* Control never reaches here */
-
-
-/* When compiling to use the heap rather than the stack for recursive calls to
-match(), the RRETURN() macro jumps here. The number that is saved in
-frame->Xwhere indicates which label we actually want to return to. */
-
-#ifdef NO_RECURSE
-#define LBL(val) case val: goto L_RM##val;
-HEAP_RETURN:
-switch (frame->Xwhere)
- {
- LBL( 1) LBL( 2) LBL( 3) LBL( 4) LBL( 5) LBL( 6) LBL( 7) LBL( 8)
- LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(17)
- LBL(19) LBL(24) LBL(25) LBL(26) LBL(27) LBL(29) LBL(31) LBL(33)
- LBL(35) LBL(43) LBL(47) LBL(48) LBL(49) LBL(50) LBL(51) LBL(52)
- LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) LBL(63) LBL(64)
- LBL(65) LBL(66)
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- LBL(20) LBL(21)
-#endif
-#ifdef SUPPORT_UTF
- LBL(16) LBL(18)
- LBL(22) LBL(23) LBL(28) LBL(30)
- LBL(32) LBL(34) LBL(42) LBL(46)
-#ifdef SUPPORT_UCP
- LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45)
- LBL(59) LBL(60) LBL(61) LBL(62) LBL(67)
-#endif /* SUPPORT_UCP */
-#endif /* SUPPORT_UTF */
- default:
- DPRINTF(("jump error in pcre match: label %d non-existent\n", frame->Xwhere));
- return PCRE_ERROR_INTERNAL;
- }
-#undef LBL
-#endif /* NO_RECURSE */
-}
-
-
-/***************************************************************************
-****************************************************************************
- RECURSION IN THE match() FUNCTION
-
-Undefine all the macros that were defined above to handle this. */
-
-#ifdef NO_RECURSE
-#undef eptr
-#undef ecode
-#undef mstart
-#undef offset_top
-#undef eptrb
-#undef flags
-
-#undef callpat
-#undef charptr
-#undef data
-#undef next
-#undef pp
-#undef prev
-#undef saved_eptr
-
-#undef new_recursive
-
-#undef cur_is_word
-#undef condition
-#undef prev_is_word
-
-#undef ctype
-#undef length
-#undef max
-#undef min
-#undef number
-#undef offset
-#undef op
-#undef save_capture_last
-#undef save_offset1
-#undef save_offset2
-#undef save_offset3
-#undef stacksave
-
-#undef newptrb
-
-#endif
-
-/* These two are defined as macros in both cases */
-
-#undef fc
-#undef fi
-
-/***************************************************************************
-***************************************************************************/
-
-
-#ifdef NO_RECURSE
-/*************************************************
-* Release allocated heap frames *
-*************************************************/
-
-/* This function releases all the allocated frames. The base frame is on the
-machine stack, and so must not be freed.
-
-Argument: the address of the base frame
-Returns: nothing
-*/
-
-static void
-release_match_heapframes (heapframe *frame_base)
-{
-heapframe *nextframe = frame_base->Xnextframe;
-while (nextframe != NULL)
- {
- heapframe *oldframe = nextframe;
- nextframe = nextframe->Xnextframe;
- (PUBL(stack_free))(oldframe);
- }
-}
-#endif
-
-
-/*************************************************
-* Execute a Regular Expression *
-*************************************************/
-
-/* This function applies a compiled re to a subject string and picks out
-portions of the string if it matches. Two elements in the vector are set for
-each substring: the offsets to the start and end of the substring.
-
-Arguments:
- argument_re points to the compiled expression
- extra_data points to extra data or is NULL
- subject points to the subject string
- length length of subject string (may contain binary zeros)
- start_offset where to start in the subject string
- options option bits
- offsets points to a vector of ints to be filled in with offsets
- offsetcount the number of elements in the vector
-
-Returns: > 0 => success; value is the number of elements filled in
- = 0 => success, but offsets is not big enough
- -1 => failed to match
- < -1 => some kind of unexpected problem
-*/
-
-#if defined COMPILE_PCRE8
-PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
-pcre_exec(const pcre *argument_re, const pcre_extra *extra_data,
- PCRE_SPTR subject, int length, int start_offset, int options, int *offsets,
- int offsetcount)
-#elif defined COMPILE_PCRE16
-PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
-pcre16_exec(const pcre16 *argument_re, const pcre16_extra *extra_data,
- PCRE_SPTR16 subject, int length, int start_offset, int options, int *offsets,
- int offsetcount)
-#elif defined COMPILE_PCRE32
-PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
-pcre32_exec(const pcre32 *argument_re, const pcre32_extra *extra_data,
- PCRE_SPTR32 subject, int length, int start_offset, int options, int *offsets,
- int offsetcount)
-#endif
-{
-int rc, ocount, arg_offset_max;
-int newline;
-BOOL using_temporary_offsets = FALSE;
-BOOL anchored;
-BOOL startline;
-BOOL firstline;
-BOOL utf;
-BOOL has_first_char = FALSE;
-BOOL has_req_char = FALSE;
-pcre_uchar first_char = 0;
-pcre_uchar first_char2 = 0;
-pcre_uchar req_char = 0;
-pcre_uchar req_char2 = 0;
-match_data match_block;
-match_data *md = &match_block;
-const pcre_uint8 *tables;
-const pcre_uint8 *start_bits = NULL;
-PCRE_PUCHAR start_match = (PCRE_PUCHAR)subject + start_offset;
-PCRE_PUCHAR end_subject;
-PCRE_PUCHAR start_partial = NULL;
-PCRE_PUCHAR match_partial = NULL;
-PCRE_PUCHAR req_char_ptr = start_match - 1;
-
-const pcre_study_data *study;
-const REAL_PCRE *re = (const REAL_PCRE *)argument_re;
-
-#ifdef NO_RECURSE
-heapframe frame_zero;
-frame_zero.Xprevframe = NULL; /* Marks the top level */
-frame_zero.Xnextframe = NULL; /* None are allocated yet */
-md->match_frames_base = &frame_zero;
-#endif
-
-/* Check for the special magic call that measures the size of the stack used
-per recursive call of match(). Without the funny casting for sizeof, a Windows
-compiler gave this error: "unary minus operator applied to unsigned type,
-result still unsigned". Hopefully the cast fixes that. */
-
-if (re == NULL && extra_data == NULL && subject == NULL && length == -999 &&
- start_offset == -999)
-#ifdef NO_RECURSE
- return -((int)sizeof(heapframe));
-#else
- return match(NULL, NULL, NULL, 0, NULL, NULL, 0);
-#endif
-
-/* Plausibility checks */
-
-if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION;
-if (re == NULL || subject == NULL || (offsets == NULL && offsetcount > 0))
- return PCRE_ERROR_NULL;
-if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
-if (length < 0) return PCRE_ERROR_BADLENGTH;
-if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;
-
-/* Check that the first field in the block is the magic number. If it is not,
-return with PCRE_ERROR_BADMAGIC. However, if the magic number is equal to
-REVERSED_MAGIC_NUMBER we return with PCRE_ERROR_BADENDIANNESS, which
-means that the pattern is likely compiled with different endianness. */
-
-if (re->magic_number != MAGIC_NUMBER)
- return re->magic_number == REVERSED_MAGIC_NUMBER?
- PCRE_ERROR_BADENDIANNESS:PCRE_ERROR_BADMAGIC;
-if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE;
-
-/* These two settings are used in the code for checking a UTF-8 string that
-follows immediately afterwards. Other values in the md block are used only
-during "normal" pcre_exec() processing, not when the JIT support is in use,
-so they are set up later. */
-
-/* PCRE_UTF16 has the same value as PCRE_UTF8. */
-utf = md->utf = (re->options & PCRE_UTF8) != 0;
-md->partial = ((options & PCRE_PARTIAL_HARD) != 0)? 2 :
- ((options & PCRE_PARTIAL_SOFT) != 0)? 1 : 0;
-
-/* Check a UTF-8 string if required. Pass back the character offset and error
-code for an invalid string if a results vector is available. */
-
-#ifdef SUPPORT_UTF
-if (utf && (options & PCRE_NO_UTF8_CHECK) == 0)
- {
- int erroroffset;
- int errorcode = PRIV(valid_utf)((PCRE_PUCHAR)subject, length, &erroroffset);
- if (errorcode != 0)
- {
- if (offsetcount >= 2)
- {
- offsets[0] = erroroffset;
- offsets[1] = errorcode;
- }
-#if defined COMPILE_PCRE8
- return (errorcode <= PCRE_UTF8_ERR5 && md->partial > 1)?
- PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;
-#elif defined COMPILE_PCRE16
- return (errorcode <= PCRE_UTF16_ERR1 && md->partial > 1)?
- PCRE_ERROR_SHORTUTF16 : PCRE_ERROR_BADUTF16;
-#elif defined COMPILE_PCRE32
- return PCRE_ERROR_BADUTF32;
-#endif
- }
-#if defined COMPILE_PCRE8 || defined COMPILE_PCRE16
- /* Check that a start_offset points to the start of a UTF character. */
- if (start_offset > 0 && start_offset < length &&
- NOT_FIRSTCHAR(((PCRE_PUCHAR)subject)[start_offset]))
- return PCRE_ERROR_BADUTF8_OFFSET;
-#endif
- }
-#endif
-
-/* 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 flag is set. */
-
-#ifdef SUPPORT_JIT
-if (extra_data != NULL
- && (extra_data->flags & (PCRE_EXTRA_EXECUTABLE_JIT |
- PCRE_EXTRA_TABLES)) == PCRE_EXTRA_EXECUTABLE_JIT
- && extra_data->executable_jit != NULL
- && (options & ~PUBLIC_JIT_EXEC_OPTIONS) == 0)
- {
- rc = PRIV(jit_exec)(extra_data, (const pcre_uchar *)subject, length,
- start_offset, options, offsets, offsetcount);
-
- /* PCRE_ERROR_NULL means that the selected normal or partial matching
- mode is not compiled. In this case we simply fallback to interpreter. */
-
- if (rc != PCRE_ERROR_JIT_BADOPTION) return rc;
- }
-#endif
-
-/* Carry on with non-JIT matching. This information is for finding all the
-numbers associated with a given name, for condition testing. */
-
-md->name_table = (pcre_uchar *)re + re->name_table_offset;
-md->name_count = re->name_count;
-md->name_entry_size = re->name_entry_size;
-
-/* Fish out the optional data from the extra_data structure, first setting
-the default values. */
-
-study = NULL;
-md->match_limit = MATCH_LIMIT;
-md->match_limit_recursion = MATCH_LIMIT_RECURSION;
-md->callout_data = NULL;
-
-/* The table pointer is always in native byte order. */
-
-tables = re->tables;
-
-/* The two limit values override the defaults, whatever their value. */
-
-if (extra_data != NULL)
- {
- register unsigned int flags = extra_data->flags;
- if ((flags & PCRE_EXTRA_STUDY_DATA) != 0)
- study = (const pcre_study_data *)extra_data->study_data;
- if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0)
- md->match_limit = extra_data->match_limit;
- if ((flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) != 0)
- md->match_limit_recursion = extra_data->match_limit_recursion;
- if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0)
- md->callout_data = extra_data->callout_data;
- if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables;
- }
-
-/* Limits in the regex override only if they are smaller. */
-
-if ((re->flags & PCRE_MLSET) != 0 && re->limit_match < md->match_limit)
- md->match_limit = re->limit_match;
-
-if ((re->flags & PCRE_RLSET) != 0 &&
- re->limit_recursion < md->match_limit_recursion)
- md->match_limit_recursion = re->limit_recursion;
-
-/* If the exec call supplied NULL for tables, use the inbuilt ones. This
-is a feature that makes it possible to save compiled regex and re-use them
-in other programs later. */
-
-if (tables == NULL) tables = PRIV(default_tables);
-
-/* Set up other data */
-
-anchored = ((re->options | options) & PCRE_ANCHORED) != 0;
-startline = (re->flags & PCRE_STARTLINE) != 0;
-firstline = (re->options & PCRE_FIRSTLINE) != 0;
-
-/* The code starts after the real_pcre block and the capture name table. */
-
-md->start_code = (const pcre_uchar *)re + re->name_table_offset +
- re->name_count * re->name_entry_size;
-
-md->start_subject = (PCRE_PUCHAR)subject;
-md->start_offset = start_offset;
-md->end_subject = md->start_subject + length;
-end_subject = md->end_subject;
-
-md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;
-md->use_ucp = (re->options & PCRE_UCP) != 0;
-md->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;
-md->ignore_skip_arg = 0;
-
-/* Some options are unpacked into BOOL variables in the hope that testing
-them will be faster than individual option bits. */
-
-md->notbol = (options & PCRE_NOTBOL) != 0;
-md->noteol = (options & PCRE_NOTEOL) != 0;
-md->notempty = (options & PCRE_NOTEMPTY) != 0;
-md->notempty_atstart = (options & PCRE_NOTEMPTY_ATSTART) != 0;
-
-md->hitend = FALSE;
-md->mark = md->nomatch_mark = NULL; /* In case never set */
-
-md->recursive = NULL; /* No recursion at top level */
-md->hasthen = (re->flags & PCRE_HASTHEN) != 0;
-
-md->lcc = tables + lcc_offset;
-md->fcc = tables + fcc_offset;
-md->ctypes = tables + ctypes_offset;
-
-/* Handle different \R options. */
-
-switch (options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))
- {
- case 0:
- if ((re->options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) != 0)
- md->bsr_anycrlf = (re->options & PCRE_BSR_ANYCRLF) != 0;
- else
-#ifdef BSR_ANYCRLF
- md->bsr_anycrlf = TRUE;
-#else
- md->bsr_anycrlf = FALSE;
-#endif
- break;
-
- case PCRE_BSR_ANYCRLF:
- md->bsr_anycrlf = TRUE;
- break;
-
- case PCRE_BSR_UNICODE:
- md->bsr_anycrlf = FALSE;
- break;
-
- default: return PCRE_ERROR_BADNEWLINE;
- }
-
-/* Handle different types of newline. The three bits give eight cases. If
-nothing is set at run time, whatever was used at compile time applies. */
-
-switch ((((options & PCRE_NEWLINE_BITS) == 0)? re->options :
- (pcre_uint32)options) & PCRE_NEWLINE_BITS)
- {
- case 0: newline = NEWLINE; break; /* Compile-time default */
- case PCRE_NEWLINE_CR: newline = CHAR_CR; break;
- case PCRE_NEWLINE_LF: newline = CHAR_NL; break;
- case PCRE_NEWLINE_CR+
- PCRE_NEWLINE_LF: newline = (CHAR_CR << 8) | CHAR_NL; break;
- case PCRE_NEWLINE_ANY: newline = -1; break;
- case PCRE_NEWLINE_ANYCRLF: newline = -2; break;
- default: return PCRE_ERROR_BADNEWLINE;
- }
-
-if (newline == -2)
- {
- md->nltype = NLTYPE_ANYCRLF;
- }
-else if (newline < 0)
- {
- md->nltype = NLTYPE_ANY;
- }
-else
- {
- md->nltype = NLTYPE_FIXED;
- if (newline > 255)
- {
- md->nllen = 2;
- md->nl[0] = (newline >> 8) & 255;
- md->nl[1] = newline & 255;
- }
- else
- {
- md->nllen = 1;
- md->nl[0] = newline;
- }
- }
-
-/* Partial matching was originally supported only for a restricted set of
-regexes; from release 8.00 there are no restrictions, but the bits are still
-defined (though never set). So there's no harm in leaving this code. */
-
-if (md->partial && (re->flags & PCRE_NOPARTIAL) != 0)
- return PCRE_ERROR_BADPARTIAL;
-
-/* If the expression has got more back references than the offsets supplied can
-hold, we get a temporary chunk of working store to use during the matching.
-Otherwise, we can use the vector supplied, rounding down its size to a multiple
-of 3. */
-
-ocount = offsetcount - (offsetcount % 3);
-arg_offset_max = (2*ocount)/3;
-
-if (re->top_backref > 0 && re->top_backref >= ocount/3)
- {
- ocount = re->top_backref * 3 + 3;
- md->offset_vector = (int *)(PUBL(malloc))(ocount * sizeof(int));
- if (md->offset_vector == NULL) return PCRE_ERROR_NOMEMORY;
- using_temporary_offsets = TRUE;
- DPRINTF(("Got memory to hold back references\n"));
- }
-else md->offset_vector = offsets;
-md->offset_end = ocount;
-md->offset_max = (2*ocount)/3;
-md->capture_last = 0;
-
-/* Reset the working variable associated with each extraction. These should
-never be used unless previously set, but they get saved and restored, and so we
-initialize them to avoid reading uninitialized locations. Also, unset the
-offsets for the matched string. This is really just for tidiness with callouts,
-in case they inspect these fields. */
-
-if (md->offset_vector != NULL)
- {
- register int *iptr = md->offset_vector + ocount;
- register int *iend = iptr - re->top_bracket;
- if (iend < md->offset_vector + 2) iend = md->offset_vector + 2;
- while (--iptr >= iend) *iptr = -1;
- md->offset_vector[0] = md->offset_vector[1] = -1;
- }
-
-/* Set up the first character to match, if available. The first_char value is
-never set for an anchored regular expression, but the anchoring may be forced
-at run time, so we have to test for anchoring. The first char may be unset for
-an unanchored pattern, of course. If there's no first char and the pattern was
-studied, there may be a bitmap of possible first characters. */
-
-if (!anchored)
- {
- if ((re->flags & PCRE_FIRSTSET) != 0)
- {
- has_first_char = TRUE;
- first_char = first_char2 = (pcre_uchar)(re->first_char);
- if ((re->flags & PCRE_FCH_CASELESS) != 0)
- {
- first_char2 = TABLE_GET(first_char, md->fcc, first_char);
-#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)
- if (utf && first_char > 127)
- first_char2 = UCD_OTHERCASE(first_char);
-#endif
- }
- }
- else
- if (!startline && study != NULL &&
- (study->flags & PCRE_STUDY_MAPPED) != 0)
- start_bits = study->start_bits;
- }
-
-/* For anchored or unanchored matches, there may be a "last known required
-character" set. */
-
-if ((re->flags & PCRE_REQCHSET) != 0)
- {
- has_req_char = TRUE;
- req_char = req_char2 = (pcre_uchar)(re->req_char);
- if ((re->flags & PCRE_RCH_CASELESS) != 0)
- {
- req_char2 = TABLE_GET(req_char, md->fcc, req_char);
-#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)
- if (utf && req_char > 127)
- req_char2 = UCD_OTHERCASE(req_char);
-#endif
- }
- }
-
-
-/* ==========================================================================*/
-
-/* Loop for handling unanchored repeated matching attempts; for anchored regexs
-the loop runs just once. */
-
-for(;;)
- {
- PCRE_PUCHAR save_end_subject = end_subject;
- PCRE_PUCHAR new_start_match;
-
- /* If firstline is TRUE, the start of the match is constrained to the first
- line of a multiline string. That is, the match must be before or at the first
- newline. Implement this by temporarily adjusting end_subject so that we stop
- scanning at a newline. If the match fails at the newline, later code breaks
- this loop. */
-
- if (firstline)
- {
- PCRE_PUCHAR t = start_match;
-#ifdef SUPPORT_UTF
- if (utf)
- {
- while (t < md->end_subject && !IS_NEWLINE(t))
- {
- t++;
- ACROSSCHAR(t < end_subject, *t, t++);
- }
- }
- else
-#endif
- while (t < md->end_subject && !IS_NEWLINE(t)) t++;
- end_subject = t;
- }
-
- /* There are some optimizations that avoid running the match if a known
- starting point is not found, or if a known later character is not present.
- However, there is an option that disables these, for testing and for ensuring
- that all callouts do actually occur. The option can be set in the regex by
- (*NO_START_OPT) or passed in match-time options. */
-
- if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0)
- {
- /* Advance to a unique first char if there is one. */
-
- if (has_first_char)
- {
- pcre_uchar smc;
-
- if (first_char != first_char2)
- while (start_match < end_subject &&
- (smc = UCHAR21TEST(start_match)) != first_char && smc != first_char2)
- start_match++;
- else
- while (start_match < end_subject && UCHAR21TEST(start_match) != first_char)
- start_match++;
- }
-
- /* Or to just after a linebreak for a multiline match */
-
- else if (startline)
- {
- if (start_match > md->start_subject + start_offset)
- {
-#ifdef SUPPORT_UTF
- if (utf)
- {
- while (start_match < end_subject && !WAS_NEWLINE(start_match))
- {
- start_match++;
- ACROSSCHAR(start_match < end_subject, *start_match,
- start_match++);
- }
- }
- else
-#endif
- while (start_match < end_subject && !WAS_NEWLINE(start_match))
- start_match++;
-
- /* If we have just passed a CR and the newline option is ANY or ANYCRLF,
- and we are now at a LF, advance the match position by one more character.
- */
-
- if (start_match[-1] == CHAR_CR &&
- (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&
- start_match < end_subject &&
- UCHAR21TEST(start_match) == CHAR_NL)
- start_match++;
- }
- }
-
- /* Or to a non-unique first byte after study */
-
- else if (start_bits != NULL)
- {
- while (start_match < end_subject)
- {
- register pcre_uint32 c = UCHAR21TEST(start_match);
-#ifndef COMPILE_PCRE8
- if (c > 255) c = 255;
-#endif
- if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
- start_match++;
- }
- }
- } /* Starting optimizations */
-
- /* Restore fudged end_subject */
-
- end_subject = save_end_subject;
-
- /* The following two optimizations are disabled for partial matching or if
- disabling is explicitly requested. */
-
- if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0 && !md->partial)
- {
- /* If the pattern was studied, a minimum subject length may be set. This 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
- bytes to avoid spending too much time in this optimization. */
-
- if (study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0 &&
- (pcre_uint32)(end_subject - start_match) < study->minlength)
- {
- rc = MATCH_NOMATCH;
- break;
- }
-
- /* If req_char is set, we know that that character must appear in the
- subject for the match to succeed. If the first character is set, req_char
- must be later in the subject; otherwise the test starts at the match 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.
-
- 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. */
-
- if (has_req_char && end_subject - start_match < REQ_BYTE_MAX)
- {
- register PCRE_PUCHAR p = start_match + (has_first_char? 1:0);
-
- /* We don't need to repeat the search if we haven't yet reached the
- place we found it at last time. */
-
- if (p > req_char_ptr)
- {
- if (req_char != req_char2)
- {
- while (p < end_subject)
- {
- register pcre_uint32 pp = UCHAR21INCTEST(p);
- if (pp == req_char || pp == req_char2) { p--; break; }
- }
- }
- else
- {
- while (p < end_subject)
- {
- if (UCHAR21INCTEST(p) == req_char) { p--; break; }
- }
- }
-
- /* If we can't find the required character, break the matching loop,
- forcing a match failure. */
-
- if (p >= end_subject)
- {
- rc = MATCH_NOMATCH;
- break;
- }
-
- /* If we have found the required character, save the point where we
- found it, so that we don't search again next time round the loop if
- the start hasn't passed this character yet. */
-
- req_char_ptr = p;
- }
- }
- }
-
-#ifdef PCRE_DEBUG /* Sigh. Some compilers never learn. */
- printf(">>>> Match against: ");
- pchars(start_match, end_subject - start_match, TRUE, md);
- printf("\n");
-#endif
-
- /* OK, we can now run the match. If "hitend" is set afterwards, remember the
- first starting point for which a partial match was found. */
-
- md->start_match_ptr = start_match;
- md->start_used_ptr = start_match;
- md->match_call_count = 0;
- md->match_function_type = 0;
- md->end_offset_top = 0;
- md->skip_arg_count = 0;
- rc = match(start_match, md->start_code, start_match, 2, md, NULL, 0);
- if (md->hitend && start_partial == NULL)
- {
- start_partial = md->start_used_ptr;
- match_partial = start_match;
- }
-
- switch(rc)
- {
- /* If MATCH_SKIP_ARG reaches this level it means that a MARK that matched
- the SKIP's arg was not found. In this circumstance, Perl ignores the SKIP
- entirely. The only way we can do that is to re-do the match at the same
- point, with a flag to force SKIP with an argument to be ignored. Just
- treating this case as NOMATCH does not work because it does not check other
- alternatives in patterns such as A(*SKIP:A)B|AC when the subject is AC. */
-
- case MATCH_SKIP_ARG:
- new_start_match = start_match;
- md->ignore_skip_arg = md->skip_arg_count;
- break;
-
- /* SKIP passes back the next starting point explicitly, but if it is no
- greater than the match we have just done, treat it as NOMATCH. */
-
- case MATCH_SKIP:
- if (md->start_match_ptr > start_match)
- {
- new_start_match = md->start_match_ptr;
- break;
- }
- /* Fall through */
-
- /* NOMATCH and PRUNE advance by one character. THEN at this level acts
- exactly like PRUNE. Unset ignore SKIP-with-argument. */
-
- case MATCH_NOMATCH:
- case MATCH_PRUNE:
- case MATCH_THEN:
- md->ignore_skip_arg = 0;
- new_start_match = start_match + 1;
-#ifdef SUPPORT_UTF
- if (utf)
- ACROSSCHAR(new_start_match < end_subject, *new_start_match,
- new_start_match++);
-#endif
- break;
-
- /* COMMIT disables the bumpalong, but otherwise behaves as NOMATCH. */
-
- case MATCH_COMMIT:
- rc = MATCH_NOMATCH;
- goto ENDLOOP;
-
- /* Any other return is either a match, or some kind of error. */
-
- default:
- goto ENDLOOP;
- }
-
- /* Control reaches here for the various types of "no match at this point"
- result. Reset the code to MATCH_NOMATCH for subsequent checking. */
-
- rc = MATCH_NOMATCH;
-
- /* If PCRE_FIRSTLINE is set, the match must happen before or at the first
- newline in the subject (though it may continue over the newline). Therefore,
- if we have just failed to match, starting at a newline, do not continue. */
-
- if (firstline && IS_NEWLINE(start_match)) break;
-
- /* Advance to new matching position */
-
- start_match = new_start_match;
-
- /* Break the loop if the pattern is anchored or if we have passed the end of
- the subject. */
-
- if (anchored || start_match > end_subject) break;
-
- /* If we have just passed a CR and we are now at a LF, and the pattern does
- not contain any explicit matches for \r or \n, and the newline option is CRLF
- or ANY or ANYCRLF, advance the match position by one more character. In
- normal matching start_match will aways be greater than the first position at
- this stage, but a failed *SKIP can cause a return at the same point, which is
- why the first test exists. */
-
- if (start_match > (PCRE_PUCHAR)subject + start_offset &&
- start_match[-1] == CHAR_CR &&
- start_match < end_subject &&
- *start_match == CHAR_NL &&
- (re->flags & PCRE_HASCRORLF) == 0 &&
- (md->nltype == NLTYPE_ANY ||
- md->nltype == NLTYPE_ANYCRLF ||
- md->nllen == 2))
- start_match++;
-
- md->mark = NULL; /* Reset for start of next match attempt */
- } /* End of for(;;) "bumpalong" loop */
-
-/* ==========================================================================*/
-
-/* We reach here when rc is not MATCH_NOMATCH, or if one of the stopping
-conditions is true:
-
-(1) The pattern is anchored or the match was failed by (*COMMIT);
-
-(2) We are past the end of the subject;
-
-(3) PCRE_FIRSTLINE is set and we have failed to match at a newline, because
- this option requests that a match occur at or before the first newline in
- the subject.
-
-When we have a match and the offset vector is big enough to deal with any
-backreferences, captured substring offsets will already be set up. In the case
-where we had to get some local store to hold offsets for backreference
-processing, copy those that we can. In this case there need not be overflow if
-certain parts of the pattern were not used, even though there are more
-capturing parentheses than vector slots. */
-
-ENDLOOP:
-
-if (rc == MATCH_MATCH || rc == MATCH_ACCEPT)
- {
- if (using_temporary_offsets)
- {
- if (arg_offset_max >= 4)
- {
- memcpy(offsets + 2, md->offset_vector + 2,
- (arg_offset_max - 2) * sizeof(int));
- DPRINTF(("Copied offsets from temporary memory\n"));
- }
- if (md->end_offset_top > arg_offset_max) md->capture_last |= OVFLBIT;
- DPRINTF(("Freeing temporary memory\n"));
- (PUBL(free))(md->offset_vector);
- }
-
- /* Set the return code to the number of captured strings, or 0 if there were
- too many to fit into the vector. */
-
- rc = ((md->capture_last & OVFLBIT) != 0 &&
- md->end_offset_top >= arg_offset_max)?
- 0 : md->end_offset_top/2;
-
- /* If there is space in the offset vector, set any unused pairs at the end of
- the pattern to -1 for backwards compatibility. It is documented that this
- happens. In earlier versions, the whole set of potential capturing offsets
- was set to -1 each time round the loop, but this is handled differently now.
- "Gaps" are set to -1 dynamically instead (this fixes a bug). Thus, it is only
- those at the end that need unsetting here. We can't just unset them all at
- the start of the whole thing because they may get set in one branch that is
- not the final matching branch. */
-
- if (md->end_offset_top/2 <= re->top_bracket && offsets != NULL)
- {
- register int *iptr, *iend;
- int resetcount = 2 + re->top_bracket * 2;
- if (resetcount > offsetcount) resetcount = offsetcount;
- iptr = offsets + md->end_offset_top;
- iend = offsets + resetcount;
- while (iptr < iend) *iptr++ = -1;
- }
-
- /* If there is space, set up the whole thing as substring 0. The value of
- md->start_match_ptr might be modified if \K was encountered on the success
- matching path. */
-
- if (offsetcount < 2) rc = 0; else
- {
- offsets[0] = (int)(md->start_match_ptr - md->start_subject);
- offsets[1] = (int)(md->end_match_ptr - md->start_subject);
- }
-
- /* Return MARK data if requested */
-
- if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0)
- *(extra_data->mark) = (pcre_uchar *)md->mark;
- DPRINTF((">>>> returning %d\n", rc));
-#ifdef NO_RECURSE
- release_match_heapframes(&frame_zero);
-#endif
- return rc;
- }
-
-/* Control gets here if there has been an error, or if the overall match
-attempt has failed at all permitted starting positions. */
-
-if (using_temporary_offsets)
- {
- DPRINTF(("Freeing temporary memory\n"));
- (PUBL(free))(md->offset_vector);
- }
-
-/* For anything other than nomatch or partial match, just return the code. */
-
-if (rc != MATCH_NOMATCH && rc != PCRE_ERROR_PARTIAL)
- {
- DPRINTF((">>>> error: returning %d\n", rc));
-#ifdef NO_RECURSE
- release_match_heapframes(&frame_zero);
-#endif
- return rc;
- }
-
-/* Handle partial matches - disable any mark data */
-
-if (match_partial != NULL)
- {
- DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n"));
- md->mark = NULL;
- if (offsetcount > 1)
- {
- offsets[0] = (int)(start_partial - (PCRE_PUCHAR)subject);
- offsets[1] = (int)(end_subject - (PCRE_PUCHAR)subject);
- if (offsetcount > 2)
- offsets[2] = (int)(match_partial - (PCRE_PUCHAR)subject);
- }
- rc = PCRE_ERROR_PARTIAL;
- }
-
-/* This is the classic nomatch case */
-
-else
- {
- DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n"));
- rc = PCRE_ERROR_NOMATCH;
- }
-
-/* Return the MARK data if it has been requested. */
-
-if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0)
- *(extra_data->mark) = (pcre_uchar *)md->nomatch_mark;
-#ifdef NO_RECURSE
- release_match_heapframes(&frame_zero);
-#endif
-return rc;
-}
-
-/* End of pcre_exec.c */
diff --git a/.pc/fix_find_fixedlength.patch/pcre_compile.c b/.pc/fix_find_fixedlength.patch/pcre_compile.c
deleted file mode 100644
index ae0027b..0000000
--- a/.pc/fix_find_fixedlength.patch/pcre_compile.c
+++ /dev/null
@@ -1,9481 +0,0 @@
-/*************************************************
-* 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
- Copyright (c) 1997-2014 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 external function pcre_compile(), along with
-supporting internal functions that are not used by other modules. */
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define NLBLOCK cd /* Block containing newline information */
-#define PSSTART start_pattern /* Field containing processed string start */
-#define PSEND end_pattern /* Field containing processed string end */
-
-#include "pcre_internal.h"
-
-
-/* When PCRE_DEBUG is defined, we need the pcre(16|32)_printint() function, which
-is also used by pcretest. PCRE_DEBUG is not defined when building a production
-library. We do not need to select pcre16_printint.c specially, because the
-COMPILE_PCREx macro will already be appropriately set. */
-
-#ifdef PCRE_DEBUG
-/* pcre_printint.c should not include any headers */
-#define PCRE_INCLUDED
-#include "pcre_printint.c"
-#undef PCRE_INCLUDED
-#endif
-
-
-/* Macro for setting individual bits in class bitmaps. */
-
-#define SETBIT(a,b) a[(b)/8] |= (1 << ((b)&7))
-
-/* Maximum length value to check against when making sure that the integer that
-holds the compiled pattern length does not overflow. We make it a bit less than
-INT_MAX to allow for adding in group terminating bytes, so that we don't have
-to check them every time. */
-
-#define OFLOW_MAX (INT_MAX - 20)
-
-/* Definitions to allow mutual recursion */
-
-static int
- add_list_to_class(pcre_uint8 *, pcre_uchar **, int, compile_data *,
- const pcre_uint32 *, unsigned int);
-
-static BOOL
- compile_regex(int, pcre_uchar **, const pcre_uchar **, int *, BOOL, BOOL, int, int,
- pcre_uint32 *, pcre_int32 *, pcre_uint32 *, pcre_int32 *, branch_chain *,
- compile_data *, int *);
-
-
-
-/*************************************************
-* Code parameters and static tables *
-*************************************************/
-
-/* This value specifies the size of stack workspace that is used during the
-first pre-compile phase that determines how much memory is required. The regex
-is partly compiled into this space, but the compiled parts are discarded as
-soon as they can be, so that hopefully there will never be an overrun. The code
-does, however, check for an overrun. The largest amount I've seen used is 218,
-so this number is very generous.
-
-The same workspace is used during the second, actual compile phase for
-remembering forward references to groups so that they can be filled in at the
-end. Each entry in this list occupies LINK_SIZE bytes, so even when LINK_SIZE
-is 4 there is plenty of room for most patterns. However, the memory can get
-filled up by repetitions of forward references, for example patterns like
-/(?1){0,1999}(b)/, and one user did hit the limit. The code has been changed so
-that the workspace is expanded using malloc() in this situation. The value
-below is therefore a minimum, and we put a maximum on it for safety. The
-minimum is now also defined in terms of LINK_SIZE so that the use of malloc()
-kicks in at the same number of forward references in all cases. */
-
-#define COMPILE_WORK_SIZE (2048*LINK_SIZE)
-#define COMPILE_WORK_SIZE_MAX (100*COMPILE_WORK_SIZE)
-
-/* This value determines the size of the initial vector that is used for
-remembering named groups during the pre-compile. It is allocated on the stack,
-but if it is too small, it is expanded using malloc(), in a similar way to the
-workspace. The value is the number of slots in the list. */
-
-#define NAMED_GROUP_LIST_SIZE 20
-
-/* The overrun tests check for a slightly smaller size so that they detect the
-overrun before it actually does run off the end of the data block. */
-
-#define WORK_SIZE_SAFETY_MARGIN (100)
-
-/* Private flags added to firstchar and reqchar. */
-
-#define REQ_CASELESS (1 << 0) /* Indicates caselessness */
-#define REQ_VARY (1 << 1) /* Reqchar followed non-literal item */
-/* Negative values for the firstchar and reqchar flags */
-#define REQ_UNSET (-2)
-#define REQ_NONE (-1)
-
-/* Repeated character flags. */
-
-#define UTF_LENGTH 0x10000000l /* The char contains its length. */
-
-/* Table for handling escaped characters in the range '0'-'z'. Positive returns
-are simple data values; negative values are for special things like \d and so
-on. Zero means further processing is needed (for things like \x), or the escape
-is invalid. */
-
-#ifndef EBCDIC
-
-/* This is the "normal" table for ASCII systems or for EBCDIC systems running
-in UTF-8 mode. */
-
-static const short int escapes[] = {
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- 0, 0,
- CHAR_COLON, CHAR_SEMICOLON,
- CHAR_LESS_THAN_SIGN, CHAR_EQUALS_SIGN,
- CHAR_GREATER_THAN_SIGN, CHAR_QUESTION_MARK,
- CHAR_COMMERCIAL_AT, -ESC_A,
- -ESC_B, -ESC_C,
- -ESC_D, -ESC_E,
- 0, -ESC_G,
- -ESC_H, 0,
- 0, -ESC_K,
- 0, 0,
- -ESC_N, 0,
- -ESC_P, -ESC_Q,
- -ESC_R, -ESC_S,
- 0, 0,
- -ESC_V, -ESC_W,
- -ESC_X, 0,
- -ESC_Z, CHAR_LEFT_SQUARE_BRACKET,
- CHAR_BACKSLASH, CHAR_RIGHT_SQUARE_BRACKET,
- CHAR_CIRCUMFLEX_ACCENT, CHAR_UNDERSCORE,
- CHAR_GRAVE_ACCENT, 7,
- -ESC_b, 0,
- -ESC_d, ESC_e,
- ESC_f, 0,
- -ESC_h, 0,
- 0, -ESC_k,
- 0, 0,
- ESC_n, 0,
- -ESC_p, 0,
- ESC_r, -ESC_s,
- ESC_tee, 0,
- -ESC_v, -ESC_w,
- 0, 0,
- -ESC_z
-};
-
-#else
-
-/* This is the "abnormal" table for EBCDIC systems without UTF-8 support. */
-
-static const short int escapes[] = {
-/* 48 */ 0, 0, 0, '.', '<', '(', '+', '|',
-/* 50 */ '&', 0, 0, 0, 0, 0, 0, 0,
-/* 58 */ 0, 0, '!', '$', '*', ')', ';', '~',
-/* 60 */ '-', '/', 0, 0, 0, 0, 0, 0,
-/* 68 */ 0, 0, '|', ',', '%', '_', '>', '?',
-/* 70 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* 78 */ 0, '`', ':', '#', '@', '\'', '=', '"',
-/* 80 */ 0, 7, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0,
-/* 88 */-ESC_h, 0, 0, '{', 0, 0, 0, 0,
-/* 90 */ 0, 0, -ESC_k, 'l', 0, ESC_n, 0, -ESC_p,
-/* 98 */ 0, ESC_r, 0, '}', 0, 0, 0, 0,
-/* A0 */ 0, '~', -ESC_s, ESC_tee, 0,-ESC_v, -ESC_w, 0,
-/* A8 */ 0,-ESC_z, 0, 0, 0, '[', 0, 0,
-/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* B8 */ 0, 0, 0, 0, 0, ']', '=', '-',
-/* C0 */ '{',-ESC_A, -ESC_B, -ESC_C, -ESC_D,-ESC_E, 0, -ESC_G,
-/* C8 */-ESC_H, 0, 0, 0, 0, 0, 0, 0,
-/* D0 */ '}', 0, -ESC_K, 0, 0,-ESC_N, 0, -ESC_P,
-/* D8 */-ESC_Q,-ESC_R, 0, 0, 0, 0, 0, 0,
-/* E0 */ '\\', 0, -ESC_S, 0, 0,-ESC_V, -ESC_W, -ESC_X,
-/* E8 */ 0,-ESC_Z, 0, 0, 0, 0, 0, 0,
-/* F0 */ 0, 0, 0, 0, 0, 0, 0, 0,
-/* F8 */ 0, 0, 0, 0, 0, 0, 0, 0
-};
-#endif
-
-
-/* Table of special "verbs" like (*PRUNE). This is a short table, so it is
-searched linearly. Put all the names into a single string, in order to reduce
-the number of relocations when a shared library is dynamically linked. The
-string is built from string macros so that it works in UTF-8 mode on EBCDIC
-platforms. */
-
-typedef struct verbitem {
- int len; /* Length of verb name */
- int op; /* Op when no arg, or -1 if arg mandatory */
- int op_arg; /* Op when arg present, or -1 if not allowed */
-} verbitem;
-
-static const char verbnames[] =
- "\0" /* Empty name is a shorthand for MARK */
- STRING_MARK0
- STRING_ACCEPT0
- STRING_COMMIT0
- STRING_F0
- STRING_FAIL0
- STRING_PRUNE0
- STRING_SKIP0
- STRING_THEN;
-
-static const verbitem verbs[] = {
- { 0, -1, OP_MARK },
- { 4, -1, OP_MARK },
- { 6, OP_ACCEPT, -1 },
- { 6, OP_COMMIT, -1 },
- { 1, OP_FAIL, -1 },
- { 4, OP_FAIL, -1 },
- { 5, OP_PRUNE, OP_PRUNE_ARG },
- { 4, OP_SKIP, OP_SKIP_ARG },
- { 4, OP_THEN, OP_THEN_ARG }
-};
-
-static const int verbcount = sizeof(verbs)/sizeof(verbitem);
-
-
-/* Substitutes for [[:<:]] and [[:>:]], which mean start and end of word in
-another regex library. */
-
-static const pcre_uchar sub_start_of_word[] = {
- CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
- CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w, CHAR_RIGHT_PARENTHESIS, '\0' };
-
-static const pcre_uchar sub_end_of_word[] = {
- CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
- CHAR_LESS_THAN_SIGN, CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w,
- CHAR_RIGHT_PARENTHESIS, '\0' };
-
-
-/* Tables of names of POSIX character classes and their lengths. The names are
-now all in a single string, to reduce the number of relocations when a shared
-library is dynamically loaded. The list of lengths is terminated by a zero
-length entry. The first three must be alpha, lower, upper, as this is assumed
-for handling case independence. The indices for graph, print, and punct are
-needed, so identify them. */
-
-static const char posix_names[] =
- STRING_alpha0 STRING_lower0 STRING_upper0 STRING_alnum0
- STRING_ascii0 STRING_blank0 STRING_cntrl0 STRING_digit0
- STRING_graph0 STRING_print0 STRING_punct0 STRING_space0
- STRING_word0 STRING_xdigit;
-
-static const pcre_uint8 posix_name_lengths[] = {
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 };
-
-#define PC_GRAPH 8
-#define PC_PRINT 9
-#define PC_PUNCT 10
-
-
-/* Table of class bit maps for each POSIX class. Each class is formed from a
-base map, with an optional addition or removal of another map. Then, for some
-classes, there is some additional tweaking: for [:blank:] the vertical space
-characters are removed, and for [:alpha:] and [:alnum:] the underscore
-character is removed. The triples in the table consist of the base map offset,
-second map offset or -1 if no second map, and a non-negative value for map
-addition or a negative value for map subtraction (if there are two maps). The
-absolute value of the third field has these meanings: 0 => no tweaking, 1 =>
-remove vertical space characters, 2 => remove underscore. */
-
-static const int posix_class_maps[] = {
- cbit_word, cbit_digit, -2, /* alpha */
- cbit_lower, -1, 0, /* lower */
- cbit_upper, -1, 0, /* upper */
- cbit_word, -1, 2, /* alnum - word without underscore */
- cbit_print, cbit_cntrl, 0, /* ascii */
- cbit_space, -1, 1, /* blank - a GNU extension */
- cbit_cntrl, -1, 0, /* cntrl */
- cbit_digit, -1, 0, /* digit */
- cbit_graph, -1, 0, /* graph */
- cbit_print, -1, 0, /* print */
- cbit_punct, -1, 0, /* punct */
- cbit_space, -1, 0, /* space */
- cbit_word, -1, 0, /* word - a Perl extension */
- cbit_xdigit,-1, 0 /* xdigit */
-};
-
-/* Table of substitutes for \d etc when PCRE_UCP is set. They are replaced by
-Unicode property escapes. */
-
-#ifdef SUPPORT_UCP
-static const pcre_uchar string_PNd[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_N, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pNd[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_N, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PXsp[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_s, CHAR_p, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pXsp[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_s, CHAR_p, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PXwd[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_w, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pXwd[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_w, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-
-static const pcre_uchar *substitutes[] = {
- string_PNd, /* \D */
- string_pNd, /* \d */
- string_PXsp, /* \S */ /* Xsp is Perl space, but from 8.34, Perl */
- string_pXsp, /* \s */ /* space and POSIX space are the same. */
- string_PXwd, /* \W */
- string_pXwd /* \w */
-};
-
-/* The POSIX class substitutes must be in the order of the POSIX class names,
-defined above, and there are both positive and negative cases. NULL means no
-general substitute of a Unicode property escape (\p or \P). However, for some
-POSIX classes (e.g. graph, print, punct) a special property code is compiled
-directly. */
-
-static const pcre_uchar string_pL[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pLl[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_l, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pLu[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_u, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_pXan[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_a, CHAR_n, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_h[] = {
- CHAR_BACKSLASH, CHAR_h, '\0' };
-static const pcre_uchar string_pXps[] = {
- CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_p, CHAR_s, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PL[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PLl[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_l, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PLu[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_L, CHAR_u, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_PXan[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_a, CHAR_n, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-static const pcre_uchar string_H[] = {
- CHAR_BACKSLASH, CHAR_H, '\0' };
-static const pcre_uchar string_PXps[] = {
- CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET,
- CHAR_X, CHAR_p, CHAR_s, CHAR_RIGHT_CURLY_BRACKET, '\0' };
-
-static const pcre_uchar *posix_substitutes[] = {
- string_pL, /* alpha */
- string_pLl, /* lower */
- string_pLu, /* upper */
- string_pXan, /* alnum */
- NULL, /* ascii */
- string_h, /* blank */
- NULL, /* cntrl */
- string_pNd, /* digit */
- NULL, /* graph */
- NULL, /* print */
- NULL, /* punct */
- string_pXps, /* space */ /* Xps is POSIX space, but from 8.34 */
- string_pXwd, /* word */ /* Perl and POSIX space are the same */
- NULL, /* xdigit */
- /* Negated cases */
- string_PL, /* ^alpha */
- string_PLl, /* ^lower */
- string_PLu, /* ^upper */
- string_PXan, /* ^alnum */
- NULL, /* ^ascii */
- string_H, /* ^blank */
- NULL, /* ^cntrl */
- string_PNd, /* ^digit */
- NULL, /* ^graph */
- NULL, /* ^print */
- NULL, /* ^punct */
- string_PXps, /* ^space */ /* Xps is POSIX space, but from 8.34 */
- string_PXwd, /* ^word */ /* Perl and POSIX space are the same */
- NULL /* ^xdigit */
-};
-#define POSIX_SUBSIZE (sizeof(posix_substitutes) / sizeof(pcre_uchar *))
-#endif
-
-#define STRING(a) # a
-#define XSTRING(s) STRING(s)
-
-/* The texts of compile-time error messages. These are "char *" because they
-are passed to the outside world. Do not ever re-use any error number, because
-they are documented. Always add a new error instead. Messages marked DEAD below
-are no longer used. This used to be a table of strings, but in order to reduce
-the number of relocations needed when a shared library is loaded dynamically,
-it is now one long string. We cannot use a table of offsets, because the
-lengths of inserts such as XSTRING(MAX_NAME_SIZE) are not known. Instead, we
-simply count through to the one we want - this isn't a performance issue
-because these strings are used only when there is a compilation error.
-
-Each substring ends with \0 to insert a null character. This includes the final
-substring, so that the whole string ends with \0\0, which can be detected when
-counting through. */
-
-static const char error_texts[] =
- "no error\0"
- "\\ at end of pattern\0"
- "\\c at end of pattern\0"
- "unrecognized character follows \\\0"
- "numbers out of order in {} quantifier\0"
- /* 5 */
- "number too big in {} quantifier\0"
- "missing terminating ] for character class\0"
- "invalid escape sequence in character class\0"
- "range out of order in character class\0"
- "nothing to repeat\0"
- /* 10 */
- "operand of unlimited repeat could match the empty string\0" /** DEAD **/
- "internal error: unexpected repeat\0"
- "unrecognized character after (? or (?-\0"
- "POSIX named classes are supported only within a class\0"
- "missing )\0"
- /* 15 */
- "reference to non-existent subpattern\0"
- "erroffset passed as NULL\0"
- "unknown option bit(s) set\0"
- "missing ) after comment\0"
- "parentheses nested too deeply\0" /** DEAD **/
- /* 20 */
- "regular expression is too large\0"
- "failed to get memory\0"
- "unmatched parentheses\0"
- "internal error: code overflow\0"
- "unrecognized character after (?<\0"
- /* 25 */
- "lookbehind assertion is not fixed length\0"
- "malformed number or name after (?(\0"
- "conditional group contains more than two branches\0"
- "assertion expected after (?(\0"
- "(?R or (?[+-]digits must be followed by )\0"
- /* 30 */
- "unknown POSIX class name\0"
- "POSIX collating elements are not supported\0"
- "this version of PCRE is compiled without UTF support\0"
- "spare error\0" /** DEAD **/
- "character value in \\x{} or \\o{} is too large\0"
- /* 35 */
- "invalid condition (?(0)\0"
- "\\C not allowed in lookbehind assertion\0"
- "PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u\0"
- "number after (?C is > 255\0"
- "closing ) for (?C expected\0"
- /* 40 */
- "recursive call could loop indefinitely\0"
- "unrecognized character after (?P\0"
- "syntax error in subpattern name (missing terminator)\0"
- "two named subpatterns have the same name\0"
- "invalid UTF-8 string\0"
- /* 45 */
- "support for \\P, \\p, and \\X has not been compiled\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"
- "too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0"
- /* 50 */
- "repeated subpattern is too long\0" /** DEAD **/
- "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"
- /* 55 */
- "repeating a DEFINE group is not allowed\0" /** DEAD **/
- "inconsistent NEWLINE options\0"
- "\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0"
- "a numbered reference must not be zero\0"
- "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)\0"
- /* 60 */
- "(*VERB) not recognized or malformed\0"
- "number is too big\0"
- "subpattern name expected\0"
- "digit expected after (?+\0"
- "] is an invalid data character in JavaScript compatibility mode\0"
- /* 65 */
- "different names for subpatterns of the same number are not allowed\0"
- "(*MARK) must have an argument\0"
- "this version of PCRE is not compiled with Unicode property support\0"
- "\\c must be followed by an ASCII character\0"
- "\\k is not followed by a braced, angle-bracketed, or quoted name\0"
- /* 70 */
- "internal error: unknown opcode in find_fixedlength()\0"
- "\\N is not supported in a class\0"
- "too many forward references\0"
- "disallowed Unicode code point (>= 0xd800 && <= 0xdfff)\0"
- "invalid UTF-16 string\0"
- /* 75 */
- "name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0"
- "character value in \\u.... sequence is too large\0"
- "invalid UTF-32 string\0"
- "setting UTF is disabled by the application\0"
- "non-hex character in \\x{} (closing brace missing?)\0"
- /* 80 */
- "non-octal character in \\o{} (closing brace missing?)\0"
- "missing opening brace after \\o\0"
- "parentheses are too deeply nested\0"
- "invalid range in character class\0"
- "group name must start with a non-digit\0"
- /* 85 */
- "parentheses are too deeply nested (stack check)\0"
- ;
-
-/* Table to identify digits and hex digits. This is used when compiling
-patterns. Note that the tables in chartables are dependent on the locale, and
-may mark arbitrary characters as digits - but the PCRE compiling code expects
-to handle only 0-9, a-z, and A-Z as digits when compiling. That is why we have
-a private table here. It costs 256 bytes, but it is a lot faster than doing
-character value tests (at least in some simple cases I timed), and in some
-applications one wants PCRE to compile efficiently as well as match
-efficiently.
-
-For convenience, we use the same bit definitions as in chartables:
-
- 0x04 decimal digit
- 0x08 hexadecimal digit
-
-Then we can use ctype_digit and ctype_xdigit in the code. */
-
-/* Using a simple comparison for decimal numbers rather than a memory read
-is much faster, and the resulting code is simpler (the compiler turns it
-into a subtraction and unsigned comparison). */
-
-#define IS_DIGIT(x) ((x) >= CHAR_0 && (x) <= CHAR_9)
-
-#ifndef EBCDIC
-
-/* This is the "normal" case, for ASCII systems, and EBCDIC systems running in
-UTF-8 mode. */
-
-static const pcre_uint8 digitab[] =
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - ' */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ( - / */
- 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 */
- 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* @ - G */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H - O */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* P - W */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* X - _ */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* ` - g */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h - o */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* p - w */
- 0x00,0x00,0x00,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 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
-
-#else
-
-/* This is the "abnormal" case, for EBCDIC systems not running in UTF-8 mode. */
-
-static const pcre_uint8 digitab[] =
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 10 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32- 39 20 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 30 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 40 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 72- | */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 50 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 88- 95 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 60 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 104- ? */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 70 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* 128- g 80 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144- p 90 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160- x A0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 B0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* { - G C0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* } - P D0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* \ - X E0 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */
- 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 F0 */
- 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */
-
-static const pcre_uint8 ebcdic_chartab[] = { /* chartable partial dup */
- 0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 0- 7 */
- 0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */
- 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 16- 23 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
- 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 32- 39 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 40- 47 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 48- 55 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 56- 63 */
- 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 */
- 0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80, /* 72- | */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 */
- 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, /* 88- 95 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 */
- 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80, /* 104- ? */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- " */
- 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* 128- g */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* h -143 */
- 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* 144- p */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* q -159 */
- 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* 160- x */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* y -175 */
- 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ^ -183 */
- 0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
- 0x80,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* { - G */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* H -207 */
- 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* } - P */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Q -223 */
- 0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* \ - X */
- 0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* Y -239 */
- 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
- 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */
-#endif
-
-
-/* This table is used to check whether auto-possessification is possible
-between adjacent character-type opcodes. The left-hand (repeated) opcode is
-used to select the row, and the right-hand opcode is use to select the column.
-A value of 1 means that auto-possessification is OK. For example, the second
-value in the first row means that \D+\d can be turned into \D++\d.
-
-The Unicode property types (\P and \p) have to be present to fill out the table
-because of what their opcode values are, but the table values should always be
-zero because property types are handled separately in the code. The last four
-columns apply to items that cannot be repeated, so there is no need to have
-rows for them. Note that OP_DIGIT etc. are generated only when PCRE_UCP is
-*not* set. When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */
-
-#define APTROWS (LAST_AUTOTAB_LEFT_OP - FIRST_AUTOTAB_OP + 1)
-#define APTCOLS (LAST_AUTOTAB_RIGHT_OP - FIRST_AUTOTAB_OP + 1)
-
-static const pcre_uint8 autoposstab[APTROWS][APTCOLS] = {
-/* \D \d \S \s \W \w . .+ \C \P \p \R \H \h \V \v \X \Z \z $ $M */
- { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* \D */
- { 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1 }, /* \d */
- { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1 }, /* \S */
- { 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* \s */
- { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* \W */
- { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1 }, /* \w */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* . */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* .+ */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, /* \C */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \P */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* \p */
- { 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 }, /* \R */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 }, /* \H */
- { 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0 }, /* \h */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0 }, /* \V */
- { 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0 }, /* \v */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 } /* \X */
-};
-
-
-/* This table is used to check whether auto-possessification is possible
-between adjacent Unicode property opcodes (OP_PROP and OP_NOTPROP). The
-left-hand (repeated) opcode is used to select the row, and the right-hand
-opcode is used to select the column. The values are as follows:
-
- 0 Always return FALSE (never auto-possessify)
- 1 Character groups are distinct (possessify if both are OP_PROP)
- 2 Check character categories in the same group (general or particular)
- 3 TRUE if the two opcodes are not the same (PROP vs NOTPROP)
-
- 4 Check left general category vs right particular category
- 5 Check right general category vs left particular category
-
- 6 Left alphanum vs right general category
- 7 Left space vs right general category
- 8 Left word vs right general category
-
- 9 Right alphanum vs left general category
- 10 Right space vs left general category
- 11 Right word vs left general category
-
- 12 Left alphanum vs right particular category
- 13 Left space vs right particular category
- 14 Left word vs right particular category
-
- 15 Right alphanum vs left particular category
- 16 Right space vs left particular category
- 17 Right word vs left particular category
-*/
-
-static const pcre_uint8 propposstab[PT_TABSIZE][PT_TABSIZE] = {
-/* ANY LAMP GC PC SC ALNUM SPACE PXSPACE WORD CLIST UCNC */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_ANY */
- { 0, 3, 0, 0, 0, 3, 1, 1, 0, 0, 0 }, /* PT_LAMP */
- { 0, 0, 2, 4, 0, 9, 10, 10, 11, 0, 0 }, /* PT_GC */
- { 0, 0, 5, 2, 0, 15, 16, 16, 17, 0, 0 }, /* PT_PC */
- { 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 }, /* PT_SC */
- { 0, 3, 6, 12, 0, 3, 1, 1, 0, 0, 0 }, /* PT_ALNUM */
- { 0, 1, 7, 13, 0, 1, 3, 3, 1, 0, 0 }, /* PT_SPACE */
- { 0, 1, 7, 13, 0, 1, 3, 3, 1, 0, 0 }, /* PT_PXSPACE */
- { 0, 0, 8, 14, 0, 0, 1, 1, 3, 0, 0 }, /* PT_WORD */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* PT_CLIST */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 } /* PT_UCNC */
-};
-
-/* This table is used to check whether auto-possessification is possible
-between adjacent Unicode property opcodes (OP_PROP and OP_NOTPROP) when one
-specifies a general category and the other specifies a particular category. The
-row is selected by the general category and the column by the particular
-category. The value is 1 if the particular category is not part of the general
-category. */
-
-static const pcre_uint8 catposstab[7][30] = {
-/* Cc Cf Cn Co Cs Ll Lm Lo Lt Lu Mc Me Mn Nd Nl No Pc Pd Pe Pf Pi Po Ps Sc Sk Sm So Zl Zp Zs */
- { 0, 0, 0, 0, 0, 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 }, /* C */
- { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* L */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* M */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* N */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }, /* P */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1 }, /* S */
- { 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, 0, 0, 0 } /* Z */
-};
-
-/* This table is used when checking ALNUM, (PX)SPACE, SPACE, and WORD against
-a general or particular category. The properties in each row are those
-that apply to the character set in question. Duplication means that a little
-unnecessary work is done when checking, but this keeps things much simpler
-because they can all use the same code. For more details see the comment where
-this table is used.
-
-Note: SPACE and PXSPACE used to be different because Perl excluded VT from
-"space", but from Perl 5.18 it's included, so both categories are treated the
-same here. */
-
-static const pcre_uint8 posspropstab[3][4] = {
- { ucp_L, ucp_N, ucp_N, ucp_Nl }, /* ALNUM, 3rd and 4th values redundant */
- { ucp_Z, ucp_Z, ucp_C, ucp_Cc }, /* SPACE and PXSPACE, 2nd value redundant */
- { ucp_L, ucp_N, ucp_P, ucp_Po } /* WORD */
-};
-
-/* This table is used when converting repeating opcodes into possessified
-versions as a result of an explicit possessive quantifier such as ++. A zero
-value means there is no possessified version - in those cases the item in
-question must be wrapped in ONCE brackets. The table is truncated at OP_CALLOUT
-because all relevant opcodes are less than that. */
-
-static const pcre_uint8 opcode_possessify[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 15 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16 - 31 */
-
- 0, /* NOTI */
- OP_POSSTAR, 0, /* STAR, MINSTAR */
- OP_POSPLUS, 0, /* PLUS, MINPLUS */
- OP_POSQUERY, 0, /* QUERY, MINQUERY */
- OP_POSUPTO, 0, /* UPTO, MINUPTO */
- 0, /* EXACT */
- 0, 0, 0, 0, /* POS{STAR,PLUS,QUERY,UPTO} */
-
- OP_POSSTARI, 0, /* STARI, MINSTARI */
- OP_POSPLUSI, 0, /* PLUSI, MINPLUSI */
- OP_POSQUERYI, 0, /* QUERYI, MINQUERYI */
- OP_POSUPTOI, 0, /* UPTOI, MINUPTOI */
- 0, /* EXACTI */
- 0, 0, 0, 0, /* POS{STARI,PLUSI,QUERYI,UPTOI} */
-
- OP_NOTPOSSTAR, 0, /* NOTSTAR, NOTMINSTAR */
- OP_NOTPOSPLUS, 0, /* NOTPLUS, NOTMINPLUS */
- OP_NOTPOSQUERY, 0, /* NOTQUERY, NOTMINQUERY */
- OP_NOTPOSUPTO, 0, /* NOTUPTO, NOTMINUPTO */
- 0, /* NOTEXACT */
- 0, 0, 0, 0, /* NOTPOS{STAR,PLUS,QUERY,UPTO} */
-
- OP_NOTPOSSTARI, 0, /* NOTSTARI, NOTMINSTARI */
- OP_NOTPOSPLUSI, 0, /* NOTPLUSI, NOTMINPLUSI */
- OP_NOTPOSQUERYI, 0, /* NOTQUERYI, NOTMINQUERYI */
- OP_NOTPOSUPTOI, 0, /* NOTUPTOI, NOTMINUPTOI */
- 0, /* NOTEXACTI */
- 0, 0, 0, 0, /* NOTPOS{STARI,PLUSI,QUERYI,UPTOI} */
-
- OP_TYPEPOSSTAR, 0, /* TYPESTAR, TYPEMINSTAR */
- OP_TYPEPOSPLUS, 0, /* TYPEPLUS, TYPEMINPLUS */
- OP_TYPEPOSQUERY, 0, /* TYPEQUERY, TYPEMINQUERY */
- OP_TYPEPOSUPTO, 0, /* TYPEUPTO, TYPEMINUPTO */
- 0, /* TYPEEXACT */
- 0, 0, 0, 0, /* TYPEPOS{STAR,PLUS,QUERY,UPTO} */
-
- OP_CRPOSSTAR, 0, /* CRSTAR, CRMINSTAR */
- OP_CRPOSPLUS, 0, /* CRPLUS, CRMINPLUS */
- OP_CRPOSQUERY, 0, /* CRQUERY, CRMINQUERY */
- OP_CRPOSRANGE, 0, /* CRRANGE, CRMINRANGE */
- 0, 0, 0, 0, /* CRPOS{STAR,PLUS,QUERY,RANGE} */
-
- 0, 0, 0, /* CLASS, NCLASS, XCLASS */
- 0, 0, /* REF, REFI */
- 0, 0, /* DNREF, DNREFI */
- 0, 0 /* RECURSE, CALLOUT */
-};
-
-
-
-/*************************************************
-* Find an error text *
-*************************************************/
-
-/* The error texts are now all in one long string, to save on relocations. As
-some of the text is of unknown length, we can't use a table of offsets.
-Instead, just count through the strings. This is not a performance issue
-because it happens only when there has been a compilation error.
-
-Argument: the error number
-Returns: pointer to the error string
-*/
-
-static const char *
-find_error_text(int n)
-{
-const char *s = error_texts;
-for (; n > 0; n--)
- {
- while (*s++ != CHAR_NULL) {};
- if (*s == CHAR_NULL) return "Error text not found (please report)";
- }
-return s;
-}
-
-
-
-/*************************************************
-* Expand the workspace *
-*************************************************/
-
-/* This function is called during the second compiling phase, if the number of
-forward references fills the existing workspace, which is originally a block on
-the stack. A larger block is obtained from malloc() unless the ultimate limit
-has been reached or the increase will be rather small.
-
-Argument: pointer to the compile data block
-Returns: 0 if all went well, else an error number
-*/
-
-static int
-expand_workspace(compile_data *cd)
-{
-pcre_uchar *newspace;
-int newsize = cd->workspace_size * 2;
-
-if (newsize > COMPILE_WORK_SIZE_MAX) newsize = COMPILE_WORK_SIZE_MAX;
-if (cd->workspace_size >= COMPILE_WORK_SIZE_MAX ||
- newsize - cd->workspace_size < WORK_SIZE_SAFETY_MARGIN)
- return ERR72;
-
-newspace = (PUBL(malloc))(IN_UCHARS(newsize));
-if (newspace == NULL) return ERR21;
-memcpy(newspace, cd->start_workspace, cd->workspace_size * sizeof(pcre_uchar));
-cd->hwm = (pcre_uchar *)newspace + (cd->hwm - cd->start_workspace);
-if (cd->workspace_size > COMPILE_WORK_SIZE)
- (PUBL(free))((void *)cd->start_workspace);
-cd->start_workspace = newspace;
-cd->workspace_size = newsize;
-return 0;
-}
-
-
-
-/*************************************************
-* Check for counted repeat *
-*************************************************/
-
-/* This function is called when a '{' is encountered in a place where it might
-start a quantifier. It looks ahead to see if it really is a quantifier or not.
-It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd}
-where the ddds are digits.
-
-Arguments:
- p pointer to the first char after '{'
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_counted_repeat(const pcre_uchar *p)
-{
-if (!IS_DIGIT(*p)) return FALSE;
-p++;
-while (IS_DIGIT(*p)) p++;
-if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE;
-
-if (*p++ != CHAR_COMMA) return FALSE;
-if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE;
-
-if (!IS_DIGIT(*p)) return FALSE;
-p++;
-while (IS_DIGIT(*p)) p++;
-
-return (*p == CHAR_RIGHT_CURLY_BRACKET);
-}
-
-
-
-/*************************************************
-* Handle escapes *
-*************************************************/
-
-/* This function is called when a \ has been encountered. It either returns a
-positive value for a simple escape such as \n, or 0 for a data character which
-will be placed in chptr. A backreference to group n is returned as negative n.
-When UTF-8 is enabled, a positive value greater than 255 may be returned in
-chptr. On entry, ptr is pointing at the \. On exit, it is on the final
-character of the escape sequence.
-
-Arguments:
- ptrptr points to the pattern position pointer
- chptr points to a returned data character
- errorcodeptr points to the errorcode variable
- bracount number of previous extracting brackets
- options the options bits
- isclass TRUE if inside a character class
-
-Returns: zero => a data character
- positive => a special escape sequence
- negative => a back reference
- on error, errorcodeptr is set
-*/
-
-static int
-check_escape(const pcre_uchar **ptrptr, pcre_uint32 *chptr, int *errorcodeptr,
- int bracount, int options, BOOL isclass)
-{
-/* PCRE_UTF16 has the same value as PCRE_UTF8. */
-BOOL utf = (options & PCRE_UTF8) != 0;
-const pcre_uchar *ptr = *ptrptr + 1;
-pcre_uint32 c;
-int escape = 0;
-int i;
-
-GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */
-ptr--; /* Set pointer back to the last byte */
-
-/* If backslash is at the end of the pattern, it's an error. */
-
-if (c == CHAR_NULL) *errorcodeptr = ERR1;
-
-/* Non-alphanumerics are literals. For digits or letters, do an initial lookup
-in a table. A non-zero result is something that can be returned immediately.
-Otherwise further processing may be required. */
-
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
-/* Not alphanumeric */
-else if (c < CHAR_0 || c > CHAR_z) {}
-else if ((i = escapes[c - CHAR_0]) != 0)
- { if (i > 0) c = (pcre_uint32)i; else escape = -i; }
-
-#else /* EBCDIC coding */
-/* Not alphanumeric */
-else if (c < CHAR_a || (!MAX_255(c) || (ebcdic_chartab[c] & 0x0E) == 0)) {}
-else if ((i = escapes[c - 0x48]) != 0) { if (i > 0) c = (pcre_uint32)i; else escape = -i; }
-#endif
-
-/* Escapes that need further processing, or are illegal. */
-
-else
- {
- const pcre_uchar *oldptr;
- BOOL braced, negated, overflow;
- int s;
-
- switch (c)
- {
- /* A number of Perl escapes are not handled by PCRE. We give an explicit
- error. */
-
- case CHAR_l:
- case CHAR_L:
- *errorcodeptr = ERR37;
- break;
-
- case CHAR_u:
- if ((options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- /* In JavaScript, \u must be followed by four hexadecimal numbers.
- Otherwise it is a lowercase u letter. */
- if (MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0
- && MAX_255(ptr[2]) && (digitab[ptr[2]] & ctype_xdigit) != 0
- && MAX_255(ptr[3]) && (digitab[ptr[3]] & ctype_xdigit) != 0
- && MAX_255(ptr[4]) && (digitab[ptr[4]] & ctype_xdigit) != 0)
- {
- c = 0;
- for (i = 0; i < 4; ++i)
- {
- register pcre_uint32 cc = *(++ptr);
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */
- c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
-#else /* EBCDIC coding */
- if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */
- c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10));
-#endif
- }
-
-#if defined COMPILE_PCRE8
- if (c > (utf ? 0x10ffffU : 0xffU))
-#elif defined COMPILE_PCRE16
- if (c > (utf ? 0x10ffffU : 0xffffU))
-#elif defined COMPILE_PCRE32
- if (utf && c > 0x10ffffU)
-#endif
- {
- *errorcodeptr = ERR76;
- }
- else if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
- }
- }
- else
- *errorcodeptr = ERR37;
- break;
-
- case CHAR_U:
- /* In JavaScript, \U is an uppercase U letter. */
- if ((options & PCRE_JAVASCRIPT_COMPAT) == 0) *errorcodeptr = ERR37;
- break;
-
- /* In a character class, \g is just a literal "g". Outside a character
- class, \g must be followed by one of a number of specific things:
-
- (1) A number, either plain or braced. If positive, it is an absolute
- backreference. If negative, it is a relative backreference. This is a Perl
- 5.10 feature.
-
- (2) Perl 5.10 also supports \g{name} as a reference to a named group. This
- is part of Perl's movement towards a unified syntax for back references. As
- this is synonymous with \k{name}, we fudge it up by pretending it really
- was \k.
-
- (3) For Oniguruma compatibility we also support \g followed by a name or a
- number either in angle brackets or in single quotes. However, these are
- (possibly recursive) subroutine calls, _not_ backreferences. Just return
- the ESC_g code (cf \k). */
-
- case CHAR_g:
- if (isclass) break;
- if (ptr[1] == CHAR_LESS_THAN_SIGN || ptr[1] == CHAR_APOSTROPHE)
- {
- escape = ESC_g;
- break;
- }
-
- /* Handle the Perl-compatible cases */
-
- if (ptr[1] == CHAR_LEFT_CURLY_BRACKET)
- {
- const pcre_uchar *p;
- for (p = ptr+2; *p != CHAR_NULL && *p != CHAR_RIGHT_CURLY_BRACKET; p++)
- if (*p != CHAR_MINUS && !IS_DIGIT(*p)) break;
- if (*p != CHAR_NULL && *p != CHAR_RIGHT_CURLY_BRACKET)
- {
- escape = ESC_k;
- break;
- }
- braced = TRUE;
- ptr++;
- }
- else braced = FALSE;
-
- if (ptr[1] == CHAR_MINUS)
- {
- negated = TRUE;
- ptr++;
- }
- else negated = FALSE;
-
- /* The integer range is limited by the machine's int representation. */
- s = 0;
- overflow = FALSE;
- while (IS_DIGIT(ptr[1]))
- {
- if (s > INT_MAX / 10 - 1) /* Integer overflow */
- {
- overflow = TRUE;
- break;
- }
- s = s * 10 + (int)(*(++ptr) - CHAR_0);
- }
- if (overflow) /* Integer overflow */
- {
- while (IS_DIGIT(ptr[1]))
- ptr++;
- *errorcodeptr = ERR61;
- break;
- }
-
- if (braced && *(++ptr) != CHAR_RIGHT_CURLY_BRACKET)
- {
- *errorcodeptr = ERR57;
- break;
- }
-
- if (s == 0)
- {
- *errorcodeptr = ERR58;
- break;
- }
-
- if (negated)
- {
- if (s > bracount)
- {
- *errorcodeptr = ERR15;
- break;
- }
- s = bracount - (s - 1);
- }
-
- escape = -s;
- break;
-
- /* The handling of escape sequences consisting of a string of digits
- starting with one that is not zero is not straightforward. Perl has changed
- over the years. Nowadays \g{} for backreferences and \o{} for octal are
- recommended to avoid the ambiguities in the old syntax.
-
- Outside a character class, the digits are read as a decimal number. If the
- number is less than 8 (used to be 10), or if there are that many previous
- extracting left brackets, then it is a back reference. Otherwise, up to
- three octal digits are read to form an escaped byte. Thus \123 is likely to
- be octal 123 (cf \0123, which is octal 012 followed by the literal 3). If
- the octal value is greater than 377, the least significant 8 bits are
- taken. \8 and \9 are treated as the literal characters 8 and 9.
-
- Inside a character class, \ followed by a digit is always either a literal
- 8 or 9 or an octal number. */
-
- case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4: case CHAR_5:
- case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9:
-
- if (!isclass)
- {
- oldptr = ptr;
- /* The integer range is limited by the machine's int representation. */
- s = (int)(c -CHAR_0);
- overflow = FALSE;
- while (IS_DIGIT(ptr[1]))
- {
- if (s > INT_MAX / 10 - 1) /* Integer overflow */
- {
- overflow = TRUE;
- break;
- }
- s = s * 10 + (int)(*(++ptr) - CHAR_0);
- }
- if (overflow) /* Integer overflow */
- {
- while (IS_DIGIT(ptr[1]))
- ptr++;
- *errorcodeptr = ERR61;
- break;
- }
- if (s < 8 || s <= bracount) /* Check for back reference */
- {
- escape = -s;
- break;
- }
- ptr = oldptr; /* Put the pointer back and fall through */
- }
-
- /* Handle a digit following \ when the number is not a back reference. If
- the first digit is 8 or 9, Perl used to generate a binary zero byte and
- then treat the digit as a following literal. At least by Perl 5.18 this
- changed so as not to insert the binary zero. */
-
- if ((c = *ptr) >= CHAR_8) break;
-
- /* Fall through with a digit less than 8 */
-
- /* \0 always starts an octal number, but we may drop through to here with a
- larger first octal digit. The original code used just to take the least
- significant 8 bits of octal numbers (I think this is what early Perls used
- to do). Nowadays we allow for larger numbers in UTF-8 mode and 16-bit mode,
- but no more than 3 octal digits. */
-
- case CHAR_0:
- c -= CHAR_0;
- while(i++ < 2 && ptr[1] >= CHAR_0 && ptr[1] <= CHAR_7)
- c = c * 8 + *(++ptr) - CHAR_0;
-#ifdef COMPILE_PCRE8
- if (!utf && c > 0xff) *errorcodeptr = ERR51;
-#endif
- break;
-
- /* \o is a relatively new Perl feature, supporting a more general way of
- specifying character codes in octal. The only supported form is \o{ddd}. */
-
- case CHAR_o:
- if (ptr[1] != CHAR_LEFT_CURLY_BRACKET) *errorcodeptr = ERR81; else
- {
- ptr += 2;
- c = 0;
- overflow = FALSE;
- while (*ptr >= CHAR_0 && *ptr <= CHAR_7)
- {
- register pcre_uint32 cc = *ptr++;
- if (c == 0 && cc == CHAR_0) continue; /* Leading zeroes */
-#ifdef COMPILE_PCRE32
- if (c >= 0x20000000l) { overflow = TRUE; break; }
-#endif
- c = (c << 3) + cc - CHAR_0 ;
-#if defined COMPILE_PCRE8
- if (c > (utf ? 0x10ffffU : 0xffU)) { overflow = TRUE; break; }
-#elif defined COMPILE_PCRE16
- if (c > (utf ? 0x10ffffU : 0xffffU)) { overflow = TRUE; break; }
-#elif defined COMPILE_PCRE32
- if (utf && c > 0x10ffffU) { overflow = TRUE; break; }
-#endif
- }
- if (overflow)
- {
- while (*ptr >= CHAR_0 && *ptr <= CHAR_7) ptr++;
- *errorcodeptr = ERR34;
- }
- else if (*ptr == CHAR_RIGHT_CURLY_BRACKET)
- {
- if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
- }
- else *errorcodeptr = ERR80;
- }
- break;
-
- /* \x is complicated. In JavaScript, \x must be followed by two hexadecimal
- numbers. Otherwise it is a lowercase x letter. */
-
- case CHAR_x:
- if ((options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- if (MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0
- && MAX_255(ptr[2]) && (digitab[ptr[2]] & ctype_xdigit) != 0)
- {
- c = 0;
- for (i = 0; i < 2; ++i)
- {
- register pcre_uint32 cc = *(++ptr);
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */
- c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
-#else /* EBCDIC coding */
- if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */
- c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10));
-#endif
- }
- }
- } /* End JavaScript handling */
-
- /* Handle \x in Perl's style. \x{ddd} is a character number which can be
- greater than 0xff in utf 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
- that, for example \x{zz} matches a binary zero. This seems crazy, so PCRE
- now gives an error. */
-
- else
- {
- if (ptr[1] == CHAR_LEFT_CURLY_BRACKET)
- {
- ptr += 2;
- c = 0;
- overflow = FALSE;
- while (MAX_255(*ptr) && (digitab[*ptr] & ctype_xdigit) != 0)
- {
- register pcre_uint32 cc = *ptr++;
- if (c == 0 && cc == CHAR_0) continue; /* Leading zeroes */
-
-#ifdef COMPILE_PCRE32
- if (c >= 0x10000000l) { overflow = TRUE; break; }
-#endif
-
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */
- c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
-#else /* EBCDIC coding */
- if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */
- c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10));
-#endif
-
-#if defined COMPILE_PCRE8
- if (c > (utf ? 0x10ffffU : 0xffU)) { overflow = TRUE; break; }
-#elif defined COMPILE_PCRE16
- if (c > (utf ? 0x10ffffU : 0xffffU)) { overflow = TRUE; break; }
-#elif defined COMPILE_PCRE32
- if (utf && c > 0x10ffffU) { overflow = TRUE; break; }
-#endif
- }
-
- if (overflow)
- {
- while (MAX_255(*ptr) && (digitab[*ptr] & ctype_xdigit) != 0) ptr++;
- *errorcodeptr = ERR34;
- }
-
- else if (*ptr == CHAR_RIGHT_CURLY_BRACKET)
- {
- if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73;
- }
-
- /* If the sequence of hex digits does not end with '}', give an error.
- We used just to recognize this construct and fall through to the normal
- \x handling, but nowadays Perl gives an error, which seems much more
- sensible, so we do too. */
-
- else *errorcodeptr = ERR79;
- } /* End of \x{} processing */
-
- /* Read a single-byte hex-defined char (up to two hex digits after \x) */
-
- else
- {
- c = 0;
- while (i++ < 2 && MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0)
- {
- pcre_uint32 cc; /* Some compilers don't like */
- cc = *(++ptr); /* ++ in initializers */
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */
- c = c * 16 + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
-#else /* EBCDIC coding */
- if (cc <= CHAR_z) cc += 64; /* Convert to upper case */
- c = c * 16 + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10));
-#endif
- }
- } /* End of \xdd handling */
- } /* End of Perl-style \x handling */
- break;
-
- /* For \c, a following letter is upper-cased; then the 0x40 bit is flipped.
- An error is given if the byte following \c is not an ASCII character. This
- coding is ASCII-specific, but then the whole concept of \cx is
- ASCII-specific. (However, an EBCDIC equivalent has now been added.) */
-
- case CHAR_c:
- c = *(++ptr);
- if (c == CHAR_NULL)
- {
- *errorcodeptr = ERR2;
- break;
- }
-#ifndef EBCDIC /* ASCII/UTF-8 coding */
- if (c > 127) /* Excludes all non-ASCII in either mode */
- {
- *errorcodeptr = ERR68;
- break;
- }
- if (c >= CHAR_a && c <= CHAR_z) c -= 32;
- c ^= 0x40;
-#else /* EBCDIC coding */
- if (c >= CHAR_a && c <= CHAR_z) c += 64;
- c ^= 0xC0;
-#endif
- break;
-
- /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any
- other alphanumeric following \ is an error if PCRE_EXTRA was set;
- otherwise, for Perl compatibility, it is a literal. This code looks a bit
- odd, but there used to be some cases other than the default, and there may
- be again in future, so I haven't "optimized" it. */
-
- default:
- if ((options & PCRE_EXTRA) != 0) switch(c)
- {
- default:
- *errorcodeptr = ERR3;
- break;
- }
- break;
- }
- }
-
-/* Perl supports \N{name} for character names, as well as plain \N for "not
-newline". PCRE does not support \N{name}. However, it does support
-quantification such as \N{2,3}. */
-
-if (escape == ESC_N && ptr[1] == CHAR_LEFT_CURLY_BRACKET &&
- !is_counted_repeat(ptr+2))
- *errorcodeptr = ERR37;
-
-/* If PCRE_UCP is set, we change the values for \d etc. */
-
-if ((options & PCRE_UCP) != 0 && escape >= ESC_D && escape <= ESC_w)
- escape += (ESC_DU - ESC_D);
-
-/* Set the pointer to the final character before returning. */
-
-*ptrptr = ptr;
-*chptr = c;
-return escape;
-}
-
-
-
-#ifdef SUPPORT_UCP
-/*************************************************
-* Handle \P and \p *
-*************************************************/
-
-/* This function is called after \P or \p has been encountered, provided that
-PCRE is compiled with support for Unicode properties. On entry, ptrptr is
-pointing at the P or p. On exit, it is pointing at the final character of the
-escape sequence.
-
-Argument:
- ptrptr points to the pattern position pointer
- negptr points to a boolean that is set TRUE for negation else FALSE
- ptypeptr points to an unsigned int that is set to the type value
- pdataptr points to an unsigned int that is set to the detailed property value
- errorcodeptr points to the error code variable
-
-Returns: TRUE if the type value was found, or FALSE for an invalid type
-*/
-
-static BOOL
-get_ucp(const pcre_uchar **ptrptr, BOOL *negptr, unsigned int *ptypeptr,
- unsigned int *pdataptr, int *errorcodeptr)
-{
-pcre_uchar c;
-int i, bot, top;
-const pcre_uchar *ptr = *ptrptr;
-pcre_uchar name[32];
-
-c = *(++ptr);
-if (c == CHAR_NULL) goto ERROR_RETURN;
-
-*negptr = FALSE;
-
-/* \P or \p can be followed by a name in {}, optionally preceded by ^ for
-negation. */
-
-if (c == CHAR_LEFT_CURLY_BRACKET)
- {
- if (ptr[1] == CHAR_CIRCUMFLEX_ACCENT)
- {
- *negptr = TRUE;
- ptr++;
- }
- for (i = 0; i < (int)(sizeof(name) / sizeof(pcre_uchar)) - 1; i++)
- {
- c = *(++ptr);
- if (c == CHAR_NULL) goto ERROR_RETURN;
- if (c == CHAR_RIGHT_CURLY_BRACKET) break;
- name[i] = c;
- }
- if (c != CHAR_RIGHT_CURLY_BRACKET) goto ERROR_RETURN;
- name[i] = 0;
- }
-
-/* Otherwise there is just one following character */
-
-else
- {
- name[0] = c;
- name[1] = 0;
- }
-
-*ptrptr = ptr;
-
-/* Search for a recognized property name using binary chop */
-
-bot = 0;
-top = PRIV(utt_size);
-
-while (bot < top)
- {
- int r;
- i = (bot + top) >> 1;
- r = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset);
- if (r == 0)
- {
- *ptypeptr = PRIV(utt)[i].type;
- *pdataptr = PRIV(utt)[i].value;
- return TRUE;
- }
- if (r > 0) bot = i + 1; else top = i;
- }
-
-*errorcodeptr = ERR47;
-*ptrptr = ptr;
-return FALSE;
-
-ERROR_RETURN:
-*errorcodeptr = ERR46;
-*ptrptr = ptr;
-return FALSE;
-}
-#endif
-
-
-
-/*************************************************
-* Read repeat counts *
-*************************************************/
-
-/* Read an item of the form {n,m} and return the values. This is called only
-after is_counted_repeat() has confirmed that a repeat-count quantifier exists,
-so the syntax is guaranteed to be correct, but we need to check the values.
-
-Arguments:
- p pointer to first char after '{'
- minp pointer to int for min
- maxp pointer to int for max
- returned as -1 if no max
- errorcodeptr points to error code variable
-
-Returns: pointer to '}' on success;
- current ptr on error, with errorcodeptr set non-zero
-*/
-
-static const pcre_uchar *
-read_repeat_counts(const pcre_uchar *p, int *minp, int *maxp, int *errorcodeptr)
-{
-int min = 0;
-int max = -1;
-
-while (IS_DIGIT(*p))
- {
- min = min * 10 + (int)(*p++ - CHAR_0);
- if (min > 65535)
- {
- *errorcodeptr = ERR5;
- return p;
- }
- }
-
-if (*p == CHAR_RIGHT_CURLY_BRACKET) max = min; else
- {
- if (*(++p) != CHAR_RIGHT_CURLY_BRACKET)
- {
- max = 0;
- while(IS_DIGIT(*p))
- {
- max = max * 10 + (int)(*p++ - CHAR_0);
- if (max > 65535)
- {
- *errorcodeptr = ERR5;
- return p;
- }
- }
- if (max < min)
- {
- *errorcodeptr = ERR4;
- return p;
- }
- }
- }
-
-*minp = min;
-*maxp = max;
-return p;
-}
-
-
-
-/*************************************************
-* Find first significant op code *
-*************************************************/
-
-/* This is called by several functions that scan a compiled expression looking
-for a fixed first character, or an anchoring op code etc. It skips over things
-that do not influence this. For some calls, it makes sense to skip negative
-forward and all backward assertions, and also the \b assertion; for others it
-does not.
-
-Arguments:
- code pointer to the start of the group
- skipassert TRUE if certain assertions are to be skipped
-
-Returns: pointer to the first significant opcode
-*/
-
-static const pcre_uchar*
-first_significant_code(const pcre_uchar *code, BOOL skipassert)
-{
-for (;;)
- {
- switch ((int)*code)
- {
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- if (!skipassert) return code;
- do code += GET(code, 1); while (*code == OP_ALT);
- code += PRIV(OP_lengths)[*code];
- break;
-
- case OP_WORD_BOUNDARY:
- case OP_NOT_WORD_BOUNDARY:
- if (!skipassert) return code;
- /* Fall through */
-
- case OP_CALLOUT:
- case OP_CREF:
- case OP_DNCREF:
- case OP_RREF:
- case OP_DNRREF:
- case OP_DEF:
- code += PRIV(OP_lengths)[*code];
- break;
-
- default:
- return code;
- }
- }
-/* Control never reaches here */
-}
-
-
-
-/*************************************************
-* Find the fixed length of a branch *
-*************************************************/
-
-/* Scan a branch and compute the fixed length of subject that will match it,
-if the length is fixed. This is needed for dealing with backward assertions.
-In UTF8 mode, the result is in characters rather than bytes. The branch is
-temporarily terminated with OP_END when this function is called.
-
-This function is called when a backward assertion is encountered, so that if it
-fails, the error message can point to the correct place in the pattern.
-However, we cannot do this when the assertion contains subroutine calls,
-because they can be forward references. We solve this by remembering this case
-and doing the check at the end; a flag specifies which mode we are running in.
-
-Arguments:
- code points to the start of the pattern (the bracket)
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- atend TRUE if called when the pattern is complete
- cd the "compile data" structure
-
-Returns: the fixed length,
- or -1 if there is no fixed length,
- or -2 if \C was encountered (in UTF-8 mode only)
- or -3 if an OP_RECURSE item was encountered and atend is FALSE
- or -4 if an unknown opcode was encountered (internal error)
-*/
-
-static int
-find_fixedlength(pcre_uchar *code, BOOL utf, BOOL atend, compile_data *cd)
-{
-int length = -1;
-
-register int branchlength = 0;
-register pcre_uchar *cc = code + 1 + LINK_SIZE;
-
-/* Scan along the opcodes for this branch. If we get to the end of the
-branch, check the length against that of the other branches. */
-
-for (;;)
- {
- int d;
- pcre_uchar *ce, *cs;
- register pcre_uchar op = *cc;
-
- switch (op)
- {
- /* We only need to continue for OP_CBRA (normal capturing bracket) and
- OP_BRA (normal non-capturing bracket) because the other variants of these
- opcodes are all concerned with unlimited repeated groups, which of course
- are not of fixed length. */
-
- case OP_CBRA:
- case OP_BRA:
- case OP_ONCE:
- case OP_ONCE_NC:
- case OP_COND:
- d = find_fixedlength(cc + ((op == OP_CBRA)? IMM2_SIZE : 0), utf, atend, cd);
- if (d < 0) return d;
- branchlength += d;
- do cc += GET(cc, 1); while (*cc == OP_ALT);
- cc += 1 + LINK_SIZE;
- break;
-
- /* 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. An ACCEPT is effectively
- an ALT. If it is END it's the end of the outer call. All can be handled by
- the same code. Note that we must not include the OP_KETRxxx opcodes here,
- because they all imply an unlimited repeat. */
-
- case OP_ALT:
- case OP_KET:
- case OP_END:
- case OP_ACCEPT:
- case OP_ASSERT_ACCEPT:
- if (length < 0) length = branchlength;
- else if (length != branchlength) return -1;
- if (*cc != OP_ALT) return length;
- cc += 1 + LINK_SIZE;
- branchlength = 0;
- break;
-
- /* A true recursion implies not fixed length, but a subroutine call may
- be OK. If the subroutine is a forward reference, we can't deal with
- it until the end of the pattern, so return -3. */
-
- case OP_RECURSE:
- if (!atend) return -3;
- cs = ce = (pcre_uchar *)cd->start_code + GET(cc, 1); /* Start subpattern */
- do ce += GET(ce, 1); while (*ce == OP_ALT); /* End subpattern */
- if (cc > cs && cc < ce) return -1; /* Recursion */
- d = find_fixedlength(cs + IMM2_SIZE, utf, atend, cd);
- if (d < 0) return d;
- branchlength += d;
- cc += 1 + LINK_SIZE;
- break;
-
- /* Skip over assertive subpatterns */
-
- case OP_ASSERT:
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- do cc += GET(cc, 1); while (*cc == OP_ALT);
- cc += PRIV(OP_lengths)[*cc];
- break;
-
- /* Skip over things that don't match chars */
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- cc += cc[1] + PRIV(OP_lengths)[*cc];
- break;
-
- case OP_CALLOUT:
- case OP_CIRC:
- case OP_CIRCM:
- case OP_CLOSE:
- case OP_COMMIT:
- case OP_CREF:
- case OP_DEF:
- case OP_DNCREF:
- case OP_DNRREF:
- case OP_DOLL:
- case OP_DOLLM:
- case OP_EOD:
- case OP_EODN:
- case OP_FAIL:
- case OP_NOT_WORD_BOUNDARY:
- case OP_PRUNE:
- case OP_REVERSE:
- case OP_RREF:
- case OP_SET_SOM:
- case OP_SKIP:
- case OP_SOD:
- case OP_SOM:
- case OP_THEN:
- case OP_WORD_BOUNDARY:
- cc += PRIV(OP_lengths)[*cc];
- break;
-
- /* Handle literal characters */
-
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- branchlength++;
- cc += 2;
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
-#endif
- break;
-
- /* Handle exact repetitions. The count is already in characters, but we
- need to skip over a multibyte character in UTF8 mode. */
-
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- branchlength += (int)GET2(cc,1);
- cc += 2 + IMM2_SIZE;
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
-#endif
- break;
-
- case OP_TYPEEXACT:
- branchlength += GET2(cc,1);
- if (cc[1 + IMM2_SIZE] == OP_PROP || cc[1 + IMM2_SIZE] == OP_NOTPROP)
- cc += 2;
- cc += 1 + IMM2_SIZE + 1;
- break;
-
- /* Handle single-char matchers */
-
- case OP_PROP:
- case OP_NOTPROP:
- cc += 2;
- /* Fall through */
-
- case OP_HSPACE:
- case OP_VSPACE:
- case OP_NOT_HSPACE:
- case OP_NOT_VSPACE:
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
- case OP_ANY:
- case OP_ALLANY:
- branchlength++;
- cc++;
- break;
-
- /* The single-byte matcher isn't allowed. This only happens in UTF-8 mode;
- otherwise \C is coded as OP_ALLANY. */
-
- case OP_ANYBYTE:
- return -2;
-
- /* Check a class for variable quantification */
-
- case OP_CLASS:
- case OP_NCLASS:
-#if defined SUPPORT_UTF || defined COMPILE_PCRE16 || defined COMPILE_PCRE32
- case OP_XCLASS:
- /* The original code caused an unsigned overflow in 64 bit systems,
- so now we use a conditional statement. */
- if (op == OP_XCLASS)
- cc += GET(cc, 1);
- else
- cc += PRIV(OP_lengths)[OP_CLASS];
-#else
- cc += PRIV(OP_lengths)[OP_CLASS];
-#endif
-
- switch (*cc)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSPLUS:
- case OP_CRPOSQUERY:
- return -1;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- if (GET2(cc,1) != GET2(cc,1+IMM2_SIZE)) return -1;
- branchlength += (int)GET2(cc,1);
- cc += 1 + 2 * IMM2_SIZE;
- break;
-
- default:
- branchlength++;
- }
- break;
-
- /* Anything else is variable length */
-
- case OP_ANYNL:
- case OP_BRAMINZERO:
- case OP_BRAPOS:
- case OP_BRAPOSZERO:
- case OP_BRAZERO:
- case OP_CBRAPOS:
- case OP_EXTUNI:
- case OP_KETRMAX:
- case OP_KETRMIN:
- case OP_KETRPOS:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_REF:
- case OP_REFI:
- case OP_DNREF:
- case OP_DNREFI:
- case OP_SBRA:
- case OP_SBRAPOS:
- case OP_SCBRA:
- case OP_SCBRAPOS:
- case OP_SCOND:
- case OP_SKIPZERO:
- case OP_STAR:
- case OP_STARI:
- case OP_TYPEMINPLUS:
- case OP_TYPEMINQUERY:
- case OP_TYPEMINSTAR:
- case OP_TYPEMINUPTO:
- case OP_TYPEPLUS:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSUPTO:
- case OP_TYPEQUERY:
- case OP_TYPESTAR:
- case OP_TYPEUPTO:
- case OP_UPTO:
- case OP_UPTOI:
- return -1;
-
- /* Catch unrecognized opcodes so that when new ones are added they
- are not forgotten, as has happened in the past. */
-
- default:
- return -4;
- }
- }
-/* Control never gets here */
-}
-
-
-
-/*************************************************
-* Scan compiled regex for specific bracket *
-*************************************************/
-
-/* This little function scans through a compiled pattern until it finds a
-capturing bracket with the given number, or, if the number is negative, an
-instance of OP_REVERSE for a lookbehind. The function is global in the C sense
-so that it can be called from pcre_study() when finding the minimum matching
-length.
-
-Arguments:
- code points to start of expression
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- number the required bracket number or negative to find a lookbehind
-
-Returns: pointer to the opcode for the bracket, or NULL if not found
-*/
-
-const pcre_uchar *
-PRIV(find_bracket)(const pcre_uchar *code, BOOL utf, int number)
-{
-for (;;)
- {
- register pcre_uchar c = *code;
-
- if (c == OP_END) return NULL;
-
- /* XCLASS is used for classes that cannot be represented just by a bit
- map. This includes negated single high-valued characters. The length in
- the table is zero; the actual length is stored in the compiled code. */
-
- if (c == OP_XCLASS) code += GET(code, 1);
-
- /* Handle recursion */
-
- else if (c == OP_REVERSE)
- {
- if (number < 0) return (pcre_uchar *)code;
- code += PRIV(OP_lengths)[c];
- }
-
- /* Handle capturing bracket */
-
- else if (c == OP_CBRA || c == OP_SCBRA ||
- c == OP_CBRAPOS || c == OP_SCBRAPOS)
- {
- int n = (int)GET2(code, 1+LINK_SIZE);
- if (n == number) return (pcre_uchar *)code;
- code += PRIV(OP_lengths)[c];
- }
-
- /* Otherwise, we can get the item's length from the table, except that for
- repeated character types, we have to test for \p and \P, which have an extra
- two bytes of parameters, and for MARK/PRUNE/SKIP/THEN with an argument, we
- must add in its length. */
-
- else
- {
- switch(c)
- {
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- case OP_TYPEPOSUPTO:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += PRIV(OP_lengths)[c];
-
- /* In UTF-8 mode, opcodes that are followed by a character may be followed by
- a multi-byte character. The length in the table is a minimum, so we have to
- arrange to skip the extra bytes. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf) switch(c)
- {
- case OP_CHAR:
- case OP_CHARI:
- case OP_EXACT:
- case OP_EXACTI:
- case OP_UPTO:
- case OP_UPTOI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_STAR:
- case OP_STARI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_POSQUERY:
- case OP_POSQUERYI:
- if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
- break;
- }
-#else
- (void)(utf); /* Keep compiler happy by referencing function argument */
-#endif
- }
- }
-}
-
-
-
-/*************************************************
-* Scan compiled regex for recursion reference *
-*************************************************/
-
-/* This little function scans through a compiled pattern until it finds an
-instance of OP_RECURSE.
-
-Arguments:
- code points to start of expression
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
-
-Returns: pointer to the opcode for OP_RECURSE, or NULL if not found
-*/
-
-static const pcre_uchar *
-find_recurse(const pcre_uchar *code, BOOL utf)
-{
-for (;;)
- {
- register pcre_uchar c = *code;
- if (c == OP_END) return NULL;
- if (c == OP_RECURSE) return code;
-
- /* XCLASS is used for classes that cannot be represented just by a bit
- map. This includes negated single high-valued characters. The length in
- the table is zero; the actual length is stored in the compiled code. */
-
- if (c == OP_XCLASS) code += GET(code, 1);
-
- /* Otherwise, we can get the item's length from the table, except that for
- repeated character types, we have to test for \p and \P, which have an extra
- two bytes of parameters, and for MARK/PRUNE/SKIP/THEN with an argument, we
- must add in its length. */
-
- else
- {
- switch(c)
- {
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEPOSUPTO:
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += PRIV(OP_lengths)[c];
-
- /* In UTF-8 mode, opcodes that are followed by a character may be followed
- by a multi-byte character. The length in the table is a minimum, so we have
- to arrange to skip the extra bytes. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf) switch(c)
- {
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- case OP_UPTO:
- case OP_UPTOI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
- case OP_STAR:
- case OP_STARI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
- case OP_PLUS:
- case OP_PLUSI:
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
- case OP_QUERY:
- case OP_QUERYI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
- if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
- break;
- }
-#else
- (void)(utf); /* Keep compiler happy by referencing function argument */
-#endif
- }
- }
-}
-
-
-
-/*************************************************
-* Scan compiled branch for non-emptiness *
-*************************************************/
-
-/* This function scans through a branch of a compiled pattern to see whether it
-can match the empty string or not. It is called from could_be_empty()
-below and from compile_branch() when checking for an unlimited repeat of a
-group that can match nothing. Note that first_significant_code() skips over
-backward and negative forward assertions when its final argument is TRUE. If we
-hit an unclosed bracket, we return "empty" - this means we've struck an inner
-bracket whose current branch will already have been scanned.
-
-Arguments:
- code points to start of search
- endcode points to where to stop
- utf TRUE if in UTF-8 / UTF-16 / UTF-32 mode
- cd contains pointers to tables etc.
- recurses chain of recurse_check to catch mutual recursion
-
-Returns: TRUE if what is matched could be empty
-*/
-
-typedef struct recurse_check {
- struct recurse_check *prev;
- const pcre_uchar *group;
-} recurse_check;
-
-static BOOL
-could_be_empty_branch(const pcre_uchar *code, const pcre_uchar *endcode,
- BOOL utf, compile_data *cd, recurse_check *recurses)
-{
-register pcre_uchar c;
-recurse_check this_recurse;
-
-for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
- code < endcode;
- code = first_significant_code(code + PRIV(OP_lengths)[c], TRUE))
- {
- const pcre_uchar *ccode;
-
- c = *code;
-
- /* Skip over forward assertions; the other assertions are skipped by
- first_significant_code() with a TRUE final argument. */
-
- if (c == OP_ASSERT)
- {
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
- }
-
- /* For a recursion/subroutine call, if its end has been reached, which
- implies a backward reference subroutine call, we can scan it. If it's a
- forward reference subroutine call, we can't. To detect forward reference
- we have to scan up the list that is kept in the workspace. This function is
- called only when doing the real compile, not during the pre-compile that
- measures the size of the compiled pattern. */
-
- if (c == OP_RECURSE)
- {
- const pcre_uchar *scode = cd->start_code + GET(code, 1);
- BOOL empty_branch;
-
- /* Test for forward reference or uncompleted reference. This is disabled
- when called to scan a completed pattern by setting cd->start_workspace to
- NULL. */
-
- if (cd->start_workspace != NULL)
- {
- const pcre_uchar *tcode;
- for (tcode = cd->start_workspace; tcode < cd->hwm; tcode += LINK_SIZE)
- if ((int)GET(tcode, 0) == (int)(code + 1 - cd->start_code)) return TRUE;
- if (GET(scode, 1) == 0) return TRUE; /* Unclosed */
- }
-
- /* If we are scanning a completed pattern, there are no forward references
- and all groups are complete. We need to detect whether this is a recursive
- call, as otherwise there will be an infinite loop. If it is a recursion,
- just skip over it. Simple recursions are easily detected. For mutual
- recursions we keep a chain on the stack. */
-
- else
- {
- recurse_check *r = recurses;
- const pcre_uchar *endgroup = scode;
-
- do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT);
- if (code >= scode && code <= endgroup) continue; /* Simple recursion */
-
- for (r = recurses; r != NULL; r = r->prev)
- if (r->group == scode) break;
- if (r != NULL) continue; /* Mutual recursion */
- }
-
- /* Completed reference; scan the referenced group, remembering it on the
- stack chain to detect mutual recursions. */
-
- empty_branch = FALSE;
- this_recurse.prev = recurses;
- this_recurse.group = scode;
-
- do
- {
- if (could_be_empty_branch(scode, endcode, utf, cd, &this_recurse))
- {
- empty_branch = TRUE;
- break;
- }
- scode += GET(scode, 1);
- }
- while (*scode == OP_ALT);
-
- if (!empty_branch) return FALSE; /* All branches are non-empty */
- continue;
- }
-
- /* Groups with zero repeats can of course be empty; skip them. */
-
- if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO ||
- c == OP_BRAPOSZERO)
- {
- code += PRIV(OP_lengths)[c];
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
- }
-
- /* A nested group that is already marked as "could be empty" can just be
- skipped. */
-
- if (c == OP_SBRA || c == OP_SBRAPOS ||
- c == OP_SCBRA || c == OP_SCBRAPOS)
- {
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- continue;
- }
-
- /* For other groups, scan the branches. */
-
- if (c == OP_BRA || c == OP_BRAPOS ||
- c == OP_CBRA || c == OP_CBRAPOS ||
- c == OP_ONCE || c == OP_ONCE_NC ||
- c == OP_COND)
- {
- BOOL empty_branch;
- if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */
-
- /* If a conditional group has only one branch, there is a second, implied,
- empty branch, so just skip over the conditional, because it could be empty.
- Otherwise, scan the individual branches of the group. */
-
- if (c == OP_COND && code[GET(code, 1)] != OP_ALT)
- code += GET(code, 1);
- else
- {
- empty_branch = FALSE;
- do
- {
- if (!empty_branch && could_be_empty_branch(code, endcode, utf, cd, NULL))
- empty_branch = TRUE;
- code += GET(code, 1);
- }
- while (*code == OP_ALT);
- if (!empty_branch) return FALSE; /* All branches are non-empty */
- }
-
- c = *code;
- continue;
- }
-
- /* Handle the other opcodes */
-
- switch (c)
- {
- /* Check for quantifiers after a class. XCLASS is used for classes that
- cannot be represented just by a bit map. This includes negated single
- high-valued characters. The length in PRIV(OP_lengths)[] is zero; the
- actual length is stored in the compiled code, so we must update "code"
- here. */
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- ccode = code += GET(code, 1);
- goto CHECK_CLASS_REPEAT;
-#endif
-
- case OP_CLASS:
- case OP_NCLASS:
- ccode = code + PRIV(OP_lengths)[OP_CLASS];
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- CHECK_CLASS_REPEAT:
-#endif
-
- switch (*ccode)
- {
- case OP_CRSTAR: /* These could be empty; continue */
- case OP_CRMINSTAR:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSQUERY:
- break;
-
- default: /* Non-repeat => class must match */
- case OP_CRPLUS: /* These repeats aren't empty */
- case OP_CRMINPLUS:
- case OP_CRPOSPLUS:
- return FALSE;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- if (GET2(ccode, 1) > 0) return FALSE; /* Minimum > 0 */
- break;
- }
- break;
-
- /* Opcodes that must match a character */
-
- case OP_ANY:
- case OP_ALLANY:
- case OP_ANYBYTE:
-
- case OP_PROP:
- case OP_NOTPROP:
- case OP_ANYNL:
-
- case OP_NOT_HSPACE:
- case OP_HSPACE:
- case OP_NOT_VSPACE:
- case OP_VSPACE:
- case OP_EXTUNI:
-
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
-
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
-
- case OP_PLUS:
- case OP_PLUSI:
- case OP_MINPLUS:
- case OP_MINPLUSI:
-
- case OP_NOTPLUS:
- case OP_NOTPLUSI:
- case OP_NOTMINPLUS:
- case OP_NOTMINPLUSI:
-
- case OP_POSPLUS:
- case OP_POSPLUSI:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSPLUSI:
-
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
-
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEPOSPLUS:
- case OP_TYPEEXACT:
-
- return FALSE;
-
- /* These are going to continue, as they may be empty, but we have to
- fudge the length for the \p and \P cases. */
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPOSSTAR:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- /* Same for these */
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEPOSUPTO:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
- /* End of branch */
-
- case OP_KET:
- case OP_KETRMAX:
- case OP_KETRMIN:
- case OP_KETRPOS:
- case OP_ALT:
- return TRUE;
-
- /* In UTF-8 mode, STAR, MINSTAR, POSSTAR, QUERY, MINQUERY, POSQUERY, UPTO,
- MINUPTO, and POSUPTO and their caseless and negative versions may be
- followed by a multibyte character. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- case OP_STAR:
- case OP_STARI:
- case OP_NOTSTAR:
- case OP_NOTSTARI:
-
- case OP_MINSTAR:
- case OP_MINSTARI:
- case OP_NOTMINSTAR:
- case OP_NOTMINSTARI:
-
- case OP_POSSTAR:
- case OP_POSSTARI:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSSTARI:
-
- case OP_QUERY:
- case OP_QUERYI:
- case OP_NOTQUERY:
- case OP_NOTQUERYI:
-
- case OP_MINQUERY:
- case OP_MINQUERYI:
- case OP_NOTMINQUERY:
- case OP_NOTMINQUERYI:
-
- case OP_POSQUERY:
- case OP_POSQUERYI:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSQUERYI:
-
- if (utf && HAS_EXTRALEN(code[1])) code += GET_EXTRALEN(code[1]);
- break;
-
- case OP_UPTO:
- case OP_UPTOI:
- case OP_NOTUPTO:
- case OP_NOTUPTOI:
-
- case OP_MINUPTO:
- case OP_MINUPTOI:
- case OP_NOTMINUPTO:
- case OP_NOTMINUPTOI:
-
- case OP_POSUPTO:
- case OP_POSUPTOI:
- case OP_NOTPOSUPTO:
- case OP_NOTPOSUPTOI:
-
- if (utf && HAS_EXTRALEN(code[1 + IMM2_SIZE])) code += GET_EXTRALEN(code[1 + IMM2_SIZE]);
- break;
-#endif
-
- /* MARK, and PRUNE/SKIP/THEN with an argument must skip over the argument
- string. */
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
-
- /* None of the remaining opcodes are required to match a character. */
-
- default:
- break;
- }
- }
-
-return TRUE;
-}
-
-
-
-/*************************************************
-* Scan compiled regex for non-emptiness *
-*************************************************/
-
-/* This function is called to check for left recursive calls. We want to check
-the current branch of the current pattern to see if it could match the empty
-string. If it could, we must look outwards for branches at other levels,
-stopping when we pass beyond the bracket which is the subject of the recursion.
-This function is called only during the real compile, not during the
-pre-compile.
-
-Arguments:
- code points to start of the recursion
- endcode points to where to stop (current RECURSE item)
- bcptr points to the chain of current (unclosed) branch starts
- utf TRUE if in UTF-8 / UTF-16 / UTF-32 mode
- cd pointers to tables etc
-
-Returns: TRUE if what is matched could be empty
-*/
-
-static BOOL
-could_be_empty(const pcre_uchar *code, const pcre_uchar *endcode,
- branch_chain *bcptr, BOOL utf, compile_data *cd)
-{
-while (bcptr != NULL && bcptr->current_branch >= code)
- {
- if (!could_be_empty_branch(bcptr->current_branch, endcode, utf, cd, NULL))
- return FALSE;
- bcptr = bcptr->outer;
- }
-return TRUE;
-}
-
-
-
-/*************************************************
-* Base opcode of repeated opcodes *
-*************************************************/
-
-/* Returns the base opcode for repeated single character type opcodes. If the
-opcode is not a repeated character type, it returns with the original value.
-
-Arguments: c opcode
-Returns: base opcode for the type
-*/
-
-static pcre_uchar
-get_repeat_base(pcre_uchar c)
-{
-return (c > OP_TYPEPOSUPTO)? c :
- (c >= OP_TYPESTAR)? OP_TYPESTAR :
- (c >= OP_NOTSTARI)? OP_NOTSTARI :
- (c >= OP_NOTSTAR)? OP_NOTSTAR :
- (c >= OP_STARI)? OP_STARI :
- OP_STAR;
-}
-
-
-
-#ifdef SUPPORT_UCP
-/*************************************************
-* Check a character and a property *
-*************************************************/
-
-/* This function is called by check_auto_possessive() when a property item
-is adjacent to a fixed character.
-
-Arguments:
- c the character
- ptype the property type
- pdata the data for the type
- negated TRUE if it's a negated property (\P or \p{^)
-
-Returns: TRUE if auto-possessifying is OK
-*/
-
-static BOOL
-check_char_prop(pcre_uint32 c, unsigned int ptype, unsigned int pdata,
- BOOL negated)
-{
-const pcre_uint32 *p;
-const ucd_record *prop = GET_UCD(c);
-
-switch(ptype)
- {
- case PT_LAMP:
- return (prop->chartype == ucp_Lu ||
- prop->chartype == ucp_Ll ||
- prop->chartype == ucp_Lt) == negated;
-
- case PT_GC:
- return (pdata == PRIV(ucp_gentype)[prop->chartype]) == negated;
-
- case PT_PC:
- return (pdata == prop->chartype) == negated;
-
- case PT_SC:
- return (pdata == prop->script) == negated;
-
- /* These are specials */
-
- case PT_ALNUM:
- return (PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
- PRIV(ucp_gentype)[prop->chartype] == ucp_N) == negated;
-
- /* Perl space used to exclude VT, but from Perl 5.18 it is included, which
- means that Perl space and POSIX space are now identical. PCRE was changed
- at release 8.34. */
-
- case PT_SPACE: /* Perl space */
- case PT_PXSPACE: /* POSIX space */
- switch(c)
- {
- HSPACE_CASES:
- VSPACE_CASES:
- return negated;
-
- default:
- return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z) == negated;
- }
- break; /* Control never reaches here */
-
- case PT_WORD:
- return (PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
- PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
- c == CHAR_UNDERSCORE) == negated;
-
- case PT_CLIST:
- p = PRIV(ucd_caseless_sets) + prop->caseset;
- for (;;)
- {
- if (c < *p) return !negated;
- if (c == *p++) return negated;
- }
- break; /* Control never reaches here */
- }
-
-return FALSE;
-}
-#endif /* SUPPORT_UCP */
-
-
-
-/*************************************************
-* Fill the character property list *
-*************************************************/
-
-/* Checks whether the code points to an opcode that can take part in auto-
-possessification, and if so, fills a list with its properties.
-
-Arguments:
- code points to start of expression
- utf TRUE if in UTF-8 / UTF-16 / UTF-32 mode
- fcc points to case-flipping table
- list points to output list
- list[0] will be filled with the opcode
- list[1] will be non-zero if this opcode
- can match an empty character string
- list[2..7] depends on the opcode
-
-Returns: points to the start of the next opcode if *code is accepted
- NULL if *code is not accepted
-*/
-
-static const pcre_uchar *
-get_chr_property_list(const pcre_uchar *code, BOOL utf,
- const pcre_uint8 *fcc, pcre_uint32 *list)
-{
-pcre_uchar c = *code;
-pcre_uchar base;
-const pcre_uchar *end;
-pcre_uint32 chr;
-
-#ifdef SUPPORT_UCP
-pcre_uint32 *clist_dest;
-const pcre_uint32 *clist_src;
-#else
-utf = utf; /* Suppress "unused parameter" compiler warning */
-#endif
-
-list[0] = c;
-list[1] = FALSE;
-code++;
-
-if (c >= OP_STAR && c <= OP_TYPEPOSUPTO)
- {
- base = get_repeat_base(c);
- c -= (base - OP_STAR);
-
- if (c == OP_UPTO || c == OP_MINUPTO || c == OP_EXACT || c == OP_POSUPTO)
- code += IMM2_SIZE;
-
- list[1] = (c != OP_PLUS && c != OP_MINPLUS && c != OP_EXACT && c != OP_POSPLUS);
-
- switch(base)
- {
- case OP_STAR:
- list[0] = OP_CHAR;
- break;
-
- case OP_STARI:
- list[0] = OP_CHARI;
- break;
-
- case OP_NOTSTAR:
- list[0] = OP_NOT;
- break;
-
- case OP_NOTSTARI:
- list[0] = OP_NOTI;
- break;
-
- case OP_TYPESTAR:
- list[0] = *code;
- code++;
- break;
- }
- c = list[0];
- }
-
-switch(c)
- {
- case OP_NOT_DIGIT:
- case OP_DIGIT:
- case OP_NOT_WHITESPACE:
- case OP_WHITESPACE:
- case OP_NOT_WORDCHAR:
- case OP_WORDCHAR:
- case OP_ANY:
- case OP_ALLANY:
- case OP_ANYNL:
- case OP_NOT_HSPACE:
- case OP_HSPACE:
- case OP_NOT_VSPACE:
- case OP_VSPACE:
- case OP_EXTUNI:
- case OP_EODN:
- case OP_EOD:
- case OP_DOLL:
- case OP_DOLLM:
- return code;
-
- case OP_CHAR:
- case OP_NOT:
- GETCHARINCTEST(chr, code);
- list[2] = chr;
- list[3] = NOTACHAR;
- return code;
-
- case OP_CHARI:
- case OP_NOTI:
- list[0] = (c == OP_CHARI) ? OP_CHAR : OP_NOT;
- GETCHARINCTEST(chr, code);
- list[2] = chr;
-
-#ifdef SUPPORT_UCP
- if (chr < 128 || (chr < 256 && !utf))
- list[3] = fcc[chr];
- else
- list[3] = UCD_OTHERCASE(chr);
-#elif defined SUPPORT_UTF || !defined COMPILE_PCRE8
- list[3] = (chr < 256) ? fcc[chr] : chr;
-#else
- list[3] = fcc[chr];
-#endif
-
- /* The othercase might be the same value. */
-
- if (chr == list[3])
- list[3] = NOTACHAR;
- else
- list[4] = NOTACHAR;
- return code;
-
-#ifdef SUPPORT_UCP
- case OP_PROP:
- case OP_NOTPROP:
- if (code[0] != PT_CLIST)
- {
- list[2] = code[0];
- list[3] = code[1];
- return code + 2;
- }
-
- /* Convert only if we have enough space. */
-
- clist_src = PRIV(ucd_caseless_sets) + code[1];
- clist_dest = list + 2;
- code += 2;
-
- do {
- if (clist_dest >= list + 8)
- {
- /* Early return if there is not enough space. This should never
- happen, since all clists are shorter than 5 character now. */
- list[2] = code[0];
- list[3] = code[1];
- return code;
- }
- *clist_dest++ = *clist_src;
- }
- while(*clist_src++ != NOTACHAR);
-
- /* All characters are stored. The terminating NOTACHAR
- is copied form the clist itself. */
-
- list[0] = (c == OP_PROP) ? OP_CHAR : OP_NOT;
- return code;
-#endif
-
- case OP_NCLASS:
- case OP_CLASS:
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- if (c == OP_XCLASS)
- end = code + GET(code, 0) - 1;
- else
-#endif
- end = code + 32 / sizeof(pcre_uchar);
-
- switch(*end)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- case OP_CRPOSSTAR:
- case OP_CRPOSQUERY:
- list[1] = TRUE;
- end++;
- break;
-
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- case OP_CRPOSPLUS:
- end++;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- case OP_CRPOSRANGE:
- list[1] = (GET2(end, 1) == 0);
- end += 1 + 2 * IMM2_SIZE;
- break;
- }
- list[2] = end - code;
- return end;
- }
-return NULL; /* Opcode not accepted */
-}
-
-
-
-/*************************************************
-* Scan further character sets for match *
-*************************************************/
-
-/* Checks whether the base and the current opcode have a common character, in
-which case the base cannot be possessified.
-
-Arguments:
- code points to the byte code
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- cd static compile data
- base_list the data list of the base opcode
-
-Returns: TRUE if the auto-possessification is possible
-*/
-
-static BOOL
-compare_opcodes(const pcre_uchar *code, BOOL utf, const compile_data *cd,
- const pcre_uint32 *base_list, const pcre_uchar *base_end)
-{
-pcre_uchar c;
-pcre_uint32 list[8];
-const pcre_uint32 *chr_ptr;
-const pcre_uint32 *ochr_ptr;
-const pcre_uint32 *list_ptr;
-const pcre_uchar *next_code;
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
-const pcre_uchar *xclass_flags;
-#endif
-const pcre_uint8 *class_bitset;
-const pcre_uint8 *set1, *set2, *set_end;
-pcre_uint32 chr;
-BOOL accepted, invert_bits;
-
-/* Note: the base_list[1] contains whether the current opcode has greedy
-(represented by a non-zero value) quantifier. This is a different from
-other character type lists, which stores here that the character iterator
-matches to an empty string (also represented by a non-zero value). */
-
-for(;;)
- {
- /* All operations move the code pointer forward.
- Therefore infinite recursions are not possible. */
-
- c = *code;
-
- /* Skip over callouts */
-
- if (c == OP_CALLOUT)
- {
- code += PRIV(OP_lengths)[c];
- continue;
- }
-
- if (c == OP_ALT)
- {
- do code += GET(code, 1); while (*code == OP_ALT);
- c = *code;
- }
-
- switch(c)
- {
- case OP_END:
- case OP_KETRPOS:
- /* TRUE only in greedy case. The non-greedy case could be replaced by
- an OP_EXACT, but it is probably not worth it. (And note that OP_EXACT
- uses more memory, which we cannot get at this stage.) */
-
- return base_list[1] != 0;
-
- case OP_KET:
- /* If the bracket is capturing, and referenced by an OP_RECURSE, or
- it is an atomic sub-pattern (assert, once, etc.) the non-greedy case
- cannot be converted to a possessive form. */
-
- if (base_list[1] == 0) return FALSE;
-
- switch(*(code - GET(code, 1)))
- {
- case OP_ASSERT:
- case OP_ASSERT_NOT:
- case OP_ASSERTBACK:
- case OP_ASSERTBACK_NOT:
- case OP_ONCE:
- case OP_ONCE_NC:
- /* Atomic sub-patterns and assertions can always auto-possessify their
- last iterator. */
- return TRUE;
- }
-
- code += PRIV(OP_lengths)[c];
- continue;
-
- case OP_ONCE:
- case OP_ONCE_NC:
- case OP_BRA:
- case OP_CBRA:
- next_code = code + GET(code, 1);
- code += PRIV(OP_lengths)[c];
-
- while (*next_code == OP_ALT)
- {
- if (!compare_opcodes(code, utf, cd, base_list, base_end)) return FALSE;
- code = next_code + 1 + LINK_SIZE;
- next_code += GET(next_code, 1);
- }
- continue;
-
- case OP_BRAZERO:
- case OP_BRAMINZERO:
-
- next_code = code + 1;
- if (*next_code != OP_BRA && *next_code != OP_CBRA
- && *next_code != OP_ONCE && *next_code != OP_ONCE_NC) return FALSE;
-
- do next_code += GET(next_code, 1); while (*next_code == OP_ALT);
-
- /* The bracket content will be checked by the
- OP_BRA/OP_CBRA case above. */
- next_code += 1 + LINK_SIZE;
- if (!compare_opcodes(next_code, utf, cd, base_list, base_end))
- return FALSE;
-
- code += PRIV(OP_lengths)[c];
- continue;
- }
-
- /* Check for a supported opcode, and load its properties. */
-
- code = get_chr_property_list(code, utf, cd->fcc, list);
- if (code == NULL) return FALSE; /* Unsupported */
-
- /* If either opcode is a small character list, set pointers for comparing
- characters from that list with another list, or with a property. */
-
- if (base_list[0] == OP_CHAR)
- {
- chr_ptr = base_list + 2;
- list_ptr = list;
- }
- else if (list[0] == OP_CHAR)
- {
- chr_ptr = list + 2;
- list_ptr = base_list;
- }
-
- /* Character bitsets can also be compared to certain opcodes. */
-
- else if (base_list[0] == OP_CLASS || list[0] == OP_CLASS
-#ifdef COMPILE_PCRE8
- /* In 8 bit, non-UTF mode, OP_CLASS and OP_NCLASS are the same. */
- || (!utf && (base_list[0] == OP_NCLASS || list[0] == OP_NCLASS))
-#endif
- )
- {
-#ifdef COMPILE_PCRE8
- if (base_list[0] == OP_CLASS || (!utf && base_list[0] == OP_NCLASS))
-#else
- if (base_list[0] == OP_CLASS)
-#endif
- {
- set1 = (pcre_uint8 *)(base_end - base_list[2]);
- list_ptr = list;
- }
- else
- {
- set1 = (pcre_uint8 *)(code - list[2]);
- list_ptr = base_list;
- }
-
- invert_bits = FALSE;
- switch(list_ptr[0])
- {
- case OP_CLASS:
- case OP_NCLASS:
- set2 = (pcre_uint8 *)
- ((list_ptr == list ? code : base_end) - list_ptr[2]);
- break;
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- xclass_flags = (list_ptr == list ? code : base_end) - list_ptr[2] + LINK_SIZE;
- if ((*xclass_flags & XCL_HASPROP) != 0) return FALSE;
- if ((*xclass_flags & XCL_MAP) == 0)
- {
- /* No bits are set for characters < 256. */
- if (list[1] == 0) return TRUE;
- /* Might be an empty repeat. */
- continue;
- }
- set2 = (pcre_uint8 *)(xclass_flags + 1);
- break;
-#endif
-
- case OP_NOT_DIGIT:
- invert_bits = TRUE;
- /* Fall through */
- case OP_DIGIT:
- set2 = (pcre_uint8 *)(cd->cbits + cbit_digit);
- break;
-
- case OP_NOT_WHITESPACE:
- invert_bits = TRUE;
- /* Fall through */
- case OP_WHITESPACE:
- set2 = (pcre_uint8 *)(cd->cbits + cbit_space);
- break;
-
- case OP_NOT_WORDCHAR:
- invert_bits = TRUE;
- /* Fall through */
- case OP_WORDCHAR:
- set2 = (pcre_uint8 *)(cd->cbits + cbit_word);
- break;
-
- default:
- return FALSE;
- }
-
- /* Because the sets are unaligned, we need
- to perform byte comparison here. */
- set_end = set1 + 32;
- if (invert_bits)
- {
- do
- {
- if ((*set1++ & ~(*set2++)) != 0) return FALSE;
- }
- while (set1 < set_end);
- }
- else
- {
- do
- {
- if ((*set1++ & *set2++) != 0) return FALSE;
- }
- while (set1 < set_end);
- }
-
- if (list[1] == 0) return TRUE;
- /* Might be an empty repeat. */
- continue;
- }
-
- /* Some property combinations also acceptable. Unicode property opcodes are
- processed specially; the rest can be handled with a lookup table. */
-
- else
- {
- pcre_uint32 leftop, rightop;
-
- leftop = base_list[0];
- rightop = list[0];
-
-#ifdef SUPPORT_UCP
- accepted = FALSE; /* Always set in non-unicode case. */
- if (leftop == OP_PROP || leftop == OP_NOTPROP)
- {
- if (rightop == OP_EOD)
- accepted = TRUE;
- else if (rightop == OP_PROP || rightop == OP_NOTPROP)
- {
- int n;
- const pcre_uint8 *p;
- BOOL same = leftop == rightop;
- BOOL lisprop = leftop == OP_PROP;
- BOOL risprop = rightop == OP_PROP;
- BOOL bothprop = lisprop && risprop;
-
- /* There's a table that specifies how each combination is to be
- processed:
- 0 Always return FALSE (never auto-possessify)
- 1 Character groups are distinct (possessify if both are OP_PROP)
- 2 Check character categories in the same group (general or particular)
- 3 Return TRUE if the two opcodes are not the same
- ... see comments below
- */
-
- n = propposstab[base_list[2]][list[2]];
- switch(n)
- {
- case 0: break;
- case 1: accepted = bothprop; break;
- case 2: accepted = (base_list[3] == list[3]) != same; break;
- case 3: accepted = !same; break;
-
- case 4: /* Left general category, right particular category */
- accepted = risprop && catposstab[base_list[3]][list[3]] == same;
- break;
-
- case 5: /* Right general category, left particular category */
- accepted = lisprop && catposstab[list[3]][base_list[3]] == same;
- break;
-
- /* This code is logically tricky. Think hard before fiddling with it.
- The posspropstab table has four entries per row. Each row relates to
- one of PCRE's special properties such as ALNUM or SPACE or WORD.
- Only WORD actually needs all four entries, but using repeats for the
- others means they can all use the same code below.
-
- The first two entries in each row are Unicode general categories, and
- apply always, because all the characters they include are part of the
- PCRE character set. The third and fourth entries are a general and a
- particular category, respectively, that include one or more relevant
- characters. One or the other is used, depending on whether the check
- is for a general or a particular category. However, in both cases the
- category contains more characters than the specials that are defined
- for the property being tested against. Therefore, it cannot be used
- in a NOTPROP case.
-
- Example: the row for WORD contains ucp_L, ucp_N, ucp_P, ucp_Po.
- Underscore is covered by ucp_P or ucp_Po. */
-
- case 6: /* Left alphanum vs right general category */
- case 7: /* Left space vs right general category */
- case 8: /* Left word vs right general category */
- p = posspropstab[n-6];
- accepted = risprop && lisprop ==
- (list[3] != p[0] &&
- list[3] != p[1] &&
- (list[3] != p[2] || !lisprop));
- break;
-
- case 9: /* Right alphanum vs left general category */
- case 10: /* Right space vs left general category */
- case 11: /* Right word vs left general category */
- p = posspropstab[n-9];
- accepted = lisprop && risprop ==
- (base_list[3] != p[0] &&
- base_list[3] != p[1] &&
- (base_list[3] != p[2] || !risprop));
- break;
-
- case 12: /* Left alphanum vs right particular category */
- case 13: /* Left space vs right particular category */
- case 14: /* Left word vs right particular category */
- p = posspropstab[n-12];
- accepted = risprop && lisprop ==
- (catposstab[p[0]][list[3]] &&
- catposstab[p[1]][list[3]] &&
- (list[3] != p[3] || !lisprop));
- break;
-
- case 15: /* Right alphanum vs left particular category */
- case 16: /* Right space vs left particular category */
- case 17: /* Right word vs left particular category */
- p = posspropstab[n-15];
- accepted = lisprop && risprop ==
- (catposstab[p[0]][base_list[3]] &&
- catposstab[p[1]][base_list[3]] &&
- (base_list[3] != p[3] || !risprop));
- break;
- }
- }
- }
-
- else
-#endif /* SUPPORT_UCP */
-
- accepted = leftop >= FIRST_AUTOTAB_OP && leftop <= LAST_AUTOTAB_LEFT_OP &&
- rightop >= FIRST_AUTOTAB_OP && rightop <= LAST_AUTOTAB_RIGHT_OP &&
- autoposstab[leftop - FIRST_AUTOTAB_OP][rightop - FIRST_AUTOTAB_OP];
-
- if (!accepted)
- return FALSE;
-
- if (list[1] == 0) return TRUE;
- /* Might be an empty repeat. */
- continue;
- }
-
- /* Control reaches here only if one of the items is a small character list.
- All characters are checked against the other side. */
-
- do
- {
- chr = *chr_ptr;
-
- switch(list_ptr[0])
- {
- case OP_CHAR:
- ochr_ptr = list_ptr + 2;
- do
- {
- if (chr == *ochr_ptr) return FALSE;
- ochr_ptr++;
- }
- while(*ochr_ptr != NOTACHAR);
- break;
-
- case OP_NOT:
- ochr_ptr = list_ptr + 2;
- do
- {
- if (chr == *ochr_ptr)
- break;
- ochr_ptr++;
- }
- while(*ochr_ptr != NOTACHAR);
- if (*ochr_ptr == NOTACHAR) return FALSE; /* Not found */
- break;
-
- /* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not*
- set. When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */
-
- case OP_DIGIT:
- if (chr < 256 && (cd->ctypes[chr] & ctype_digit) != 0) return FALSE;
- break;
-
- case OP_NOT_DIGIT:
- if (chr > 255 || (cd->ctypes[chr] & ctype_digit) == 0) return FALSE;
- break;
-
- case OP_WHITESPACE:
- if (chr < 256 && (cd->ctypes[chr] & ctype_space) != 0) return FALSE;
- break;
-
- case OP_NOT_WHITESPACE:
- if (chr > 255 || (cd->ctypes[chr] & ctype_space) == 0) return FALSE;
- break;
-
- case OP_WORDCHAR:
- if (chr < 255 && (cd->ctypes[chr] & ctype_word) != 0) return FALSE;
- break;
-
- case OP_NOT_WORDCHAR:
- if (chr > 255 || (cd->ctypes[chr] & ctype_word) == 0) return FALSE;
- break;
-
- case OP_HSPACE:
- switch(chr)
- {
- HSPACE_CASES: return FALSE;
- default: break;
- }
- break;
-
- case OP_NOT_HSPACE:
- switch(chr)
- {
- HSPACE_CASES: break;
- default: return FALSE;
- }
- break;
-
- case OP_ANYNL:
- case OP_VSPACE:
- switch(chr)
- {
- VSPACE_CASES: return FALSE;
- default: break;
- }
- break;
-
- case OP_NOT_VSPACE:
- switch(chr)
- {
- VSPACE_CASES: break;
- default: return FALSE;
- }
- break;
-
- case OP_DOLL:
- case OP_EODN:
- switch (chr)
- {
- case CHAR_CR:
- case CHAR_LF:
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_NEL:
-#ifndef EBCDIC
- case 0x2028:
- case 0x2029:
-#endif /* Not EBCDIC */
- return FALSE;
- }
- break;
-
- case OP_EOD: /* Can always possessify before \z */
- break;
-
-#ifdef SUPPORT_UCP
- case OP_PROP:
- case OP_NOTPROP:
- if (!check_char_prop(chr, list_ptr[2], list_ptr[3],
- list_ptr[0] == OP_NOTPROP))
- return FALSE;
- break;
-#endif
-
- case OP_NCLASS:
- if (chr > 255) return FALSE;
- /* Fall through */
-
- case OP_CLASS:
- if (chr > 255) break;
- class_bitset = (pcre_uint8 *)
- ((list_ptr == list ? code : base_end) - list_ptr[2]);
- if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE;
- break;
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- if (PRIV(xclass)(chr, (list_ptr == list ? code : base_end) -
- list_ptr[2] + LINK_SIZE, utf)) return FALSE;
- break;
-#endif
-
- default:
- return FALSE;
- }
-
- chr_ptr++;
- }
- while(*chr_ptr != NOTACHAR);
-
- /* At least one character must be matched from this opcode. */
-
- if (list[1] == 0) return TRUE;
- }
-
-/* Control never reaches here. There used to be a fail-save return FALSE; here,
-but some compilers complain about an unreachable statement. */
-
-}
-
-
-
-/*************************************************
-* Scan compiled regex for auto-possession *
-*************************************************/
-
-/* Replaces single character iterations with their possessive alternatives
-if appropriate. This function modifies the compiled opcode!
-
-Arguments:
- code points to start of the byte code
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- cd static compile data
-
-Returns: nothing
-*/
-
-static void
-auto_possessify(pcre_uchar *code, BOOL utf, const compile_data *cd)
-{
-register pcre_uchar c;
-const pcre_uchar *end;
-pcre_uchar *repeat_opcode;
-pcre_uint32 list[8];
-
-for (;;)
- {
- c = *code;
-
- if (c >= OP_STAR && c <= OP_TYPEPOSUPTO)
- {
- c -= get_repeat_base(c) - OP_STAR;
- end = (c <= OP_MINUPTO) ?
- get_chr_property_list(code, utf, cd->fcc, list) : NULL;
- list[1] = c == OP_STAR || c == OP_PLUS || c == OP_QUERY || c == OP_UPTO;
-
- if (end != NULL && compare_opcodes(end, utf, cd, list, end))
- {
- switch(c)
- {
- case OP_STAR:
- *code += OP_POSSTAR - OP_STAR;
- break;
-
- case OP_MINSTAR:
- *code += OP_POSSTAR - OP_MINSTAR;
- break;
-
- case OP_PLUS:
- *code += OP_POSPLUS - OP_PLUS;
- break;
-
- case OP_MINPLUS:
- *code += OP_POSPLUS - OP_MINPLUS;
- break;
-
- case OP_QUERY:
- *code += OP_POSQUERY - OP_QUERY;
- break;
-
- case OP_MINQUERY:
- *code += OP_POSQUERY - OP_MINQUERY;
- break;
-
- case OP_UPTO:
- *code += OP_POSUPTO - OP_UPTO;
- break;
-
- case OP_MINUPTO:
- *code += OP_POSUPTO - OP_MINUPTO;
- break;
- }
- }
- c = *code;
- }
- else if (c == OP_CLASS || c == OP_NCLASS || c == OP_XCLASS)
- {
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- if (c == OP_XCLASS)
- repeat_opcode = code + GET(code, 1);
- else
-#endif
- repeat_opcode = code + 1 + (32 / sizeof(pcre_uchar));
-
- c = *repeat_opcode;
- if (c >= OP_CRSTAR && c <= OP_CRMINRANGE)
- {
- /* end must not be NULL. */
- end = get_chr_property_list(code, utf, cd->fcc, list);
-
- list[1] = (c & 1) == 0;
-
- if (compare_opcodes(end, utf, cd, list, end))
- {
- switch (c)
- {
- case OP_CRSTAR:
- case OP_CRMINSTAR:
- *repeat_opcode = OP_CRPOSSTAR;
- break;
-
- case OP_CRPLUS:
- case OP_CRMINPLUS:
- *repeat_opcode = OP_CRPOSPLUS;
- break;
-
- case OP_CRQUERY:
- case OP_CRMINQUERY:
- *repeat_opcode = OP_CRPOSQUERY;
- break;
-
- case OP_CRRANGE:
- case OP_CRMINRANGE:
- *repeat_opcode = OP_CRPOSRANGE;
- break;
- }
- }
- }
- c = *code;
- }
-
- switch(c)
- {
- case OP_END:
- return;
-
- case OP_TYPESTAR:
- case OP_TYPEMINSTAR:
- case OP_TYPEPLUS:
- case OP_TYPEMINPLUS:
- case OP_TYPEQUERY:
- case OP_TYPEMINQUERY:
- case OP_TYPEPOSSTAR:
- case OP_TYPEPOSPLUS:
- case OP_TYPEPOSQUERY:
- if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2;
- break;
-
- case OP_TYPEUPTO:
- case OP_TYPEMINUPTO:
- case OP_TYPEEXACT:
- case OP_TYPEPOSUPTO:
- if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
- code += 2;
- break;
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- code += GET(code, 1);
- break;
-#endif
-
- case OP_MARK:
- case OP_PRUNE_ARG:
- case OP_SKIP_ARG:
- case OP_THEN_ARG:
- code += code[1];
- break;
- }
-
- /* Add in the fixed length from the table */
-
- code += PRIV(OP_lengths)[c];
-
- /* In UTF-8 mode, opcodes that are followed by a character may be followed by
- a multi-byte character. The length in the table is a minimum, so we have to
- arrange to skip the extra bytes. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf) switch(c)
- {
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_STAR:
- case OP_MINSTAR:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_QUERY:
- case OP_MINQUERY:
- case OP_UPTO:
- case OP_MINUPTO:
- case OP_EXACT:
- case OP_POSSTAR:
- case OP_POSPLUS:
- case OP_POSQUERY:
- case OP_POSUPTO:
- case OP_STARI:
- case OP_MINSTARI:
- case OP_PLUSI:
- case OP_MINPLUSI:
- case OP_QUERYI:
- case OP_MINQUERYI:
- case OP_UPTOI:
- case OP_MINUPTOI:
- case OP_EXACTI:
- case OP_POSSTARI:
- case OP_POSPLUSI:
- case OP_POSQUERYI:
- case OP_POSUPTOI:
- case OP_NOTSTAR:
- case OP_NOTMINSTAR:
- case OP_NOTPLUS:
- case OP_NOTMINPLUS:
- case OP_NOTQUERY:
- case OP_NOTMINQUERY:
- case OP_NOTUPTO:
- case OP_NOTMINUPTO:
- case OP_NOTEXACT:
- case OP_NOTPOSSTAR:
- case OP_NOTPOSPLUS:
- case OP_NOTPOSQUERY:
- case OP_NOTPOSUPTO:
- case OP_NOTSTARI:
- case OP_NOTMINSTARI:
- case OP_NOTPLUSI:
- case OP_NOTMINPLUSI:
- case OP_NOTQUERYI:
- case OP_NOTMINQUERYI:
- case OP_NOTUPTOI:
- case OP_NOTMINUPTOI:
- case OP_NOTEXACTI:
- case OP_NOTPOSSTARI:
- case OP_NOTPOSPLUSI:
- case OP_NOTPOSQUERYI:
- case OP_NOTPOSUPTOI:
- if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
- break;
- }
-#else
- (void)(utf); /* Keep compiler happy by referencing function argument */
-#endif
- }
-}
-
-
-
-/*************************************************
-* Check for POSIX class syntax *
-*************************************************/
-
-/* This function is called when the sequence "[:" or "[." or "[=" is
-encountered in a character class. It checks whether this is followed by a
-sequence of characters terminated by a matching ":]" or ".]" or "=]". If we
-reach an unescaped ']' without the special preceding character, return FALSE.
-
-Originally, this function only recognized a sequence of letters between the
-terminators, but it seems that Perl recognizes any sequence of characters,
-though of course unknown POSIX names are subsequently rejected. Perl gives an
-"Unknown POSIX class" error for [:f\oo:] for example, where previously PCRE
-didn't consider this to be a POSIX class. Likewise for [:1234:].
-
-The problem in trying to be exactly like Perl is in the handling of escapes. We
-have to be sure that [abc[:x\]pqr] is *not* treated as containing a POSIX
-class, but [abc[:x\]pqr:]] is (so that an error can be generated). The code
-below handles the special case of \], but does not try to do any other escape
-processing. This makes it different from Perl for cases such as [:l\ower:]
-where Perl recognizes it as the POSIX class "lower" but PCRE does not recognize
-"l\ower". This is a lesser evil than not diagnosing bad classes when Perl does,
-I think.
-
-A user pointed out that PCRE was rejecting [:a[:digit:]] whereas Perl was not.
-It seems that the appearance of a nested POSIX class supersedes an apparent
-external class. For example, [:a[:digit:]b:] matches "a", "b", ":", or
-a digit.
-
-In Perl, unescaped square brackets may also appear as part of class names. For
-example, [:a[:abc]b:] gives unknown POSIX class "[:abc]b:]". However, for
-[:a[:abc]b][b:] it gives unknown POSIX class "[:abc]b][b:]", which does not
-seem right at all. PCRE does not allow closing square brackets in POSIX class
-names.
-
-Arguments:
- ptr pointer to the initial [
- endptr where to return the end pointer
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-check_posix_syntax(const pcre_uchar *ptr, const pcre_uchar **endptr)
-{
-pcre_uchar terminator; /* Don't combine these lines; the Solaris cc */
-terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */
-for (++ptr; *ptr != CHAR_NULL; ptr++)
- {
- if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
- ptr++;
- else if (*ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE;
- else
- {
- if (*ptr == terminator && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
- {
- *endptr = ptr;
- return TRUE;
- }
- if (*ptr == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) &&
- check_posix_syntax(ptr, endptr))
- return FALSE;
- }
- }
-return FALSE;
-}
-
-
-
-
-/*************************************************
-* Check POSIX class name *
-*************************************************/
-
-/* This function is called to check the name given in a POSIX-style class entry
-such as [:alnum:].
-
-Arguments:
- ptr points to the first letter
- len the length of the name
-
-Returns: a value representing the name, or -1 if unknown
-*/
-
-static int
-check_posix_name(const pcre_uchar *ptr, int len)
-{
-const char *pn = posix_names;
-register int yield = 0;
-while (posix_name_lengths[yield] != 0)
- {
- if (len == posix_name_lengths[yield] &&
- STRNCMP_UC_C8(ptr, pn, (unsigned int)len) == 0) return yield;
- pn += posix_name_lengths[yield] + 1;
- yield++;
- }
-return -1;
-}
-
-
-/*************************************************
-* Adjust OP_RECURSE items in repeated group *
-*************************************************/
-
-/* OP_RECURSE items contain an offset from the start of the regex to the group
-that is referenced. This means that groups can be replicated for fixed
-repetition simply by copying (because the recursion is allowed to refer to
-earlier groups that are outside the current group). However, when a group is
-optional (i.e. the minimum quantifier is zero), OP_BRAZERO or OP_SKIPZERO is
-inserted before it, after it has been compiled. This means that any OP_RECURSE
-items within it that refer to the group itself or any contained groups have to
-have their offsets adjusted. That one of the jobs of this function. Before it
-is called, the partially compiled regex must be temporarily terminated with
-OP_END.
-
-This function has been extended with the possibility of forward references for
-recursions and subroutine calls. It must also check the list of such references
-for the group we are dealing with. If it finds that one of the recursions in
-the current group is on this list, it adjusts the offset in the list, not the
-value in the reference (which is a group number).
-
-Arguments:
- group points to the start of the group
- adjust the amount by which the group is to be moved
- utf TRUE in UTF-8 / UTF-16 / UTF-32 mode
- cd contains pointers to tables etc.
- save_hwm the hwm forward reference pointer at the start of the group
-
-Returns: nothing
-*/
-
-static void
-adjust_recurse(pcre_uchar *group, int adjust, BOOL utf, compile_data *cd,
- pcre_uchar *save_hwm)
-{
-pcre_uchar *ptr = group;
-
-while ((ptr = (pcre_uchar *)find_recurse(ptr, utf)) != NULL)
- {
- int offset;
- pcre_uchar *hc;
-
- /* See if this recursion is on the forward reference list. If so, adjust the
- reference. */
-
- for (hc = save_hwm; hc < cd->hwm; hc += LINK_SIZE)
- {
- offset = (int)GET(hc, 0);
- if (cd->start_code + offset == ptr + 1)
- {
- PUT(hc, 0, offset + adjust);
- break;
- }
- }
-
- /* Otherwise, adjust the recursion offset if it's after the start of this
- group. */
-
- if (hc >= cd->hwm)
- {
- offset = (int)GET(ptr, 1);
- if (cd->start_code + offset >= group) PUT(ptr, 1, offset + adjust);
- }
-
- ptr += 1 + LINK_SIZE;
- }
-}
-
-
-
-/*************************************************
-* Insert an automatic callout point *
-*************************************************/
-
-/* This function is called when the PCRE_AUTO_CALLOUT option is set, to insert
-callout points before each pattern item.
-
-Arguments:
- code current code pointer
- ptr current pattern pointer
- cd pointers to tables etc
-
-Returns: new code pointer
-*/
-
-static pcre_uchar *
-auto_callout(pcre_uchar *code, const pcre_uchar *ptr, compile_data *cd)
-{
-*code++ = OP_CALLOUT;
-*code++ = 255;
-PUT(code, 0, (int)(ptr - cd->start_pattern)); /* Pattern offset */
-PUT(code, LINK_SIZE, 0); /* Default length */
-return code + 2 * LINK_SIZE;
-}
-
-
-
-/*************************************************
-* Complete a callout item *
-*************************************************/
-
-/* A callout item contains the length of the next item in the pattern, which
-we can't fill in till after we have reached the relevant point. This is used
-for both automatic and manual callouts.
-
-Arguments:
- previous_callout points to previous callout item
- ptr current pattern pointer
- cd pointers to tables etc
-
-Returns: nothing
-*/
-
-static void
-complete_callout(pcre_uchar *previous_callout, const pcre_uchar *ptr, compile_data *cd)
-{
-int length = (int)(ptr - cd->start_pattern - GET(previous_callout, 2));
-PUT(previous_callout, 2 + LINK_SIZE, length);
-}
-
-
-
-#ifdef SUPPORT_UCP
-/*************************************************
-* Get othercase range *
-*************************************************/
-
-/* This function is passed the start and end of a class range, in UTF-8 mode
-with UCP support. It searches up the characters, looking for ranges of
-characters in the "other" case. Each call returns the next one, updating the
-start address. A character with multiple other cases is returned on its own
-with a special return value.
-
-Arguments:
- cptr points to starting character value; updated
- d end value
- ocptr where to put start of othercase range
- odptr where to put end of othercase range
-
-Yield: -1 when no more
- 0 when a range is returned
- >0 the CASESET offset for char with multiple other cases
- in this case, ocptr contains the original
-*/
-
-static int
-get_othercase_range(pcre_uint32 *cptr, pcre_uint32 d, pcre_uint32 *ocptr,
- pcre_uint32 *odptr)
-{
-pcre_uint32 c, othercase, next;
-unsigned int co;
-
-/* Find the first character that has an other case. If it has multiple other
-cases, return its case offset value. */
-
-for (c = *cptr; c <= d; c++)
- {
- if ((co = UCD_CASESET(c)) != 0)
- {
- *ocptr = c++; /* Character that has the set */
- *cptr = c; /* Rest of input range */
- return (int)co;
- }
- if ((othercase = UCD_OTHERCASE(c)) != c) break;
- }
-
-if (c > d) return -1; /* Reached end of range */
-
-/* Found a character that has a single other case. Search for the end of the
-range, which is either the end of the input range, or a character that has zero
-or more than one other cases. */
-
-*ocptr = othercase;
-next = othercase + 1;
-
-for (++c; c <= d; c++)
- {
- if ((co = UCD_CASESET(c)) != 0 || UCD_OTHERCASE(c) != next) break;
- next++;
- }
-
-*odptr = next - 1; /* End of othercase range */
-*cptr = c; /* Rest of input range */
-return 0;
-}
-#endif /* SUPPORT_UCP */
-
-
-
-/*************************************************
-* Add a character or range to a class *
-*************************************************/
-
-/* This function packages up the logic of adding a character or range of
-characters to a class. The character values in the arguments will be within the
-valid values for the current mode (8-bit, 16-bit, UTF, etc). This function is
-mutually recursive with the function immediately below.
-
-Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cd contains pointers to tables etc.
- start start of range character
- end end of range character
-
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
-*/
-
-static int
-add_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr, int options,
- compile_data *cd, pcre_uint32 start, pcre_uint32 end)
-{
-pcre_uint32 c;
-pcre_uint32 classbits_end = (end <= 0xff ? end : 0xff);
-int n8 = 0;
-
-/* If caseless matching is required, scan the range and process alternate
-cases. In Unicode, there are 8-bit characters that have alternate cases that
-are greater than 255 and vice-versa. Sometimes we can just extend the original
-range. */
-
-if ((options & PCRE_CASELESS) != 0)
- {
-#ifdef SUPPORT_UCP
- if ((options & PCRE_UTF8) != 0)
- {
- int rc;
- pcre_uint32 oc, od;
-
- options &= ~PCRE_CASELESS; /* Remove for recursive calls */
- c = start;
-
- while ((rc = get_othercase_range(&c, end, &oc, &od)) >= 0)
- {
- /* Handle a single character that has more than one other case. */
-
- if (rc > 0) n8 += add_list_to_class(classbits, uchardptr, options, cd,
- PRIV(ucd_caseless_sets) + rc, oc);
-
- /* Do nothing if the other case range is within the original range. */
-
- else if (oc >= start && od <= end) continue;
-
- /* Extend the original range if there is overlap, noting that if oc < c, we
- can't have od > end because a subrange is always shorter than the basic
- range. Otherwise, use a recursive call to add the additional range. */
-
- else if (oc < start && od >= start - 1) start = oc; /* Extend downwards */
- else if (od > end && oc <= end + 1) end = od; /* Extend upwards */
- else n8 += add_to_class(classbits, uchardptr, options, cd, oc, od);
- }
- }
- else
-#endif /* SUPPORT_UCP */
-
- /* Not UTF-mode, or no UCP */
-
- for (c = start; c <= classbits_end; c++)
- {
- SETBIT(classbits, cd->fcc[c]);
- n8++;
- }
- }
-
-/* Now handle the original range. Adjust the final value according to the bit
-length - this means that the same lists of (e.g.) horizontal spaces can be used
-in all cases. */
-
-#if defined COMPILE_PCRE8
-#ifdef SUPPORT_UTF
- if ((options & PCRE_UTF8) == 0)
-#endif
- if (end > 0xff) end = 0xff;
-
-#elif defined COMPILE_PCRE16
-#ifdef SUPPORT_UTF
- if ((options & PCRE_UTF16) == 0)
-#endif
- if (end > 0xffff) end = 0xffff;
-
-#endif /* COMPILE_PCRE[8|16] */
-
-/* Use the bitmap for characters < 256. Otherwise use extra data.*/
-
-for (c = start; c <= classbits_end; c++)
- {
- /* Regardless of start, c will always be <= 255. */
- SETBIT(classbits, c);
- n8++;
- }
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
-if (start <= 0xff) start = 0xff + 1;
-
-if (end >= start)
- {
- pcre_uchar *uchardata = *uchardptr;
-#ifdef SUPPORT_UTF
- if ((options & PCRE_UTF8) != 0) /* All UTFs use the same flag bit */
- {
- if (start < end)
- {
- *uchardata++ = XCL_RANGE;
- uchardata += PRIV(ord2utf)(start, uchardata);
- uchardata += PRIV(ord2utf)(end, uchardata);
- }
- else if (start == end)
- {
- *uchardata++ = XCL_SINGLE;
- uchardata += PRIV(ord2utf)(start, uchardata);
- }
- }
- else
-#endif /* SUPPORT_UTF */
-
- /* Without UTF support, character values are constrained by the bit length,
- and can only be > 256 for 16-bit and 32-bit libraries. */
-
-#ifdef COMPILE_PCRE8
- {}
-#else
- if (start < end)
- {
- *uchardata++ = XCL_RANGE;
- *uchardata++ = start;
- *uchardata++ = end;
- }
- else if (start == end)
- {
- *uchardata++ = XCL_SINGLE;
- *uchardata++ = start;
- }
-#endif
-
- *uchardptr = uchardata; /* Updata extra data pointer */
- }
-#endif /* SUPPORT_UTF || !COMPILE_PCRE8 */
-
-return n8; /* Number of 8-bit characters */
-}
-
-
-
-
-/*************************************************
-* Add a list of characters to a class *
-*************************************************/
-
-/* This function is used for adding a list of case-equivalent characters to a
-class, and also for adding a list of horizontal or vertical whitespace. If the
-list is in order (which it should be), ranges of characters are detected and
-handled appropriately. This function is mutually recursive with the function
-above.
-
-Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cd contains pointers to tables etc.
- p points to row of 32-bit values, terminated by NOTACHAR
- except character to omit; this is used when adding lists of
- case-equivalent characters to avoid including the one we
- already know about
-
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
-*/
-
-static int
-add_list_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr, int options,
- compile_data *cd, const pcre_uint32 *p, unsigned int except)
-{
-int n8 = 0;
-while (p[0] < NOTACHAR)
- {
- int n = 0;
- if (p[0] != except)
- {
- while(p[n+1] == p[0] + n + 1) n++;
- n8 += add_to_class(classbits, uchardptr, options, cd, p[0], p[n]);
- }
- p += n + 1;
- }
-return n8;
-}
-
-
-
-/*************************************************
-* Add characters not in a list to a class *
-*************************************************/
-
-/* This function is used for adding the complement of a list of horizontal or
-vertical whitespace to a class. The list must be in order.
-
-Arguments:
- classbits the bit map for characters < 256
- uchardptr points to the pointer for extra data
- options the options word
- cd contains pointers to tables etc.
- p points to row of 32-bit values, terminated by NOTACHAR
-
-Returns: the number of < 256 characters added
- the pointer to extra data is updated
-*/
-
-static int
-add_not_list_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr,
- int options, compile_data *cd, const pcre_uint32 *p)
-{
-BOOL utf = (options & PCRE_UTF8) != 0;
-int n8 = 0;
-if (p[0] > 0)
- n8 += add_to_class(classbits, uchardptr, options, cd, 0, p[0] - 1);
-while (p[0] < NOTACHAR)
- {
- while (p[1] == p[0] + 1) p++;
- n8 += add_to_class(classbits, uchardptr, options, cd, p[0] + 1,
- (p[1] == NOTACHAR) ? (utf ? 0x10ffffu : 0xffffffffu) : p[1] - 1);
- p++;
- }
-return n8;
-}
-
-
-
-/*************************************************
-* Compile one branch *
-*************************************************/
-
-/* Scan the pattern, compiling it into the a vector. If the options are
-changed during the branch, the pointer is used to change the external options
-bits. This function is used during the pre-compile phase when we are trying
-to find out the amount of memory needed, as well as during the real compile
-phase. The value of lengthptr distinguishes the two phases.
-
-Arguments:
- optionsptr pointer to the option bits
- codeptr points to the pointer to the current code point
- ptrptr points to the current pattern pointer
- errorcodeptr points to error code variable
- firstcharptr place to put the first required character
- firstcharflagsptr place to put the first character flags, or a negative number
- reqcharptr place to put the last required character
- reqcharflagsptr place to put the last required character flags, or a negative number
- bcptr points to current branch chain
- cond_depth conditional nesting depth
- cd contains pointers to tables etc.
- lengthptr NULL during the real compile phase
- points to length accumulator during pre-compile phase
-
-Returns: TRUE on success
- FALSE, with *errorcodeptr set non-zero on error
-*/
-
-static BOOL
-compile_branch(int *optionsptr, pcre_uchar **codeptr,
- const pcre_uchar **ptrptr, int *errorcodeptr,
- pcre_uint32 *firstcharptr, pcre_int32 *firstcharflagsptr,
- pcre_uint32 *reqcharptr, pcre_int32 *reqcharflagsptr,
- branch_chain *bcptr, int cond_depth,
- compile_data *cd, int *lengthptr)
-{
-int repeat_type, op_type;
-int repeat_min = 0, repeat_max = 0; /* To please picky compilers */
-int bravalue = 0;
-int greedy_default, greedy_non_default;
-pcre_uint32 firstchar, reqchar;
-pcre_int32 firstcharflags, reqcharflags;
-pcre_uint32 zeroreqchar, zerofirstchar;
-pcre_int32 zeroreqcharflags, zerofirstcharflags;
-pcre_int32 req_caseopt, reqvary, tempreqvary;
-int options = *optionsptr; /* May change dynamically */
-int after_manual_callout = 0;
-int length_prevgroup = 0;
-register pcre_uint32 c;
-int escape;
-register pcre_uchar *code = *codeptr;
-pcre_uchar *last_code = code;
-pcre_uchar *orig_code = code;
-pcre_uchar *tempcode;
-BOOL inescq = FALSE;
-BOOL groupsetfirstchar = FALSE;
-const pcre_uchar *ptr = *ptrptr;
-const pcre_uchar *tempptr;
-const pcre_uchar *nestptr = NULL;
-pcre_uchar *previous = NULL;
-pcre_uchar *previous_callout = NULL;
-pcre_uchar *save_hwm = NULL;
-pcre_uint8 classbits[32];
-
-/* We can fish out the UTF-8 setting once and for all into a BOOL, but we
-must not do this for other options (e.g. PCRE_EXTENDED) because they may change
-dynamically as we process the pattern. */
-
-#ifdef SUPPORT_UTF
-/* PCRE_UTF[16|32] have the same value as PCRE_UTF8. */
-BOOL utf = (options & PCRE_UTF8) != 0;
-#ifndef COMPILE_PCRE32
-pcre_uchar utf_chars[6];
-#endif
-#else
-BOOL utf = FALSE;
-#endif
-
-/* Helper variables for OP_XCLASS opcode (for characters > 255). We define
-class_uchardata always so that it can be passed to add_to_class() always,
-though it will not be used in non-UTF 8-bit cases. This avoids having to supply
-alternative calls for the different cases. */
-
-pcre_uchar *class_uchardata;
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
-BOOL xclass;
-pcre_uchar *class_uchardata_base;
-#endif
-
-#ifdef PCRE_DEBUG
-if (lengthptr != NULL) DPRINTF((">> start branch\n"));
-#endif
-
-/* Set up the default and non-default settings for greediness */
-
-greedy_default = ((options & PCRE_UNGREEDY) != 0);
-greedy_non_default = greedy_default ^ 1;
-
-/* Initialize no first byte, no required byte. REQ_UNSET means "no char
-matching encountered yet". It gets changed to REQ_NONE if we hit something that
-matches a non-fixed char first char; reqchar just remains unset if we never
-find one.
-
-When we hit a repeat whose minimum is zero, we may have to adjust these values
-to take the zero repeat into account. This is implemented by setting them to
-zerofirstbyte and zeroreqchar when such a repeat is encountered. The individual
-item types that can be repeated set these backoff variables appropriately. */
-
-firstchar = reqchar = zerofirstchar = zeroreqchar = 0;
-firstcharflags = reqcharflags = zerofirstcharflags = zeroreqcharflags = REQ_UNSET;
-
-/* The variable req_caseopt contains either the REQ_CASELESS value
-or zero, according to the current setting of the caseless flag. The
-REQ_CASELESS leaves the lower 28 bit empty. It is added into the
-firstchar or reqchar variables to record the case status of the
-value. This is used only for ASCII characters. */
-
-req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
-
-/* Switch on next character until the end of the branch */
-
-for (;; ptr++)
- {
- BOOL negate_class;
- BOOL should_flip_negation;
- BOOL possessive_quantifier;
- BOOL is_quantifier;
- BOOL is_recurse;
- BOOL reset_bracount;
- int class_has_8bitchar;
- int class_one_char;
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- BOOL xclass_has_prop;
-#endif
- int newoptions;
- int recno;
- int refsign;
- int skipbytes;
- pcre_uint32 subreqchar, subfirstchar;
- pcre_int32 subreqcharflags, subfirstcharflags;
- int terminator;
- unsigned int mclength;
- unsigned int tempbracount;
- pcre_uint32 ec;
- pcre_uchar mcbuffer[8];
-
- /* Get next character in the pattern */
-
- c = *ptr;
-
- /* If we are at the end of a nested substitution, revert to the outer level
- string. Nesting only happens one level deep. */
-
- if (c == CHAR_NULL && nestptr != NULL)
- {
- ptr = nestptr;
- nestptr = NULL;
- c = *ptr;
- }
-
- /* If we are in the pre-compile phase, accumulate the length used for the
- previous cycle of this loop. */
-
- if (lengthptr != NULL)
- {
-#ifdef PCRE_DEBUG
- if (code > cd->hwm) cd->hwm = code; /* High water info */
-#endif
- if (code > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN) /* Check for overrun */
- {
- *errorcodeptr = ERR52;
- goto FAILED;
- }
-
- /* There is at least one situation where code goes backwards: this is the
- case of a zero quantifier after a class (e.g. [ab]{0}). At compile time,
- the class is simply eliminated. However, it is created first, so we have to
- allow memory for it. Therefore, don't ever reduce the length at this point.
- */
-
- if (code < last_code) code = last_code;
-
- /* Paranoid check for integer overflow */
-
- if (OFLOW_MAX - *lengthptr < code - last_code)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
-
- *lengthptr += (int)(code - last_code);
- DPRINTF(("length=%d added %d c=%c (0x%x)\n", *lengthptr,
- (int)(code - last_code), c, c));
-
- /* If "previous" is set and it is not at the start of the work space, move
- it back to there, in order to avoid filling up the work space. Otherwise,
- if "previous" is NULL, reset the current code pointer to the start. */
-
- if (previous != NULL)
- {
- if (previous > orig_code)
- {
- memmove(orig_code, previous, IN_UCHARS(code - previous));
- code -= previous - orig_code;
- previous = orig_code;
- }
- }
- else code = orig_code;
-
- /* Remember where this code item starts so we can pick up the length
- next time round. */
-
- last_code = code;
- }
-
- /* In the real compile phase, just check the workspace used by the forward
- reference list. */
-
- else if (cd->hwm > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN)
- {
- *errorcodeptr = ERR52;
- goto FAILED;
- }
-
- /* If in \Q...\E, check for the end; if not, we have a literal */
-
- if (inescq && c != CHAR_NULL)
- {
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E)
- {
- inescq = FALSE;
- ptr++;
- continue;
- }
- else
- {
- if (previous_callout != NULL)
- {
- if (lengthptr == NULL) /* Don't attempt in pre-compile phase */
- complete_callout(previous_callout, ptr, cd);
- previous_callout = NULL;
- }
- if ((options & PCRE_AUTO_CALLOUT) != 0)
- {
- previous_callout = code;
- code = auto_callout(code, ptr, cd);
- }
- goto NORMAL_CHAR;
- }
- /* Control does not reach here. */
- }
-
- /* In extended mode, skip white space and comments. We need a loop in order
- to check for more white space and more comments after a comment. */
-
- if ((options & PCRE_EXTENDED) != 0)
- {
- for (;;)
- {
- while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr);
- if (c != CHAR_NUMBER_SIGN) break;
- ptr++;
- while (*ptr != CHAR_NULL)
- {
- if (IS_NEWLINE(ptr)) /* For non-fixed-length newline cases, */
- { /* IS_NEWLINE sets cd->nllen. */
- ptr += cd->nllen;
- break;
- }
- ptr++;
-#ifdef SUPPORT_UTF
- if (utf) FORWARDCHAR(ptr);
-#endif
- }
- c = *ptr; /* Either NULL or the char after a newline */
- }
- }
-
- /* See if the next thing is a quantifier. */
-
- is_quantifier =
- c == CHAR_ASTERISK || c == CHAR_PLUS || c == CHAR_QUESTION_MARK ||
- (c == CHAR_LEFT_CURLY_BRACKET && is_counted_repeat(ptr+1));
-
- /* Fill in length of a previous callout, except when the next thing is a
- quantifier or when processing a property substitution string in UCP mode. */
-
- if (!is_quantifier && previous_callout != NULL && nestptr == NULL &&
- after_manual_callout-- <= 0)
- {
- if (lengthptr == NULL) /* Don't attempt in pre-compile phase */
- complete_callout(previous_callout, ptr, cd);
- previous_callout = NULL;
- }
-
- /* Create auto callout, except for quantifiers, or while processing property
- strings that are substituted for \w etc in UCP mode. */
-
- if ((options & PCRE_AUTO_CALLOUT) != 0 && !is_quantifier && nestptr == NULL)
- {
- previous_callout = code;
- code = auto_callout(code, ptr, cd);
- }
-
- /* Process the next pattern item. */
-
- switch(c)
- {
- /* ===================================================================*/
- case CHAR_NULL: /* The branch terminates at string end */
- case CHAR_VERTICAL_LINE: /* or | or ) */
- case CHAR_RIGHT_PARENTHESIS:
- *firstcharptr = firstchar;
- *firstcharflagsptr = firstcharflags;
- *reqcharptr = reqchar;
- *reqcharflagsptr = reqcharflags;
- *codeptr = code;
- *ptrptr = ptr;
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < code - last_code)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += (int)(code - last_code); /* To include callout length */
- DPRINTF((">> end branch\n"));
- }
- return TRUE;
-
-
- /* ===================================================================*/
- /* Handle single-character metacharacters. In multiline mode, ^ disables
- the setting of any following char as a first character. */
-
- case CHAR_CIRCUMFLEX_ACCENT:
- previous = NULL;
- if ((options & PCRE_MULTILINE) != 0)
- {
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- *code++ = OP_CIRCM;
- }
- else *code++ = OP_CIRC;
- break;
-
- case CHAR_DOLLAR_SIGN:
- previous = NULL;
- *code++ = ((options & PCRE_MULTILINE) != 0)? OP_DOLLM : OP_DOLL;
- break;
-
- /* There can never be a first char if '.' is first, whatever happens about
- repeats. The value of reqchar doesn't change either. */
-
- case CHAR_DOT:
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
- previous = code;
- *code++ = ((options & PCRE_DOTALL) != 0)? OP_ALLANY: OP_ANY;
- break;
-
-
- /* ===================================================================*/
- /* Character classes. If the included characters are all < 256, we build a
- 32-byte bitmap of the permitted characters, except in the special case
- where there is only one such character. For negated classes, we build the
- map as usual, then invert it at the end. However, we use a different opcode
- so that data characters > 255 can be handled correctly.
-
- If the class contains characters outside the 0-255 range, a different
- opcode is compiled. It may optionally have a bit map for characters < 256,
- but those above are are explicitly listed afterwards. A flag byte tells
- whether the bitmap is present, and whether this is a negated class or not.
-
- In JavaScript compatibility mode, an isolated ']' causes an error. In
- default (Perl) mode, it is treated as a data character. */
-
- case CHAR_RIGHT_SQUARE_BRACKET:
- if ((cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- *errorcodeptr = ERR64;
- goto FAILED;
- }
- goto NORMAL_CHAR;
-
- /* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
- used for "start of word" and "end of word". As these are otherwise illegal
- sequences, we don't break anything by recognizing them. They are replaced
- by \b(?=\w) and \b(?<=\w) respectively. Sequences like [a[:<:]] are
- erroneous and are handled by the normal code below. */
-
- case CHAR_LEFT_SQUARE_BRACKET:
- if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
- {
- nestptr = ptr + 7;
- ptr = sub_start_of_word - 1;
- continue;
- }
-
- if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
- {
- nestptr = ptr + 7;
- ptr = sub_end_of_word - 1;
- continue;
- }
-
- /* Handle a real character class. */
-
- previous = code;
-
- /* PCRE supports POSIX class stuff inside a class. Perl gives an error if
- they are encountered at the top level, so we'll do that too. */
-
- if ((ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) &&
- check_posix_syntax(ptr, &tempptr))
- {
- *errorcodeptr = (ptr[1] == CHAR_COLON)? ERR13 : ERR31;
- goto FAILED;
- }
-
- /* If the first character is '^', set the negation flag and skip it. Also,
- if the first few characters (either before or after ^) are \Q\E or \E we
- skip them too. This makes for compatibility with Perl. */
-
- negate_class = FALSE;
- for (;;)
- {
- c = *(++ptr);
- if (c == CHAR_BACKSLASH)
- {
- if (ptr[1] == CHAR_E)
- ptr++;
- else if (STRNCMP_UC_C8(ptr + 1, STR_Q STR_BACKSLASH STR_E, 3) == 0)
- ptr += 3;
- else
- break;
- }
- else if (!negate_class && c == CHAR_CIRCUMFLEX_ACCENT)
- negate_class = TRUE;
- else break;
- }
-
- /* Empty classes are allowed in JavaScript compatibility mode. Otherwise,
- an initial ']' is taken as a data character -- the code below handles
- that. In JS mode, [] must always fail, so generate OP_FAIL, whereas
- [^] must match any character, so generate OP_ALLANY. */
-
- if (c == CHAR_RIGHT_SQUARE_BRACKET &&
- (cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0)
- {
- *code++ = negate_class? OP_ALLANY : OP_FAIL;
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- break;
- }
-
- /* If a class contains a negative special such as \S, we need to flip the
- negation flag at the end, so that support for characters > 255 works
- correctly (they are all included in the class). */
-
- should_flip_negation = FALSE;
-
- /* Extended class (xclass) will be used when characters > 255
- might match. */
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- xclass = FALSE;
- class_uchardata = code + LINK_SIZE + 2; /* For XCLASS items */
- class_uchardata_base = class_uchardata; /* Save the start */
-#endif
-
- /* For optimization purposes, we track some properties of the class:
- class_has_8bitchar will be non-zero if the class contains at least one <
- 256 character; class_one_char will be 1 if the class contains just one
- character; xclass_has_prop will be TRUE if unicode property checks
- are present in the class. */
-
- class_has_8bitchar = 0;
- class_one_char = 0;
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- xclass_has_prop = FALSE;
-#endif
-
- /* Initialize the 32-char bit map to all zeros. We build the map in a
- temporary bit of memory, in case the class contains fewer than two
- 8-bit characters because in that case the compiled code doesn't use the bit
- map. */
-
- memset(classbits, 0, 32 * sizeof(pcre_uint8));
-
- /* Process characters until ] is reached. By writing this as a "do" it
- means that an initial ] is taken as a data character. At the start of the
- loop, c contains the first byte of the character. */
-
- if (c != CHAR_NULL) do
- {
- const pcre_uchar *oldptr;
-
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(c))
- { /* Braces are required because the */
- GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */
- }
-#endif
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- /* In the pre-compile phase, accumulate the length of any extra
- data and reset the pointer. This is so that very large classes that
- contain a zillion > 255 characters no longer overwrite the work space
- (which is on the stack). We have to remember that there was XCLASS data,
- however. */
-
- if (lengthptr != NULL && class_uchardata > class_uchardata_base)
- {
- xclass = TRUE;
- *lengthptr += class_uchardata - class_uchardata_base;
- class_uchardata = class_uchardata_base;
- }
-#endif
-
- /* Inside \Q...\E everything is literal except \E */
-
- if (inescq)
- {
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E) /* If we are at \E */
- {
- inescq = FALSE; /* Reset literal state */
- ptr++; /* Skip the 'E' */
- continue; /* Carry on with next */
- }
- goto CHECK_RANGE; /* Could be range if \E follows */
- }
-
- /* Handle POSIX class names. Perl allows a negation extension of the
- form [:^name:]. A square bracket that doesn't match the syntax is
- treated as a literal. We also recognize the POSIX constructions
- [.ch.] and [=ch=] ("collating elements") and fault them, as Perl
- 5.6 and 5.8 do. */
-
- if (c == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) && check_posix_syntax(ptr, &tempptr))
- {
- BOOL local_negate = FALSE;
- int posix_class, taboffset, tabopt;
- register const pcre_uint8 *cbits = cd->cbits;
- pcre_uint8 pbits[32];
-
- if (ptr[1] != CHAR_COLON)
- {
- *errorcodeptr = ERR31;
- goto FAILED;
- }
-
- ptr += 2;
- if (*ptr == CHAR_CIRCUMFLEX_ACCENT)
- {
- local_negate = TRUE;
- should_flip_negation = TRUE; /* Note negative special */
- ptr++;
- }
-
- posix_class = check_posix_name(ptr, (int)(tempptr - ptr));
- if (posix_class < 0)
- {
- *errorcodeptr = ERR30;
- goto FAILED;
- }
-
- /* If matching is caseless, upper and lower are converted to
- alpha. This relies on the fact that the class table starts with
- alpha, lower, upper as the first 3 entries. */
-
- if ((options & PCRE_CASELESS) != 0 && posix_class <= 2)
- posix_class = 0;
-
- /* When PCRE_UCP is set, some of the POSIX classes are converted to
- different escape sequences that use Unicode properties \p or \P. Others
- that are not available via \p or \P generate XCL_PROP/XCL_NOTPROP
- directly. */
-
-#ifdef SUPPORT_UCP
- if ((options & PCRE_UCP) != 0)
- {
- unsigned int ptype = 0;
- int pc = posix_class + ((local_negate)? POSIX_SUBSIZE/2 : 0);
-
- /* The posix_substitutes table specifies which POSIX classes can be
- converted to \p or \P items. */
-
- if (posix_substitutes[pc] != NULL)
- {
- nestptr = tempptr + 1;
- ptr = posix_substitutes[pc] - 1;
- continue;
- }
-
- /* There are three other classes that generate special property calls
- that are recognized only in an XCLASS. */
-
- else switch(posix_class)
- {
- case PC_GRAPH:
- ptype = PT_PXGRAPH;
- /* Fall through */
- case PC_PRINT:
- if (ptype == 0) ptype = PT_PXPRINT;
- /* Fall through */
- case PC_PUNCT:
- if (ptype == 0) ptype = PT_PXPUNCT;
- *class_uchardata++ = local_negate? XCL_NOTPROP : XCL_PROP;
- *class_uchardata++ = ptype;
- *class_uchardata++ = 0;
- xclass_has_prop = TRUE;
- ptr = tempptr + 1;
- continue;
-
- /* For all other POSIX classes, no special action is taken in UCP
- mode. Fall through to the non_UCP case. */
-
- default:
- break;
- }
- }
-#endif
- /* In the non-UCP case, or when UCP makes no difference, we build the
- bit map for the POSIX class in a chunk of local store because we may be
- adding and subtracting from it, and we don't want to subtract bits that
- may be in the main map already. At the end we or the result into the
- bit map that is being built. */
-
- posix_class *= 3;
-
- /* Copy in the first table (always present) */
-
- memcpy(pbits, cbits + posix_class_maps[posix_class],
- 32 * sizeof(pcre_uint8));
-
- /* If there is a second table, add or remove it as required. */
-
- taboffset = posix_class_maps[posix_class + 1];
- tabopt = posix_class_maps[posix_class + 2];
-
- if (taboffset >= 0)
- {
- if (tabopt >= 0)
- for (c = 0; c < 32; c++) pbits[c] |= cbits[c + taboffset];
- else
- for (c = 0; c < 32; c++) pbits[c] &= ~cbits[c + taboffset];
- }
-
- /* Now see if we need to remove any special characters. An option
- value of 1 removes vertical space and 2 removes underscore. */
-
- if (tabopt < 0) tabopt = -tabopt;
- if (tabopt == 1) pbits[1] &= ~0x3c;
- else if (tabopt == 2) pbits[11] &= 0x7f;
-
- /* Add the POSIX table or its complement into the main table that is
- being built and we are done. */
-
- if (local_negate)
- for (c = 0; c < 32; c++) classbits[c] |= ~pbits[c];
- else
- for (c = 0; c < 32; c++) classbits[c] |= pbits[c];
-
- ptr = tempptr + 1;
- /* Every class contains at least one < 256 character. */
- class_has_8bitchar = 1;
- /* Every class contains at least two characters. */
- class_one_char = 2;
- continue; /* End of POSIX syntax handling */
- }
-
- /* Backslash may introduce a single character, or it may introduce one
- of the specials, which just set a flag. The sequence \b is a special
- case. Inside a class (and only there) it is treated as backspace. We
- assume that other escapes have more than one character in them, so
- speculatively set both class_has_8bitchar and class_one_char bigger
- than one. Unrecognized escapes fall through and are either treated
- as literal characters (by default), or are faulted if
- PCRE_EXTRA is set. */
-
- if (c == CHAR_BACKSLASH)
- {
- escape = check_escape(&ptr, &ec, errorcodeptr, cd->bracount, options,
- TRUE);
- if (*errorcodeptr != 0) goto FAILED;
- if (escape == 0) c = ec;
- else if (escape == ESC_b) c = CHAR_BS; /* \b is backspace in a class */
- else if (escape == ESC_N) /* \N is not supported in a class */
- {
- *errorcodeptr = ERR71;
- goto FAILED;
- }
- else if (escape == ESC_Q) /* Handle start of quoted string */
- {
- if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
- {
- ptr += 2; /* avoid empty string */
- }
- else inescq = TRUE;
- continue;
- }
- else if (escape == ESC_E) continue; /* Ignore orphan \E */
-
- else
- {
- register const pcre_uint8 *cbits = cd->cbits;
- /* Every class contains at least two < 256 characters. */
- class_has_8bitchar++;
- /* Every class contains at least two characters. */
- class_one_char += 2;
-
- switch (escape)
- {
-#ifdef SUPPORT_UCP
- case ESC_du: /* These are the values given for \d etc */
- case ESC_DU: /* when PCRE_UCP is set. We replace the */
- case ESC_wu: /* escape sequence with an appropriate \p */
- case ESC_WU: /* or \P to test Unicode properties instead */
- case ESC_su: /* of the default ASCII testing. */
- case ESC_SU:
- nestptr = ptr;
- ptr = substitutes[escape - ESC_DU] - 1; /* Just before substitute */
- class_has_8bitchar--; /* Undo! */
- continue;
-#endif
- case ESC_d:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_digit];
- continue;
-
- case ESC_D:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit];
- continue;
-
- case ESC_w:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_word];
- continue;
-
- case ESC_W:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word];
- continue;
-
- /* Perl 5.004 onwards omitted VT from \s, but restored it at Perl
- 5.18. Before PCRE 8.34, we had to preserve the VT bit if it was
- previously set by something earlier in the character class.
- Luckily, the value of CHAR_VT is 0x0b in both ASCII and EBCDIC, so
- we could just adjust the appropriate bit. From PCRE 8.34 we no
- longer treat \s and \S specially. */
-
- case ESC_s:
- for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_space];
- continue;
-
- case ESC_S:
- should_flip_negation = TRUE;
- for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space];
- continue;
-
- /* The rest apply in both UCP and non-UCP cases. */
-
- case ESC_h:
- (void)add_list_to_class(classbits, &class_uchardata, options, cd,
- PRIV(hspace_list), NOTACHAR);
- continue;
-
- case ESC_H:
- (void)add_not_list_to_class(classbits, &class_uchardata, options,
- cd, PRIV(hspace_list));
- continue;
-
- case ESC_v:
- (void)add_list_to_class(classbits, &class_uchardata, options, cd,
- PRIV(vspace_list), NOTACHAR);
- continue;
-
- case ESC_V:
- (void)add_not_list_to_class(classbits, &class_uchardata, options,
- cd, PRIV(vspace_list));
- continue;
-
-#ifdef SUPPORT_UCP
- case ESC_p:
- case ESC_P:
- {
- BOOL negated;
- unsigned int ptype = 0, pdata = 0;
- if (!get_ucp(&ptr, &negated, &ptype, &pdata, errorcodeptr))
- goto FAILED;
- *class_uchardata++ = ((escape == ESC_p) != negated)?
- XCL_PROP : XCL_NOTPROP;
- *class_uchardata++ = ptype;
- *class_uchardata++ = pdata;
- xclass_has_prop = TRUE;
- class_has_8bitchar--; /* Undo! */
- continue;
- }
-#endif
- /* Unrecognized escapes are faulted if PCRE is running in its
- strict mode. By default, for compatibility with Perl, they are
- treated as literals. */
-
- default:
- if ((options & PCRE_EXTRA) != 0)
- {
- *errorcodeptr = ERR7;
- goto FAILED;
- }
- class_has_8bitchar--; /* Undo the speculative increase. */
- class_one_char -= 2; /* Undo the speculative increase. */
- c = *ptr; /* Get the final character and fall through */
- break;
- }
- }
-
- /* Fall through if the escape just defined a single character (c >= 0).
- This may be greater than 256. */
-
- escape = 0;
-
- } /* End of backslash handling */
-
- /* A character may be followed by '-' to form a range. However, Perl does
- not permit ']' to be the end of the range. A '-' character at the end is
- treated as a literal. Perl ignores orphaned \E sequences entirely. The
- code for handling \Q and \E is messy. */
-
- CHECK_RANGE:
- while (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
- {
- inescq = FALSE;
- ptr += 2;
- }
- oldptr = ptr;
-
- /* Remember if \r or \n were explicitly used */
-
- if (c == CHAR_CR || c == CHAR_NL) cd->external_flags |= PCRE_HASCRORLF;
-
- /* Check for range */
-
- if (!inescq && ptr[1] == CHAR_MINUS)
- {
- pcre_uint32 d;
- ptr += 2;
- while (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_E) ptr += 2;
-
- /* If we hit \Q (not followed by \E) at this point, go into escaped
- mode. */
-
- while (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_Q)
- {
- ptr += 2;
- if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_E)
- { ptr += 2; continue; }
- inescq = TRUE;
- break;
- }
-
- /* Minus (hyphen) at the end of a class is treated as a literal, so put
- back the pointer and jump to handle the character that preceded it. */
-
- if (*ptr == CHAR_NULL || (!inescq && *ptr == CHAR_RIGHT_SQUARE_BRACKET))
- {
- ptr = oldptr;
- goto CLASS_SINGLE_CHARACTER;
- }
-
- /* Otherwise, we have a potential range; pick up the next character */
-
-#ifdef SUPPORT_UTF
- if (utf)
- { /* Braces are required because the */
- GETCHARLEN(d, ptr, ptr); /* macro generates multiple statements */
- }
- else
-#endif
- d = *ptr; /* Not UTF-8 mode */
-
- /* The second part of a range can be a single-character escape
- sequence, but not any of the other escapes. Perl treats a hyphen as a
- literal in such circumstances. However, in Perl's warning mode, a
- warning is given, so PCRE now faults it as it is almost certainly a
- mistake on the user's part. */
-
- if (!inescq)
- {
- if (d == CHAR_BACKSLASH)
- {
- int descape;
- descape = check_escape(&ptr, &d, errorcodeptr, cd->bracount, options, TRUE);
- if (*errorcodeptr != 0) goto FAILED;
-
- /* 0 means a character was put into d; \b is backspace; any other
- special causes an error. */
-
- if (descape != 0)
- {
- if (descape == ESC_b) d = CHAR_BS; else
- {
- *errorcodeptr = ERR83;
- goto FAILED;
- }
- }
- }
-
- /* A hyphen followed by a POSIX class is treated in the same way. */
-
- else if (d == CHAR_LEFT_SQUARE_BRACKET &&
- (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT ||
- ptr[1] == CHAR_EQUALS_SIGN) &&
- check_posix_syntax(ptr, &tempptr))
- {
- *errorcodeptr = ERR83;
- goto FAILED;
- }
- }
-
- /* Check that the two values are in the correct order. Optimize
- one-character ranges. */
-
- if (d < c)
- {
- *errorcodeptr = ERR8;
- goto FAILED;
- }
- if (d == c) goto CLASS_SINGLE_CHARACTER; /* A few lines below */
-
- /* We have found a character range, so single character optimizations
- cannot be done anymore. Any value greater than 1 indicates that there
- is more than one character. */
-
- class_one_char = 2;
-
- /* Remember an explicit \r or \n, and add the range to the class. */
-
- if (d == CHAR_CR || d == CHAR_NL) cd->external_flags |= PCRE_HASCRORLF;
-
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cd, c, d);
-
- continue; /* Go get the next char in the class */
- }
-
- /* Handle a single character - we can get here for a normal non-escape
- char, or after \ that introduces a single character or for an apparent
- range that isn't. Only the value 1 matters for class_one_char, so don't
- increase it if it is already 2 or more ... just in case there's a class
- with a zillion characters in it. */
-
- CLASS_SINGLE_CHARACTER:
- if (class_one_char < 2) class_one_char++;
-
- /* If class_one_char is 1, we have the first single character in the
- class, and there have been no prior ranges, or XCLASS items generated by
- escapes. If this is the final character in the class, we can optimize by
- turning the item into a 1-character OP_CHAR[I] if it's positive, or
- OP_NOT[I] if it's negative. In the positive case, it can cause firstchar
- to be set. Otherwise, there can be no first char if this item is first,
- whatever repeat count may follow. In the case of reqchar, save the
- previous value for reinstating. */
-
- if (class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
- {
- ptr++;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
-
- if (negate_class)
- {
-#ifdef SUPPORT_UCP
- int d;
-#endif
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
-
- /* For caseless UTF-8 mode when UCP support is available, check
- whether this character has more than one other case. If so, generate
- a special OP_NOTPROP item instead of OP_NOTI. */
-
-#ifdef SUPPORT_UCP
- if (utf && (options & PCRE_CASELESS) != 0 &&
- (d = UCD_CASESET(c)) != 0)
- {
- *code++ = OP_NOTPROP;
- *code++ = PT_CLIST;
- *code++ = d;
- }
- else
-#endif
- /* Char has only one other case, or UCP not available */
-
- {
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_NOTI: OP_NOT;
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR)
- code += PRIV(ord2utf)(c, code);
- else
-#endif
- *code++ = c;
- }
-
- /* We are finished with this character class */
-
- goto END_CLASS;
- }
-
- /* For a single, positive character, get the value into mcbuffer, and
- then we can handle this with the normal one-character code. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR)
- mclength = PRIV(ord2utf)(c, mcbuffer);
- else
-#endif
- {
- mcbuffer[0] = c;
- mclength = 1;
- }
- goto ONE_CHAR;
- } /* End of 1-char optimization */
-
- /* There is more than one character in the class, or an XCLASS item
- has been generated. Add this character to the class. */
-
- class_has_8bitchar +=
- add_to_class(classbits, &class_uchardata, options, cd, c, c);
- }
-
- /* Loop until ']' reached. This "while" is the end of the "do" far above.
- If we are at the end of an internal nested string, revert to the outer
- string. */
-
- while (((c = *(++ptr)) != CHAR_NULL ||
- (nestptr != NULL &&
- (ptr = nestptr, nestptr = NULL, c = *(++ptr)) != CHAR_NULL)) &&
- (c != CHAR_RIGHT_SQUARE_BRACKET || inescq));
-
- /* Check for missing terminating ']' */
-
- if (c == CHAR_NULL)
- {
- *errorcodeptr = ERR6;
- goto FAILED;
- }
-
- /* We will need an XCLASS if data has been placed in class_uchardata. In
- the second phase this is a sufficient test. However, in the pre-compile
- phase, class_uchardata gets emptied to prevent workspace overflow, so it
- only if the very last character in the class needs XCLASS will it contain
- anything at this point. For this reason, xclass gets set TRUE above when
- uchar_classdata is emptied, and that's why this code is the way it is here
- instead of just doing a test on class_uchardata below. */
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- if (class_uchardata > class_uchardata_base) xclass = TRUE;
-#endif
-
- /* If this is the first thing in the branch, there can be no first char
- setting, whatever the repeat count. Any reqchar setting must remain
- unchanged after any kind of repeat. */
-
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
-
- /* If there are characters with values > 255, we have to compile an
- extended class, with its own opcode, unless there was a negated special
- such as \S in the class, and PCRE_UCP is not set, because in that case all
- characters > 255 are in the class, so any that were explicitly given as
- well can be ignored. If (when there are explicit characters > 255 that must
- be listed) there are no characters < 256, we can omit the bitmap in the
- actual compiled code. */
-
-#ifdef SUPPORT_UTF
- if (xclass && (!should_flip_negation || (options & PCRE_UCP) != 0))
-#elif !defined COMPILE_PCRE8
- if (xclass && !should_flip_negation)
-#endif
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- {
- *class_uchardata++ = XCL_END; /* Marks the end of extra data */
- *code++ = OP_XCLASS;
- code += LINK_SIZE;
- *code = negate_class? XCL_NOT:0;
- if (xclass_has_prop) *code |= XCL_HASPROP;
-
- /* If the map is required, move up the extra data to make room for it;
- otherwise just move the code pointer to the end of the extra data. */
-
- if (class_has_8bitchar > 0)
- {
- *code++ |= XCL_MAP;
- memmove(code + (32 / sizeof(pcre_uchar)), code,
- IN_UCHARS(class_uchardata - code));
- if (negate_class && !xclass_has_prop)
- for (c = 0; c < 32; c++) classbits[c] = ~classbits[c];
- memcpy(code, classbits, 32);
- code = class_uchardata + (32 / sizeof(pcre_uchar));
- }
- else code = class_uchardata;
-
- /* Now fill in the complete length of the item */
-
- PUT(previous, 1, (int)(code - previous));
- break; /* End of class handling */
- }
-#endif
-
- /* If there are no characters > 255, or they are all to be included or
- excluded, set the opcode to OP_CLASS or OP_NCLASS, depending on whether the
- whole class was negated and whether there were negative specials such as \S
- (non-UCP) in the class. Then copy the 32-byte map into the code vector,
- negating it if necessary. */
-
- *code++ = (negate_class == should_flip_negation) ? OP_CLASS : OP_NCLASS;
- if (lengthptr == NULL) /* Save time in the pre-compile phase */
- {
- if (negate_class)
- for (c = 0; c < 32; c++) classbits[c] = ~classbits[c];
- memcpy(code, classbits, 32);
- }
- code += 32 / sizeof(pcre_uchar);
-
- END_CLASS:
- break;
-
-
- /* ===================================================================*/
- /* Various kinds of repeat; '{' is not necessarily a quantifier, but this
- has been tested above. */
-
- case CHAR_LEFT_CURLY_BRACKET:
- if (!is_quantifier) goto NORMAL_CHAR;
- ptr = read_repeat_counts(ptr+1, &repeat_min, &repeat_max, errorcodeptr);
- if (*errorcodeptr != 0) goto FAILED;
- goto REPEAT;
-
- case CHAR_ASTERISK:
- repeat_min = 0;
- repeat_max = -1;
- goto REPEAT;
-
- case CHAR_PLUS:
- repeat_min = 1;
- repeat_max = -1;
- goto REPEAT;
-
- case CHAR_QUESTION_MARK:
- repeat_min = 0;
- repeat_max = 1;
-
- REPEAT:
- if (previous == NULL)
- {
- *errorcodeptr = ERR9;
- goto FAILED;
- }
-
- if (repeat_min == 0)
- {
- firstchar = zerofirstchar; /* Adjust for zero repeat */
- firstcharflags = zerofirstcharflags;
- reqchar = zeroreqchar; /* Ditto */
- reqcharflags = zeroreqcharflags;
- }
-
- /* Remember whether this is a variable length repeat */
-
- reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY;
-
- op_type = 0; /* Default single-char op codes */
- possessive_quantifier = FALSE; /* Default not possessive quantifier */
-
- /* Save start of previous item, in case we have to move it up in order to
- insert something before it. */
-
- tempcode = previous;
-
- /* Before checking for a possessive quantifier, we must skip over
- whitespace and comments in extended mode because Perl allows white space at
- this point. */
-
- if ((options & PCRE_EXTENDED) != 0)
- {
- const pcre_uchar *p = ptr + 1;
- for (;;)
- {
- while (MAX_255(*p) && (cd->ctypes[*p] & ctype_space) != 0) p++;
- if (*p != CHAR_NUMBER_SIGN) break;
- p++;
- while (*p != CHAR_NULL)
- {
- if (IS_NEWLINE(p)) /* For non-fixed-length newline cases, */
- { /* IS_NEWLINE sets cd->nllen. */
- p += cd->nllen;
- break;
- }
- p++;
-#ifdef SUPPORT_UTF
- if (utf) FORWARDCHAR(p);
-#endif
- } /* Loop for comment characters */
- } /* Loop for multiple comments */
- ptr = p - 1; /* Character before the next significant one. */
- }
-
- /* If the next character is '+', we have a possessive quantifier. This
- implies greediness, whatever the setting of the PCRE_UNGREEDY option.
- If the next character is '?' this is a minimizing repeat, by default,
- but if PCRE_UNGREEDY is set, it works the other way round. We change the
- repeat type to the non-default. */
-
- if (ptr[1] == CHAR_PLUS)
- {
- repeat_type = 0; /* Force greedy */
- possessive_quantifier = TRUE;
- ptr++;
- }
- else if (ptr[1] == CHAR_QUESTION_MARK)
- {
- repeat_type = greedy_non_default;
- ptr++;
- }
- else repeat_type = greedy_default;
-
- /* If previous was a recursion call, wrap it in atomic brackets so that
- previous becomes the atomic group. All recursions were so wrapped in the
- past, but it no longer happens for non-repeated recursions. In fact, the
- repeated ones could be re-implemented independently so as not to need this,
- but for the moment we rely on the code for repeating groups. */
-
- if (*previous == OP_RECURSE)
- {
- memmove(previous + 1 + LINK_SIZE, previous, IN_UCHARS(1 + LINK_SIZE));
- *previous = OP_ONCE;
- PUT(previous, 1, 2 + 2*LINK_SIZE);
- previous[2 + 2*LINK_SIZE] = OP_KET;
- PUT(previous, 3 + 2*LINK_SIZE, 2 + 2*LINK_SIZE);
- code += 2 + 2 * LINK_SIZE;
- length_prevgroup = 3 + 3*LINK_SIZE;
-
- /* When actually compiling, we need to check whether this was a forward
- reference, and if so, adjust the offset. */
-
- if (lengthptr == NULL && cd->hwm >= cd->start_workspace + LINK_SIZE)
- {
- int offset = GET(cd->hwm, -LINK_SIZE);
- if (offset == previous + 1 - cd->start_code)
- PUT(cd->hwm, -LINK_SIZE, offset + 1 + LINK_SIZE);
- }
- }
-
- /* Now handle repetition for the different types of item. */
-
- /* If previous was a character or negated character match, abolish the item
- and generate a repeat item instead. If a char item has a minimum of more
- than one, ensure that it is set in reqchar - it might not be if a sequence
- such as x{3} is the first thing in a branch because the x will have gone
- into firstchar instead. */
-
- if (*previous == OP_CHAR || *previous == OP_CHARI
- || *previous == OP_NOT || *previous == OP_NOTI)
- {
- switch (*previous)
- {
- default: /* Make compiler happy. */
- case OP_CHAR: op_type = OP_STAR - OP_STAR; break;
- case OP_CHARI: op_type = OP_STARI - OP_STAR; break;
- case OP_NOT: op_type = OP_NOTSTAR - OP_STAR; break;
- case OP_NOTI: op_type = OP_NOTSTARI - OP_STAR; break;
- }
-
- /* Deal with UTF characters that take up more than one character. It's
- easier to write this out separately than try to macrify it. Use c to
- hold the length of the character in bytes, plus UTF_LENGTH to flag that
- it's a length rather than a small character. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && NOT_FIRSTCHAR(code[-1]))
- {
- pcre_uchar *lastchar = code - 1;
- BACKCHAR(lastchar);
- c = (int)(code - lastchar); /* Length of UTF-8 character */
- memcpy(utf_chars, lastchar, IN_UCHARS(c)); /* Save the char */
- c |= UTF_LENGTH; /* Flag c as a length */
- }
- else
-#endif /* SUPPORT_UTF */
-
- /* Handle the case of a single charater - either with no UTF support, or
- with UTF disabled, or for a single character UTF character. */
- {
- c = code[-1];
- if (*previous <= OP_CHARI && repeat_min > 1)
- {
- reqchar = c;
- reqcharflags = req_caseopt | cd->req_varyopt;
- }
- }
-
- goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */
- }
-
- /* If previous was a character type match (\d or similar), abolish it and
- create a suitable repeat item. The code is shared with single-character
- repeats by setting op_type to add a suitable offset into repeat_type. Note
- the the Unicode property types will be present only when SUPPORT_UCP is
- defined, but we don't wrap the little bits of code here because it just
- makes it horribly messy. */
-
- else if (*previous < OP_EODN)
- {
- pcre_uchar *oldcode;
- int prop_type, prop_value;
- op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */
- c = *previous;
-
- OUTPUT_SINGLE_REPEAT:
- if (*previous == OP_PROP || *previous == OP_NOTPROP)
- {
- prop_type = previous[1];
- prop_value = previous[2];
- }
- else prop_type = prop_value = -1;
-
- oldcode = code;
- code = previous; /* Usually overwrite previous item */
-
- /* If the maximum is zero then the minimum must also be zero; Perl allows
- this case, so we do too - by simply omitting the item altogether. */
-
- if (repeat_max == 0) goto END_REPEAT;
-
- /* Combine the op_type with the repeat_type */
-
- repeat_type += op_type;
-
- /* A minimum of zero is handled either as the special case * or ?, or as
- an UPTO, with the maximum given. */
-
- if (repeat_min == 0)
- {
- if (repeat_max == -1) *code++ = OP_STAR + repeat_type;
- else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type;
- else
- {
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max);
- }
- }
-
- /* A repeat minimum of 1 is optimized into some special cases. If the
- maximum is unlimited, we use OP_PLUS. Otherwise, the original item is
- left in place and, if the maximum is greater than 1, we use OP_UPTO with
- one less than the maximum. */
-
- else if (repeat_min == 1)
- {
- if (repeat_max == -1)
- *code++ = OP_PLUS + repeat_type;
- else
- {
- code = oldcode; /* leave previous item in place */
- if (repeat_max == 1) goto END_REPEAT;
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max - 1);
- }
- }
-
- /* The case {n,n} is just an EXACT, while the general case {n,m} is
- handled as an EXACT followed by an UPTO. */
-
- else
- {
- *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */
- PUT2INC(code, 0, repeat_min);
-
- /* If the maximum is unlimited, insert an OP_STAR. Before doing so,
- we have to insert the character for the previous code. For a repeated
- Unicode property match, there are two extra bytes that define the
- required property. In UTF-8 mode, long characters have their length in
- c, with the UTF_LENGTH bit as a flag. */
-
- if (repeat_max < 0)
- {
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && (c & UTF_LENGTH) != 0)
- {
- memcpy(code, utf_chars, IN_UCHARS(c & 7));
- code += c & 7;
- }
- else
-#endif
- {
- *code++ = c;
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
- }
- *code++ = OP_STAR + repeat_type;
- }
-
- /* Else insert an UPTO if the max is greater than the min, again
- preceded by the character, for the previously inserted code. If the
- UPTO is just for 1 instance, we can use QUERY instead. */
-
- else if (repeat_max != repeat_min)
- {
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && (c & UTF_LENGTH) != 0)
- {
- memcpy(code, utf_chars, IN_UCHARS(c & 7));
- code += c & 7;
- }
- else
-#endif
- *code++ = c;
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
- repeat_max -= repeat_min;
-
- if (repeat_max == 1)
- {
- *code++ = OP_QUERY + repeat_type;
- }
- else
- {
- *code++ = OP_UPTO + repeat_type;
- PUT2INC(code, 0, repeat_max);
- }
- }
- }
-
- /* The character or character type itself comes last in all cases. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && (c & UTF_LENGTH) != 0)
- {
- memcpy(code, utf_chars, IN_UCHARS(c & 7));
- code += c & 7;
- }
- else
-#endif
- *code++ = c;
-
- /* For a repeated Unicode property match, there are two extra bytes that
- define the required property. */
-
-#ifdef SUPPORT_UCP
- if (prop_type >= 0)
- {
- *code++ = prop_type;
- *code++ = prop_value;
- }
-#endif
- }
-
- /* If previous was a character class or a back reference, we put the repeat
- stuff after it, but just skip the item if the repeat was {0,0}. */
-
- else if (*previous == OP_CLASS || *previous == OP_NCLASS ||
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- *previous == OP_XCLASS ||
-#endif
- *previous == OP_REF || *previous == OP_REFI ||
- *previous == OP_DNREF || *previous == OP_DNREFI)
- {
- if (repeat_max == 0)
- {
- code = previous;
- goto END_REPEAT;
- }
-
- if (repeat_min == 0 && repeat_max == -1)
- *code++ = OP_CRSTAR + repeat_type;
- else if (repeat_min == 1 && repeat_max == -1)
- *code++ = OP_CRPLUS + repeat_type;
- else if (repeat_min == 0 && repeat_max == 1)
- *code++ = OP_CRQUERY + repeat_type;
- else
- {
- *code++ = OP_CRRANGE + repeat_type;
- PUT2INC(code, 0, repeat_min);
- if (repeat_max == -1) repeat_max = 0; /* 2-byte encoding for max */
- PUT2INC(code, 0, repeat_max);
- }
- }
-
- /* If previous was a bracket group, we may have to replicate it in certain
- cases. Note that at this point we can encounter only the "basic" bracket
- opcodes such as BRA and CBRA, as this is the place where they get converted
- into the more special varieties such as BRAPOS and SBRA. A test for >=
- OP_ASSERT and <= OP_COND includes ASSERT, ASSERT_NOT, ASSERTBACK,
- ASSERTBACK_NOT, ONCE, ONCE_NC, BRA, BRAPOS, CBRA, CBRAPOS, and COND.
- Originally, PCRE did not allow repetition of assertions, but now it does,
- for Perl compatibility. */
-
- else if (*previous >= OP_ASSERT && *previous <= OP_COND)
- {
- register int i;
- int len = (int)(code - previous);
- pcre_uchar *bralink = NULL;
- pcre_uchar *brazeroptr = NULL;
-
- /* Repeating a DEFINE group is pointless, but Perl allows the syntax, so
- we just ignore the repeat. */
-
- if (*previous == OP_COND && previous[LINK_SIZE+1] == OP_DEF)
- goto END_REPEAT;
-
- /* There is no sense in actually repeating assertions. The only potential
- use of repetition is in cases when the assertion is optional. Therefore,
- if the minimum is greater than zero, just ignore the repeat. If the
- maximum is not zero or one, set it to 1. */
-
- if (*previous < OP_ONCE) /* Assertion */
- {
- if (repeat_min > 0) goto END_REPEAT;
- if (repeat_max < 0 || repeat_max > 1) repeat_max = 1;
- }
-
- /* The case of a zero minimum is special because of the need to stick
- OP_BRAZERO in front of it, and because the group appears once in the
- data, whereas in other cases it appears the minimum number of times. For
- this reason, it is simplest to treat this case separately, as otherwise
- the code gets far too messy. There are several special subcases when the
- minimum is zero. */
-
- if (repeat_min == 0)
- {
- /* If the maximum is also zero, we used to just omit the group from the
- output altogether, like this:
-
- ** if (repeat_max == 0)
- ** {
- ** code = previous;
- ** goto END_REPEAT;
- ** }
-
- However, that fails when a group or a subgroup within it is referenced
- as a subroutine from elsewhere in the pattern, so now we stick in
- OP_SKIPZERO in front of it so that it is skipped on execution. As we
- don't have a list of which groups are referenced, we cannot do this
- selectively.
-
- If the maximum is 1 or unlimited, we just have to stick in the BRAZERO
- and do no more at this point. However, we do need to adjust any
- OP_RECURSE calls inside the group that refer to the group itself or any
- internal or forward referenced group, because the offset is from the
- start of the whole regex. Temporarily terminate the pattern while doing
- this. */
-
- if (repeat_max <= 1) /* Covers 0, 1, and unlimited */
- {
- *code = OP_END;
- adjust_recurse(previous, 1, utf, cd, save_hwm);
- memmove(previous + 1, previous, IN_UCHARS(len));
- code++;
- if (repeat_max == 0)
- {
- *previous++ = OP_SKIPZERO;
- goto END_REPEAT;
- }
- brazeroptr = previous; /* Save for possessive optimizing */
- *previous++ = OP_BRAZERO + repeat_type;
- }
-
- /* If the maximum is greater than 1 and limited, we have to replicate
- in a nested fashion, sticking OP_BRAZERO before each set of brackets.
- The first one has to be handled carefully because it's the original
- copy, which has to be moved up. The remainder can be handled by code
- that is common with the non-zero minimum case below. We have to
- adjust the value or repeat_max, since one less copy is required. Once
- again, we may have to adjust any OP_RECURSE calls inside the group. */
-
- else
- {
- int offset;
- *code = OP_END;
- adjust_recurse(previous, 2 + LINK_SIZE, utf, cd, save_hwm);
- memmove(previous + 2 + LINK_SIZE, previous, IN_UCHARS(len));
- code += 2 + LINK_SIZE;
- *previous++ = OP_BRAZERO + repeat_type;
- *previous++ = OP_BRA;
-
- /* We chain together the bracket offset fields that have to be
- filled in later when the ends of the brackets are reached. */
-
- offset = (bralink == NULL)? 0 : (int)(previous - bralink);
- bralink = previous;
- PUTINC(previous, 0, offset);
- }
-
- repeat_max--;
- }
-
- /* If the minimum is greater than zero, replicate the group as many
- times as necessary, and adjust the maximum to the number of subsequent
- copies that we need. If we set a first char from the group, and didn't
- set a required char, copy the latter from the former. If there are any
- forward reference subroutine calls in the group, there will be entries on
- the workspace list; replicate these with an appropriate increment. */
-
- else
- {
- if (repeat_min > 1)
- {
- /* In the pre-compile phase, we don't actually do the replication. We
- just adjust the length as if we had. Do some paranoid checks for
- potential integer overflow. The INT64_OR_DOUBLE type is a 64-bit
- integer type when available, otherwise double. */
-
- if (lengthptr != NULL)
- {
- int delta = (repeat_min - 1)*length_prevgroup;
- if ((INT64_OR_DOUBLE)(repeat_min - 1)*
- (INT64_OR_DOUBLE)length_prevgroup >
- (INT64_OR_DOUBLE)INT_MAX ||
- OFLOW_MAX - *lengthptr < delta)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += delta;
- }
-
- /* This is compiling for real. If there is a set first byte for
- the group, and we have not yet set a "required byte", set it. Make
- sure there is enough workspace for copying forward references before
- doing the copy. */
-
- else
- {
- if (groupsetfirstchar && reqcharflags < 0)
- {
- reqchar = firstchar;
- reqcharflags = firstcharflags;
- }
-
- for (i = 1; i < repeat_min; i++)
- {
- pcre_uchar *hc;
- pcre_uchar *this_hwm = cd->hwm;
- memcpy(code, previous, IN_UCHARS(len));
-
- while (cd->hwm > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN - (this_hwm - save_hwm))
- {
- int save_offset = save_hwm - cd->start_workspace;
- int this_offset = this_hwm - cd->start_workspace;
- *errorcodeptr = expand_workspace(cd);
- if (*errorcodeptr != 0) goto FAILED;
- save_hwm = (pcre_uchar *)cd->start_workspace + save_offset;
- this_hwm = (pcre_uchar *)cd->start_workspace + this_offset;
- }
-
- for (hc = save_hwm; hc < this_hwm; hc += LINK_SIZE)
- {
- PUT(cd->hwm, 0, GET(hc, 0) + len);
- cd->hwm += LINK_SIZE;
- }
- save_hwm = this_hwm;
- code += len;
- }
- }
- }
-
- if (repeat_max > 0) repeat_max -= repeat_min;
- }
-
- /* This code is common to both the zero and non-zero minimum cases. If
- the maximum is limited, it replicates the group in a nested fashion,
- remembering the bracket starts on a stack. In the case of a zero minimum,
- the first one was set up above. In all cases the repeat_max now specifies
- the number of additional copies needed. Again, we must remember to
- replicate entries on the forward reference list. */
-
- if (repeat_max >= 0)
- {
- /* In the pre-compile phase, we don't actually do the replication. We
- just adjust the length as if we had. For each repetition we must add 1
- to the length for BRAZERO and for all but the last repetition we must
- add 2 + 2*LINKSIZE to allow for the nesting that occurs. Do some
- paranoid checks to avoid integer overflow. The INT64_OR_DOUBLE type is
- a 64-bit integer type when available, otherwise double. */
-
- if (lengthptr != NULL && repeat_max > 0)
- {
- int delta = repeat_max * (length_prevgroup + 1 + 2 + 2*LINK_SIZE) -
- 2 - 2*LINK_SIZE; /* Last one doesn't nest */
- if ((INT64_OR_DOUBLE)repeat_max *
- (INT64_OR_DOUBLE)(length_prevgroup + 1 + 2 + 2*LINK_SIZE)
- > (INT64_OR_DOUBLE)INT_MAX ||
- OFLOW_MAX - *lengthptr < delta)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += delta;
- }
-
- /* This is compiling for real */
-
- else for (i = repeat_max - 1; i >= 0; i--)
- {
- pcre_uchar *hc;
- pcre_uchar *this_hwm = cd->hwm;
-
- *code++ = OP_BRAZERO + repeat_type;
-
- /* All but the final copy start a new nesting, maintaining the
- chain of brackets outstanding. */
-
- if (i != 0)
- {
- int offset;
- *code++ = OP_BRA;
- offset = (bralink == NULL)? 0 : (int)(code - bralink);
- bralink = code;
- PUTINC(code, 0, offset);
- }
-
- memcpy(code, previous, IN_UCHARS(len));
-
- /* Ensure there is enough workspace for forward references before
- copying them. */
-
- while (cd->hwm > cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN - (this_hwm - save_hwm))
- {
- int save_offset = save_hwm - cd->start_workspace;
- int this_offset = this_hwm - cd->start_workspace;
- *errorcodeptr = expand_workspace(cd);
- if (*errorcodeptr != 0) goto FAILED;
- save_hwm = (pcre_uchar *)cd->start_workspace + save_offset;
- this_hwm = (pcre_uchar *)cd->start_workspace + this_offset;
- }
-
- for (hc = save_hwm; hc < this_hwm; hc += LINK_SIZE)
- {
- PUT(cd->hwm, 0, GET(hc, 0) + len + ((i != 0)? 2+LINK_SIZE : 1));
- cd->hwm += LINK_SIZE;
- }
- save_hwm = this_hwm;
- code += len;
- }
-
- /* Now chain through the pending brackets, and fill in their length
- fields (which are holding the chain links pro tem). */
-
- while (bralink != NULL)
- {
- int oldlinkoffset;
- int offset = (int)(code - bralink + 1);
- pcre_uchar *bra = code - offset;
- oldlinkoffset = GET(bra, 1);
- bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset;
- *code++ = OP_KET;
- PUTINC(code, 0, offset);
- PUT(bra, 1, offset);
- }
- }
-
- /* 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.
-
- 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.]
-
- 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 pcre_exec(). 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
- atomic brackets, does not happen. When the minimum is greater than 1,
- there will be earlier copies of the group, and so we still have to wrap
- the whole thing. */
-
- else
- {
- pcre_uchar *ketcode = code - 1 - LINK_SIZE;
- pcre_uchar *bracode = ketcode - GET(ketcode, 1);
-
- /* Convert possessive ONCE brackets to non-capturing */
-
- if ((*bracode == OP_ONCE || *bracode == OP_ONCE_NC) &&
- possessive_quantifier) *bracode = OP_BRA;
-
- /* For non-possessive ONCE brackets, all we need to do is to
- set the KET. */
-
- if (*bracode == OP_ONCE || *bracode == OP_ONCE_NC)
- *ketcode = OP_KETRMAX + repeat_type;
-
- /* Handle non-ONCE brackets and possessive ONCEs (which have been
- converted to non-capturing above). */
-
- else
- {
- /* In the compile phase, check for empty string matching. */
-
- if (lengthptr == NULL)
- {
- pcre_uchar *scode = bracode;
- do
- {
- if (could_be_empty_branch(scode, ketcode, utf, cd, NULL))
- {
- *bracode += OP_SBRA - OP_BRA;
- break;
- }
- scode += GET(scode, 1);
- }
- while (*scode == OP_ALT);
- }
-
- /* Handle possessive quantifiers. */
-
- if (possessive_quantifier)
- {
- /* For COND brackets, we wrap the whole thing in a possessively
- repeated non-capturing bracket, because we have not invented POS
- versions of the COND opcodes. Because we are moving code along, we
- must ensure that any pending recursive references are updated. */
-
- if (*bracode == OP_COND || *bracode == OP_SCOND)
- {
- int nlen = (int)(code - bracode);
- *code = OP_END;
- adjust_recurse(bracode, 1 + LINK_SIZE, utf, cd, save_hwm);
- memmove(bracode + 1 + LINK_SIZE, bracode, IN_UCHARS(nlen));
- code += 1 + LINK_SIZE;
- nlen += 1 + LINK_SIZE;
- *bracode = OP_BRAPOS;
- *code++ = OP_KETRPOS;
- PUTINC(code, 0, nlen);
- PUT(bracode, 1, nlen);
- }
-
- /* For non-COND brackets, we modify the BRA code and use KETRPOS. */
-
- else
- {
- *bracode += 1; /* Switch to xxxPOS opcodes */
- *ketcode = OP_KETRPOS;
- }
-
- /* If the minimum is zero, mark it as possessive, then unset the
- possessive flag when the minimum is 0 or 1. */
-
- if (brazeroptr != NULL) *brazeroptr = OP_BRAPOSZERO;
- if (repeat_min < 2) possessive_quantifier = FALSE;
- }
-
- /* Non-possessive quantifier */
-
- else *ketcode = OP_KETRMAX + repeat_type;
- }
- }
- }
-
- /* If previous is OP_FAIL, it was generated by an empty class [] in
- JavaScript mode. The other ways in which OP_FAIL can be generated, that is
- by (*FAIL) or (?!) set previous to NULL, which gives a "nothing to repeat"
- error above. We can just ignore the repeat in JS case. */
-
- else if (*previous == OP_FAIL) goto END_REPEAT;
-
- /* Else there's some kind of shambles */
-
- else
- {
- *errorcodeptr = ERR11;
- goto FAILED;
- }
-
- /* If the character following a repeat is '+', possessive_quantifier is
- TRUE. For some opcodes, there are special alternative opcodes for this
- case. For anything else, we wrap the entire repeated item inside OP_ONCE
- brackets. Logically, the '+' notation is just syntactic sugar, taken from
- Sun's Java package, but the special opcodes can optimize it.
-
- Some (but not all) possessively repeated subpatterns have already been
- completely handled in the code just above. For them, possessive_quantifier
- is always FALSE at this stage. Note that the repeated item starts at
- tempcode, not at previous, which might be the first part of a string whose
- (former) last char we repeated. */
-
- if (possessive_quantifier)
- {
- int len;
-
- /* Possessifying an EXACT quantifier has no effect, so we can ignore it.
- However, QUERY, STAR, or UPTO may follow (for quantifiers such as {5,6},
- {5,}, or {5,10}). We skip over an EXACT item; if the length of what
- remains is greater than zero, there's a further opcode that can be
- handled. If not, do nothing, leaving the EXACT alone. */
-
- switch(*tempcode)
- {
- case OP_TYPEEXACT:
- tempcode += PRIV(OP_lengths)[*tempcode] +
- ((tempcode[1 + IMM2_SIZE] == OP_PROP
- || tempcode[1 + IMM2_SIZE] == OP_NOTPROP)? 2 : 0);
- break;
-
- /* CHAR opcodes are used for exacts whose count is 1. */
-
- case OP_CHAR:
- case OP_CHARI:
- case OP_NOT:
- case OP_NOTI:
- case OP_EXACT:
- case OP_EXACTI:
- case OP_NOTEXACT:
- case OP_NOTEXACTI:
- tempcode += PRIV(OP_lengths)[*tempcode];
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(tempcode[-1]))
- tempcode += GET_EXTRALEN(tempcode[-1]);
-#endif
- break;
-
- /* For the class opcodes, the repeat operator appears at the end;
- adjust tempcode to point to it. */
-
- case OP_CLASS:
- case OP_NCLASS:
- tempcode += 1 + 32/sizeof(pcre_uchar);
- break;
-
-#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
- case OP_XCLASS:
- tempcode += GET(tempcode, 1);
- break;
-#endif
- }
-
- /* If tempcode is equal to code (which points to the end of the repeated
- item), it means we have skipped an EXACT item but there is no following
- QUERY, STAR, or UPTO; the value of len will be 0, and we do nothing. In
- all other cases, tempcode will be pointing to the repeat opcode, and will
- be less than code, so the value of len will be greater than 0. */
-
- len = (int)(code - tempcode);
- if (len > 0)
- {
- unsigned int repcode = *tempcode;
-
- /* There is a table for possessifying opcodes, all of which are less
- than OP_CALLOUT. A zero entry means there is no possessified version.
- */
-
- if (repcode < OP_CALLOUT && opcode_possessify[repcode] > 0)
- *tempcode = opcode_possessify[repcode];
-
- /* For opcode without a special possessified version, wrap the item in
- ONCE brackets. Because we are moving code along, we must ensure that any
- pending recursive references are updated. */
-
- else
- {
- *code = OP_END;
- adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, save_hwm);
- memmove(tempcode + 1 + LINK_SIZE, tempcode, IN_UCHARS(len));
- code += 1 + LINK_SIZE;
- len += 1 + LINK_SIZE;
- tempcode[0] = OP_ONCE;
- *code++ = OP_KET;
- PUTINC(code, 0, len);
- PUT(tempcode, 1, len);
- }
- }
-
-#ifdef NEVER
- if (len > 0) switch (*tempcode)
- {
- case OP_STAR: *tempcode = OP_POSSTAR; break;
- case OP_PLUS: *tempcode = OP_POSPLUS; break;
- case OP_QUERY: *tempcode = OP_POSQUERY; break;
- case OP_UPTO: *tempcode = OP_POSUPTO; break;
-
- case OP_STARI: *tempcode = OP_POSSTARI; break;
- case OP_PLUSI: *tempcode = OP_POSPLUSI; break;
- case OP_QUERYI: *tempcode = OP_POSQUERYI; break;
- case OP_UPTOI: *tempcode = OP_POSUPTOI; break;
-
- case OP_NOTSTAR: *tempcode = OP_NOTPOSSTAR; break;
- case OP_NOTPLUS: *tempcode = OP_NOTPOSPLUS; break;
- case OP_NOTQUERY: *tempcode = OP_NOTPOSQUERY; break;
- case OP_NOTUPTO: *tempcode = OP_NOTPOSUPTO; break;
-
- case OP_NOTSTARI: *tempcode = OP_NOTPOSSTARI; break;
- case OP_NOTPLUSI: *tempcode = OP_NOTPOSPLUSI; break;
- case OP_NOTQUERYI: *tempcode = OP_NOTPOSQUERYI; break;
- case OP_NOTUPTOI: *tempcode = OP_NOTPOSUPTOI; break;
-
- case OP_TYPESTAR: *tempcode = OP_TYPEPOSSTAR; break;
- case OP_TYPEPLUS: *tempcode = OP_TYPEPOSPLUS; break;
- case OP_TYPEQUERY: *tempcode = OP_TYPEPOSQUERY; break;
- case OP_TYPEUPTO: *tempcode = OP_TYPEPOSUPTO; break;
-
- case OP_CRSTAR: *tempcode = OP_CRPOSSTAR; break;
- case OP_CRPLUS: *tempcode = OP_CRPOSPLUS; break;
- case OP_CRQUERY: *tempcode = OP_CRPOSQUERY; break;
- case OP_CRRANGE: *tempcode = OP_CRPOSRANGE; break;
-
- /* Because we are moving code along, we must ensure that any
- pending recursive references are updated. */
-
- default:
- *code = OP_END;
- adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, save_hwm);
- memmove(tempcode + 1 + LINK_SIZE, tempcode, IN_UCHARS(len));
- code += 1 + LINK_SIZE;
- len += 1 + LINK_SIZE;
- tempcode[0] = OP_ONCE;
- *code++ = OP_KET;
- PUTINC(code, 0, len);
- PUT(tempcode, 1, len);
- break;
- }
-#endif
- }
-
- /* In all case we no longer have a previous item. We also set the
- "follows varying string" flag for subsequently encountered reqchars if
- it isn't already set and we have just passed a varying length item. */
-
- END_REPEAT:
- previous = NULL;
- cd->req_varyopt |= reqvary;
- break;
-
-
- /* ===================================================================*/
- /* Start of nested parenthesized sub-expression, or comment or lookahead or
- lookbehind or option setting or condition or all the other extended
- parenthesis forms. */
-
- case CHAR_LEFT_PARENTHESIS:
- newoptions = options;
- skipbytes = 0;
- bravalue = OP_CBRA;
- save_hwm = cd->hwm;
- reset_bracount = FALSE;
-
- /* First deal with various "verbs" that can be introduced by '*'. */
-
- ptr++;
- if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':'
- || (MAX_255(ptr[1]) && ((cd->ctypes[ptr[1]] & ctype_letter) != 0))))
- {
- int i, namelen;
- int arglen = 0;
- const char *vn = verbnames;
- const pcre_uchar *name = ptr + 1;
- const pcre_uchar *arg = NULL;
- previous = NULL;
- ptr++;
- while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_letter) != 0) ptr++;
- namelen = (int)(ptr - name);
-
- /* It appears that Perl allows any characters whatsoever, other than
- a closing parenthesis, to appear in arguments, so we no longer insist on
- letters, digits, and underscores. */
-
- if (*ptr == CHAR_COLON)
- {
- arg = ++ptr;
- while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
- arglen = (int)(ptr - arg);
- if ((unsigned int)arglen > MAX_MARK)
- {
- *errorcodeptr = ERR75;
- goto FAILED;
- }
- }
-
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR60;
- goto FAILED;
- }
-
- /* Scan the table of verb names */
-
- for (i = 0; i < verbcount; i++)
- {
- if (namelen == verbs[i].len &&
- STRNCMP_UC_C8(name, vn, namelen) == 0)
- {
- int setverb;
-
- /* Check for open captures before ACCEPT and convert it to
- ASSERT_ACCEPT if in an assertion. */
-
- if (verbs[i].op == OP_ACCEPT)
- {
- open_capitem *oc;
- if (arglen != 0)
- {
- *errorcodeptr = ERR59;
- goto FAILED;
- }
- cd->had_accept = TRUE;
- for (oc = cd->open_caps; oc != NULL; oc = oc->next)
- {
- *code++ = OP_CLOSE;
- PUT2INC(code, 0, oc->number);
- }
- setverb = *code++ =
- (cd->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT;
-
- /* Do not set firstchar after *ACCEPT */
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- }
-
- /* Handle other cases with/without an argument */
-
- else if (arglen == 0)
- {
- if (verbs[i].op < 0) /* Argument is mandatory */
- {
- *errorcodeptr = ERR66;
- goto FAILED;
- }
- setverb = *code++ = verbs[i].op;
- }
-
- else
- {
- if (verbs[i].op_arg < 0) /* Argument is forbidden */
- {
- *errorcodeptr = ERR59;
- goto FAILED;
- }
- setverb = *code++ = verbs[i].op_arg;
- *code++ = arglen;
- memcpy(code, arg, IN_UCHARS(arglen));
- code += arglen;
- *code++ = 0;
- }
-
- switch (setverb)
- {
- case OP_THEN:
- case OP_THEN_ARG:
- cd->external_flags |= PCRE_HASTHEN;
- break;
-
- case OP_PRUNE:
- case OP_PRUNE_ARG:
- case OP_SKIP:
- case OP_SKIP_ARG:
- cd->had_pruneorskip = TRUE;
- break;
- }
-
- break; /* Found verb, exit loop */
- }
-
- vn += verbs[i].len + 1;
- }
-
- if (i < verbcount) continue; /* Successfully handled a verb */
- *errorcodeptr = ERR60; /* Verb not recognized */
- goto FAILED;
- }
-
- /* Deal with the extended parentheses; all are introduced by '?', and the
- appearance of any of them means that this is not a capturing group. */
-
- else if (*ptr == CHAR_QUESTION_MARK)
- {
- int i, set, unset, namelen;
- int *optset;
- const pcre_uchar *name;
- pcre_uchar *slot;
-
- switch (*(++ptr))
- {
- case CHAR_NUMBER_SIGN: /* Comment; skip to ket */
- ptr++;
- while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
- if (*ptr == CHAR_NULL)
- {
- *errorcodeptr = ERR18;
- goto FAILED;
- }
- continue;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_VERTICAL_LINE: /* Reset capture count for each branch */
- reset_bracount = TRUE;
- /* Fall through */
-
- /* ------------------------------------------------------------ */
- case CHAR_COLON: /* Non-capturing bracket */
- bravalue = OP_BRA;
- ptr++;
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_LEFT_PARENTHESIS:
- bravalue = OP_COND; /* Conditional group */
- tempptr = ptr;
-
- /* A condition can be an assertion, a number (referring to a numbered
- group's having been set), a name (referring to a named group), or 'R',
- referring to recursion. R<digits> and R&name are also permitted for
- recursion tests.
-
- There are ways of testing a named group: (?(name)) is used by Python;
- Perl 5.10 onwards uses (?(<name>) or (?('name')).
-
- There is one unfortunate ambiguity, caused by history. 'R' can be the
- recursive thing or the name 'R' (and similarly for 'R' followed by
- digits). We look for a name first; if not found, we try the other case.
-
- For compatibility with auto-callouts, we allow a callout to be
- specified before a condition that is an assertion. First, check for the
- syntax of a callout; if found, adjust the temporary pointer that is
- used to check for an assertion condition. That's all that is needed! */
-
- if (ptr[1] == CHAR_QUESTION_MARK && ptr[2] == CHAR_C)
- {
- for (i = 3;; i++) if (!IS_DIGIT(ptr[i])) break;
- if (ptr[i] == CHAR_RIGHT_PARENTHESIS)
- tempptr += i + 1;
- }
-
- /* For conditions that are assertions, check the syntax, and then exit
- the switch. This will take control down to where bracketed groups,
- including assertions, are processed. */
-
- if (tempptr[1] == CHAR_QUESTION_MARK &&
- (tempptr[2] == CHAR_EQUALS_SIGN ||
- tempptr[2] == CHAR_EXCLAMATION_MARK ||
- tempptr[2] == CHAR_LESS_THAN_SIGN))
- break;
-
- /* Other conditions use OP_CREF/OP_DNCREF/OP_RREF/OP_DNRREF, and all
- need to skip at least 1+IMM2_SIZE bytes at the start of the group. */
-
- code[1+LINK_SIZE] = OP_CREF;
- skipbytes = 1+IMM2_SIZE;
- refsign = -1; /* => not a number */
- namelen = -1; /* => not a name; must set to avoid warning */
- name = NULL; /* Always set to avoid warning */
- recno = 0; /* Always set to avoid warning */
-
- /* Check for a test for recursion in a named group. */
-
- ptr++;
- if (*ptr == CHAR_R && ptr[1] == CHAR_AMPERSAND)
- {
- terminator = -1;
- ptr += 2;
- code[1+LINK_SIZE] = OP_RREF; /* Change the type of test */
- }
-
- /* Check for a test for a named group's having been set, using the Perl
- syntax (?(<name>) or (?('name'), and also allow for the original PCRE
- syntax of (?(name) or for (?(+n), (?(-n), and just (?(n). */
-
- else if (*ptr == CHAR_LESS_THAN_SIGN)
- {
- terminator = CHAR_GREATER_THAN_SIGN;
- ptr++;
- }
- else if (*ptr == CHAR_APOSTROPHE)
- {
- terminator = CHAR_APOSTROPHE;
- ptr++;
- }
- else
- {
- terminator = CHAR_NULL;
- if (*ptr == CHAR_MINUS || *ptr == CHAR_PLUS) refsign = *ptr++;
- else if (IS_DIGIT(*ptr)) refsign = 0;
- }
-
- /* Handle a number */
-
- if (refsign >= 0)
- {
- while (IS_DIGIT(*ptr))
- {
- recno = recno * 10 + (int)(*ptr - CHAR_0);
- ptr++;
- }
- }
-
- /* Otherwise we expect to read a name; anything else is an error. When
- a name is one of a number of duplicates, a different opcode is used and
- it needs more memory. Unfortunately we cannot tell whether a name is a
- duplicate in the first pass, so we have to allow for more memory. */
-
- else
- {
- if (IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR84;
- goto FAILED;
- }
- if (!MAX_255(*ptr) || (cd->ctypes[*ptr] & ctype_word) == 0)
- {
- *errorcodeptr = ERR28; /* Assertion expected */
- goto FAILED;
- }
- name = ptr++;
- while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0)
- {
- ptr++;
- }
- namelen = (int)(ptr - name);
- if (lengthptr != NULL) *lengthptr += IMM2_SIZE;
- }
-
- /* Check the terminator */
-
- if ((terminator > 0 && *ptr++ != (pcre_uchar)terminator) ||
- *ptr++ != CHAR_RIGHT_PARENTHESIS)
- {
- ptr--; /* Error offset */
- *errorcodeptr = ERR26; /* Malformed number or name */
- goto FAILED;
- }
-
- /* Do no further checking in the pre-compile phase. */
-
- if (lengthptr != NULL) break;
-
- /* In the real compile we do the work of looking for the actual
- reference. If refsign is not negative, it means we have a number in
- recno. */
-
- if (refsign >= 0)
- {
- if (recno <= 0)
- {
- *errorcodeptr = ERR35;
- goto FAILED;
- }
- if (refsign != 0) recno = (refsign == CHAR_MINUS)?
- cd->bracount - recno + 1 : recno + cd->bracount;
- if (recno <= 0 || recno > cd->final_bracount)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- PUT2(code, 2+LINK_SIZE, recno);
- break;
- }
-
- /* Otherwise look for the name. */
-
- slot = cd->name_table;
- for (i = 0; i < cd->names_found; i++)
- {
- if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) == 0) break;
- slot += cd->name_entry_size;
- }
-
- /* Found the named subpattern. If the name is duplicated, add one to
- the opcode to change CREF/RREF into DNCREF/DNRREF and insert
- appropriate data values. Otherwise, just insert the unique subpattern
- number. */
-
- if (i < cd->names_found)
- {
- int offset = i++;
- int count = 1;
- recno = GET2(slot, 0); /* Number from first found */
- for (; i < cd->names_found; i++)
- {
- slot += cd->name_entry_size;
- if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) != 0) break;
- count++;
- }
- if (count > 1)
- {
- PUT2(code, 2+LINK_SIZE, offset);
- PUT2(code, 2+LINK_SIZE+IMM2_SIZE, count);
- skipbytes += IMM2_SIZE;
- code[1+LINK_SIZE]++;
- }
- else /* Not a duplicated name */
- {
- PUT2(code, 2+LINK_SIZE, recno);
- }
- }
-
- /* If terminator == CHAR_NULL it means that the name followed directly
- after the opening parenthesis [e.g. (?(abc)...] and in this case there
- are some further alternatives to try. For the cases where terminator !=
- CHAR_NULL [things like (?(<name>... or (?('name')... or (?(R&name)... ]
- we have now checked all the possibilities, so give an error. */
-
- else if (terminator != CHAR_NULL)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
-
- /* Check for (?(R) for recursion. Allow digits after R to specify a
- specific group number. */
-
- else if (*name == CHAR_R)
- {
- recno = 0;
- for (i = 1; i < namelen; i++)
- {
- if (!IS_DIGIT(name[i]))
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- recno = recno * 10 + name[i] - CHAR_0;
- }
- if (recno == 0) recno = RREF_ANY;
- code[1+LINK_SIZE] = OP_RREF; /* Change test type */
- PUT2(code, 2+LINK_SIZE, recno);
- }
-
- /* Similarly, check for the (?(DEFINE) "condition", which is always
- false. */
-
- else if (namelen == 6 && STRNCMP_UC_C8(name, STRING_DEFINE, 6) == 0)
- {
- code[1+LINK_SIZE] = OP_DEF;
- skipbytes = 1;
- }
-
- /* Reference to an unidentified subpattern. */
-
- else
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_EQUALS_SIGN: /* Positive lookahead */
- bravalue = OP_ASSERT;
- cd->assert_depth += 1;
- ptr++;
- break;
-
- /* 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
- this feature. Not that that applies to a quantified (?!) but we allow
- it for uniformity. */
-
- /* ------------------------------------------------------------ */
- case CHAR_EXCLAMATION_MARK: /* Negative lookahead */
- ptr++;
- if (*ptr == CHAR_RIGHT_PARENTHESIS && ptr[1] != CHAR_ASTERISK &&
- ptr[1] != CHAR_PLUS && ptr[1] != CHAR_QUESTION_MARK &&
- (ptr[1] != CHAR_LEFT_CURLY_BRACKET || !is_counted_repeat(ptr+2)))
- {
- *code++ = OP_FAIL;
- previous = NULL;
- continue;
- }
- bravalue = OP_ASSERT_NOT;
- cd->assert_depth += 1;
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_LESS_THAN_SIGN: /* Lookbehind or named define */
- switch (ptr[1])
- {
- case CHAR_EQUALS_SIGN: /* Positive lookbehind */
- bravalue = OP_ASSERTBACK;
- cd->assert_depth += 1;
- ptr += 2;
- break;
-
- case CHAR_EXCLAMATION_MARK: /* Negative lookbehind */
- bravalue = OP_ASSERTBACK_NOT;
- cd->assert_depth += 1;
- ptr += 2;
- break;
-
- default: /* Could be name define, else bad */
- if (MAX_255(ptr[1]) && (cd->ctypes[ptr[1]] & ctype_word) != 0)
- goto DEFINE_NAME;
- ptr++; /* Correct offset for error */
- *errorcodeptr = ERR24;
- goto FAILED;
- }
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_GREATER_THAN_SIGN: /* One-time brackets */
- bravalue = OP_ONCE;
- ptr++;
- break;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_C: /* Callout - may be followed by digits; */
- previous_callout = code; /* Save for later completion */
- after_manual_callout = 1; /* Skip one item before completing */
- *code++ = OP_CALLOUT;
- {
- int n = 0;
- ptr++;
- while(IS_DIGIT(*ptr))
- n = n * 10 + *ptr++ - CHAR_0;
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR39;
- goto FAILED;
- }
- if (n > 255)
- {
- *errorcodeptr = ERR38;
- goto FAILED;
- }
- *code++ = n;
- PUT(code, 0, (int)(ptr - cd->start_pattern + 1)); /* Pattern offset */
- PUT(code, LINK_SIZE, 0); /* Default length */
- code += 2 * LINK_SIZE;
- }
- previous = NULL;
- continue;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_P: /* Python-style named subpattern handling */
- if (*(++ptr) == CHAR_EQUALS_SIGN ||
- *ptr == CHAR_GREATER_THAN_SIGN) /* Reference or recursion */
- {
- is_recurse = *ptr == CHAR_GREATER_THAN_SIGN;
- terminator = CHAR_RIGHT_PARENTHESIS;
- goto NAMED_REF_OR_RECURSE;
- }
- else if (*ptr != CHAR_LESS_THAN_SIGN) /* Test for Python-style defn */
- {
- *errorcodeptr = ERR41;
- goto FAILED;
- }
- /* Fall through to handle (?P< as (?< is handled */
-
-
- /* ------------------------------------------------------------ */
- DEFINE_NAME: /* Come here from (?< handling */
- case CHAR_APOSTROPHE:
- terminator = (*ptr == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE;
- name = ++ptr;
- if (IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR84; /* Group name must start with non-digit */
- goto FAILED;
- }
- while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0) ptr++;
- namelen = (int)(ptr - name);
-
- /* In the pre-compile phase, do a syntax check, remember the longest
- name, and then remember the group in a vector, expanding it if
- necessary. Duplicates for the same number are skipped; other duplicates
- are checked for validity. In the actual compile, there is nothing to
- do. */
-
- if (lengthptr != NULL)
- {
- named_group *ng;
- pcre_uint32 number = cd->bracount + 1;
-
- if (*ptr != (pcre_uchar)terminator)
- {
- *errorcodeptr = ERR42;
- goto FAILED;
- }
-
- if (cd->names_found >= MAX_NAME_COUNT)
- {
- *errorcodeptr = ERR49;
- goto FAILED;
- }
-
- if (namelen + IMM2_SIZE + 1 > cd->name_entry_size)
- {
- cd->name_entry_size = namelen + IMM2_SIZE + 1;
- if (namelen > MAX_NAME_SIZE)
- {
- *errorcodeptr = ERR48;
- goto FAILED;
- }
- }
-
- /* Scan the list to check for duplicates. For duplicate names, if the
- number is the same, break the loop, which causes the name to be
- discarded; otherwise, if DUPNAMES is not set, give an error.
- If it is set, allow the name with a different number, but continue
- scanning in case this is a duplicate with the same number. For
- non-duplicate names, give an error if the number is duplicated. */
-
- ng = cd->named_groups;
- for (i = 0; i < cd->names_found; i++, ng++)
- {
- if (namelen == ng->length &&
- STRNCMP_UC_UC(name, ng->name, namelen) == 0)
- {
- if (ng->number == number) break;
- if ((options & PCRE_DUPNAMES) == 0)
- {
- *errorcodeptr = ERR43;
- goto FAILED;
- }
- cd->dupnames = TRUE; /* Duplicate names exist */
- }
- else if (ng->number == number)
- {
- *errorcodeptr = ERR65;
- goto FAILED;
- }
- }
-
- if (i >= cd->names_found) /* Not a duplicate with same number */
- {
- /* Increase the list size if necessary */
-
- if (cd->names_found >= cd->named_group_list_size)
- {
- int newsize = cd->named_group_list_size * 2;
- named_group *newspace = (PUBL(malloc))
- (newsize * sizeof(named_group));
-
- if (newspace == NULL)
- {
- *errorcodeptr = ERR21;
- goto FAILED;
- }
-
- memcpy(newspace, cd->named_groups,
- cd->named_group_list_size * sizeof(named_group));
- if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
- (PUBL(free))((void *)cd->named_groups);
- cd->named_groups = newspace;
- cd->named_group_list_size = newsize;
- }
-
- cd->named_groups[cd->names_found].name = name;
- cd->named_groups[cd->names_found].length = namelen;
- cd->named_groups[cd->names_found].number = number;
- cd->names_found++;
- }
- }
-
- ptr++; /* Move past > or ' in both passes. */
- goto NUMBERED_GROUP;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_AMPERSAND: /* Perl recursion/subroutine syntax */
- terminator = CHAR_RIGHT_PARENTHESIS;
- is_recurse = TRUE;
- /* Fall through */
-
- /* We come here from the Python syntax above that handles both
- references (?P=name) and recursion (?P>name), as well as falling
- through from the Perl recursion syntax (?&name). We also come here from
- the Perl \k<name> or \k'name' back reference syntax and the \k{name}
- .NET syntax, and the Oniguruma \g<...> and \g'...' subroutine syntax. */
-
- NAMED_REF_OR_RECURSE:
- name = ++ptr;
- if (IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR84; /* Group name must start with non-digit */
- goto FAILED;
- }
- while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0) ptr++;
- namelen = (int)(ptr - name);
-
- /* In the pre-compile phase, do a syntax check. We used to just set
- a dummy reference number, because it was not used in the first pass.
- However, with the change of recursive back references to be atomic,
- we have to look for the number so that this state can be identified, as
- otherwise the incorrect length is computed. If it's not a backwards
- reference, the dummy number will do. */
-
- if (lengthptr != NULL)
- {
- named_group *ng;
-
- if (namelen == 0)
- {
- *errorcodeptr = ERR62;
- goto FAILED;
- }
- if (*ptr != (pcre_uchar)terminator)
- {
- *errorcodeptr = ERR42;
- goto FAILED;
- }
- if (namelen > MAX_NAME_SIZE)
- {
- *errorcodeptr = ERR48;
- goto FAILED;
- }
-
- /* The name table does not exist in the first pass; instead we must
- scan the list of names encountered so far in order to get the
- number. If the name is not found, set the value to 0 for a forward
- reference. */
-
- ng = cd->named_groups;
- for (i = 0; i < cd->names_found; i++, ng++)
- {
- if (namelen == ng->length &&
- STRNCMP_UC_UC(name, ng->name, namelen) == 0)
- break;
- }
- recno = (i < cd->names_found)? ng->number : 0;
-
- /* Count named back references. */
-
- if (!is_recurse) cd->namedrefcount++;
- }
-
- /* In the real compile, search the name table. We check the name
- first, and then check that we have reached the end of the name in the
- table. That way, if the name is longer than any in the table, the
- comparison will fail without reading beyond the table entry. */
-
- else
- {
- slot = cd->name_table;
- for (i = 0; i < cd->names_found; i++)
- {
- if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) == 0 &&
- slot[IMM2_SIZE+namelen] == 0)
- break;
- slot += cd->name_entry_size;
- }
-
- if (i < cd->names_found)
- {
- recno = GET2(slot, 0);
- }
- else
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- }
-
- /* In both phases, for recursions, we can now go to the code than
- handles numerical recursion. */
-
- if (is_recurse) goto HANDLE_RECURSION;
-
- /* In the second pass we must see if the name is duplicated. If so, we
- generate a different opcode. */
-
- if (lengthptr == NULL && cd->dupnames)
- {
- int count = 1;
- unsigned int index = i;
- pcre_uchar *cslot = slot + cd->name_entry_size;
-
- for (i++; i < cd->names_found; i++)
- {
- if (STRCMP_UC_UC(slot + IMM2_SIZE, cslot + IMM2_SIZE) != 0) break;
- count++;
- cslot += cd->name_entry_size;
- }
-
- if (count > 1)
- {
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- previous = code;
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_DNREFI : OP_DNREF;
- PUT2INC(code, 0, index);
- PUT2INC(code, 0, count);
-
- /* Process each potentially referenced group. */
-
- for (; slot < cslot; slot += cd->name_entry_size)
- {
- open_capitem *oc;
- recno = GET2(slot, 0);
- cd->backref_map |= (recno < 32)? (1 << recno) : 1;
- if (recno > cd->top_backref) cd->top_backref = recno;
-
- /* Check to see if this back reference is recursive, that it, it
- is inside the group that it references. A flag is set so that the
- group can be made atomic. */
-
- for (oc = cd->open_caps; oc != NULL; oc = oc->next)
- {
- if (oc->number == recno)
- {
- oc->flag = TRUE;
- break;
- }
- }
- }
-
- continue; /* End of back ref handling */
- }
- }
-
- /* First pass, or a non-duplicated name. */
-
- goto HANDLE_REFERENCE;
-
-
- /* ------------------------------------------------------------ */
- case CHAR_R: /* Recursion */
- ptr++; /* Same as (?0) */
- /* Fall through */
-
-
- /* ------------------------------------------------------------ */
- case CHAR_MINUS: case CHAR_PLUS: /* Recursion or subroutine */
- case CHAR_0: case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4:
- case CHAR_5: case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9:
- {
- const pcre_uchar *called;
- terminator = CHAR_RIGHT_PARENTHESIS;
-
- /* Come here from the \g<...> and \g'...' code (Oniguruma
- compatibility). However, the syntax has been checked to ensure that
- the ... are a (signed) number, so that neither ERR63 nor ERR29 will
- be called on this path, nor with the jump to OTHER_CHAR_AFTER_QUERY
- ever be taken. */
-
- HANDLE_NUMERICAL_RECURSION:
-
- if ((refsign = *ptr) == CHAR_PLUS)
- {
- ptr++;
- if (!IS_DIGIT(*ptr))
- {
- *errorcodeptr = ERR63;
- goto FAILED;
- }
- }
- else if (refsign == CHAR_MINUS)
- {
- if (!IS_DIGIT(ptr[1]))
- goto OTHER_CHAR_AFTER_QUERY;
- ptr++;
- }
-
- recno = 0;
- while(IS_DIGIT(*ptr))
- recno = recno * 10 + *ptr++ - CHAR_0;
-
- if (*ptr != (pcre_uchar)terminator)
- {
- *errorcodeptr = ERR29;
- goto FAILED;
- }
-
- if (refsign == CHAR_MINUS)
- {
- if (recno == 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno = cd->bracount - recno + 1;
- if (recno <= 0)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
- }
- else if (refsign == CHAR_PLUS)
- {
- if (recno == 0)
- {
- *errorcodeptr = ERR58;
- goto FAILED;
- }
- recno += cd->bracount;
- }
-
- /* Come here from code above that handles a named recursion */
-
- HANDLE_RECURSION:
-
- previous = code;
- called = cd->start_code;
-
- /* When we are actually compiling, find the bracket that is being
- referenced. Temporarily end the regex in case it doesn't exist before
- this point. If we end up with a forward reference, first check that
- the bracket does occur later so we can give the error (and position)
- now. Then remember this forward reference in the workspace so it can
- be filled in at the end. */
-
- if (lengthptr == NULL)
- {
- *code = OP_END;
- if (recno != 0)
- called = PRIV(find_bracket)(cd->start_code, utf, recno);
-
- /* Forward reference */
-
- if (called == NULL)
- {
- if (recno > cd->final_bracount)
- {
- *errorcodeptr = ERR15;
- goto FAILED;
- }
-
- /* Fudge the value of "called" so that when it is inserted as an
- offset below, what it actually inserted is the reference number
- of the group. Then remember the forward reference. */
-
- called = cd->start_code + recno;
- if (cd->hwm >= cd->start_workspace + cd->workspace_size -
- WORK_SIZE_SAFETY_MARGIN)
- {
- *errorcodeptr = expand_workspace(cd);
- if (*errorcodeptr != 0) goto FAILED;
- }
- PUTINC(cd->hwm, 0, (int)(code + 1 - cd->start_code));
- }
-
- /* If not a forward reference, and the subpattern is still open,
- this is a recursive call. We check to see if this is a left
- recursion that could loop for ever, and diagnose that case. We
- must not, however, do this check if we are in a conditional
- subpattern because the condition might be testing for recursion in
- a pattern such as /(?(R)a+|(?R)b)/, which is perfectly valid.
- Forever loops are also detected at runtime, so those that occur in
- conditional subpatterns will be picked up then. */
-
- else if (GET(called, 1) == 0 && cond_depth <= 0 &&
- could_be_empty(called, code, bcptr, utf, cd))
- {
- *errorcodeptr = ERR40;
- goto FAILED;
- }
- }
-
- /* Insert the recursion/subroutine item. It does not have a set first
- character (relevant if it is repeated, because it will then be
- wrapped with ONCE brackets). */
-
- *code = OP_RECURSE;
- PUT(code, 1, (int)(called - cd->start_code));
- code += 1 + LINK_SIZE;
- groupsetfirstchar = FALSE;
- }
-
- /* Can't determine a first byte now */
-
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- continue;
-
-
- /* ------------------------------------------------------------ */
- default: /* Other characters: check option setting */
- OTHER_CHAR_AFTER_QUERY:
- set = unset = 0;
- optset = &set;
-
- while (*ptr != CHAR_RIGHT_PARENTHESIS && *ptr != CHAR_COLON)
- {
- switch (*ptr++)
- {
- case CHAR_MINUS: optset = &unset; break;
-
- case CHAR_J: /* Record that it changed in the external options */
- *optset |= PCRE_DUPNAMES;
- cd->external_flags |= PCRE_JCHANGED;
- break;
-
- case CHAR_i: *optset |= PCRE_CASELESS; break;
- case CHAR_m: *optset |= PCRE_MULTILINE; break;
- case CHAR_s: *optset |= PCRE_DOTALL; break;
- case CHAR_x: *optset |= PCRE_EXTENDED; break;
- case CHAR_U: *optset |= PCRE_UNGREEDY; break;
- case CHAR_X: *optset |= PCRE_EXTRA; break;
-
- default: *errorcodeptr = ERR12;
- ptr--; /* Correct the offset */
- goto FAILED;
- }
- }
-
- /* Set up the changed option bits, but don't change anything yet. */
-
- newoptions = (options | set) & (~unset);
-
- /* If the options ended with ')' this is not the start of a nested
- group with option changes, so the options change at this level. If this
- item is right at the start of the pattern, the options can be
- abstracted and made external in the pre-compile phase, and ignored in
- the compile phase. This can be helpful when matching -- for instance in
- caseless checking of required bytes.
-
- If the code pointer is not (cd->start_code + 1 + LINK_SIZE), we are
- definitely *not* at the start of the pattern because something has been
- compiled. In the pre-compile phase, however, the code pointer can have
- that value after the start, because it gets reset as code is discarded
- during the pre-compile. However, this can happen only at top level - if
- we are within parentheses, the starting BRA will still be present. At
- any parenthesis level, the length value can be used to test if anything
- has been compiled at that level. Thus, a test for both these conditions
- is necessary to ensure we correctly detect the start of the pattern in
- both phases.
-
- If we are not at the pattern start, reset the greedy defaults and the
- case value for firstchar and reqchar. */
-
- if (*ptr == CHAR_RIGHT_PARENTHESIS)
- {
- if (code == cd->start_code + 1 + LINK_SIZE &&
- (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE))
- {
- cd->external_options = newoptions;
- }
- else
- {
- greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
- greedy_non_default = greedy_default ^ 1;
- req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
- }
-
- /* Change options at this level, and pass them back for use
- in subsequent branches. */
-
- *optionsptr = options = newoptions;
- previous = NULL; /* This item can't be repeated */
- continue; /* It is complete */
- }
-
- /* If the options ended with ':' we are heading into a nested group
- with possible change of options. Such groups are non-capturing and are
- not assertions of any kind. All we need to do is skip over the ':';
- the newoptions value is handled below. */
-
- bravalue = OP_BRA;
- ptr++;
- } /* End of switch for character following (? */
- } /* End of (? handling */
-
- /* Opening parenthesis not followed by '*' or '?'. If PCRE_NO_AUTO_CAPTURE
- is set, all unadorned brackets become non-capturing and behave like (?:...)
- brackets. */
-
- else if ((options & PCRE_NO_AUTO_CAPTURE) != 0)
- {
- bravalue = OP_BRA;
- }
-
- /* Else we have a capturing group. */
-
- else
- {
- NUMBERED_GROUP:
- cd->bracount += 1;
- PUT2(code, 1+LINK_SIZE, cd->bracount);
- skipbytes = IMM2_SIZE;
- }
-
- /* Process nested bracketed regex. First check for parentheses nested too
- deeply. */
-
- if ((cd->parens_depth += 1) > PARENS_NEST_LIMIT)
- {
- *errorcodeptr = ERR82;
- goto FAILED;
- }
-
- /* Assertions used not to be repeatable, but this was changed for Perl
- compatibility, so all kinds can now be repeated. We copy code into a
- non-register variable (tempcode) in order to be able to pass its address
- because some compilers complain otherwise. */
-
- previous = code; /* For handling repetition */
- *code = bravalue;
- tempcode = code;
- tempreqvary = cd->req_varyopt; /* Save value before bracket */
- tempbracount = cd->bracount; /* Save value before bracket */
- length_prevgroup = 0; /* Initialize for pre-compile phase */
-
- if (!compile_regex(
- newoptions, /* The complete new option state */
- &tempcode, /* Where to put code (updated) */
- &ptr, /* Input pointer (updated) */
- errorcodeptr, /* Where to put an error message */
- (bravalue == OP_ASSERTBACK ||
- bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */
- reset_bracount, /* True if (?| group */
- skipbytes, /* Skip over bracket number */
- cond_depth +
- ((bravalue == OP_COND)?1:0), /* Depth of condition subpatterns */
- &subfirstchar, /* For possible first char */
- &subfirstcharflags,
- &subreqchar, /* For possible last char */
- &subreqcharflags,
- bcptr, /* Current branch chain */
- cd, /* Tables block */
- (lengthptr == NULL)? NULL : /* Actual compile phase */
- &length_prevgroup /* Pre-compile phase */
- ))
- goto FAILED;
-
- cd->parens_depth -= 1;
-
- /* If this was an atomic group and there are no capturing groups within it,
- generate OP_ONCE_NC instead of OP_ONCE. */
-
- if (bravalue == OP_ONCE && cd->bracount <= tempbracount)
- *code = OP_ONCE_NC;
-
- if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT)
- cd->assert_depth -= 1;
-
- /* At the end of compiling, code is still pointing to the start of the
- group, while tempcode has been updated to point past the end of the group.
- The pattern pointer (ptr) is on the bracket.
-
- If this is a conditional bracket, check that there are no more than
- two branches in the group, or just one if it's a DEFINE group. We do this
- in the real compile phase, not in the pre-pass, where the whole group may
- not be available. */
-
- if (bravalue == OP_COND && lengthptr == NULL)
- {
- pcre_uchar *tc = code;
- int condcount = 0;
-
- do {
- condcount++;
- tc += GET(tc,1);
- }
- while (*tc != OP_KET);
-
- /* A DEFINE group is never obeyed inline (the "condition" is always
- false). It must have only one branch. */
-
- if (code[LINK_SIZE+1] == OP_DEF)
- {
- if (condcount > 1)
- {
- *errorcodeptr = ERR54;
- goto FAILED;
- }
- bravalue = OP_DEF; /* Just a flag to suppress char handling below */
- }
-
- /* A "normal" conditional group. If there is just one branch, we must not
- make use of its firstchar or reqchar, because this is equivalent to an
- empty second branch. */
-
- else
- {
- if (condcount > 2)
- {
- *errorcodeptr = ERR27;
- goto FAILED;
- }
- if (condcount == 1) subfirstcharflags = subreqcharflags = REQ_NONE;
- }
- }
-
- /* Error if hit end of pattern */
-
- if (*ptr != CHAR_RIGHT_PARENTHESIS)
- {
- *errorcodeptr = ERR14;
- goto FAILED;
- }
-
- /* In the pre-compile phase, update the length by the length of the group,
- less the brackets at either end. Then reduce the compiled code to just a
- set of non-capturing brackets so that it doesn't use much memory if it is
- duplicated by a quantifier.*/
-
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < length_prevgroup - 2 - 2*LINK_SIZE)
- {
- *errorcodeptr = ERR20;
- goto FAILED;
- }
- *lengthptr += length_prevgroup - 2 - 2*LINK_SIZE;
- code++; /* This already contains bravalue */
- PUTINC(code, 0, 1 + LINK_SIZE);
- *code++ = OP_KET;
- PUTINC(code, 0, 1 + LINK_SIZE);
- break; /* No need to waste time with special character handling */
- }
-
- /* Otherwise update the main code pointer to the end of the group. */
-
- code = tempcode;
-
- /* For a DEFINE group, required and first character settings are not
- relevant. */
-
- if (bravalue == OP_DEF) break;
-
- /* Handle updating of the required and first characters for other types of
- group. Update for normal brackets of all kinds, and conditions with two
- branches (see code above). If the bracket is followed by a quantifier with
- zero repeat, we have to back off. Hence the definition of zeroreqchar and
- zerofirstchar outside the main loop so that they can be accessed for the
- back off. */
-
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- groupsetfirstchar = FALSE;
-
- if (bravalue >= OP_ONCE)
- {
- /* If we have not yet set a firstchar in this branch, take it from the
- subpattern, remembering that it was set here so that a repeat of more
- than one can replicate it as reqchar if necessary. If the subpattern has
- no firstchar, set "none" for the whole branch. In both cases, a zero
- repeat forces firstchar to "none". */
-
- if (firstcharflags == REQ_UNSET)
- {
- if (subfirstcharflags >= 0)
- {
- firstchar = subfirstchar;
- firstcharflags = subfirstcharflags;
- groupsetfirstchar = TRUE;
- }
- else firstcharflags = REQ_NONE;
- zerofirstcharflags = REQ_NONE;
- }
-
- /* If firstchar was previously set, convert the subpattern's firstchar
- into reqchar if there wasn't one, using the vary flag that was in
- existence beforehand. */
-
- else if (subfirstcharflags >= 0 && subreqcharflags < 0)
- {
- subreqchar = subfirstchar;
- subreqcharflags = subfirstcharflags | tempreqvary;
- }
-
- /* If the subpattern set a required byte (or set a first byte that isn't
- really the first byte - see above), set it. */
-
- if (subreqcharflags >= 0)
- {
- reqchar = subreqchar;
- reqcharflags = subreqcharflags;
- }
- }
-
- /* For a forward assertion, we take the reqchar, if set. This can be
- helpful if the pattern that follows the assertion doesn't set a different
- char. For example, it's useful for /(?=abcde).+/. We can't set firstchar
- for an assertion, however because it leads to incorrect effect for patterns
- such as /(?=a)a.+/ when the "real" "a" would then become a reqchar instead
- of a firstchar. This is overcome by a scan at the end if there's no
- firstchar, looking for an asserted first char. */
-
- else if (bravalue == OP_ASSERT && subreqcharflags >= 0)
- {
- reqchar = subreqchar;
- reqcharflags = subreqcharflags;
- }
- break; /* End of processing '(' */
-
-
- /* ===================================================================*/
- /* Handle metasequences introduced by \. For ones like \d, the ESC_ values
- are arranged to be the negation of the corresponding OP_values in the
- default case when PCRE_UCP is not set. For the back references, the values
- are negative the reference number. Only back references and those types
- that consume a character may be repeated. We can test for values between
- ESC_b and ESC_Z for the latter; this may have to change if any new ones are
- ever created. */
-
- case CHAR_BACKSLASH:
- tempptr = ptr;
- escape = check_escape(&ptr, &ec, errorcodeptr, cd->bracount, options, FALSE);
- if (*errorcodeptr != 0) goto FAILED;
-
- if (escape == 0) /* The escape coded a single character */
- c = ec;
- else
- {
- if (escape == ESC_Q) /* Handle start of quoted string */
- {
- if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
- ptr += 2; /* avoid empty string */
- else inescq = TRUE;
- continue;
- }
-
- if (escape == ESC_E) continue; /* Perl ignores an orphan \E */
-
- /* For metasequences that actually match a character, we disable the
- setting of a first character if it hasn't already been set. */
-
- if (firstcharflags == REQ_UNSET && escape > ESC_b && escape < ESC_Z)
- firstcharflags = REQ_NONE;
-
- /* Set values to reset to if this is followed by a zero repeat. */
-
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
-
- /* \g<name> or \g'name' is a subroutine call by name and \g<n> or \g'n'
- is a subroutine call by number (Oniguruma syntax). In fact, the value
- ESC_g is returned only for these cases. So we don't need to check for <
- or ' if the value is ESC_g. For the Perl syntax \g{n} the value is
- -n, and for the Perl syntax \g{name} the result is ESC_k (as
- that is a synonym for a named back reference). */
-
- if (escape == ESC_g)
- {
- const pcre_uchar *p;
- pcre_uint32 cf;
-
- save_hwm = cd->hwm; /* Normally this is set when '(' is read */
- terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE;
-
- /* These two statements stop the compiler for warning about possibly
- unset variables caused by the jump to HANDLE_NUMERICAL_RECURSION. In
- fact, because we do the check for a number below, the paths that
- would actually be in error are never taken. */
-
- skipbytes = 0;
- reset_bracount = FALSE;
-
- /* If it's not a signed or unsigned number, treat it as a name. */
-
- cf = ptr[1];
- if (cf != CHAR_PLUS && cf != CHAR_MINUS && !IS_DIGIT(cf))
- {
- is_recurse = TRUE;
- goto NAMED_REF_OR_RECURSE;
- }
-
- /* Signed or unsigned number (cf = ptr[1]) is known to be plus or minus
- or a digit. */
-
- p = ptr + 2;
- while (IS_DIGIT(*p)) p++;
- if (*p != (pcre_uchar)terminator)
- {
- *errorcodeptr = ERR57;
- break;
- }
- ptr++;
- goto HANDLE_NUMERICAL_RECURSION;
- }
-
- /* \k<name> or \k'name' is a back reference by name (Perl syntax).
- We also support \k{name} (.NET syntax). */
-
- if (escape == ESC_k)
- {
- if ((ptr[1] != CHAR_LESS_THAN_SIGN &&
- ptr[1] != CHAR_APOSTROPHE && ptr[1] != CHAR_LEFT_CURLY_BRACKET))
- {
- *errorcodeptr = ERR69;
- break;
- }
- is_recurse = FALSE;
- terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)?
- CHAR_GREATER_THAN_SIGN : (*ptr == CHAR_APOSTROPHE)?
- CHAR_APOSTROPHE : CHAR_RIGHT_CURLY_BRACKET;
- goto NAMED_REF_OR_RECURSE;
- }
-
- /* Back references are handled specially; must disable firstchar if
- not set to cope with cases like (?=(\w+))\1: which would otherwise set
- ':' later. */
-
- if (escape < 0)
- {
- open_capitem *oc;
- recno = -escape;
-
- /* Come here from named backref handling when the reference is to a
- single group (i.e. not to a duplicated name. */
-
- HANDLE_REFERENCE:
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
- previous = code;
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF;
- PUT2INC(code, 0, recno);
- cd->backref_map |= (recno < 32)? (1 << recno) : 1;
- if (recno > cd->top_backref) cd->top_backref = recno;
-
- /* Check to see if this back reference is recursive, that it, it
- is inside the group that it references. A flag is set so that the
- group can be made atomic. */
-
- for (oc = cd->open_caps; oc != NULL; oc = oc->next)
- {
- if (oc->number == recno)
- {
- oc->flag = TRUE;
- break;
- }
- }
- }
-
- /* So are Unicode property matches, if supported. */
-
-#ifdef SUPPORT_UCP
- else if (escape == ESC_P || escape == ESC_p)
- {
- BOOL negated;
- unsigned int ptype = 0, pdata = 0;
- if (!get_ucp(&ptr, &negated, &ptype, &pdata, errorcodeptr))
- goto FAILED;
- previous = code;
- *code++ = ((escape == ESC_p) != negated)? OP_PROP : OP_NOTPROP;
- *code++ = ptype;
- *code++ = pdata;
- }
-#else
-
- /* If Unicode properties are not supported, \X, \P, and \p are not
- allowed. */
-
- else if (escape == ESC_X || escape == ESC_P || escape == ESC_p)
- {
- *errorcodeptr = ERR45;
- goto FAILED;
- }
-#endif
-
- /* For the rest (including \X when Unicode properties are supported), we
- can obtain the OP value by negating the escape value in the default
- situation when PCRE_UCP is not set. When it *is* set, we substitute
- Unicode property tests. Note that \b and \B do a one-character
- lookbehind, and \A also behaves as if it does. */
-
- else
- {
- if ((escape == ESC_b || escape == ESC_B || escape == ESC_A) &&
- cd->max_lookbehind == 0)
- cd->max_lookbehind = 1;
-#ifdef SUPPORT_UCP
- if (escape >= ESC_DU && escape <= ESC_wu)
- {
- nestptr = ptr + 1; /* Where to resume */
- ptr = substitutes[escape - ESC_DU] - 1; /* Just before substitute */
- }
- else
-#endif
- /* In non-UTF-8 mode, we turn \C into OP_ALLANY instead of OP_ANYBYTE
- so that it works in DFA mode and in lookbehinds. */
-
- {
- previous = (escape > ESC_b && escape < ESC_Z)? code : NULL;
- *code++ = (!utf && escape == ESC_C)? OP_ALLANY : escape;
- }
- }
- continue;
- }
-
- /* We have a data character whose value is in c. In UTF-8 mode it may have
- a value > 127. We set its representation in the length/buffer, and then
- handle it as a data character. */
-
-#if defined SUPPORT_UTF && !defined COMPILE_PCRE32
- if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR)
- mclength = PRIV(ord2utf)(c, mcbuffer);
- else
-#endif
-
- {
- mcbuffer[0] = c;
- mclength = 1;
- }
- goto ONE_CHAR;
-
-
- /* ===================================================================*/
- /* Handle a literal character. It is guaranteed not to be whitespace or #
- when the extended flag is set. If we are in a UTF mode, it may be a
- multi-unit literal character. */
-
- default:
- NORMAL_CHAR:
- mclength = 1;
- mcbuffer[0] = c;
-
-#ifdef SUPPORT_UTF
- if (utf && HAS_EXTRALEN(c))
- ACROSSCHAR(TRUE, ptr[1], mcbuffer[mclength++] = *(++ptr));
-#endif
-
- /* At this point we have the character's bytes in mcbuffer, and the length
- in mclength. When not in UTF-8 mode, the length is always 1. */
-
- ONE_CHAR:
- previous = code;
-
- /* For caseless UTF-8 mode when UCP support is available, check whether
- this character has more than one other case. If so, generate a special
- OP_PROP item instead of OP_CHARI. */
-
-#ifdef SUPPORT_UCP
- if (utf && (options & PCRE_CASELESS) != 0)
- {
- GETCHAR(c, mcbuffer);
- if ((c = UCD_CASESET(c)) != 0)
- {
- *code++ = OP_PROP;
- *code++ = PT_CLIST;
- *code++ = c;
- if (firstcharflags == REQ_UNSET)
- firstcharflags = zerofirstcharflags = REQ_NONE;
- break;
- }
- }
-#endif
-
- /* Caseful matches, or not one of the multicase characters. */
-
- *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARI : OP_CHAR;
- for (c = 0; c < mclength; c++) *code++ = mcbuffer[c];
-
- /* Remember if \r or \n were seen */
-
- if (mcbuffer[0] == CHAR_CR || mcbuffer[0] == CHAR_NL)
- cd->external_flags |= PCRE_HASCRORLF;
-
- /* Set the first and required bytes appropriately. If no previous first
- byte, set it from this character, but revert to none on a zero repeat.
- Otherwise, leave the firstchar value alone, and don't change it on a zero
- repeat. */
-
- if (firstcharflags == REQ_UNSET)
- {
- zerofirstcharflags = REQ_NONE;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
-
- /* If the character is more than one byte long, we can set firstchar
- only if it is not to be matched caselessly. */
-
- if (mclength == 1 || req_caseopt == 0)
- {
- firstchar = mcbuffer[0] | req_caseopt;
- firstchar = mcbuffer[0];
- firstcharflags = req_caseopt;
-
- if (mclength != 1)
- {
- reqchar = code[-1];
- reqcharflags = cd->req_varyopt;
- }
- }
- else firstcharflags = reqcharflags = REQ_NONE;
- }
-
- /* firstchar was previously set; we can set reqchar only if the length is
- 1 or the matching is caseful. */
-
- else
- {
- zerofirstchar = firstchar;
- zerofirstcharflags = firstcharflags;
- zeroreqchar = reqchar;
- zeroreqcharflags = reqcharflags;
- if (mclength == 1 || req_caseopt == 0)
- {
- reqchar = code[-1];
- reqcharflags = req_caseopt | cd->req_varyopt;
- }
- }
-
- break; /* End of literal character handling */
- }
- } /* end of big loop */
-
-
-/* Control never reaches here by falling through, only by a goto for all the
-error states. Pass back the position in the pattern so that it can be displayed
-to the user for diagnosing the error. */
-
-FAILED:
-*ptrptr = ptr;
-return FALSE;
-}
-
-
-
-/*************************************************
-* Compile sequence of alternatives *
-*************************************************/
-
-/* On entry, ptr is pointing past the bracket character, but on return it
-points to the closing bracket, or vertical bar, or end of string. The code
-variable is pointing at the byte into which the BRA operator has been stored.
-This function is used during the pre-compile phase when we are trying to find
-out the amount of memory needed, as well as during the real compile phase. The
-value of lengthptr distinguishes the two phases.
-
-Arguments:
- options option bits, including any changes for this subpattern
- codeptr -> the address of the current code pointer
- ptrptr -> the address of the current pattern pointer
- errorcodeptr -> pointer to error code variable
- lookbehind TRUE if this is a lookbehind assertion
- reset_bracount TRUE to reset the count for each branch
- skipbytes skip this many bytes at start (for brackets and OP_COND)
- cond_depth depth of nesting for conditional subpatterns
- firstcharptr place to put the first required character
- firstcharflagsptr place to put the first character flags, or a negative number
- reqcharptr place to put the last required character
- reqcharflagsptr place to put the last required character flags, or a negative number
- bcptr pointer to the chain of currently open branches
- cd points to the data block with tables pointers etc.
- lengthptr NULL during the real compile phase
- points to length accumulator during pre-compile phase
-
-Returns: TRUE on success
-*/
-
-static BOOL
-compile_regex(int options, pcre_uchar **codeptr, const pcre_uchar **ptrptr,
- int *errorcodeptr, BOOL lookbehind, BOOL reset_bracount, int skipbytes,
- int cond_depth,
- pcre_uint32 *firstcharptr, pcre_int32 *firstcharflagsptr,
- pcre_uint32 *reqcharptr, pcre_int32 *reqcharflagsptr,
- branch_chain *bcptr, compile_data *cd, int *lengthptr)
-{
-const pcre_uchar *ptr = *ptrptr;
-pcre_uchar *code = *codeptr;
-pcre_uchar *last_branch = code;
-pcre_uchar *start_bracket = code;
-pcre_uchar *reverse_count = NULL;
-open_capitem capitem;
-int capnumber = 0;
-pcre_uint32 firstchar, reqchar;
-pcre_int32 firstcharflags, reqcharflags;
-pcre_uint32 branchfirstchar, branchreqchar;
-pcre_int32 branchfirstcharflags, branchreqcharflags;
-int length;
-unsigned int orig_bracount;
-unsigned int max_bracount;
-branch_chain bc;
-
-/* If set, call the external function that checks for stack availability. */
-
-if (PUBL(stack_guard) != NULL && PUBL(stack_guard)())
- {
- *errorcodeptr= ERR85;
- return FALSE;
- }
-
-/* Miscellaneous initialization */
-
-bc.outer = bcptr;
-bc.current_branch = code;
-
-firstchar = reqchar = 0;
-firstcharflags = reqcharflags = REQ_UNSET;
-
-/* Accumulate the length for use in the pre-compile phase. Start with the
-length of the BRA and KET and any extra bytes that are required at the
-beginning. We accumulate in a local variable to save frequent testing of
-lenthptr for NULL. We cannot do this by looking at the value of code at the
-start and end of each alternative, because compiled items are discarded during
-the pre-compile phase so that the work space is not exceeded. */
-
-length = 2 + 2*LINK_SIZE + skipbytes;
-
-/* WARNING: If the above line is changed for any reason, you must also change
-the code that abstracts option settings at the start of the pattern and makes
-them global. It tests the value of length for (2 + 2*LINK_SIZE) in the
-pre-compile phase to find out whether anything has yet been compiled or not. */
-
-/* If this is a capturing subpattern, add to the chain of open capturing items
-so that we can detect them if (*ACCEPT) is encountered. This is also used to
-detect groups that contain recursive back references to themselves. Note that
-only OP_CBRA need be tested here; changing this opcode to one of its variants,
-e.g. OP_SCBRAPOS, happens later, after the group has been compiled. */
-
-if (*code == OP_CBRA)
- {
- capnumber = GET2(code, 1 + LINK_SIZE);
- capitem.number = capnumber;
- capitem.next = cd->open_caps;
- capitem.flag = FALSE;
- cd->open_caps = &capitem;
- }
-
-/* Offset is set zero to mark that this bracket is still open */
-
-PUT(code, 1, 0);
-code += 1 + LINK_SIZE + skipbytes;
-
-/* Loop for each alternative branch */
-
-orig_bracount = max_bracount = cd->bracount;
-for (;;)
- {
- /* For a (?| group, reset the capturing bracket count so that each branch
- uses the same numbers. */
-
- if (reset_bracount) cd->bracount = orig_bracount;
-
- /* Set up dummy OP_REVERSE if lookbehind assertion */
-
- if (lookbehind)
- {
- *code++ = OP_REVERSE;
- reverse_count = code;
- PUTINC(code, 0, 0);
- length += 1 + LINK_SIZE;
- }
-
- /* Now compile the branch; in the pre-compile phase its length gets added
- into the length. */
-
- if (!compile_branch(&options, &code, &ptr, errorcodeptr, &branchfirstchar,
- &branchfirstcharflags, &branchreqchar, &branchreqcharflags, &bc,
- cond_depth, cd, (lengthptr == NULL)? NULL : &length))
- {
- *ptrptr = ptr;
- return FALSE;
- }
-
- /* Keep the highest bracket count in case (?| was used and some branch
- has fewer than the rest. */
-
- if (cd->bracount > max_bracount) max_bracount = cd->bracount;
-
- /* In the real compile phase, there is some post-processing to be done. */
-
- if (lengthptr == NULL)
- {
- /* If this is the first branch, the firstchar and reqchar values for the
- branch become the values for the regex. */
-
- if (*last_branch != OP_ALT)
- {
- firstchar = branchfirstchar;
- firstcharflags = branchfirstcharflags;
- reqchar = branchreqchar;
- reqcharflags = branchreqcharflags;
- }
-
- /* If this is not the first branch, the first char and reqchar have to
- match the values from all the previous branches, except that if the
- previous value for reqchar didn't have REQ_VARY set, it can still match,
- and we set REQ_VARY for the regex. */
-
- else
- {
- /* If we previously had a firstchar, but it doesn't match the new branch,
- we have to abandon the firstchar for the regex, but if there was
- previously no reqchar, it takes on the value of the old firstchar. */
-
- if (firstcharflags >= 0 &&
- (firstcharflags != branchfirstcharflags || firstchar != branchfirstchar))
- {
- if (reqcharflags < 0)
- {
- reqchar = firstchar;
- reqcharflags = firstcharflags;
- }
- firstcharflags = REQ_NONE;
- }
-
- /* If we (now or from before) have no firstchar, a firstchar from the
- branch becomes a reqchar if there isn't a branch reqchar. */
-
- if (firstcharflags < 0 && branchfirstcharflags >= 0 && branchreqcharflags < 0)
- {
- branchreqchar = branchfirstchar;
- branchreqcharflags = branchfirstcharflags;
- }
-
- /* Now ensure that the reqchars match */
-
- if (((reqcharflags & ~REQ_VARY) != (branchreqcharflags & ~REQ_VARY)) ||
- reqchar != branchreqchar)
- reqcharflags = REQ_NONE;
- else
- {
- reqchar = branchreqchar;
- reqcharflags |= branchreqcharflags; /* To "or" REQ_VARY */
- }
- }
-
- /* If lookbehind, check that this branch matches a fixed-length string, and
- put the length into the OP_REVERSE item. Temporarily mark the end of the
- branch with OP_END. If the branch contains OP_RECURSE, the result is -3
- because there may be forward references that we can't check here. Set a
- flag to cause another lookbehind check at the end. Why not do it all at the
- end? Because common, erroneous checks are picked up here and the offset of
- the problem can be shown. */
-
- if (lookbehind)
- {
- int fixed_length;
- *code = OP_END;
- fixed_length = find_fixedlength(last_branch, (options & PCRE_UTF8) != 0,
- FALSE, cd);
- DPRINTF(("fixed length = %d\n", fixed_length));
- if (fixed_length == -3)
- {
- cd->check_lookbehind = TRUE;
- }
- else if (fixed_length < 0)
- {
- *errorcodeptr = (fixed_length == -2)? ERR36 :
- (fixed_length == -4)? ERR70: ERR25;
- *ptrptr = ptr;
- return FALSE;
- }
- else
- {
- if (fixed_length > cd->max_lookbehind)
- cd->max_lookbehind = fixed_length;
- PUT(reverse_count, 0, fixed_length);
- }
- }
- }
-
- /* Reached end of expression, either ')' or end of pattern. In the real
- compile phase, go back through the alternative branches and reverse the chain
- of offsets, with the field in the BRA item now becoming an offset to the
- first alternative. If there are no alternatives, it points to the end of the
- group. The length in the terminating ket is always the length of the whole
- bracketed item. Return leaving the pointer at the terminating char. */
-
- if (*ptr != CHAR_VERTICAL_LINE)
- {
- if (lengthptr == NULL)
- {
- int branch_length = (int)(code - last_branch);
- do
- {
- int prev_length = GET(last_branch, 1);
- PUT(last_branch, 1, branch_length);
- branch_length = prev_length;
- last_branch -= branch_length;
- }
- while (branch_length > 0);
- }
-
- /* Fill in the ket */
-
- *code = OP_KET;
- PUT(code, 1, (int)(code - start_bracket));
- code += 1 + LINK_SIZE;
-
- /* If it was a capturing subpattern, check to see if it contained any
- recursive back references. If so, we must wrap it in atomic brackets.
- In any event, remove the block from the chain. */
-
- if (capnumber > 0)
- {
- if (cd->open_caps->flag)
- {
- memmove(start_bracket + 1 + LINK_SIZE, start_bracket,
- IN_UCHARS(code - start_bracket));
- *start_bracket = OP_ONCE;
- code += 1 + LINK_SIZE;
- PUT(start_bracket, 1, (int)(code - start_bracket));
- *code = OP_KET;
- PUT(code, 1, (int)(code - start_bracket));
- code += 1 + LINK_SIZE;
- length += 2 + 2*LINK_SIZE;
- }
- cd->open_caps = cd->open_caps->next;
- }
-
- /* Retain the highest bracket number, in case resetting was used. */
-
- cd->bracount = max_bracount;
-
- /* Set values to pass back */
-
- *codeptr = code;
- *ptrptr = ptr;
- *firstcharptr = firstchar;
- *firstcharflagsptr = firstcharflags;
- *reqcharptr = reqchar;
- *reqcharflagsptr = reqcharflags;
- if (lengthptr != NULL)
- {
- if (OFLOW_MAX - *lengthptr < length)
- {
- *errorcodeptr = ERR20;
- return FALSE;
- }
- *lengthptr += length;
- }
- return TRUE;
- }
-
- /* Another branch follows. In the pre-compile phase, we can move the code
- pointer back to where it was for the start of the first branch. (That is,
- pretend that each branch is the only one.)
-
- In the real compile phase, insert an ALT node. Its length field points back
- to the previous branch while the bracket remains open. At the end the chain
- is reversed. It's done like this so that the start of the bracket has a
- zero offset until it is closed, making it possible to detect recursion. */
-
- if (lengthptr != NULL)
- {
- code = *codeptr + 1 + LINK_SIZE + skipbytes;
- length += 1 + LINK_SIZE;
- }
- else
- {
- *code = OP_ALT;
- PUT(code, 1, (int)(code - last_branch));
- bc.current_branch = last_branch = code;
- code += 1 + LINK_SIZE;
- }
-
- ptr++;
- }
-/* Control never reaches here */
-}
-
-
-
-
-/*************************************************
-* Check for anchored expression *
-*************************************************/
-
-/* Try to find out if this is an anchored regular expression. Consider each
-alternative branch. If they all start with OP_SOD or OP_CIRC, or with a bracket
-all of whose alternatives start with OP_SOD or OP_CIRC (recurse ad lib), then
-it's anchored. However, if this is a multiline pattern, then only OP_SOD will
-be found, because ^ generates OP_CIRCM in that mode.
-
-We can also consider a regex to be anchored if OP_SOM starts all its branches.
-This is the code for \G, which means "match at start of match position, taking
-into account the match offset".
-
-A branch is also implicitly anchored if it starts with .* and DOTALL is set,
-because that will try the rest of the pattern at all possible matching points,
-so there is no point trying again.... er ....
-
-.... except when the .* appears inside capturing parentheses, and there is a
-subsequent back reference to those parentheses. We haven't enough information
-to catch that case precisely.
-
-At first, the best we could do was to detect when .* was in capturing brackets
-and the highest back reference was greater than or equal to that level.
-However, by keeping a bitmap of the first 31 back references, we can catch some
-of the more common cases more precisely.
-
-... A second exception is when the .* appears inside an atomic group, because
-this prevents the number of characters it matches from being adjusted.
-
-Arguments:
- code points to start of expression (the bracket)
- bracket_map a bitmap of which brackets we are inside while testing; this
- handles up to substring 31; after that we just have to take
- the less precise approach
- cd points to the compile data block
- atomcount atomic group level
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_anchored(register const pcre_uchar *code, unsigned int bracket_map,
- compile_data *cd, int atomcount)
-{
-do {
- const pcre_uchar *scode = first_significant_code(
- code + PRIV(OP_lengths)[*code], FALSE);
- register int op = *scode;
-
- /* Non-capturing brackets */
-
- if (op == OP_BRA || op == OP_BRAPOS ||
- op == OP_SBRA || op == OP_SBRAPOS)
- {
- if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE;
- }
-
- /* Capturing brackets */
-
- else if (op == OP_CBRA || op == OP_CBRAPOS ||
- op == OP_SCBRA || op == OP_SCBRAPOS)
- {
- int n = GET2(scode, 1+LINK_SIZE);
- int new_map = bracket_map | ((n < 32)? (1 << n) : 1);
- if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE;
- }
-
- /* Positive forward assertions and conditions */
-
- else if (op == OP_ASSERT || op == OP_COND)
- {
- if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE;
- }
-
- /* Atomic groups */
-
- else if (op == OP_ONCE || op == OP_ONCE_NC)
- {
- if (!is_anchored(scode, bracket_map, cd, atomcount + 1))
- return FALSE;
- }
-
- /* .* is not anchored unless DOTALL is set (which generates OP_ALLANY) and
- it isn't in brackets that are or may be referenced or inside an atomic
- group. */
-
- else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR ||
- op == OP_TYPEPOSSTAR))
- {
- if (scode[1] != OP_ALLANY || (bracket_map & cd->backref_map) != 0 ||
- atomcount > 0 || cd->had_pruneorskip)
- return FALSE;
- }
-
- /* Check for explicit anchoring */
-
- else if (op != OP_SOD && op != OP_SOM && op != OP_CIRC) return FALSE;
-
- code += GET(code, 1);
- }
-while (*code == OP_ALT); /* Loop for each alternative */
-return TRUE;
-}
-
-
-
-/*************************************************
-* Check for starting with ^ or .* *
-*************************************************/
-
-/* This is called to find out if every branch starts with ^ or .* so that
-"first char" processing can be done to speed things up in multiline
-matching and for non-DOTALL patterns that start with .* (which must start at
-the beginning or after \n). As in the case of is_anchored() (see above), we
-have to take account of back references to capturing brackets that contain .*
-because in that case we can't make the assumption. Also, the appearance of .*
-inside atomic brackets or in a pattern that contains *PRUNE or *SKIP does not
-count, because once again the assumption no longer holds.
-
-Arguments:
- code points to start of expression (the bracket)
- bracket_map a bitmap of which brackets we are inside while testing; this
- handles up to substring 31; after that we just have to take
- the less precise approach
- cd points to the compile data
- atomcount atomic group level
-
-Returns: TRUE or FALSE
-*/
-
-static BOOL
-is_startline(const pcre_uchar *code, unsigned int bracket_map,
- compile_data *cd, int atomcount)
-{
-do {
- const pcre_uchar *scode = first_significant_code(
- code + PRIV(OP_lengths)[*code], FALSE);
- register int op = *scode;
-
- /* If we are at the start of a conditional assertion group, *both* the
- conditional assertion *and* what follows the condition must satisfy the test
- for start of line. Other kinds of condition fail. Note that there may be an
- auto-callout at the start of a condition. */
-
- if (op == OP_COND)
- {
- scode += 1 + LINK_SIZE;
- if (*scode == OP_CALLOUT) scode += PRIV(OP_lengths)[OP_CALLOUT];
- switch (*scode)
- {
- case OP_CREF:
- case OP_DNCREF:
- case OP_RREF:
- case OP_DNRREF:
- case OP_DEF:
- return FALSE;
-
- default: /* Assertion */
- if (!is_startline(scode, bracket_map, cd, atomcount)) return FALSE;
- do scode += GET(scode, 1); while (*scode == OP_ALT);
- scode += 1 + LINK_SIZE;
- break;
- }
- scode = first_significant_code(scode, FALSE);
- op = *scode;
- }
-
- /* Non-capturing brackets */
-
- if (op == OP_BRA || op == OP_BRAPOS ||
- op == OP_SBRA || op == OP_SBRAPOS)
- {
- if (!is_startline(scode, bracket_map, cd, atomcount)) return FALSE;
- }
-
- /* Capturing brackets */
-
- else if (op == OP_CBRA || op == OP_CBRAPOS ||
- op == OP_SCBRA || op == OP_SCBRAPOS)
- {
- int n = GET2(scode, 1+LINK_SIZE);
- int new_map = bracket_map | ((n < 32)? (1 << n) : 1);
- if (!is_startline(scode, new_map, cd, atomcount)) return FALSE;
- }
-
- /* Positive forward assertions */
-
- else if (op == OP_ASSERT)
- {
- if (!is_startline(scode, bracket_map, cd, atomcount)) return FALSE;
- }
-
- /* Atomic brackets */
-
- else if (op == OP_ONCE || op == OP_ONCE_NC)
- {
- if (!is_startline(scode, bracket_map, cd, atomcount + 1)) return FALSE;
- }
-
- /* .* means "start at start or after \n" if it isn't in atomic brackets or
- brackets that may be referenced, as long as the pattern does not contain
- *PRUNE or *SKIP, because these break the feature. Consider, for example,
- /.*?a(*PRUNE)b/ with the subject "aab", which matches "ab", i.e. not at the
- start of a line. */
-
- else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR || op == OP_TYPEPOSSTAR)
- {
- if (scode[1] != OP_ANY || (bracket_map & cd->backref_map) != 0 ||
- atomcount > 0 || cd->had_pruneorskip)
- return FALSE;
- }
-
- /* Check for explicit circumflex; anything else gives a FALSE result. Note
- in particular that this includes atomic brackets OP_ONCE and OP_ONCE_NC
- because the number of characters matched by .* cannot be adjusted inside
- them. */
-
- else if (op != OP_CIRC && op != OP_CIRCM) return FALSE;
-
- /* Move on to the next alternative */
-
- code += GET(code, 1);
- }
-while (*code == OP_ALT); /* Loop for each alternative */
-return TRUE;
-}
-
-
-
-/*************************************************
-* Check for asserted fixed first char *
-*************************************************/
-
-/* During compilation, the "first char" settings from forward assertions are
-discarded, because they can cause conflicts with actual literals that follow.
-However, if we end up without a first char setting for an unanchored pattern,
-it is worth scanning the regex to see if there is an initial asserted first
-char. If all branches start with the same asserted char, or with a
-non-conditional bracket all of whose alternatives start with the same asserted
-char (recurse ad lib), then we return that char, with the flags set to zero or
-REQ_CASELESS; otherwise return zero with REQ_NONE in the flags.
-
-Arguments:
- code points to start of expression (the bracket)
- flags points to the first char flags, or to REQ_NONE
- inassert TRUE if in an assertion
-
-Returns: the fixed first char, or 0 with REQ_NONE in flags
-*/
-
-static pcre_uint32
-find_firstassertedchar(const pcre_uchar *code, pcre_int32 *flags,
- BOOL inassert)
-{
-register pcre_uint32 c = 0;
-int cflags = REQ_NONE;
-
-*flags = REQ_NONE;
-do {
- pcre_uint32 d;
- int dflags;
- int xl = (*code == OP_CBRA || *code == OP_SCBRA ||
- *code == OP_CBRAPOS || *code == OP_SCBRAPOS)? IMM2_SIZE:0;
- const pcre_uchar *scode = first_significant_code(code + 1+LINK_SIZE + xl,
- TRUE);
- register pcre_uchar op = *scode;
-
- switch(op)
- {
- default:
- return 0;
-
- case OP_BRA:
- case OP_BRAPOS:
- case OP_CBRA:
- case OP_SCBRA:
- case OP_CBRAPOS:
- case OP_SCBRAPOS:
- case OP_ASSERT:
- case OP_ONCE:
- case OP_ONCE_NC:
- d = find_firstassertedchar(scode, &dflags, op == OP_ASSERT);
- if (dflags < 0)
- return 0;
- if (cflags < 0) { c = d; cflags = dflags; } else if (c != d || cflags != dflags) return 0;
- break;
-
- case OP_EXACT:
- scode += IMM2_SIZE;
- /* Fall through */
-
- case OP_CHAR:
- case OP_PLUS:
- case OP_MINPLUS:
- case OP_POSPLUS:
- if (!inassert) return 0;
- if (cflags < 0) { c = scode[1]; cflags = 0; }
- else if (c != scode[1]) return 0;
- break;
-
- case OP_EXACTI:
- scode += IMM2_SIZE;
- /* Fall through */
-
- case OP_CHARI:
- case OP_PLUSI:
- case OP_MINPLUSI:
- case OP_POSPLUSI:
- if (!inassert) return 0;
- if (cflags < 0) { c = scode[1]; cflags = REQ_CASELESS; }
- else if (c != scode[1]) return 0;
- break;
- }
-
- code += GET(code, 1);
- }
-while (*code == OP_ALT);
-
-*flags = cflags;
-return c;
-}
-
-
-
-/*************************************************
-* Add an entry to the name/number table *
-*************************************************/
-
-/* This function is called between compiling passes to add an entry to the
-name/number table, maintaining alphabetical order. Checking for permitted
-and forbidden duplicates has already been done.
-
-Arguments:
- cd the compile data block
- name the name to add
- length the length of the name
- groupno the group number
-
-Returns: nothing
-*/
-
-static void
-add_name(compile_data *cd, const pcre_uchar *name, int length,
- unsigned int groupno)
-{
-int i;
-pcre_uchar *slot = cd->name_table;
-
-for (i = 0; i < cd->names_found; i++)
- {
- int crc = memcmp(name, slot+IMM2_SIZE, IN_UCHARS(length));
- if (crc == 0 && slot[IMM2_SIZE+length] != 0)
- crc = -1; /* Current name is a substring */
-
- /* Make space in the table and break the loop for an earlier name. For a
- duplicate or later name, carry on. We do this for duplicates so that in the
- simple case (when ?(| is not used) they are in order of their numbers. In all
- cases they are in the order in which they appear in the pattern. */
-
- if (crc < 0)
- {
- memmove(slot + cd->name_entry_size, slot,
- IN_UCHARS((cd->names_found - i) * cd->name_entry_size));
- break;
- }
-
- /* Continue the loop for a later or duplicate name */
-
- slot += cd->name_entry_size;
- }
-
-PUT2(slot, 0, groupno);
-memcpy(slot + IMM2_SIZE, name, IN_UCHARS(length));
-slot[IMM2_SIZE + length] = 0;
-cd->names_found++;
-}
-
-
-
-/*************************************************
-* Compile a Regular Expression *
-*************************************************/
-
-/* This function takes a string and returns a pointer to a block of store
-holding a compiled version of the expression. The original API for this
-function had no error code return variable; it is retained for backwards
-compatibility. The new function is given a new name.
-
-Arguments:
- pattern the regular expression
- options various option bits
- errorcodeptr pointer to error code variable (pcre_compile2() only)
- can be NULL if you don't want a code value
- errorptr pointer to pointer to error text
- erroroffset ptr offset in pattern where error was detected
- tables pointer to character tables or NULL
-
-Returns: pointer to compiled data block, or NULL on error,
- with errorptr and erroroffset set
-*/
-
-#if defined COMPILE_PCRE8
-PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION
-pcre_compile(const char *pattern, int options, const char **errorptr,
- int *erroroffset, const unsigned char *tables)
-#elif defined COMPILE_PCRE16
-PCRE_EXP_DEFN pcre16 * PCRE_CALL_CONVENTION
-pcre16_compile(PCRE_SPTR16 pattern, int options, const char **errorptr,
- int *erroroffset, const unsigned char *tables)
-#elif defined COMPILE_PCRE32
-PCRE_EXP_DEFN pcre32 * PCRE_CALL_CONVENTION
-pcre32_compile(PCRE_SPTR32 pattern, int options, const char **errorptr,
- int *erroroffset, const unsigned char *tables)
-#endif
-{
-#if defined COMPILE_PCRE8
-return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables);
-#elif defined COMPILE_PCRE16
-return pcre16_compile2(pattern, options, NULL, errorptr, erroroffset, tables);
-#elif defined COMPILE_PCRE32
-return pcre32_compile2(pattern, options, NULL, errorptr, erroroffset, tables);
-#endif
-}
-
-
-#if defined COMPILE_PCRE8
-PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION
-pcre_compile2(const char *pattern, int options, int *errorcodeptr,
- const char **errorptr, int *erroroffset, const unsigned char *tables)
-#elif defined COMPILE_PCRE16
-PCRE_EXP_DEFN pcre16 * PCRE_CALL_CONVENTION
-pcre16_compile2(PCRE_SPTR16 pattern, int options, int *errorcodeptr,
- const char **errorptr, int *erroroffset, const unsigned char *tables)
-#elif defined COMPILE_PCRE32
-PCRE_EXP_DEFN pcre32 * PCRE_CALL_CONVENTION
-pcre32_compile2(PCRE_SPTR32 pattern, int options, int *errorcodeptr,
- const char **errorptr, int *erroroffset, const unsigned char *tables)
-#endif
-{
-REAL_PCRE *re;
-int length = 1; /* For final END opcode */
-pcre_int32 firstcharflags, reqcharflags;
-pcre_uint32 firstchar, reqchar;
-pcre_uint32 limit_match = PCRE_UINT32_MAX;
-pcre_uint32 limit_recursion = PCRE_UINT32_MAX;
-int newline;
-int errorcode = 0;
-int skipatstart = 0;
-BOOL utf;
-BOOL never_utf = FALSE;
-size_t size;
-pcre_uchar *code;
-const pcre_uchar *codestart;
-const pcre_uchar *ptr;
-compile_data compile_block;
-compile_data *cd = &compile_block;
-
-/* This space is used for "compiling" into during the first phase, when we are
-computing the amount of memory that is needed. Compiled items are thrown away
-as soon as possible, so that a fairly large buffer should be sufficient for
-this purpose. The same space is used in the second phase for remembering where
-to fill in forward references to subpatterns. That may overflow, in which case
-new memory is obtained from malloc(). */
-
-pcre_uchar cworkspace[COMPILE_WORK_SIZE];
-
-/* This vector is used for remembering name groups during the pre-compile. In a
-similar way to cworkspace, it can be expanded using malloc() if necessary. */
-
-named_group named_groups[NAMED_GROUP_LIST_SIZE];
-
-/* Set this early so that early errors get offset 0. */
-
-ptr = (const pcre_uchar *)pattern;
-
-/* We can't pass back an error message if errorptr is NULL; I guess the best we
-can do is just return NULL, but we can set a code value if there is a code
-pointer. */
-
-if (errorptr == NULL)
- {
- if (errorcodeptr != NULL) *errorcodeptr = 99;
- return NULL;
- }
-
-*errorptr = NULL;
-if (errorcodeptr != NULL) *errorcodeptr = ERR0;
-
-/* However, we can give a message for this error */
-
-if (erroroffset == NULL)
- {
- errorcode = ERR16;
- goto PCRE_EARLY_ERROR_RETURN2;
- }
-
-*erroroffset = 0;
-
-/* Set up pointers to the individual character tables */
-
-if (tables == NULL) tables = PRIV(default_tables);
-cd->lcc = tables + lcc_offset;
-cd->fcc = tables + fcc_offset;
-cd->cbits = tables + cbits_offset;
-cd->ctypes = tables + ctypes_offset;
-
-/* Check that all undefined public option bits are zero */
-
-if ((options & ~PUBLIC_COMPILE_OPTIONS) != 0)
- {
- errorcode = ERR17;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* If PCRE_NEVER_UTF is set, remember it. */
-
-if ((options & PCRE_NEVER_UTF) != 0) never_utf = TRUE;
-
-/* Check for global one-time settings at the start of the pattern, and remember
-the offset for later. */
-
-cd->external_flags = 0; /* Initialize here for LIMIT_MATCH/RECURSION */
-
-while (ptr[skipatstart] == CHAR_LEFT_PARENTHESIS &&
- ptr[skipatstart+1] == CHAR_ASTERISK)
- {
- int newnl = 0;
- int newbsr = 0;
-
-/* For completeness and backward compatibility, (*UTFn) is supported in the
-relevant libraries, but (*UTF) is generic and always supported. Note that
-PCRE_UTF8 == PCRE_UTF16 == PCRE_UTF32. */
-
-#ifdef COMPILE_PCRE8
- if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF8_RIGHTPAR, 5) == 0)
- { skipatstart += 7; options |= PCRE_UTF8; continue; }
-#endif
-#ifdef COMPILE_PCRE16
- if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF16_RIGHTPAR, 6) == 0)
- { skipatstart += 8; options |= PCRE_UTF16; continue; }
-#endif
-#ifdef COMPILE_PCRE32
- if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF32_RIGHTPAR, 6) == 0)
- { skipatstart += 8; options |= PCRE_UTF32; continue; }
-#endif
-
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF_RIGHTPAR, 4) == 0)
- { skipatstart += 6; options |= PCRE_UTF8; continue; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UCP_RIGHTPAR, 4) == 0)
- { skipatstart += 6; options |= PCRE_UCP; continue; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_NO_AUTO_POSSESS_RIGHTPAR, 16) == 0)
- { skipatstart += 18; options |= PCRE_NO_AUTO_POSSESS; continue; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_NO_START_OPT_RIGHTPAR, 13) == 0)
- { skipatstart += 15; options |= PCRE_NO_START_OPTIMIZE; continue; }
-
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_LIMIT_MATCH_EQ, 12) == 0)
- {
- pcre_uint32 c = 0;
- int p = skipatstart + 14;
- while (isdigit(ptr[p]))
- {
- if (c > PCRE_UINT32_MAX / 10 - 1) break; /* Integer overflow */
- c = c*10 + ptr[p++] - CHAR_0;
- }
- if (ptr[p++] != CHAR_RIGHT_PARENTHESIS) break;
- if (c < limit_match)
- {
- limit_match = c;
- cd->external_flags |= PCRE_MLSET;
- }
- skipatstart = p;
- continue;
- }
-
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_LIMIT_RECURSION_EQ, 16) == 0)
- {
- pcre_uint32 c = 0;
- int p = skipatstart + 18;
- while (isdigit(ptr[p]))
- {
- if (c > PCRE_UINT32_MAX / 10 - 1) break; /* Integer overflow check */
- c = c*10 + ptr[p++] - CHAR_0;
- }
- if (ptr[p++] != CHAR_RIGHT_PARENTHESIS) break;
- if (c < limit_recursion)
- {
- limit_recursion = c;
- cd->external_flags |= PCRE_RLSET;
- }
- skipatstart = p;
- continue;
- }
-
- if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_CR_RIGHTPAR, 3) == 0)
- { skipatstart += 5; newnl = PCRE_NEWLINE_CR; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_LF_RIGHTPAR, 3) == 0)
- { skipatstart += 5; newnl = PCRE_NEWLINE_LF; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_CRLF_RIGHTPAR, 5) == 0)
- { skipatstart += 7; newnl = PCRE_NEWLINE_CR + PCRE_NEWLINE_LF; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_ANY_RIGHTPAR, 4) == 0)
- { skipatstart += 6; newnl = PCRE_NEWLINE_ANY; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_ANYCRLF_RIGHTPAR, 8) == 0)
- { skipatstart += 10; newnl = PCRE_NEWLINE_ANYCRLF; }
-
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_BSR_ANYCRLF_RIGHTPAR, 12) == 0)
- { skipatstart += 14; newbsr = PCRE_BSR_ANYCRLF; }
- else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_BSR_UNICODE_RIGHTPAR, 12) == 0)
- { skipatstart += 14; newbsr = PCRE_BSR_UNICODE; }
-
- if (newnl != 0)
- options = (options & ~PCRE_NEWLINE_BITS) | newnl;
- else if (newbsr != 0)
- options = (options & ~(PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) | newbsr;
- else break;
- }
-
-/* PCRE_UTF(16|32) have the same value as PCRE_UTF8. */
-utf = (options & PCRE_UTF8) != 0;
-if (utf && never_utf)
- {
- errorcode = ERR78;
- goto PCRE_EARLY_ERROR_RETURN2;
- }
-
-/* Can't support UTF unless PCRE has been compiled to include the code. The
-return of an error code from PRIV(valid_utf)() is a new feature, introduced in
-release 8.13. It is passed back from pcre_[dfa_]exec(), but at the moment is
-not used here. */
-
-#ifdef SUPPORT_UTF
-if (utf && (options & PCRE_NO_UTF8_CHECK) == 0 &&
- (errorcode = PRIV(valid_utf)((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0)
- {
-#if defined COMPILE_PCRE8
- errorcode = ERR44;
-#elif defined COMPILE_PCRE16
- errorcode = ERR74;
-#elif defined COMPILE_PCRE32
- errorcode = ERR77;
-#endif
- goto PCRE_EARLY_ERROR_RETURN2;
- }
-#else
-if (utf)
- {
- errorcode = ERR32;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-#endif
-
-/* Can't support UCP unless PCRE has been compiled to include the code. */
-
-#ifndef SUPPORT_UCP
-if ((options & PCRE_UCP) != 0)
- {
- errorcode = ERR67;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-#endif
-
-/* Check validity of \R options. */
-
-if ((options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) ==
- (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))
- {
- errorcode = ERR56;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Handle different types of newline. The three bits give seven cases. The
-current code allows for fixed one- or two-byte sequences, plus "any" and
-"anycrlf". */
-
-switch (options & PCRE_NEWLINE_BITS)
- {
- case 0: newline = NEWLINE; break; /* Build-time default */
- case PCRE_NEWLINE_CR: newline = CHAR_CR; break;
- case PCRE_NEWLINE_LF: newline = CHAR_NL; break;
- case PCRE_NEWLINE_CR+
- PCRE_NEWLINE_LF: newline = (CHAR_CR << 8) | CHAR_NL; break;
- case PCRE_NEWLINE_ANY: newline = -1; break;
- case PCRE_NEWLINE_ANYCRLF: newline = -2; break;
- default: errorcode = ERR56; goto PCRE_EARLY_ERROR_RETURN;
- }
-
-if (newline == -2)
- {
- cd->nltype = NLTYPE_ANYCRLF;
- }
-else if (newline < 0)
- {
- cd->nltype = NLTYPE_ANY;
- }
-else
- {
- cd->nltype = NLTYPE_FIXED;
- if (newline > 255)
- {
- cd->nllen = 2;
- cd->nl[0] = (newline >> 8) & 255;
- cd->nl[1] = newline & 255;
- }
- else
- {
- cd->nllen = 1;
- cd->nl[0] = newline;
- }
- }
-
-/* Maximum back reference and backref bitmap. The bitmap records up to 31 back
-references to help in deciding whether (.*) can be treated as anchored or not.
-*/
-
-cd->top_backref = 0;
-cd->backref_map = 0;
-
-/* Reflect pattern for debugging output */
-
-DPRINTF(("------------------------------------------------------------------\n"));
-#ifdef PCRE_DEBUG
-print_puchar(stdout, (PCRE_PUCHAR)pattern);
-#endif
-DPRINTF(("\n"));
-
-/* Pretend to compile the pattern while actually just accumulating the length
-of memory required. This behaviour is triggered by passing a non-NULL final
-argument to compile_regex(). We pass a block of workspace (cworkspace) for it
-to compile parts of the pattern into; the compiled code is discarded when it is
-no longer needed, so hopefully this workspace will never overflow, though there
-is a test for its doing so. */
-
-cd->bracount = cd->final_bracount = 0;
-cd->names_found = 0;
-cd->name_entry_size = 0;
-cd->name_table = NULL;
-cd->dupnames = FALSE;
-cd->namedrefcount = 0;
-cd->start_code = cworkspace;
-cd->hwm = cworkspace;
-cd->start_workspace = cworkspace;
-cd->workspace_size = COMPILE_WORK_SIZE;
-cd->named_groups = named_groups;
-cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
-cd->start_pattern = (const pcre_uchar *)pattern;
-cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar *)pattern));
-cd->req_varyopt = 0;
-cd->parens_depth = 0;
-cd->assert_depth = 0;
-cd->max_lookbehind = 0;
-cd->external_options = options;
-cd->open_caps = NULL;
-
-/* Now do the pre-compile. On error, errorcode will be set non-zero, so we
-don't need to look at the result of the function here. The initial options have
-been put into the cd block so that they can be changed if an option setting is
-found within the regex right at the beginning. Bringing initial option settings
-outside can help speed up starting point checks. */
-
-ptr += skipatstart;
-code = cworkspace;
-*code = OP_BRA;
-
-(void)compile_regex(cd->external_options, &code, &ptr, &errorcode, FALSE,
- FALSE, 0, 0, &firstchar, &firstcharflags, &reqchar, &reqcharflags, NULL,
- cd, &length);
-if (errorcode != 0) goto PCRE_EARLY_ERROR_RETURN;
-
-DPRINTF(("end pre-compile: length=%d workspace=%d\n", length,
- (int)(cd->hwm - cworkspace)));
-
-if (length > MAX_PATTERN_SIZE)
- {
- errorcode = ERR20;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* If there are groups with duplicate names and there are also references by
-name, we must allow for the possibility of named references to duplicated
-groups. These require an extra data item each. */
-
-if (cd->dupnames && cd->namedrefcount > 0)
- length += cd->namedrefcount * IMM2_SIZE * sizeof(pcre_uchar);
-
-/* Compute the size of the data block for storing the compiled pattern. Integer
-overflow should no longer be possible because nowadays we limit the maximum
-value of cd->names_found and cd->name_entry_size. */
-
-size = sizeof(REAL_PCRE) +
- (length + cd->names_found * cd->name_entry_size) * sizeof(pcre_uchar);
-
-/* Get the memory. */
-
-re = (REAL_PCRE *)(PUBL(malloc))(size);
-if (re == NULL)
- {
- errorcode = ERR21;
- goto PCRE_EARLY_ERROR_RETURN;
- }
-
-/* Put in the magic number, and save the sizes, initial options, internal
-flags, and character table pointer. NULL is used for the default character
-tables. The nullpad field is at the end; it's there to help in the case when a
-regex compiled on a system with 4-byte pointers is run on another with 8-byte
-pointers. */
-
-re->magic_number = MAGIC_NUMBER;
-re->size = (int)size;
-re->options = cd->external_options;
-re->flags = cd->external_flags;
-re->limit_match = limit_match;
-re->limit_recursion = limit_recursion;
-re->first_char = 0;
-re->req_char = 0;
-re->name_table_offset = sizeof(REAL_PCRE) / sizeof(pcre_uchar);
-re->name_entry_size = cd->name_entry_size;
-re->name_count = cd->names_found;
-re->ref_count = 0;
-re->tables = (tables == PRIV(default_tables))? NULL : tables;
-re->nullpad = NULL;
-#ifdef COMPILE_PCRE32
-re->dummy = 0;
-#else
-re->dummy1 = re->dummy2 = re->dummy3 = 0;
-#endif
-
-/* The starting points of the name/number translation table and of the code are
-passed around in the compile data block. The start/end pattern and initial
-options are already set from the pre-compile phase, as is the name_entry_size
-field. Reset the bracket count and the names_found field. Also reset the hwm
-field; this time it's used for remembering forward references to subpatterns.
-*/
-
-cd->final_bracount = cd->bracount; /* Save for checking forward references */
-cd->parens_depth = 0;
-cd->assert_depth = 0;
-cd->bracount = 0;
-cd->max_lookbehind = 0;
-cd->name_table = (pcre_uchar *)re + re->name_table_offset;
-codestart = cd->name_table + re->name_entry_size * re->name_count;
-cd->start_code = codestart;
-cd->hwm = (pcre_uchar *)(cd->start_workspace);
-cd->req_varyopt = 0;
-cd->had_accept = FALSE;
-cd->had_pruneorskip = FALSE;
-cd->check_lookbehind = FALSE;
-cd->open_caps = NULL;
-
-/* If any named groups were found, create the name/number table from the list
-created in the first pass. */
-
-if (cd->names_found > 0)
- {
- int i = cd->names_found;
- named_group *ng = cd->named_groups;
- cd->names_found = 0;
- for (; i > 0; i--, ng++)
- add_name(cd, ng->name, ng->length, ng->number);
- if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
- (PUBL(free))((void *)cd->named_groups);
- }
-
-/* Set up a starting, non-extracting bracket, then compile the expression. On
-error, errorcode will be set non-zero, so we don't need to look at the result
-of the function here. */
-
-ptr = (const pcre_uchar *)pattern + skipatstart;
-code = (pcre_uchar *)codestart;
-*code = OP_BRA;
-(void)compile_regex(re->options, &code, &ptr, &errorcode, FALSE, FALSE, 0, 0,
- &firstchar, &firstcharflags, &reqchar, &reqcharflags, NULL, cd, NULL);
-re->top_bracket = cd->bracount;
-re->top_backref = cd->top_backref;
-re->max_lookbehind = cd->max_lookbehind;
-re->flags = cd->external_flags | PCRE_MODE;
-
-if (cd->had_accept)
- {
- reqchar = 0; /* Must disable after (*ACCEPT) */
- reqcharflags = REQ_NONE;
- }
-
-/* If not reached end of pattern on success, there's an excess bracket. */
-
-if (errorcode == 0 && *ptr != CHAR_NULL) errorcode = ERR22;
-
-/* Fill in the terminating state and check for disastrous overflow, but
-if debugging, leave the test till after things are printed out. */
-
-*code++ = OP_END;
-
-#ifndef PCRE_DEBUG
-if (code - codestart > length) errorcode = ERR23;
-#endif
-
-#ifdef SUPPORT_VALGRIND
-/* If the estimated length exceeds the really used length, mark the extra
-allocated memory as unaddressable, so that any out-of-bound reads can be
-detected. */
-VALGRIND_MAKE_MEM_NOACCESS(code, (length - (code - codestart)) * sizeof(pcre_uchar));
-#endif
-
-/* Fill in any forward references that are required. There may be repeated
-references; optimize for them, as searching a large regex takes time. */
-
-if (cd->hwm > cd->start_workspace)
- {
- int prev_recno = -1;
- const pcre_uchar *groupptr = NULL;
- while (errorcode == 0 && cd->hwm > cd->start_workspace)
- {
- int offset, recno;
- cd->hwm -= LINK_SIZE;
- offset = GET(cd->hwm, 0);
- recno = GET(codestart, offset);
- if (recno != prev_recno)
- {
- groupptr = PRIV(find_bracket)(codestart, utf, recno);
- prev_recno = recno;
- }
- if (groupptr == NULL) errorcode = ERR53;
- else PUT(((pcre_uchar *)codestart), offset, (int)(groupptr - codestart));
- }
- }
-
-/* If the workspace had to be expanded, free the new memory. Set the pointer to
-NULL to indicate that forward references have been filled in. */
-
-if (cd->workspace_size > COMPILE_WORK_SIZE)
- (PUBL(free))((void *)cd->start_workspace);
-cd->start_workspace = NULL;
-
-/* Give an error if there's back reference to a non-existent capturing
-subpattern. */
-
-if (errorcode == 0 && re->top_backref > re->top_bracket) errorcode = ERR15;
-
-/* Unless disabled, check whether single character iterators can be
-auto-possessified. The function overwrites the appropriate opcode values. */
-
-if ((options & PCRE_NO_AUTO_POSSESS) == 0)
- auto_possessify((pcre_uchar *)codestart, utf, cd);
-
-/* If there were any lookbehind assertions that contained OP_RECURSE
-(recursions or subroutine calls), a flag is set for them to be checked here,
-because they may contain forward references. Actual recursions cannot be fixed
-length, but subroutine calls can. It is done like this so that those without
-OP_RECURSE that are not fixed length get a diagnosic with a useful offset. The
-exceptional ones forgo this. We scan the pattern to check that they are fixed
-length, and set their lengths. */
-
-if (cd->check_lookbehind)
- {
- pcre_uchar *cc = (pcre_uchar *)codestart;
-
- /* Loop, searching for OP_REVERSE items, and process those that do not have
- their length set. (Actually, it will also re-process any that have a length
- of zero, but that is a pathological case, and it does no harm.) When we find
- one, we temporarily terminate the branch it is in while we scan it. */
-
- for (cc = (pcre_uchar *)PRIV(find_bracket)(codestart, utf, -1);
- cc != NULL;
- cc = (pcre_uchar *)PRIV(find_bracket)(cc, utf, -1))
- {
- if (GET(cc, 1) == 0)
- {
- int fixed_length;
- pcre_uchar *be = cc - 1 - LINK_SIZE + GET(cc, -LINK_SIZE);
- int end_op = *be;
- *be = OP_END;
- fixed_length = find_fixedlength(cc, (re->options & PCRE_UTF8) != 0, TRUE,
- cd);
- *be = end_op;
- DPRINTF(("fixed length = %d\n", fixed_length));
- if (fixed_length < 0)
- {
- errorcode = (fixed_length == -2)? ERR36 :
- (fixed_length == -4)? ERR70 : ERR25;
- break;
- }
- if (fixed_length > cd->max_lookbehind) cd->max_lookbehind = fixed_length;
- PUT(cc, 1, fixed_length);
- }
- cc += 1 + LINK_SIZE;
- }
- }
-
-/* Failed to compile, or error while post-processing */
-
-if (errorcode != 0)
- {
- (PUBL(free))(re);
- PCRE_EARLY_ERROR_RETURN:
- *erroroffset = (int)(ptr - (const pcre_uchar *)pattern);
- PCRE_EARLY_ERROR_RETURN2:
- *errorptr = find_error_text(errorcode);
- if (errorcodeptr != NULL) *errorcodeptr = errorcode;
- return NULL;
- }
-
-/* If the anchored option was not passed, set the flag if we can determine that
-the pattern is anchored by virtue of ^ characters or \A or anything else, such
-as starting with non-atomic .* when DOTALL is set and there are no occurrences
-of *PRUNE or *SKIP.
-
-Otherwise, if we know what the first byte has to be, save it, because that
-speeds up unanchored matches no end. If not, see if we can set the
-PCRE_STARTLINE flag. This is helpful for multiline matches when all branches
-start with ^. and also when all branches start with non-atomic .* for
-non-DOTALL matches when *PRUNE and SKIP are not present. */
-
-if ((re->options & PCRE_ANCHORED) == 0)
- {
- if (is_anchored(codestart, 0, cd, 0)) re->options |= PCRE_ANCHORED;
- else
- {
- if (firstcharflags < 0)
- firstchar = find_firstassertedchar(codestart, &firstcharflags, FALSE);
- if (firstcharflags >= 0) /* Remove caseless flag for non-caseable chars */
- {
-#if defined COMPILE_PCRE8
- re->first_char = firstchar & 0xff;
-#elif defined COMPILE_PCRE16
- re->first_char = firstchar & 0xffff;
-#elif defined COMPILE_PCRE32
- re->first_char = firstchar;
-#endif
- if ((firstcharflags & REQ_CASELESS) != 0)
- {
-#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)
- /* We ignore non-ASCII first chars in 8 bit mode. */
- if (utf)
- {
- if (re->first_char < 128)
- {
- if (cd->fcc[re->first_char] != re->first_char)
- re->flags |= PCRE_FCH_CASELESS;
- }
- else if (UCD_OTHERCASE(re->first_char) != re->first_char)
- re->flags |= PCRE_FCH_CASELESS;
- }
- else
-#endif
- if (MAX_255(re->first_char)
- && cd->fcc[re->first_char] != re->first_char)
- re->flags |= PCRE_FCH_CASELESS;
- }
-
- re->flags |= PCRE_FIRSTSET;
- }
-
- else if (is_startline(codestart, 0, cd, 0)) re->flags |= PCRE_STARTLINE;
- }
- }
-
-/* For an anchored pattern, we use the "required byte" only if it follows a
-variable length item in the regex. Remove the caseless flag for non-caseable
-bytes. */
-
-if (reqcharflags >= 0 &&
- ((re->options & PCRE_ANCHORED) == 0 || (reqcharflags & REQ_VARY) != 0))
- {
-#if defined COMPILE_PCRE8
- re->req_char = reqchar & 0xff;
-#elif defined COMPILE_PCRE16
- re->req_char = reqchar & 0xffff;
-#elif defined COMPILE_PCRE32
- re->req_char = reqchar;
-#endif
- if ((reqcharflags & REQ_CASELESS) != 0)
- {
-#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)
- /* We ignore non-ASCII first chars in 8 bit mode. */
- if (utf)
- {
- if (re->req_char < 128)
- {
- if (cd->fcc[re->req_char] != re->req_char)
- re->flags |= PCRE_RCH_CASELESS;
- }
- else if (UCD_OTHERCASE(re->req_char) != re->req_char)
- re->flags |= PCRE_RCH_CASELESS;
- }
- else
-#endif
- if (MAX_255(re->req_char) && cd->fcc[re->req_char] != re->req_char)
- re->flags |= PCRE_RCH_CASELESS;
- }
-
- re->flags |= PCRE_REQCHSET;
- }
-
-/* Print out the compiled data if debugging is enabled. This is never the
-case when building a production library. */
-
-#ifdef PCRE_DEBUG
-printf("Length = %d top_bracket = %d top_backref = %d\n",
- length, re->top_bracket, re->top_backref);
-
-printf("Options=%08x\n", re->options);
-
-if ((re->flags & PCRE_FIRSTSET) != 0)
- {
- pcre_uchar ch = re->first_char;
- const char *caseless =
- ((re->flags & PCRE_FCH_CASELESS) == 0)? "" : " (caseless)";
- if (PRINTABLE(ch)) printf("First char = %c%s\n", ch, caseless);
- else printf("First char = \\x%02x%s\n", ch, caseless);
- }
-
-if ((re->flags & PCRE_REQCHSET) != 0)
- {
- pcre_uchar ch = re->req_char;
- const char *caseless =
- ((re->flags & PCRE_RCH_CASELESS) == 0)? "" : " (caseless)";
- if (PRINTABLE(ch)) printf("Req char = %c%s\n", ch, caseless);
- else printf("Req char = \\x%02x%s\n", ch, caseless);
- }
-
-#if defined COMPILE_PCRE8
-pcre_printint((pcre *)re, stdout, TRUE);
-#elif defined COMPILE_PCRE16
-pcre16_printint((pcre *)re, stdout, TRUE);
-#elif defined COMPILE_PCRE32
-pcre32_printint((pcre *)re, stdout, TRUE);
-#endif
-
-/* This check is done here in the debugging case so that the code that
-was compiled can be seen. */
-
-if (code - codestart > length)
- {
- (PUBL(free))(re);
- *errorptr = find_error_text(ERR23);
- *erroroffset = ptr - (pcre_uchar *)pattern;
- if (errorcodeptr != NULL) *errorcodeptr = ERR23;
- return NULL;
- }
-#endif /* PCRE_DEBUG */
-
-/* Check for a pattern than can match an empty string, so that this information
-can be provided to applications. */
-
-do
- {
- if (could_be_empty_branch(codestart, code, utf, cd, NULL))
- {
- re->flags |= PCRE_MATCH_EMPTY;
- break;
- }
- codestart += GET(codestart, 1);
- }
-while (*codestart == OP_ALT);
-
-#if defined COMPILE_PCRE8
-return (pcre *)re;
-#elif defined COMPILE_PCRE16
-return (pcre16 *)re;
-#elif defined COMPILE_PCRE32
-return (pcre32 *)re;
-#endif
-}
-
-/* End of pcre_compile.c */
-
diff --git a/.pc/no_jit_x32_powerpcspe.patch/sljit/sljitConfigInternal.h b/.pc/no_jit_x32_powerpcspe.patch/sljit/sljitConfigInternal.h
deleted file mode 100644
index 89be38b..0000000
--- a/.pc/no_jit_x32_powerpcspe.patch/sljit/sljitConfigInternal.h
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * Stack-less Just-In-Time compiler
- *
- * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- *
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) 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 HOLDER(S) 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.
- */
-
-#ifndef _SLJIT_CONFIG_INTERNAL_H_
-#define _SLJIT_CONFIG_INTERNAL_H_
-
-/*
- SLJIT defines the following macros depending on the target architecture:
-
- Feature detection (boolean) macros:
- SLJIT_32BIT_ARCHITECTURE : 32 bit architecture
- SLJIT_64BIT_ARCHITECTURE : 64 bit architecture
- SLJIT_WORD_SHIFT : the shift required to apply when accessing a sljit_sw/sljit_uw array by index
- SLJIT_DOUBLE_SHIFT : the shift required to apply when accessing a double array by index
- SLJIT_LITTLE_ENDIAN : little endian architecture
- SLJIT_BIG_ENDIAN : big endian architecture
- SLJIT_UNALIGNED : allows unaligned memory accesses for non-fpu operations (only!)
- SLJIT_INDIRECT_CALL : see SLJIT_FUNC_OFFSET() for more information
- SLJIT_RETURN_ADDRESS_OFFSET : a return instruction always adds this offset to the return address
-
- Types and useful macros:
- sljit_sb, sljit_ub : signed and unsigned 8 bit byte
- sljit_sh, sljit_uh : signed and unsigned 16 bit half-word (short) type
- sljit_si, sljit_ui : signed and unsigned 32 bit integer type
- sljit_sw, sljit_uw : signed and unsigned machine word, enough to store a pointer
- sljit_p : unsgined pointer value (usually the same as sljit_uw, but
- some 64 bit ABIs may use 32 bit pointers)
- sljit_s : single precision floating point value
- sljit_d : double precision floating point value
- SLJIT_CALL : C calling convention define for both calling JIT form C and C callbacks for JIT
- SLJIT_W(number) : defining 64 bit constants on 64 bit architectures (compiler independent helper)
-*/
-
-#if !((defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) \
- || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) \
- || (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) \
- || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7) \
- || (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2) \
- || (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) \
- || (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) \
- || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) \
- || (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) \
- || (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) \
- || (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) \
- || (defined SLJIT_CONFIG_TILEGX && SLJIT_CONFIG_TILEGX) \
- || (defined SLJIT_CONFIG_AUTO && SLJIT_CONFIG_AUTO) \
- || (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED))
-#error "An architecture must be selected"
-#endif
-
-/* Sanity check. */
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) \
- + (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) \
- + (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) \
- + (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7) \
- + (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2) \
- + (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) \
- + (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) \
- + (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) \
- + (defined SLJIT_CONFIG_TILEGX && SLJIT_CONFIG_TILEGX) \
- + (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) \
- + (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) \
- + (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) \
- + (defined SLJIT_CONFIG_AUTO && SLJIT_CONFIG_AUTO) \
- + (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED) >= 2
-#error "Multiple architectures are selected"
-#endif
-
-/* Auto select option (requires compiler support) */
-#if (defined SLJIT_CONFIG_AUTO && SLJIT_CONFIG_AUTO)
-
-#ifndef _WIN32
-
-#if defined(__i386__) || defined(__i386)
-#define SLJIT_CONFIG_X86_32 1
-#elif defined(__x86_64__)
-#define SLJIT_CONFIG_X86_64 1
-#elif defined(__arm__) || defined(__ARM__)
-#ifdef __thumb2__
-#define SLJIT_CONFIG_ARM_THUMB2 1
-#elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__)
-#define SLJIT_CONFIG_ARM_V7 1
-#else
-#define SLJIT_CONFIG_ARM_V5 1
-#endif
-#elif defined (__aarch64__)
-#define SLJIT_CONFIG_ARM_64 1
-#elif defined(__ppc64__) || defined(__powerpc64__) || defined(_ARCH_PPC64) || (defined(_POWER) && defined(__64BIT__))
-#define SLJIT_CONFIG_PPC_64 1
-#elif defined(__ppc__) || defined(__powerpc__) || defined(_ARCH_PPC) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_POWER)
-#define SLJIT_CONFIG_PPC_32 1
-#elif defined(__mips__) && !defined(_LP64)
-#define SLJIT_CONFIG_MIPS_32 1
-#elif defined(__mips64)
-#define SLJIT_CONFIG_MIPS_64 1
-#elif defined(__sparc__) || defined(__sparc)
-#define SLJIT_CONFIG_SPARC_32 1
-#elif defined(__tilegx__)
-#define SLJIT_CONFIG_TILEGX 1
-#else
-/* Unsupported architecture */
-#define SLJIT_CONFIG_UNSUPPORTED 1
-#endif
-
-#else /* !_WIN32 */
-
-#if defined(_M_X64) || defined(__x86_64__)
-#define SLJIT_CONFIG_X86_64 1
-#elif defined(_ARM_)
-#define SLJIT_CONFIG_ARM_V5 1
-#else
-#define SLJIT_CONFIG_X86_32 1
-#endif
-
-#endif /* !WIN32 */
-#endif /* SLJIT_CONFIG_AUTO */
-
-#if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
-#undef SLJIT_EXECUTABLE_ALLOCATOR
-#endif
-
-#if !(defined SLJIT_STD_MACROS_DEFINED && SLJIT_STD_MACROS_DEFINED)
-
-/* These libraries are needed for the macros below. */
-#include <stdlib.h>
-#include <string.h>
-
-#endif /* STD_MACROS_DEFINED */
-
-/* General macros:
- Note: SLJIT is designed to be independent from them as possible.
-
- In release mode (SLJIT_DEBUG is not defined) only the following macros are needed:
-*/
-
-#ifndef SLJIT_MALLOC
-#define SLJIT_MALLOC(size) malloc(size)
-#endif
-
-#ifndef SLJIT_FREE
-#define SLJIT_FREE(ptr) free(ptr)
-#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
-
-#if !defined(SLJIT_LIKELY) && !defined(SLJIT_UNLIKELY)
-
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-#define SLJIT_LIKELY(x) __builtin_expect((x), 1)
-#define SLJIT_UNLIKELY(x) __builtin_expect((x), 0)
-#else
-#define SLJIT_LIKELY(x) (x)
-#define SLJIT_UNLIKELY(x) (x)
-#endif
-
-#endif /* !defined(SLJIT_LIKELY) && !defined(SLJIT_UNLIKELY) */
-
-#ifndef SLJIT_INLINE
-/* Inline functions. Some old compilers do not support them. */
-#if defined(__SUNPRO_C) && __SUNPRO_C <= 0x510
-#define SLJIT_INLINE
-#else
-#define SLJIT_INLINE __inline
-#endif
-#endif /* !SLJIT_INLINE */
-
-#ifndef SLJIT_CONST
-/* Const variables. */
-#define SLJIT_CONST const
-#endif
-
-#ifndef SLJIT_UNUSED_ARG
-/* Unused arguments. */
-#define SLJIT_UNUSED_ARG(arg) (void)arg
-#endif
-
-#if (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC)
-/* Static ABI functions. For all-in-one programs. */
-
-#if defined(__GNUC__)
-/* Disable unused warnings in gcc. */
-#define SLJIT_API_FUNC_ATTRIBUTE static __attribute__((unused))
-#else
-#define SLJIT_API_FUNC_ATTRIBUTE static
-#endif
-
-#else
-#define SLJIT_API_FUNC_ATTRIBUTE
-#endif /* (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC) */
-
-#ifndef SLJIT_CACHE_FLUSH
-
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
-
-/* Not required to implement on archs with unified caches. */
-#define SLJIT_CACHE_FLUSH(from, to)
-
-#elif defined __APPLE__
-
-/* Supported by all macs since Mac OS 10.5.
- However, it does not work on non-jailbroken iOS devices,
- although the compilation is successful. */
-
-#define SLJIT_CACHE_FLUSH(from, to) \
- sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from))
-
-#elif defined __ANDROID__
-
-/* Android lacks __clear_cache; instead, cacheflush should be used. */
-
-#define SLJIT_CACHE_FLUSH(from, to) \
- cacheflush((long)(from), (long)(to), 0)
-
-#elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
-
-/* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */
-#define SLJIT_CACHE_FLUSH(from, to) \
- ppc_cache_flush((from), (to))
-
-#elif (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
-
-/* The __clear_cache() implementation of GCC is a dummy function on Sparc. */
-#define SLJIT_CACHE_FLUSH(from, to) \
- sparc_cache_flush((from), (to))
-
-#else
-
-/* Calls __ARM_NR_cacheflush on ARM-Linux. */
-#define SLJIT_CACHE_FLUSH(from, to) \
- __clear_cache((char*)(from), (char*)(to))
-
-#endif
-
-#endif /* !SLJIT_CACHE_FLUSH */
-
-/* 8 bit byte type. */
-typedef unsigned char sljit_ub;
-typedef signed char sljit_sb;
-
-/* 16 bit half-word type. */
-typedef unsigned short int sljit_uh;
-typedef signed short int sljit_sh;
-
-/* 32 bit integer type. */
-typedef unsigned int sljit_ui;
-typedef signed int sljit_si;
-
-/* Machine word type. Can encapsulate a pointer.
- 32 bit for 32 bit machines.
- 64 bit for 64 bit machines. */
-#if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
-/* Just to have something. */
-#define SLJIT_WORD_SHIFT 0
-typedef unsigned long int sljit_uw;
-typedef long int sljit_sw;
-#elif !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) \
- && !(defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) \
- && !(defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) \
- && !(defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) \
- && !(defined SLJIT_CONFIG_TILEGX && SLJIT_CONFIG_TILEGX)
-#define SLJIT_32BIT_ARCHITECTURE 1
-#define SLJIT_WORD_SHIFT 2
-typedef unsigned int sljit_uw;
-typedef int sljit_sw;
-#else
-#define SLJIT_64BIT_ARCHITECTURE 1
-#define SLJIT_WORD_SHIFT 3
-#ifdef _WIN32
-typedef unsigned __int64 sljit_uw;
-typedef __int64 sljit_sw;
-#else
-typedef unsigned long int sljit_uw;
-typedef long int sljit_sw;
-#endif
-#endif
-
-typedef sljit_uw sljit_p;
-
-/* Floating point types. */
-typedef float sljit_s;
-typedef double sljit_d;
-
-/* Shift for pointer sized data. */
-#define SLJIT_POINTER_SHIFT SLJIT_WORD_SHIFT
-
-/* Shift for double precision sized data. */
-#define SLJIT_DOUBLE_SHIFT 3
-
-#ifndef SLJIT_W
-
-/* Defining long constants. */
-#if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
-#define SLJIT_W(w) (w##ll)
-#else
-#define SLJIT_W(w) (w)
-#endif
-
-#endif /* !SLJIT_W */
-
-#ifndef SLJIT_CALL
-
-/* ABI (Application Binary Interface) types. */
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
-
-#if defined(__GNUC__) && !defined(__APPLE__)
-
-#define SLJIT_CALL __attribute__ ((fastcall))
-#define SLJIT_X86_32_FASTCALL 1
-
-#elif defined(_MSC_VER)
-
-#define SLJIT_CALL __fastcall
-#define SLJIT_X86_32_FASTCALL 1
-
-#elif defined(__BORLANDC__)
-
-#define SLJIT_CALL __msfastcall
-#define SLJIT_X86_32_FASTCALL 1
-
-#else /* Unknown compiler. */
-
-/* The cdecl attribute is the default. */
-#define SLJIT_CALL
-
-#endif
-
-#else /* Non x86-32 architectures. */
-
-#define SLJIT_CALL
-
-#endif /* SLJIT_CONFIG_X86_32 */
-
-#endif /* !SLJIT_CALL */
-
-#if !defined(SLJIT_BIG_ENDIAN) && !defined(SLJIT_LITTLE_ENDIAN)
-
-/* These macros are useful for the applications. */
-#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) \
- || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
-
-#ifdef __LITTLE_ENDIAN__
-#define SLJIT_LITTLE_ENDIAN 1
-#else
-#define SLJIT_BIG_ENDIAN 1
-#endif
-
-#elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) \
- || (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
-
-#ifdef __MIPSEL__
-#define SLJIT_LITTLE_ENDIAN 1
-#else
-#define SLJIT_BIG_ENDIAN 1
-#endif
-
-#elif (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
-
-#define SLJIT_BIG_ENDIAN 1
-
-#else
-#define SLJIT_LITTLE_ENDIAN 1
-#endif
-
-#endif /* !defined(SLJIT_BIG_ENDIAN) && !defined(SLJIT_LITTLE_ENDIAN) */
-
-/* Sanity check. */
-#if (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN) && (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
-#error "Exactly one endianness must be selected"
-#endif
-
-#if !(defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN) && !(defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
-#error "Exactly one endianness must be selected"
-#endif
-
-#ifndef SLJIT_INDIRECT_CALL
-#if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN)) \
- || ((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. */
-#define SLJIT_INDIRECT_CALL 1
-#endif
-#endif /* SLJIT_INDIRECT_CALL */
-
-#ifndef SLJIT_RETURN_ADDRESS_OFFSET
-#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
-#define SLJIT_RETURN_ADDRESS_OFFSET 8
-#else
-#define SLJIT_RETURN_ADDRESS_OFFSET 0
-#endif
-#endif /* SLJIT_RETURN_ADDRESS_OFFSET */
-
-#ifndef SLJIT_SSE2
-
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
-/* Turn on SSE2 support on x86. */
-#define SLJIT_SSE2 1
-
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
-/* Auto detect SSE2 support using CPUID.
- On 64 bit x86 cpus, sse2 must be present. */
-#define SLJIT_DETECT_SSE2 1
-#endif
-
-#endif /* (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) */
-
-#endif /* !SLJIT_SSE2 */
-
-#ifndef SLJIT_UNALIGNED
-
-#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) \
- || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) \
- || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7) \
- || (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2) \
- || (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) \
- || (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) \
- || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
-#define SLJIT_UNALIGNED 1
-#endif
-
-#endif /* !SLJIT_UNALIGNED */
-
-#if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
-SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size);
-SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* ptr);
-SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void);
-#define SLJIT_MALLOC_EXEC(size) sljit_malloc_exec(size)
-#define SLJIT_FREE_EXEC(ptr) sljit_free_exec(ptr)
-#endif
-
-#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
-#include <stdio.h>
-#endif
-
-#if (defined SLJIT_DEBUG && SLJIT_DEBUG)
-
-#if !defined(SLJIT_ASSERT) || !defined(SLJIT_ASSERT_STOP)
-
-/* SLJIT_HALT_PROCESS must halt the process. */
-#ifndef SLJIT_HALT_PROCESS
-#include <stdlib.h>
-
-#define SLJIT_HALT_PROCESS() \
- abort();
-#endif /* !SLJIT_HALT_PROCESS */
-
-#include <stdio.h>
-
-#endif /* !SLJIT_ASSERT || !SLJIT_ASSERT_STOP */
-
-/* Feel free to redefine these two macros. */
-#ifndef SLJIT_ASSERT
-
-#define SLJIT_ASSERT(x) \
- do { \
- if (SLJIT_UNLIKELY(!(x))) { \
- printf("Assertion failed at " __FILE__ ":%d\n", __LINE__); \
- SLJIT_HALT_PROCESS(); \
- } \
- } while (0)
-
-#endif /* !SLJIT_ASSERT */
-
-#ifndef SLJIT_ASSERT_STOP
-
-#define SLJIT_ASSERT_STOP() \
- do { \
- printf("Should never been reached " __FILE__ ":%d\n", __LINE__); \
- SLJIT_HALT_PROCESS(); \
- } while (0)
-
-#endif /* !SLJIT_ASSERT_STOP */
-
-#else /* (defined SLJIT_DEBUG && SLJIT_DEBUG) */
-
-/* Forcing empty, but valid statements. */
-#undef SLJIT_ASSERT
-#undef SLJIT_ASSERT_STOP
-
-#define SLJIT_ASSERT(x) \
- do { } while (0)
-#define SLJIT_ASSERT_STOP() \
- do { } while (0)
-
-#endif /* (defined SLJIT_DEBUG && SLJIT_DEBUG) */
-
-#ifndef SLJIT_COMPILE_ASSERT
-
-/* Should be improved eventually. */
-#define SLJIT_COMPILE_ASSERT(x, description) \
- SLJIT_ASSERT(x)
-
-#endif /* !SLJIT_COMPILE_ASSERT */
-
-#endif
diff --git a/.pc/pcre_info.patch/Makefile.am b/.pc/pcre_info.patch/Makefile.am
deleted file mode 100644
index 5f640b0..0000000
--- a/.pc/pcre_info.patch/Makefile.am
+++ /dev/null
@@ -1,894 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-
-ACLOCAL_AMFLAGS = -I m4
-
-dist_doc_DATA = \
- doc/pcre.txt \
- doc/pcre-config.txt \
- doc/pcregrep.txt \
- doc/pcretest.txt \
- AUTHORS \
- COPYING \
- ChangeLog \
- LICENCE \
- NEWS \
- README
-
-# Note that pcrecpp.html is not in this list; it is listed separately below.
-
-dist_html_DATA = \
- doc/html/NON-AUTOTOOLS-BUILD.txt \
- doc/html/README.txt \
- doc/html/index.html \
- doc/html/pcre-config.html \
- doc/html/pcre.html \
- doc/html/pcre16.html \
- doc/html/pcre32.html \
- doc/html/pcre_assign_jit_stack.html \
- doc/html/pcre_compile.html \
- doc/html/pcre_compile2.html \
- doc/html/pcre_config.html \
- doc/html/pcre_copy_named_substring.html \
- doc/html/pcre_copy_substring.html \
- doc/html/pcre_dfa_exec.html \
- doc/html/pcre_exec.html \
- doc/html/pcre_free_study.html \
- doc/html/pcre_free_substring.html \
- doc/html/pcre_free_substring_list.html \
- doc/html/pcre_fullinfo.html \
- doc/html/pcre_get_named_substring.html \
- doc/html/pcre_get_stringnumber.html \
- doc/html/pcre_get_stringtable_entries.html \
- doc/html/pcre_get_substring.html \
- doc/html/pcre_get_substring_list.html \
- doc/html/pcre_jit_exec.html \
- doc/html/pcre_jit_stack_alloc.html \
- doc/html/pcre_jit_stack_free.html \
- doc/html/pcre_maketables.html \
- doc/html/pcre_pattern_to_host_byte_order.html \
- doc/html/pcre_refcount.html \
- doc/html/pcre_study.html \
- doc/html/pcre_utf16_to_host_byte_order.html \
- doc/html/pcre_utf32_to_host_byte_order.html \
- doc/html/pcre_version.html \
- doc/html/pcreapi.html \
- doc/html/pcrebuild.html \
- doc/html/pcrecallout.html \
- doc/html/pcrecompat.html \
- doc/html/pcredemo.html \
- doc/html/pcregrep.html \
- doc/html/pcrejit.html \
- doc/html/pcrelimits.html \
- doc/html/pcrematching.html \
- doc/html/pcrepartial.html \
- doc/html/pcrepattern.html \
- doc/html/pcreperform.html \
- doc/html/pcreposix.html \
- doc/html/pcreprecompile.html \
- doc/html/pcresample.html \
- doc/html/pcrestack.html \
- doc/html/pcresyntax.html \
- doc/html/pcretest.html \
- doc/html/pcreunicode.html
-
-pcrecpp_html = doc/html/pcrecpp.html
-dist_noinst_DATA = $(pcrecpp_html)
-
-if WITH_PCRE_CPP
-html_DATA = $(pcrecpp_html)
-endif
-
-# The Libtool libraries to install. We'll add to this later.
-lib_LTLIBRARIES =
-
-# Unit tests you want to run when people type 'make check'.
-# TESTS is for binary unit tests, check_SCRIPTS for script-based tests
-TESTS =
-check_SCRIPTS =
-dist_noinst_SCRIPTS =
-
-# Some of the binaries we make are to be installed, and others are
-# (non-user-visible) helper programs needed to build libpcre, libpcre16
-# or libpcre32.
-bin_PROGRAMS =
-noinst_PROGRAMS =
-
-# Additional files to delete on 'make clean' and 'make maintainer-clean'.
-CLEANFILES =
-MAINTAINERCLEANFILES =
-
-# Additional files to bundle with the distribution, over and above what
-# the Autotools include by default.
-EXTRA_DIST =
-
-# These files contain additional m4 macros that are used by autoconf.
-EXTRA_DIST += \
- m4/ax_pthread.m4 m4/pcre_visibility.m4
-
-# These files contain maintenance information
-EXTRA_DIST += \
- doc/perltest.txt \
- NON-UNIX-USE \
- NON-AUTOTOOLS-BUILD \
- HACKING
-
-# These files are used in the preparation of a release
-EXTRA_DIST += \
- PrepareRelease \
- CheckMan \
- CleanTxt \
- Detrail \
- 132html \
- doc/index.html.src
-
-# These files are to do with building for Virtual Pascal
-EXTRA_DIST += \
- makevp.bat \
- makevp_c.txt \
- makevp_l.txt \
- pcregexp.pas
-
-# These files are usable versions of pcre.h and config.h that are distributed
-# for the benefit of people who are building PCRE manually, without the
-# Autotools support.
-EXTRA_DIST += \
- pcre.h.generic \
- config.h.generic
-
-# The only difference between pcre.h.in and pcre.h is the setting of the PCRE
-# version number. Therefore, we can create the generic version just by copying.
-pcre.h.generic: pcre.h.in configure.ac
- rm -f $@
- cp -p pcre.h $@
-
-# It is more complicated for config.h.generic. We need the version that results
-# from a default configuration so as to get all the default values for PCRE
-# configuration macros such as MATCH_LIMIT and NEWLINE. We can get this by
-# doing a configure in a temporary directory. However, some trickery is needed,
-# because the source directory may already be configured. If you just try
-# running configure in a new directory, it complains. For this reason, we move
-# config.status out of the way while doing the default configuration. The
-# resulting config.h is munged by perl to put #ifdefs round any #defines for
-# macros with values, and to #undef all boolean macros such as HAVE_xxx and
-# SUPPORT_xxx. We also get rid of any gcc-specific visibility settings. Make
-# sure that PCRE_EXP_DEFN is unset (in case it has visibility settings).
-config.h.generic: configure.ac
- rm -rf $@ _generic
- mkdir _generic
- cs=$(srcdir)/config.status; test ! -f $$cs || mv -f $$cs $$cs.aside
- cd _generic && $(abs_top_srcdir)/configure || :
- cs=$(srcdir)/config.status; test ! -f $$cs.aside || mv -f $$cs.aside $$cs
- test -f _generic/config.h
- perl -n \
- -e 'BEGIN{$$blank=0;}' \
- -e 'if(/PCRE_EXP_DEFN/){print"/* #undef PCRE_EXP_DEFN */\n";$$blank=0;next;}' \
- -e 'if(/to make a symbol visible/){next;}' \
- -e 'if(/__attribute__ \(\(visibility/){next;}' \
- -e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \
- -e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \
- -e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \
- -e 'if(/^\s*$$/){print unless $$blank; $$blank=1;} else{print;$$blank=0;}' \
- _generic/config.h >$@
- rm -rf _generic
-
-MAINTAINERCLEANFILES += pcre.h.generic config.h.generic
-
-# These are the header files we'll install. We do not distribute pcre.h because
-# it is generated from pcre.h.in.
-nodist_include_HEADERS = \
- pcre.h
-include_HEADERS = \
- pcreposix.h
-
-# These additional headers will be be installed if C++ support is enabled. We
-# do not distribute pcrecpparg.h or pcre_stringpiece.h, as these are generated
-# from corresponding .h.in files (which we do distribute).
-if WITH_PCRE_CPP
-nodist_include_HEADERS += \
- pcrecpparg.h \
- pcre_stringpiece.h
-include_HEADERS += \
- pcrecpp.h \
- pcre_scanner.h
-endif # WITH_PCRE_CPP
-
-bin_SCRIPTS = pcre-config
-
-## ---------------------------------------------------------------
-## The dftables program is used to rebuild character tables before compiling
-## PCRE, if --enable-rebuild-chartables is specified. It is not a user-visible
-## program. The default (when --enable-rebuild-chartables is not specified) is
-## to copy a distributed set of tables that are defined for ASCII code. In this
-## case, dftables is not needed.
-
-if WITH_REBUILD_CHARTABLES
-
-noinst_PROGRAMS += dftables
-dftables_SOURCES = dftables.c
-
-pcre_chartables.c: dftables$(EXEEXT)
- ./dftables$(EXEEXT) $@
-else
-
-pcre_chartables.c: $(srcdir)/pcre_chartables.c.dist
- rm -f $@
- $(LN_S) $(srcdir)/pcre_chartables.c.dist $@
-
-endif # WITH_REBUILD_CHARTABLES
-
-BUILT_SOURCES = pcre_chartables.c
-
-## The main pcre library
-
-# Build the 8 bit library if it is enabled.
-if WITH_PCRE8
-lib_LTLIBRARIES += libpcre.la
-
-libpcre_la_SOURCES = \
- pcre_byte_order.c \
- pcre_compile.c \
- pcre_config.c \
- pcre_dfa_exec.c \
- pcre_exec.c \
- pcre_fullinfo.c \
- pcre_get.c \
- pcre_globals.c \
- pcre_internal.h \
- pcre_jit_compile.c \
- pcre_maketables.c \
- pcre_newline.c \
- pcre_ord2utf8.c \
- pcre_refcount.c \
- pcre_string_utils.c \
- pcre_study.c \
- pcre_tables.c \
- pcre_ucd.c \
- pcre_valid_utf8.c \
- pcre_version.c \
- pcre_xclass.c \
- ucp.h
-
-libpcre_la_CFLAGS = \
- $(VISIBILITY_CFLAGS) \
- $(AM_CFLAGS)
-
-libpcre_la_LIBADD =
-
-## This file is generated as part of the building process, so don't distribute.
-nodist_libpcre_la_SOURCES = \
- pcre_chartables.c
-
-endif # WITH_PCRE8
-
-# Build the 16 bit library if it is enabled.
-if WITH_PCRE16
-lib_LTLIBRARIES += libpcre16.la
-libpcre16_la_SOURCES = \
- pcre16_byte_order.c \
- pcre16_chartables.c \
- pcre16_compile.c \
- pcre16_config.c \
- pcre16_dfa_exec.c \
- pcre16_exec.c \
- pcre16_fullinfo.c \
- pcre16_get.c \
- pcre16_globals.c \
- pcre16_jit_compile.c \
- pcre16_maketables.c \
- pcre16_newline.c \
- pcre16_ord2utf16.c \
- pcre16_refcount.c \
- pcre16_string_utils.c \
- pcre16_study.c \
- pcre16_tables.c \
- pcre16_ucd.c \
- pcre16_utf16_utils.c \
- pcre16_valid_utf16.c \
- pcre16_version.c \
- pcre16_xclass.c
-
-libpcre16_la_CFLAGS = \
- $(VISIBILITY_CFLAGS) \
- $(AM_CFLAGS)
-
-libpcre16_la_LIBADD =
-
-## This file is generated as part of the building process, so don't distribute.
-nodist_libpcre16_la_SOURCES = \
- pcre_chartables.c
-
-endif # WITH_PCRE16
-
-# Build the 32 bit library if it is enabled.
-if WITH_PCRE32
-lib_LTLIBRARIES += libpcre32.la
-libpcre32_la_SOURCES = \
- pcre32_byte_order.c \
- pcre32_chartables.c \
- pcre32_compile.c \
- pcre32_config.c \
- pcre32_dfa_exec.c \
- pcre32_exec.c \
- pcre32_fullinfo.c \
- pcre32_get.c \
- pcre32_globals.c \
- pcre32_jit_compile.c \
- pcre32_maketables.c \
- pcre32_newline.c \
- pcre32_ord2utf32.c \
- pcre32_refcount.c \
- pcre32_string_utils.c \
- pcre32_study.c \
- pcre32_tables.c \
- pcre32_ucd.c \
- pcre32_utf32_utils.c \
- pcre32_valid_utf32.c \
- pcre32_version.c \
- pcre32_xclass.c
-
-libpcre32_la_CFLAGS = \
- $(VISIBILITY_CFLAGS) \
- $(AM_CFLAGS)
-
-libpcre32_la_LIBADD =
-
-## This file is generated as part of the building process, so don't distribute.
-nodist_libpcre32_la_SOURCES = \
- pcre_chartables.c
-
-endif # WITH_PCRE32
-
-# The pcre_chartables.c.dist file is the default version of pcre_chartables.c,
-# used unless --enable-rebuild-chartables is specified.
-EXTRA_DIST += pcre_chartables.c.dist
-
-# The JIT compiler lives in a separate directory, but its files are #included
-# when pcre_jit_compile.c is processed, so they must be distributed.
-EXTRA_DIST += \
- sljit/sljitConfig.h \
- sljit/sljitConfigInternal.h \
- sljit/sljitExecAllocator.c \
- sljit/sljitLir.c \
- sljit/sljitLir.h \
- sljit/sljitNativeARM_32.c \
- sljit/sljitNativeARM_64.c \
- sljit/sljitNativeARM_T2_32.c \
- sljit/sljitNativeMIPS_32.c \
- sljit/sljitNativeMIPS_64.c \
- sljit/sljitNativeMIPS_common.c \
- sljit/sljitNativePPC_32.c \
- sljit/sljitNativePPC_64.c \
- sljit/sljitNativePPC_common.c \
- sljit/sljitNativeSPARC_32.c \
- sljit/sljitNativeSPARC_common.c \
- sljit/sljitNativeTILEGX_64.c \
- sljit/sljitNativeTILEGX-encoder.c \
- sljit/sljitNativeX86_32.c \
- sljit/sljitNativeX86_64.c \
- sljit/sljitNativeX86_common.c \
- sljit/sljitUtils.c
-
-if WITH_PCRE8
-libpcre_la_LDFLAGS = $(EXTRA_LIBPCRE_LDFLAGS)
-endif # WITH_PCRE8
-if WITH_PCRE16
-libpcre16_la_LDFLAGS = $(EXTRA_LIBPCRE16_LDFLAGS)
-endif # WITH_PCRE16
-if WITH_PCRE32
-libpcre32_la_LDFLAGS = $(EXTRA_LIBPCRE32_LDFLAGS)
-endif # WITH_PCRE32
-
-if WITH_VALGRIND
-if WITH_PCRE8
-libpcre_la_CFLAGS += $(VALGRIND_CFLAGS)
-endif # WITH_PCRE8
-if WITH_PCRE16
-libpcre16_la_CFLAGS += $(VALGRIND_CFLAGS)
-endif # WITH_PCRE16
-if WITH_PCRE32
-libpcre32_la_CFLAGS += $(VALGRIND_CFLAGS)
-endif # WITH_PCRE32
-endif # WITH_VALGRIND
-
-if WITH_GCOV
-if WITH_PCRE8
-libpcre_la_CFLAGS += $(GCOV_CFLAGS)
-endif # WITH_PCRE8
-if WITH_PCRE16
-libpcre16_la_CFLAGS += $(GCOV_CFLAGS)
-endif # WITH_PCRE16
-if WITH_PCRE32
-libpcre32_la_CFLAGS += $(GCOV_CFLAGS)
-endif # WITH_PCRE32
-endif # WITH_GCOV
-
-CLEANFILES += pcre_chartables.c
-
-## If JIT support is enabled, arrange for the JIT test program to run.
-if WITH_JIT
-TESTS += pcre_jit_test
-noinst_PROGRAMS += pcre_jit_test
-pcre_jit_test_SOURCES = pcre_jit_test.c
-pcre_jit_test_CFLAGS = $(AM_CFLAGS)
-pcre_jit_test_LDADD =
-if WITH_PCRE8
-pcre_jit_test_LDADD += libpcre.la
-endif # WITH_PCRE8
-if WITH_PCRE16
-pcre_jit_test_LDADD += libpcre16.la
-endif # WITH_PCRE16
-if WITH_PCRE32
-pcre_jit_test_LDADD += libpcre32.la
-endif # WITH_PCRE32
-if WITH_GCOV
-pcre_jit_test_CFLAGS += $(GCOV_CFLAGS)
-pcre_jit_test_LDADD += $(GCOV_LIBS)
-endif # WITH_GCOV
-endif # WITH_JIT
-
-## A version of the main pcre library that has a posix re API.
-if WITH_PCRE8
-
-lib_LTLIBRARIES += libpcreposix.la
-libpcreposix_la_SOURCES = \
- pcreposix.c
-libpcreposix_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS)
-libpcreposix_la_LDFLAGS = $(EXTRA_LIBPCREPOSIX_LDFLAGS)
-libpcreposix_la_LIBADD = libpcre.la
-
-if WITH_GCOV
-libpcreposix_la_CFLAGS += $(GCOV_CFLAGS)
-endif # WITH_GCOV
-
-endif # WITH_PCRE8
-
-## There's a C++ library as well.
-if WITH_PCRE_CPP
-
-lib_LTLIBRARIES += libpcrecpp.la
-libpcrecpp_la_SOURCES = \
- pcrecpp_internal.h \
- pcrecpp.cc \
- pcre_scanner.cc \
- pcre_stringpiece.cc
-libpcrecpp_la_CXXFLAGS = $(VISIBILITY_CXXFLAGS) $(AM_CXXFLAGS)
-libpcrecpp_la_LDFLAGS = $(EXTRA_LIBPCRECPP_LDFLAGS)
-libpcrecpp_la_LIBADD = libpcre.la
-
-TESTS += pcrecpp_unittest
-noinst_PROGRAMS += pcrecpp_unittest
-pcrecpp_unittest_SOURCES = pcrecpp_unittest.cc
-pcrecpp_unittest_CXXFLAGS = $(AM_CXXFLAGS)
-pcrecpp_unittest_LDADD = libpcrecpp.la
-
-TESTS += pcre_scanner_unittest
-noinst_PROGRAMS += pcre_scanner_unittest
-pcre_scanner_unittest_SOURCES = pcre_scanner_unittest.cc
-pcre_scanner_unittest_CXXFLAGS = $(AM_CXXFLAGS)
-pcre_scanner_unittest_LDADD = libpcrecpp.la
-
-TESTS += pcre_stringpiece_unittest
-noinst_PROGRAMS += pcre_stringpiece_unittest
-pcre_stringpiece_unittest_SOURCES = pcre_stringpiece_unittest.cc
-pcre_stringpiece_unittest_CXXFLAGS = $(AM_CXXFLAGS)
-pcre_stringpiece_unittest_LDADD = libpcrecpp.la
-
-if WITH_GCOV
-libpcrecpp_la_CXXFLAGS += $(GCOV_CXXFLAGS)
-pcrecpp_unittest_LDADD += $(GCOV_LIBS)
-pcre_scanner_unittest_LDADD += $(GCOV_LIBS)
-pcre_stringpiece_unittest_LDADD += $(GCOV_LIBS)
-endif # WITH_GCOV
-
-endif # WITH_PCRE_CPP
-
-## The main unit tests
-
-# Each unit test is a binary plus a script that runs that binary in various
-# ways. We install these test binaries in case folks find it helpful.
-
-TESTS += RunTest
-dist_noinst_SCRIPTS += RunTest
-EXTRA_DIST += RunTest.bat
-bin_PROGRAMS += pcretest
-pcretest_SOURCES = pcretest.c
-pcretest_CFLAGS = $(AM_CFLAGS)
-pcretest_LDADD = $(LIBREADLINE)
-if WITH_PCRE8
-pcretest_SOURCES += pcre_printint.c
-pcretest_LDADD += libpcre.la libpcreposix.la
-endif # WITH_PCRE8
-if WITH_PCRE16
-pcretest_SOURCES += pcre16_printint.c
-pcretest_LDADD += libpcre16.la
-endif # WITH_PCRE16
-if WITH_PCRE32
-pcretest_SOURCES += pcre32_printint.c
-pcretest_LDADD += libpcre32.la
-endif # WITH_PCRE32
-if WITH_VALGRIND
-pcretest_CFLAGS += $(VALGRIND_CFLAGS)
-endif # WITH_VALGRIND
-if WITH_GCOV
-pcretest_CFLAGS += $(GCOV_CFLAGS)
-pcretest_LDADD += $(GCOV_LIBS)
-endif # WITH_GCOV
-
-if WITH_PCRE8
-TESTS += RunGrepTest
-dist_noinst_SCRIPTS += RunGrepTest
-bin_PROGRAMS += pcregrep
-pcregrep_SOURCES = pcregrep.c
-pcregrep_CFLAGS = $(AM_CFLAGS)
-pcregrep_LDADD = $(LIBZ) $(LIBBZ2)
-pcregrep_LDADD += libpcre.la libpcreposix.la
-if WITH_GCOV
-pcregrep_CFLAGS += $(GCOV_CFLAGS)
-pcregrep_LDADD += $(GCOV_LIBS)
-endif # WITH_GCOV
-endif # WITH_PCRE8
-
-EXTRA_DIST += \
- testdata/grepbinary \
- testdata/grepfilelist \
- testdata/grepinput \
- testdata/grepinput3 \
- testdata/grepinput8 \
- testdata/grepinputv \
- testdata/grepinputx \
- testdata/greplist \
- testdata/grepoutput \
- testdata/grepoutput8 \
- testdata/grepoutputN \
- testdata/greppatN4 \
- testdata/saved16 \
- testdata/saved16BE-1 \
- testdata/saved16BE-2 \
- testdata/saved16LE-1 \
- testdata/saved16LE-2 \
- testdata/saved32 \
- testdata/saved32BE-1 \
- testdata/saved32BE-2 \
- testdata/saved32LE-1 \
- testdata/saved32LE-2 \
- testdata/saved8 \
- 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/testinput26 \
- testdata/testinputEBC \
- testdata/testoutput1 \
- testdata/testoutput2 \
- testdata/testoutput3 \
- testdata/testoutput3A \
- testdata/testoutput3B \
- testdata/testoutput4 \
- testdata/testoutput5 \
- testdata/testoutput6 \
- testdata/testoutput7 \
- testdata/testoutput8 \
- testdata/testoutput9 \
- testdata/testoutput10 \
- testdata/testoutput11-8 \
- testdata/testoutput11-16 \
- testdata/testoutput11-32 \
- testdata/testoutput12 \
- testdata/testoutput13 \
- testdata/testoutput14 \
- testdata/testoutput15 \
- testdata/testoutput16 \
- testdata/testoutput17 \
- testdata/testoutput18-16 \
- testdata/testoutput18-32 \
- testdata/testoutput19 \
- testdata/testoutput20 \
- testdata/testoutput21-16 \
- testdata/testoutput21-32 \
- testdata/testoutput22-16 \
- testdata/testoutput22-32 \
- testdata/testoutput23 \
- testdata/testoutput24 \
- testdata/testoutput25 \
- testdata/testoutput26 \
- testdata/testoutputEBC \
- testdata/wintestinput3 \
- testdata/wintestoutput3 \
- perltest.pl
-
-CLEANFILES += \
- testsavedregex \
- teststderr \
- testtemp* \
- testtry \
- testNinput \
- testtrygrep \
- teststderrgrep \
- testNinputgrep
-
-# PCRE demonstration program. No longer built automatcally. The point is that
-# the users should build it themselves. So just distribute the source.
-# noinst_PROGRAMS += pcredemo
-# pcredemo_SOURCES = pcredemo.c
-# pcredemo_LDADD = libpcre.la
-
-EXTRA_DIST += pcredemo.c
-
-
-## Utility rules, documentation, etc.
-
-# A compatibility line, the old build system worked with 'make test'
-test: check ;
-
-
-# A PCRE user submitted the following addition, saying that it "will allow
-# anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
-# nice DLL for Windows use". (It is used by the pcre.dll target.)
-DLL_OBJS= pcre_byte_order.o pcre_compile.o pcre_config.o \
- pcre_dfa_exec.o pcre_exec.o pcre_fullinfo.o pcre_get.o \
- pcre_globals.o pcre_jit_compile.o pcre_maketables.o \
- pcre_newline.o pcre_ord2utf8.o pcre_refcount.o \
- pcre_study.o pcre_tables.o pcre_ucd.o \
- pcre_valid_utf8.o pcre_version.o pcre_chartables.o \
- pcre_xclass.o
-
-# A PCRE user submitted the following addition, saying that it "will allow
-# anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
-# nice DLL for Windows use".
-pcre.dll: $(DLL_OBJS)
- $(CC) -shared -o pcre.dll -Wl,"--strip-all" -Wl,"--export-all-symbols" $(DLL_OBJS)
-
-
-# We have .pc files for pkg-config users.
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libpcre.pc libpcreposix.pc
-if WITH_PCRE16
-pkgconfig_DATA += libpcre16.pc
-endif
-if WITH_PCRE32
-pkgconfig_DATA += libpcre32.pc
-endif
-if WITH_PCRE_CPP
-pkgconfig_DATA += libpcrecpp.pc
-endif
-
-# Note that pcrecpp.3 is not in this list, but is included separately below.
-
-dist_man_MANS = \
- doc/pcre-config.1 \
- doc/pcre.3 \
- doc/pcre16.3 \
- doc/pcre32.3 \
- doc/pcre_assign_jit_stack.3 \
- doc/pcre_compile.3 \
- doc/pcre_compile2.3 \
- doc/pcre_config.3 \
- doc/pcre_copy_named_substring.3 \
- doc/pcre_copy_substring.3 \
- doc/pcre_dfa_exec.3 \
- doc/pcre_exec.3 \
- doc/pcre_free_study.3 \
- doc/pcre_free_substring.3 \
- doc/pcre_free_substring_list.3 \
- doc/pcre_fullinfo.3 \
- doc/pcre_get_named_substring.3 \
- doc/pcre_get_stringnumber.3 \
- doc/pcre_get_stringtable_entries.3 \
- doc/pcre_get_substring.3 \
- doc/pcre_get_substring_list.3 \
- doc/pcre_jit_exec.3 \
- doc/pcre_jit_stack_alloc.3 \
- doc/pcre_jit_stack_free.3 \
- doc/pcre_maketables.3 \
- doc/pcre_pattern_to_host_byte_order.3 \
- doc/pcre_refcount.3 \
- doc/pcre_study.3 \
- doc/pcre_utf16_to_host_byte_order.3 \
- doc/pcre_utf32_to_host_byte_order.3 \
- doc/pcre_version.3 \
- doc/pcreapi.3 \
- doc/pcrebuild.3 \
- doc/pcrecallout.3 \
- doc/pcrecompat.3 \
- doc/pcredemo.3 \
- doc/pcregrep.1 \
- doc/pcrejit.3 \
- doc/pcrelimits.3 \
- doc/pcrematching.3 \
- doc/pcrepartial.3 \
- doc/pcrepattern.3 \
- doc/pcreperform.3 \
- doc/pcreposix.3 \
- doc/pcreprecompile.3 \
- doc/pcresample.3 \
- doc/pcrestack.3 \
- doc/pcresyntax.3 \
- doc/pcretest.1 \
- doc/pcreunicode.3
-
-# Arrange for the per-function man pages to have 16- and 32-bit names as well.
-install-data-hook:
- ln -sf pcre_assign_jit_stack.3 $(DESTDIR)$(man3dir)/pcre16_assign_jit_stack.3
- ln -sf pcre_compile.3 $(DESTDIR)$(man3dir)/pcre16_compile.3
- ln -sf pcre_compile2.3 $(DESTDIR)$(man3dir)/pcre16_compile2.3
- ln -sf pcre_config.3 $(DESTDIR)$(man3dir)/pcre16_config.3
- ln -sf pcre_copy_named_substring.3 $(DESTDIR)$(man3dir)/pcre16_copy_named_substring.3
- ln -sf pcre_copy_substring.3 $(DESTDIR)$(man3dir)/pcre16_copy_substring.3
- ln -sf pcre_dfa_exec.3 $(DESTDIR)$(man3dir)/pcre16_dfa_exec.3
- ln -sf pcre_exec.3 $(DESTDIR)$(man3dir)/pcre16_exec.3
- ln -sf pcre_free_study.3 $(DESTDIR)$(man3dir)/pcre16_free_study.3
- ln -sf pcre_free_substring.3 $(DESTDIR)$(man3dir)/pcre16_free_substring.3
- ln -sf pcre_free_substring_list.3 $(DESTDIR)$(man3dir)/pcre16_free_substring_list.3
- ln -sf pcre_fullinfo.3 $(DESTDIR)$(man3dir)/pcre16_fullinfo.3
- ln -sf pcre_get_named_substring.3 $(DESTDIR)$(man3dir)/pcre16_get_named_substring.3
- ln -sf pcre_get_stringnumber.3 $(DESTDIR)$(man3dir)/pcre16_get_stringnumber.3
- ln -sf pcre_get_stringtable_entries.3 $(DESTDIR)$(man3dir)/pcre16_get_stringtable_entries.3
- ln -sf pcre_get_substring.3 $(DESTDIR)$(man3dir)/pcre16_get_substring.3
- ln -sf pcre_get_substring_list.3 $(DESTDIR)$(man3dir)/pcre16_get_substring_list.3
- ln -sf pcre_jit_exec.3 $(DESTDIR)$(man3dir)/pcre16_jit_exec.3
- ln -sf pcre_jit_stack_alloc.3 $(DESTDIR)$(man3dir)/pcre16_jit_stack_alloc.3
- ln -sf pcre_jit_stack_free.3 $(DESTDIR)$(man3dir)/pcre16_jit_stack_free.3
- ln -sf pcre_maketables.3 $(DESTDIR)$(man3dir)/pcre16_maketables.3
- ln -sf pcre_pattern_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre16_pattern_to_host_byte_order.3
- ln -sf pcre_refcount.3 $(DESTDIR)$(man3dir)/pcre16_refcount.3
- ln -sf pcre_study.3 $(DESTDIR)$(man3dir)/pcre16_study.3
- ln -sf pcre_utf16_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre16_utf16_to_host_byte_order.3
- ln -sf pcre_version.3 $(DESTDIR)$(man3dir)/pcre16_version.3
- ln -sf pcre_assign_jit_stack.3 $(DESTDIR)$(man3dir)/pcre32_assign_jit_stack.3
- ln -sf pcre_compile.3 $(DESTDIR)$(man3dir)/pcre32_compile.3
- ln -sf pcre_compile2.3 $(DESTDIR)$(man3dir)/pcre32_compile2.3
- ln -sf pcre_config.3 $(DESTDIR)$(man3dir)/pcre32_config.3
- ln -sf pcre_copy_named_substring.3 $(DESTDIR)$(man3dir)/pcre32_copy_named_substring.3
- ln -sf pcre_copy_substring.3 $(DESTDIR)$(man3dir)/pcre32_copy_substring.3
- ln -sf pcre_dfa_exec.3 $(DESTDIR)$(man3dir)/pcre32_dfa_exec.3
- ln -sf pcre_exec.3 $(DESTDIR)$(man3dir)/pcre32_exec.3
- ln -sf pcre_free_study.3 $(DESTDIR)$(man3dir)/pcre32_free_study.3
- ln -sf pcre_free_substring.3 $(DESTDIR)$(man3dir)/pcre32_free_substring.3
- ln -sf pcre_free_substring_list.3 $(DESTDIR)$(man3dir)/pcre32_free_substring_list.3
- ln -sf pcre_fullinfo.3 $(DESTDIR)$(man3dir)/pcre32_fullinfo.3
- ln -sf pcre_get_named_substring.3 $(DESTDIR)$(man3dir)/pcre32_get_named_substring.3
- ln -sf pcre_get_stringnumber.3 $(DESTDIR)$(man3dir)/pcre32_get_stringnumber.3
- ln -sf pcre_get_stringtable_entries.3 $(DESTDIR)$(man3dir)/pcre32_get_stringtable_entries.3
- ln -sf pcre_get_substring.3 $(DESTDIR)$(man3dir)/pcre32_get_substring.3
- ln -sf pcre_get_substring_list.3 $(DESTDIR)$(man3dir)/pcre32_get_substring_list.3
- ln -sf pcre_jit_exec.3 $(DESTDIR)$(man3dir)/pcre32_jit_exec.3
- ln -sf pcre_jit_stack_alloc.3 $(DESTDIR)$(man3dir)/pcre32_jit_stack_alloc.3
- ln -sf pcre_jit_stack_free.3 $(DESTDIR)$(man3dir)/pcre32_jit_stack_free.3
- ln -sf pcre_maketables.3 $(DESTDIR)$(man3dir)/pcre32_maketables.3
- ln -sf pcre_pattern_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre32_pattern_to_host_byte_order.3
- ln -sf pcre_refcount.3 $(DESTDIR)$(man3dir)/pcre32_refcount.3
- ln -sf pcre_study.3 $(DESTDIR)$(man3dir)/pcre32_study.3
- ln -sf pcre_utf32_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre32_utf32_to_host_byte_order.3
- ln -sf pcre_version.3 $(DESTDIR)$(man3dir)/pcre32_version.3
-
-pcrecpp_man = doc/pcrecpp.3
-EXTRA_DIST += $(pcrecpp_man)
-
-if WITH_PCRE_CPP
-man_MANS = $(pcrecpp_man)
-endif
-
-# gcov/lcov code coverage reporting
-
-if WITH_GCOV
-
-# Coverage reporting targets:
-#
-# coverage: Create a coverage report from 'make check'
-# coverage-baseline: Capture baseline coverage information
-# coverage-reset: This zeros the coverage counters only
-# coverage-report: This creates the coverage report only
-# coverage-clean-report: This removes the generated coverage report
-# without cleaning the coverage data itself
-# coverage-clean-data: This removes the captured coverage data without
-# removing the coverage files created at compile time (*.gcno)
-# coverage-clean: This cleans all coverage data including the generated
-# coverage report.
-
-COVERAGE_TEST_NAME = $(PACKAGE)
-COVERAGE_NAME = $(PACKAGE)-$(VERSION)
-COVERAGE_OUTPUT_FILE = $(COVERAGE_NAME)-coverage.info
-COVERAGE_OUTPUT_DIR = $(COVERAGE_NAME)-coverage
-COVERAGE_LCOV_EXTRA_FLAGS =
-COVERAGE_GENHTML_EXTRA_FLAGS =
-
-coverage_quiet = $(coverage_quiet_$(V))
-coverage_quiet_ = $(coverage_quiet_$(AM_DEFAULT_VERBOSITY))
-coverage_quiet_0 = --quiet
-
-coverage-check: all
- -$(MAKE) $(AM_MAKEFLAGS) -k check
-
-coverage-baseline:
- $(LCOV) $(coverage_quiet) \
- --directory $(top_builddir) \
- --output-file "$(COVERAGE_OUTPUT_FILE)" \
- --capture \
- --initial
-
-coverage-report:
- $(LCOV) $(coverage_quiet) \
- --directory $(top_builddir) \
- --capture \
- --output-file "$(COVERAGE_OUTPUT_FILE).tmp" \
- --test-name "$(COVERAGE_TEST_NAME)" \
- --no-checksum \
- --compat-libtool \
- $(COVERAGE_LCOV_EXTRA_FLAGS)
- $(LCOV) $(coverage_quiet) \
- --directory $(top_builddir) \
- --output-file "$(COVERAGE_OUTPUT_FILE)" \
- --remove "$(COVERAGE_OUTPUT_FILE).tmp" \
- "/tmp/*" \
- "/usr/include/*" \
- "$(includedir)/*"
- -@rm -f "$(COVERAGE_OUTPUT_FILE).tmp"
- LANG=C $(GENHTML) $(coverage_quiet) \
- --prefix $(top_builddir) \
- --output-directory "$(COVERAGE_OUTPUT_DIR)" \
- --title "$(PACKAGE) $(VERSION) Code Coverage Report" \
- --show-details "$(COVERAGE_OUTPUT_FILE)" \
- --legend \
- $(COVERAGE_GENHTML_EXTRA_FLAGS)
- @echo "Code coverage report written to file://$(abs_builddir)/$(COVERAGE_OUTPUT_DIR)/index.html"
-
-coverage-reset:
- -$(LCOV) $(coverage_quiet) --zerocounters --directory $(top_builddir)
-
-coverage-clean-report:
- -rm -f "$(COVERAGE_OUTPUT_FILE)" "$(COVERAGE_OUTPUT_FILE).tmp"
- -rm -rf "$(COVERAGE_OUTPUT_DIR)"
-
-coverage-clean-data:
- -find $(top_builddir) -name "*.gcda" -delete
-
-coverage-clean: coverage-reset coverage-clean-report coverage-clean-data
- -find $(top_builddir) -name "*.gcno" -delete
-
-coverage-distclean: coverage-clean
-
-coverage: coverage-reset coverage-baseline coverage-check coverage-report
-clean-local: coverage-clean
-distclean-local: coverage-distclean
-
-.PHONY: coverage coverage-baseline coverage-check coverage-report coverage-reset coverage-clean-report coverage-clean-data coverage-clean coverage-distclean
-
-else
-
-coverage:
- @echo "Configuring with --enable-coverage required to generate code coverage report."
-
-endif # WITH_GCOV
-
-## CMake support
-
-EXTRA_DIST += \
- cmake/COPYING-CMAKE-SCRIPTS \
- cmake/FindPackageHandleStandardArgs.cmake \
- cmake/FindReadline.cmake \
- cmake/FindEditline.cmake \
- CMakeLists.txt \
- config-cmake.h.in
-
-## end Makefile.am
diff --git a/.pc/pcre_info.patch/Makefile.in b/.pc/pcre_info.patch/Makefile.in
deleted file mode 100644
index 75cfe6d..0000000
--- a/.pc/pcre_info.patch/Makefile.in
+++ /dev/null
@@ -1,3283 +0,0 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-TESTS = $(am__EXEEXT_3) $(am__EXEEXT_4) RunTest $(am__append_38)
-bin_PROGRAMS = pcretest$(EXEEXT) $(am__EXEEXT_1)
-noinst_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
-
-# These additional headers will be be installed if C++ support is enabled. We
-# do not distribute pcrecpparg.h or pcre_stringpiece.h, as these are generated
-# from corresponding .h.in files (which we do distribute).
-@WITH_PCRE_CPP_TRUE@am__append_1 = \
-@WITH_PCRE_CPP_TRUE@ pcrecpparg.h \
-@WITH_PCRE_CPP_TRUE@ pcre_stringpiece.h
-
-@WITH_PCRE_CPP_TRUE@am__append_2 = \
-@WITH_PCRE_CPP_TRUE@ pcrecpp.h \
-@WITH_PCRE_CPP_TRUE@ pcre_scanner.h
-
-@WITH_REBUILD_CHARTABLES_TRUE@am__append_3 = dftables
-
-# Build the 8 bit library if it is enabled.
-@WITH_PCRE8_TRUE@am__append_4 = libpcre.la
-
-# Build the 16 bit library if it is enabled.
-@WITH_PCRE16_TRUE@am__append_5 = libpcre16.la
-
-# Build the 32 bit library if it is enabled.
-@WITH_PCRE32_TRUE@am__append_6 = libpcre32.la
-@WITH_PCRE8_TRUE@@WITH_VALGRIND_TRUE@am__append_7 = $(VALGRIND_CFLAGS)
-@WITH_PCRE16_TRUE@@WITH_VALGRIND_TRUE@am__append_8 = $(VALGRIND_CFLAGS)
-@WITH_PCRE32_TRUE@@WITH_VALGRIND_TRUE@am__append_9 = $(VALGRIND_CFLAGS)
-@WITH_GCOV_TRUE@@WITH_PCRE8_TRUE@am__append_10 = $(GCOV_CFLAGS)
-@WITH_GCOV_TRUE@@WITH_PCRE16_TRUE@am__append_11 = $(GCOV_CFLAGS)
-@WITH_GCOV_TRUE@@WITH_PCRE32_TRUE@am__append_12 = $(GCOV_CFLAGS)
-@WITH_JIT_TRUE@am__append_13 = pcre_jit_test
-@WITH_JIT_TRUE@am__append_14 = pcre_jit_test
-@WITH_JIT_TRUE@@WITH_PCRE8_TRUE@am__append_15 = libpcre.la
-@WITH_JIT_TRUE@@WITH_PCRE16_TRUE@am__append_16 = libpcre16.la
-@WITH_JIT_TRUE@@WITH_PCRE32_TRUE@am__append_17 = libpcre32.la
-@WITH_GCOV_TRUE@@WITH_JIT_TRUE@am__append_18 = $(GCOV_CFLAGS)
-@WITH_GCOV_TRUE@@WITH_JIT_TRUE@am__append_19 = $(GCOV_LIBS)
-@WITH_PCRE8_TRUE@am__append_20 = libpcreposix.la
-@WITH_GCOV_TRUE@@WITH_PCRE8_TRUE@am__append_21 = $(GCOV_CFLAGS)
-@WITH_PCRE_CPP_TRUE@am__append_22 = libpcrecpp.la
-@WITH_PCRE_CPP_TRUE@am__append_23 = pcrecpp_unittest \
-@WITH_PCRE_CPP_TRUE@ pcre_scanner_unittest \
-@WITH_PCRE_CPP_TRUE@ pcre_stringpiece_unittest
-@WITH_PCRE_CPP_TRUE@am__append_24 = pcrecpp_unittest \
-@WITH_PCRE_CPP_TRUE@ pcre_scanner_unittest \
-@WITH_PCRE_CPP_TRUE@ pcre_stringpiece_unittest
-@WITH_GCOV_TRUE@@WITH_PCRE_CPP_TRUE@am__append_25 = $(GCOV_CXXFLAGS)
-@WITH_GCOV_TRUE@@WITH_PCRE_CPP_TRUE@am__append_26 = $(GCOV_LIBS)
-@WITH_GCOV_TRUE@@WITH_PCRE_CPP_TRUE@am__append_27 = $(GCOV_LIBS)
-@WITH_GCOV_TRUE@@WITH_PCRE_CPP_TRUE@am__append_28 = $(GCOV_LIBS)
-@WITH_PCRE8_TRUE@am__append_29 = pcre_printint.c
-@WITH_PCRE8_TRUE@am__append_30 = libpcre.la libpcreposix.la
-@WITH_PCRE16_TRUE@am__append_31 = pcre16_printint.c
-@WITH_PCRE16_TRUE@am__append_32 = libpcre16.la
-@WITH_PCRE32_TRUE@am__append_33 = pcre32_printint.c
-@WITH_PCRE32_TRUE@am__append_34 = libpcre32.la
-@WITH_VALGRIND_TRUE@am__append_35 = $(VALGRIND_CFLAGS)
-@WITH_GCOV_TRUE@am__append_36 = $(GCOV_CFLAGS)
-@WITH_GCOV_TRUE@am__append_37 = $(GCOV_LIBS)
-@WITH_PCRE8_TRUE@am__append_38 = RunGrepTest
-@WITH_PCRE8_TRUE@am__append_39 = RunGrepTest
-@WITH_PCRE8_TRUE@am__append_40 = pcregrep
-@WITH_GCOV_TRUE@@WITH_PCRE8_TRUE@am__append_41 = $(GCOV_CFLAGS)
-@WITH_GCOV_TRUE@@WITH_PCRE8_TRUE@am__append_42 = $(GCOV_LIBS)
-@WITH_PCRE16_TRUE@am__append_43 = libpcre16.pc
-@WITH_PCRE32_TRUE@am__append_44 = libpcre32.pc
-@WITH_PCRE_CPP_TRUE@am__append_45 = libpcrecpp.pc
-subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
- $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.h.in $(srcdir)/libpcre.pc.in \
- $(srcdir)/libpcre16.pc.in $(srcdir)/libpcre32.pc.in \
- $(srcdir)/libpcreposix.pc.in $(srcdir)/libpcrecpp.pc.in \
- $(srcdir)/pcre-config.in $(srcdir)/pcre.h.in \
- $(srcdir)/pcre_stringpiece.h.in $(srcdir)/pcrecpparg.h.in \
- $(am__dist_noinst_SCRIPTS_DIST) depcomp $(dist_man_MANS) \
- $(dist_doc_DATA) $(dist_html_DATA) $(dist_noinst_DATA) \
- $(am__include_HEADERS_DIST) test-driver COPYING ar-lib compile \
- config.guess config.sub install-sh missing ltmain.sh
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pcre_visibility.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = libpcre.pc libpcre16.pc libpcre32.pc \
- libpcreposix.pc libpcrecpp.pc pcre-config pcre.h \
- pcre_stringpiece.h pcrecpparg.h
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$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)$(htmldir)" \
- "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" \
- "$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libpcre_la_DEPENDENCIES =
-am__libpcre_la_SOURCES_DIST = pcre_byte_order.c pcre_compile.c \
- pcre_config.c pcre_dfa_exec.c pcre_exec.c pcre_fullinfo.c \
- pcre_get.c pcre_globals.c pcre_internal.h pcre_jit_compile.c \
- pcre_maketables.c pcre_newline.c pcre_ord2utf8.c \
- pcre_refcount.c pcre_string_utils.c pcre_study.c pcre_tables.c \
- pcre_ucd.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c \
- ucp.h
-@WITH_PCRE8_TRUE@am_libpcre_la_OBJECTS = \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_byte_order.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_compile.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_config.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_dfa_exec.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_exec.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_fullinfo.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_get.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_globals.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_jit_compile.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_maketables.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_newline.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_ord2utf8.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_refcount.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_string_utils.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_study.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_tables.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_ucd.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_valid_utf8.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_version.lo \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_xclass.lo
-@WITH_PCRE8_TRUE@nodist_libpcre_la_OBJECTS = \
-@WITH_PCRE8_TRUE@ libpcre_la-pcre_chartables.lo
-libpcre_la_OBJECTS = $(am_libpcre_la_OBJECTS) \
- $(nodist_libpcre_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libpcre_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libpcre_la_CFLAGS) \
- $(CFLAGS) $(libpcre_la_LDFLAGS) $(LDFLAGS) -o $@
-@WITH_PCRE8_TRUE@am_libpcre_la_rpath = -rpath $(libdir)
-libpcre16_la_DEPENDENCIES =
-am__libpcre16_la_SOURCES_DIST = pcre16_byte_order.c \
- pcre16_chartables.c pcre16_compile.c pcre16_config.c \
- pcre16_dfa_exec.c pcre16_exec.c pcre16_fullinfo.c pcre16_get.c \
- pcre16_globals.c pcre16_jit_compile.c pcre16_maketables.c \
- pcre16_newline.c pcre16_ord2utf16.c pcre16_refcount.c \
- pcre16_string_utils.c pcre16_study.c pcre16_tables.c \
- pcre16_ucd.c pcre16_utf16_utils.c pcre16_valid_utf16.c \
- pcre16_version.c pcre16_xclass.c
-@WITH_PCRE16_TRUE@am_libpcre16_la_OBJECTS = \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_byte_order.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_chartables.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_compile.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_config.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_dfa_exec.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_exec.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_fullinfo.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_get.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_globals.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_jit_compile.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_maketables.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_newline.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_ord2utf16.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_refcount.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_string_utils.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_study.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_tables.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_ucd.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_utf16_utils.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_valid_utf16.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_version.lo \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre16_xclass.lo
-@WITH_PCRE16_TRUE@nodist_libpcre16_la_OBJECTS = \
-@WITH_PCRE16_TRUE@ libpcre16_la-pcre_chartables.lo
-libpcre16_la_OBJECTS = $(am_libpcre16_la_OBJECTS) \
- $(nodist_libpcre16_la_OBJECTS)
-libpcre16_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libpcre16_la_CFLAGS) \
- $(CFLAGS) $(libpcre16_la_LDFLAGS) $(LDFLAGS) -o $@
-@WITH_PCRE16_TRUE@am_libpcre16_la_rpath = -rpath $(libdir)
-libpcre32_la_DEPENDENCIES =
-am__libpcre32_la_SOURCES_DIST = pcre32_byte_order.c \
- pcre32_chartables.c pcre32_compile.c pcre32_config.c \
- pcre32_dfa_exec.c pcre32_exec.c pcre32_fullinfo.c pcre32_get.c \
- pcre32_globals.c pcre32_jit_compile.c pcre32_maketables.c \
- pcre32_newline.c pcre32_ord2utf32.c pcre32_refcount.c \
- pcre32_string_utils.c pcre32_study.c pcre32_tables.c \
- pcre32_ucd.c pcre32_utf32_utils.c pcre32_valid_utf32.c \
- pcre32_version.c pcre32_xclass.c
-@WITH_PCRE32_TRUE@am_libpcre32_la_OBJECTS = \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_byte_order.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_chartables.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_compile.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_config.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_dfa_exec.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_exec.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_fullinfo.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_get.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_globals.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_jit_compile.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_maketables.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_newline.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_ord2utf32.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_refcount.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_string_utils.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_study.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_tables.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_ucd.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_utf32_utils.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_valid_utf32.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_version.lo \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre32_xclass.lo
-@WITH_PCRE32_TRUE@nodist_libpcre32_la_OBJECTS = \
-@WITH_PCRE32_TRUE@ libpcre32_la-pcre_chartables.lo
-libpcre32_la_OBJECTS = $(am_libpcre32_la_OBJECTS) \
- $(nodist_libpcre32_la_OBJECTS)
-libpcre32_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libpcre32_la_CFLAGS) \
- $(CFLAGS) $(libpcre32_la_LDFLAGS) $(LDFLAGS) -o $@
-@WITH_PCRE32_TRUE@am_libpcre32_la_rpath = -rpath $(libdir)
-@WITH_PCRE_CPP_TRUE@libpcrecpp_la_DEPENDENCIES = libpcre.la
-am__libpcrecpp_la_SOURCES_DIST = pcrecpp_internal.h pcrecpp.cc \
- pcre_scanner.cc pcre_stringpiece.cc
-@WITH_PCRE_CPP_TRUE@am_libpcrecpp_la_OBJECTS = \
-@WITH_PCRE_CPP_TRUE@ libpcrecpp_la-pcrecpp.lo \
-@WITH_PCRE_CPP_TRUE@ libpcrecpp_la-pcre_scanner.lo \
-@WITH_PCRE_CPP_TRUE@ libpcrecpp_la-pcre_stringpiece.lo
-libpcrecpp_la_OBJECTS = $(am_libpcrecpp_la_OBJECTS)
-libpcrecpp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
- $(libpcrecpp_la_CXXFLAGS) $(CXXFLAGS) $(libpcrecpp_la_LDFLAGS) \
- $(LDFLAGS) -o $@
-@WITH_PCRE_CPP_TRUE@am_libpcrecpp_la_rpath = -rpath $(libdir)
-@WITH_PCRE8_TRUE@libpcreposix_la_DEPENDENCIES = libpcre.la
-am__libpcreposix_la_SOURCES_DIST = pcreposix.c
-@WITH_PCRE8_TRUE@am_libpcreposix_la_OBJECTS = \
-@WITH_PCRE8_TRUE@ libpcreposix_la-pcreposix.lo
-libpcreposix_la_OBJECTS = $(am_libpcreposix_la_OBJECTS)
-libpcreposix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(libpcreposix_la_CFLAGS) $(CFLAGS) $(libpcreposix_la_LDFLAGS) \
- $(LDFLAGS) -o $@
-@WITH_PCRE8_TRUE@am_libpcreposix_la_rpath = -rpath $(libdir)
-@WITH_PCRE8_TRUE@am__EXEEXT_1 = pcregrep$(EXEEXT)
-@WITH_REBUILD_CHARTABLES_TRUE@am__EXEEXT_2 = dftables$(EXEEXT)
-@WITH_JIT_TRUE@am__EXEEXT_3 = pcre_jit_test$(EXEEXT)
-@WITH_PCRE_CPP_TRUE@am__EXEEXT_4 = pcrecpp_unittest$(EXEEXT) \
-@WITH_PCRE_CPP_TRUE@ pcre_scanner_unittest$(EXEEXT) \
-@WITH_PCRE_CPP_TRUE@ pcre_stringpiece_unittest$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
-am__dftables_SOURCES_DIST = dftables.c
-@WITH_REBUILD_CHARTABLES_TRUE@am_dftables_OBJECTS = \
-@WITH_REBUILD_CHARTABLES_TRUE@ dftables.$(OBJEXT)
-dftables_OBJECTS = $(am_dftables_OBJECTS)
-dftables_LDADD = $(LDADD)
-am__pcre_jit_test_SOURCES_DIST = pcre_jit_test.c
-@WITH_JIT_TRUE@am_pcre_jit_test_OBJECTS = \
-@WITH_JIT_TRUE@ pcre_jit_test-pcre_jit_test.$(OBJEXT)
-pcre_jit_test_OBJECTS = $(am_pcre_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@pcre_jit_test_DEPENDENCIES = $(am__append_15) \
-@WITH_JIT_TRUE@ $(am__append_16) $(am__append_17) \
-@WITH_JIT_TRUE@ $(am__DEPENDENCIES_2)
-pcre_jit_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pcre_jit_test_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am__pcre_scanner_unittest_SOURCES_DIST = pcre_scanner_unittest.cc
-@WITH_PCRE_CPP_TRUE@am_pcre_scanner_unittest_OBJECTS = pcre_scanner_unittest-pcre_scanner_unittest.$(OBJEXT)
-pcre_scanner_unittest_OBJECTS = $(am_pcre_scanner_unittest_OBJECTS)
-@WITH_GCOV_TRUE@@WITH_PCRE_CPP_TRUE@am__DEPENDENCIES_3 = \
-@WITH_GCOV_TRUE@@WITH_PCRE_CPP_TRUE@ $(am__DEPENDENCIES_1)
-@WITH_PCRE_CPP_TRUE@pcre_scanner_unittest_DEPENDENCIES = \
-@WITH_PCRE_CPP_TRUE@ libpcrecpp.la $(am__DEPENDENCIES_3)
-pcre_scanner_unittest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
- $(pcre_scanner_unittest_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-am__pcre_stringpiece_unittest_SOURCES_DIST = \
- pcre_stringpiece_unittest.cc
-@WITH_PCRE_CPP_TRUE@am_pcre_stringpiece_unittest_OBJECTS = pcre_stringpiece_unittest-pcre_stringpiece_unittest.$(OBJEXT)
-pcre_stringpiece_unittest_OBJECTS = \
- $(am_pcre_stringpiece_unittest_OBJECTS)
-@WITH_PCRE_CPP_TRUE@pcre_stringpiece_unittest_DEPENDENCIES = \
-@WITH_PCRE_CPP_TRUE@ libpcrecpp.la $(am__DEPENDENCIES_3)
-pcre_stringpiece_unittest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
- $(pcre_stringpiece_unittest_CXXFLAGS) $(CXXFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am__pcrecpp_unittest_SOURCES_DIST = pcrecpp_unittest.cc
-@WITH_PCRE_CPP_TRUE@am_pcrecpp_unittest_OBJECTS = pcrecpp_unittest-pcrecpp_unittest.$(OBJEXT)
-pcrecpp_unittest_OBJECTS = $(am_pcrecpp_unittest_OBJECTS)
-@WITH_PCRE_CPP_TRUE@pcrecpp_unittest_DEPENDENCIES = libpcrecpp.la \
-@WITH_PCRE_CPP_TRUE@ $(am__DEPENDENCIES_3)
-pcrecpp_unittest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
- $(pcrecpp_unittest_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-am__pcregrep_SOURCES_DIST = pcregrep.c
-@WITH_PCRE8_TRUE@am_pcregrep_OBJECTS = pcregrep-pcregrep.$(OBJEXT)
-pcregrep_OBJECTS = $(am_pcregrep_OBJECTS)
-@WITH_GCOV_TRUE@@WITH_PCRE8_TRUE@am__DEPENDENCIES_4 = \
-@WITH_GCOV_TRUE@@WITH_PCRE8_TRUE@ $(am__DEPENDENCIES_1)
-@WITH_PCRE8_TRUE@pcregrep_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-@WITH_PCRE8_TRUE@ $(am__DEPENDENCIES_1) libpcre.la \
-@WITH_PCRE8_TRUE@ libpcreposix.la $(am__DEPENDENCIES_4)
-pcregrep_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pcregrep_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am__pcretest_SOURCES_DIST = pcretest.c pcre_printint.c \
- pcre16_printint.c pcre32_printint.c
-@WITH_PCRE8_TRUE@am__objects_1 = pcretest-pcre_printint.$(OBJEXT)
-@WITH_PCRE16_TRUE@am__objects_2 = pcretest-pcre16_printint.$(OBJEXT)
-@WITH_PCRE32_TRUE@am__objects_3 = pcretest-pcre32_printint.$(OBJEXT)
-am_pcretest_OBJECTS = pcretest-pcretest.$(OBJEXT) $(am__objects_1) \
- $(am__objects_2) $(am__objects_3)
-pcretest_OBJECTS = $(am_pcretest_OBJECTS)
-@WITH_GCOV_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1)
-pcretest_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__append_30) \
- $(am__append_32) $(am__append_34) $(am__DEPENDENCIES_5)
-pcretest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pcretest_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am__dist_noinst_SCRIPTS_DIST = RunTest RunGrepTest
-SCRIPTS = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS)
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_@AM_V@)
-am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-am__v_CXX_0 = @echo " CXX " $@;
-am__v_CXX_1 =
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-am__v_CXXLD_1 =
-SOURCES = $(libpcre_la_SOURCES) $(nodist_libpcre_la_SOURCES) \
- $(libpcre16_la_SOURCES) $(nodist_libpcre16_la_SOURCES) \
- $(libpcre32_la_SOURCES) $(nodist_libpcre32_la_SOURCES) \
- $(libpcrecpp_la_SOURCES) $(libpcreposix_la_SOURCES) \
- $(dftables_SOURCES) $(pcre_jit_test_SOURCES) \
- $(pcre_scanner_unittest_SOURCES) \
- $(pcre_stringpiece_unittest_SOURCES) \
- $(pcrecpp_unittest_SOURCES) $(pcregrep_SOURCES) \
- $(pcretest_SOURCES)
-DIST_SOURCES = $(am__libpcre_la_SOURCES_DIST) \
- $(am__libpcre16_la_SOURCES_DIST) \
- $(am__libpcre32_la_SOURCES_DIST) \
- $(am__libpcrecpp_la_SOURCES_DIST) \
- $(am__libpcreposix_la_SOURCES_DIST) \
- $(am__dftables_SOURCES_DIST) $(am__pcre_jit_test_SOURCES_DIST) \
- $(am__pcre_scanner_unittest_SOURCES_DIST) \
- $(am__pcre_stringpiece_unittest_SOURCES_DIST) \
- $(am__pcrecpp_unittest_SOURCES_DIST) \
- $(am__pcregrep_SOURCES_DIST) $(am__pcretest_SOURCES_DIST)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-man1dir = $(mandir)/man1
-man3dir = $(mandir)/man3
-NROFF = nroff
-MANS = $(dist_man_MANS) $(man_MANS)
-DATA = $(dist_doc_DATA) $(dist_html_DATA) $(dist_noinst_DATA) \
- $(html_DATA) $(pkgconfig_DATA)
-am__include_HEADERS_DIST = pcreposix.h pcrecpp.h pcre_scanner.h
-HEADERS = $(include_HEADERS) $(nodist_include_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)config.h.in
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
-AM_RECURSIVE_TARGETS = cscope check recheck
-am__tty_colors_dummy = \
- mgn= red= grn= lgn= blu= brg= std=; \
- am__color_tests=no
-am__tty_colors = { \
- $(am__tty_colors_dummy); \
- if test "X$(AM_COLOR_TESTS)" = Xno; then \
- am__color_tests=no; \
- elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
- am__color_tests=yes; \
- elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
- am__color_tests=yes; \
- fi; \
- if test $$am__color_tests = yes; then \
- red=''; \
- grn=''; \
- lgn=''; \
- blu=''; \
- mgn=''; \
- brg=''; \
- std=''; \
- fi; \
-}
-am__recheck_rx = ^[ ]*:recheck:[ ]*
-am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
-am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
-# A command that, given a newline-separated list of test names on the
-# standard input, print the name of the tests that are to be re-run
-# upon "make recheck".
-am__list_recheck_tests = $(AWK) '{ \
- recheck = 1; \
- while ((rc = (getline line < ($$0 ".trs"))) != 0) \
- { \
- if (rc < 0) \
- { \
- if ((getline line2 < ($$0 ".log")) < 0) \
- recheck = 0; \
- break; \
- } \
- else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
- { \
- recheck = 0; \
- break; \
- } \
- else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
- { \
- break; \
- } \
- }; \
- if (recheck) \
- print $$0; \
- close ($$0 ".trs"); \
- close ($$0 ".log"); \
-}'
-# A command that, given a newline-separated list of test names on the
-# standard input, create the global log from their .trs and .log files.
-am__create_global_log = $(AWK) ' \
-function fatal(msg) \
-{ \
- print "fatal: making $@: " msg | "cat >&2"; \
- exit 1; \
-} \
-function rst_section(header) \
-{ \
- print header; \
- len = length(header); \
- for (i = 1; i <= len; i = i + 1) \
- printf "="; \
- printf "\n\n"; \
-} \
-{ \
- copy_in_global_log = 1; \
- global_test_result = "RUN"; \
- while ((rc = (getline line < ($$0 ".trs"))) != 0) \
- { \
- if (rc < 0) \
- fatal("failed to read from " $$0 ".trs"); \
- if (line ~ /$(am__global_test_result_rx)/) \
- { \
- sub("$(am__global_test_result_rx)", "", line); \
- sub("[ ]*$$", "", line); \
- global_test_result = line; \
- } \
- else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
- copy_in_global_log = 0; \
- }; \
- if (copy_in_global_log) \
- { \
- rst_section(global_test_result ": " $$0); \
- while ((rc = (getline line < ($$0 ".log"))) != 0) \
- { \
- if (rc < 0) \
- fatal("failed to read from " $$0 ".log"); \
- print line; \
- }; \
- printf "\n"; \
- }; \
- close ($$0 ".trs"); \
- close ($$0 ".log"); \
-}'
-# Restructured Text title.
-am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
-# Solaris 10 'make', and several other traditional 'make' implementations,
-# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
-# by disabling -e (using the XSI extension "set +e") if it's set.
-am__sh_e_setup = case $$- in *e*) set +e;; esac
-# Default flags passed to test drivers.
-am__common_driver_flags = \
- --color-tests "$$am__color_tests" \
- --enable-hard-errors "$$am__enable_hard_errors" \
- --expect-failure "$$am__expect_failure"
-# To be inserted before the command running the test. Creates the
-# directory for the log if needed. Stores in $dir the directory
-# containing $f, in $tst the test, in $log the log. Executes the
-# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
-# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
-# will run the test scripts (or their associated LOG_COMPILER, if
-# thy have one).
-am__check_pre = \
-$(am__sh_e_setup); \
-$(am__vpath_adj_setup) $(am__vpath_adj) \
-$(am__tty_colors); \
-srcdir=$(srcdir); export srcdir; \
-case "$@" in \
- */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
- *) am__odir=.;; \
-esac; \
-test "x$$am__odir" = x"." || test -d "$$am__odir" \
- || $(MKDIR_P) "$$am__odir" || exit $$?; \
-if test -f "./$$f"; then dir=./; \
-elif test -f "$$f"; then dir=; \
-else dir="$(srcdir)/"; fi; \
-tst=$$dir$$f; log='$@'; \
-if test -n '$(DISABLE_HARD_ERRORS)'; then \
- am__enable_hard_errors=no; \
-else \
- am__enable_hard_errors=yes; \
-fi; \
-case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
- am__expect_failure=yes;; \
- *) \
- am__expect_failure=no;; \
-esac; \
-$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
-# A shell command to get the names of the tests scripts with any registered
-# extension removed (i.e., equivalently, the names of the test logs, with
-# the '.log' extension removed). The result is saved in the shell variable
-# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
-# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
-# since that might cause problem with VPATH rewrites for suffix-less tests.
-# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
-am__set_TESTS_bases = \
- bases='$(TEST_LOGS)'; \
- bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
- bases=`echo $$bases`
-RECHECK_LOGS = $(TEST_LOGS)
-TEST_SUITE_LOG = test-suite.log
-TEST_EXTENSIONS = @EXEEXT@ .test
-LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
-LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
-am__set_b = \
- case '$@' in \
- */*) \
- case '$*' in \
- */*) b='$*';; \
- *) b=`echo '$@' | sed 's/\.log$$//'`; \
- esac;; \
- *) \
- b='$*';; \
- esac
-am__test_logs1 = $(TESTS:=.log)
-am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
-TEST_LOGS = $(am__test_logs2:.test.log=.log)
-TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
-TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
- $(TEST_LOG_FLAGS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
- || { sleep 5 && rm -rf "$(distdir)"; }; \
- else :; fi
-am__post_remove_distdir = $(am__remove_distdir)
-DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).zip
-GZIP_ENV = --best
-DIST_TARGETS = dist-bzip2 dist-gzip dist-zip
-distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
- | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXTRA_LIBPCRE16_LDFLAGS = @EXTRA_LIBPCRE16_LDFLAGS@
-EXTRA_LIBPCRE32_LDFLAGS = @EXTRA_LIBPCRE32_LDFLAGS@
-EXTRA_LIBPCRECPP_LDFLAGS = @EXTRA_LIBPCRECPP_LDFLAGS@
-EXTRA_LIBPCREPOSIX_LDFLAGS = @EXTRA_LIBPCREPOSIX_LDFLAGS@
-EXTRA_LIBPCRE_LDFLAGS = @EXTRA_LIBPCRE_LDFLAGS@
-FGREP = @FGREP@
-GCOV_CFLAGS = @GCOV_CFLAGS@
-GCOV_CXXFLAGS = @GCOV_CXXFLAGS@
-GCOV_LIBS = @GCOV_LIBS@
-GENHTML = @GENHTML@
-GREP = @GREP@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LCOV = @LCOV@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBBZ2 = @LIBBZ2@
-LIBOBJS = @LIBOBJS@
-LIBREADLINE = @LIBREADLINE@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBZ = @LIBZ@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PCRE_DATE = @PCRE_DATE@
-PCRE_MAJOR = @PCRE_MAJOR@
-PCRE_MINOR = @PCRE_MINOR@
-PCRE_PRERELEASE = @PCRE_PRERELEASE@
-PCRE_STATIC_CFLAG = @PCRE_STATIC_CFLAG@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-PTHREAD_CC = @PTHREAD_CC@
-PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
-PTHREAD_LIBS = @PTHREAD_LIBS@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SHTOOL = @SHTOOL@
-STRIP = @STRIP@
-VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
-VALGRIND_LIBS = @VALGRIND_LIBS@
-VERSION = @VERSION@
-VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@
-VISIBILITY_CXXFLAGS = @VISIBILITY_CXXFLAGS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-ax_pthread_config = @ax_pthread_config@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-enable_cpp = @enable_cpp@
-enable_pcre16 = @enable_pcre16@
-enable_pcre32 = @enable_pcre32@
-enable_pcre8 = @enable_pcre8@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pcre_have_bits_type_traits = @pcre_have_bits_type_traits@
-pcre_have_long_long = @pcre_have_long_long@
-pcre_have_type_traits = @pcre_have_type_traits@
-pcre_have_ulong_long = @pcre_have_ulong_long@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-ACLOCAL_AMFLAGS = -I m4
-dist_doc_DATA = \
- doc/pcre.txt \
- doc/pcre-config.txt \
- doc/pcregrep.txt \
- doc/pcretest.txt \
- AUTHORS \
- COPYING \
- ChangeLog \
- LICENCE \
- NEWS \
- README
-
-
-# Note that pcrecpp.html is not in this list; it is listed separately below.
-dist_html_DATA = \
- doc/html/NON-AUTOTOOLS-BUILD.txt \
- doc/html/README.txt \
- doc/html/index.html \
- doc/html/pcre-config.html \
- doc/html/pcre.html \
- doc/html/pcre16.html \
- doc/html/pcre32.html \
- doc/html/pcre_assign_jit_stack.html \
- doc/html/pcre_compile.html \
- doc/html/pcre_compile2.html \
- doc/html/pcre_config.html \
- doc/html/pcre_copy_named_substring.html \
- doc/html/pcre_copy_substring.html \
- doc/html/pcre_dfa_exec.html \
- doc/html/pcre_exec.html \
- doc/html/pcre_free_study.html \
- doc/html/pcre_free_substring.html \
- doc/html/pcre_free_substring_list.html \
- doc/html/pcre_fullinfo.html \
- doc/html/pcre_get_named_substring.html \
- doc/html/pcre_get_stringnumber.html \
- doc/html/pcre_get_stringtable_entries.html \
- doc/html/pcre_get_substring.html \
- doc/html/pcre_get_substring_list.html \
- doc/html/pcre_jit_exec.html \
- doc/html/pcre_jit_stack_alloc.html \
- doc/html/pcre_jit_stack_free.html \
- doc/html/pcre_maketables.html \
- doc/html/pcre_pattern_to_host_byte_order.html \
- doc/html/pcre_refcount.html \
- doc/html/pcre_study.html \
- doc/html/pcre_utf16_to_host_byte_order.html \
- doc/html/pcre_utf32_to_host_byte_order.html \
- doc/html/pcre_version.html \
- doc/html/pcreapi.html \
- doc/html/pcrebuild.html \
- doc/html/pcrecallout.html \
- doc/html/pcrecompat.html \
- doc/html/pcredemo.html \
- doc/html/pcregrep.html \
- doc/html/pcrejit.html \
- doc/html/pcrelimits.html \
- doc/html/pcrematching.html \
- doc/html/pcrepartial.html \
- doc/html/pcrepattern.html \
- doc/html/pcreperform.html \
- doc/html/pcreposix.html \
- doc/html/pcreprecompile.html \
- doc/html/pcresample.html \
- doc/html/pcrestack.html \
- doc/html/pcresyntax.html \
- doc/html/pcretest.html \
- doc/html/pcreunicode.html
-
-pcrecpp_html = doc/html/pcrecpp.html
-dist_noinst_DATA = $(pcrecpp_html)
-@WITH_PCRE_CPP_TRUE@html_DATA = $(pcrecpp_html)
-
-# The Libtool libraries to install. We'll add to this later.
-lib_LTLIBRARIES = $(am__append_4) $(am__append_5) $(am__append_6) \
- $(am__append_20) $(am__append_22)
-check_SCRIPTS =
-dist_noinst_SCRIPTS = RunTest $(am__append_39)
-
-# Additional files to delete on 'make clean' and 'make maintainer-clean'.
-CLEANFILES = pcre_chartables.c testsavedregex teststderr testtemp* \
- testtry testNinput testtrygrep teststderrgrep testNinputgrep
-MAINTAINERCLEANFILES = pcre.h.generic config.h.generic
-
-# Additional files to bundle with the distribution, over and above what
-# the Autotools include by default.
-
-# These files contain additional m4 macros that are used by autoconf.
-
-# These files contain maintenance information
-
-# These files are used in the preparation of a release
-
-# These files are to do with building for Virtual Pascal
-
-# These files are usable versions of pcre.h and config.h that are distributed
-# for the benefit of people who are building PCRE manually, without the
-# Autotools support.
-
-# The pcre_chartables.c.dist file is the default version of pcre_chartables.c,
-# used unless --enable-rebuild-chartables is specified.
-
-# The JIT compiler lives in a separate directory, but its files are #included
-# when pcre_jit_compile.c is processed, so they must be distributed.
-
-# PCRE demonstration program. No longer built automatcally. The point is that
-# the users should build it themselves. So just distribute the source.
-# noinst_PROGRAMS += pcredemo
-# pcredemo_SOURCES = pcredemo.c
-# pcredemo_LDADD = libpcre.la
-EXTRA_DIST = m4/ax_pthread.m4 m4/pcre_visibility.m4 doc/perltest.txt \
- NON-UNIX-USE NON-AUTOTOOLS-BUILD HACKING PrepareRelease \
- CheckMan CleanTxt Detrail 132html doc/index.html.src \
- makevp.bat makevp_c.txt makevp_l.txt pcregexp.pas \
- pcre.h.generic config.h.generic pcre_chartables.c.dist \
- sljit/sljitConfig.h sljit/sljitConfigInternal.h \
- sljit/sljitExecAllocator.c sljit/sljitLir.c sljit/sljitLir.h \
- sljit/sljitNativeARM_32.c sljit/sljitNativeARM_64.c \
- sljit/sljitNativeARM_T2_32.c sljit/sljitNativeMIPS_32.c \
- sljit/sljitNativeMIPS_64.c sljit/sljitNativeMIPS_common.c \
- sljit/sljitNativePPC_32.c sljit/sljitNativePPC_64.c \
- sljit/sljitNativePPC_common.c sljit/sljitNativeSPARC_32.c \
- sljit/sljitNativeSPARC_common.c sljit/sljitNativeTILEGX_64.c \
- sljit/sljitNativeTILEGX-encoder.c sljit/sljitNativeX86_32.c \
- sljit/sljitNativeX86_64.c sljit/sljitNativeX86_common.c \
- sljit/sljitUtils.c RunTest.bat testdata/grepbinary \
- testdata/grepfilelist testdata/grepinput testdata/grepinput3 \
- testdata/grepinput8 testdata/grepinputv testdata/grepinputx \
- testdata/greplist testdata/grepoutput testdata/grepoutput8 \
- testdata/grepoutputN testdata/greppatN4 testdata/saved16 \
- testdata/saved16BE-1 testdata/saved16BE-2 testdata/saved16LE-1 \
- testdata/saved16LE-2 testdata/saved32 testdata/saved32BE-1 \
- testdata/saved32BE-2 testdata/saved32LE-1 testdata/saved32LE-2 \
- testdata/saved8 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/testinput26 \
- testdata/testinputEBC testdata/testoutput1 \
- testdata/testoutput2 testdata/testoutput3 \
- testdata/testoutput3A testdata/testoutput3B \
- testdata/testoutput4 testdata/testoutput5 testdata/testoutput6 \
- testdata/testoutput7 testdata/testoutput8 testdata/testoutput9 \
- testdata/testoutput10 testdata/testoutput11-8 \
- testdata/testoutput11-16 testdata/testoutput11-32 \
- testdata/testoutput12 testdata/testoutput13 \
- testdata/testoutput14 testdata/testoutput15 \
- testdata/testoutput16 testdata/testoutput17 \
- testdata/testoutput18-16 testdata/testoutput18-32 \
- testdata/testoutput19 testdata/testoutput20 \
- testdata/testoutput21-16 testdata/testoutput21-32 \
- testdata/testoutput22-16 testdata/testoutput22-32 \
- testdata/testoutput23 testdata/testoutput24 \
- testdata/testoutput25 testdata/testoutput26 \
- testdata/testoutputEBC testdata/wintestinput3 \
- testdata/wintestoutput3 perltest.pl pcredemo.c $(pcrecpp_man) \
- cmake/COPYING-CMAKE-SCRIPTS \
- cmake/FindPackageHandleStandardArgs.cmake \
- cmake/FindReadline.cmake cmake/FindEditline.cmake \
- CMakeLists.txt config-cmake.h.in
-
-# These are the header files we'll install. We do not distribute pcre.h because
-# it is generated from pcre.h.in.
-nodist_include_HEADERS = pcre.h $(am__append_1)
-include_HEADERS = pcreposix.h $(am__append_2)
-bin_SCRIPTS = pcre-config
-@WITH_REBUILD_CHARTABLES_TRUE@dftables_SOURCES = dftables.c
-BUILT_SOURCES = pcre_chartables.c
-@WITH_PCRE8_TRUE@libpcre_la_SOURCES = \
-@WITH_PCRE8_TRUE@ pcre_byte_order.c \
-@WITH_PCRE8_TRUE@ pcre_compile.c \
-@WITH_PCRE8_TRUE@ pcre_config.c \
-@WITH_PCRE8_TRUE@ pcre_dfa_exec.c \
-@WITH_PCRE8_TRUE@ pcre_exec.c \
-@WITH_PCRE8_TRUE@ pcre_fullinfo.c \
-@WITH_PCRE8_TRUE@ pcre_get.c \
-@WITH_PCRE8_TRUE@ pcre_globals.c \
-@WITH_PCRE8_TRUE@ pcre_internal.h \
-@WITH_PCRE8_TRUE@ pcre_jit_compile.c \
-@WITH_PCRE8_TRUE@ pcre_maketables.c \
-@WITH_PCRE8_TRUE@ pcre_newline.c \
-@WITH_PCRE8_TRUE@ pcre_ord2utf8.c \
-@WITH_PCRE8_TRUE@ pcre_refcount.c \
-@WITH_PCRE8_TRUE@ pcre_string_utils.c \
-@WITH_PCRE8_TRUE@ pcre_study.c \
-@WITH_PCRE8_TRUE@ pcre_tables.c \
-@WITH_PCRE8_TRUE@ pcre_ucd.c \
-@WITH_PCRE8_TRUE@ pcre_valid_utf8.c \
-@WITH_PCRE8_TRUE@ pcre_version.c \
-@WITH_PCRE8_TRUE@ pcre_xclass.c \
-@WITH_PCRE8_TRUE@ ucp.h
-
-@WITH_PCRE8_TRUE@libpcre_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS) \
-@WITH_PCRE8_TRUE@ $(am__append_7) $(am__append_10)
-@WITH_PCRE8_TRUE@libpcre_la_LIBADD =
-@WITH_PCRE8_TRUE@nodist_libpcre_la_SOURCES = \
-@WITH_PCRE8_TRUE@ pcre_chartables.c
-
-@WITH_PCRE16_TRUE@libpcre16_la_SOURCES = \
-@WITH_PCRE16_TRUE@ pcre16_byte_order.c \
-@WITH_PCRE16_TRUE@ pcre16_chartables.c \
-@WITH_PCRE16_TRUE@ pcre16_compile.c \
-@WITH_PCRE16_TRUE@ pcre16_config.c \
-@WITH_PCRE16_TRUE@ pcre16_dfa_exec.c \
-@WITH_PCRE16_TRUE@ pcre16_exec.c \
-@WITH_PCRE16_TRUE@ pcre16_fullinfo.c \
-@WITH_PCRE16_TRUE@ pcre16_get.c \
-@WITH_PCRE16_TRUE@ pcre16_globals.c \
-@WITH_PCRE16_TRUE@ pcre16_jit_compile.c \
-@WITH_PCRE16_TRUE@ pcre16_maketables.c \
-@WITH_PCRE16_TRUE@ pcre16_newline.c \
-@WITH_PCRE16_TRUE@ pcre16_ord2utf16.c \
-@WITH_PCRE16_TRUE@ pcre16_refcount.c \
-@WITH_PCRE16_TRUE@ pcre16_string_utils.c \
-@WITH_PCRE16_TRUE@ pcre16_study.c \
-@WITH_PCRE16_TRUE@ pcre16_tables.c \
-@WITH_PCRE16_TRUE@ pcre16_ucd.c \
-@WITH_PCRE16_TRUE@ pcre16_utf16_utils.c \
-@WITH_PCRE16_TRUE@ pcre16_valid_utf16.c \
-@WITH_PCRE16_TRUE@ pcre16_version.c \
-@WITH_PCRE16_TRUE@ pcre16_xclass.c
-
-@WITH_PCRE16_TRUE@libpcre16_la_CFLAGS = $(VISIBILITY_CFLAGS) \
-@WITH_PCRE16_TRUE@ $(AM_CFLAGS) $(am__append_8) \
-@WITH_PCRE16_TRUE@ $(am__append_11)
-@WITH_PCRE16_TRUE@libpcre16_la_LIBADD =
-@WITH_PCRE16_TRUE@nodist_libpcre16_la_SOURCES = \
-@WITH_PCRE16_TRUE@ pcre_chartables.c
-
-@WITH_PCRE32_TRUE@libpcre32_la_SOURCES = \
-@WITH_PCRE32_TRUE@ pcre32_byte_order.c \
-@WITH_PCRE32_TRUE@ pcre32_chartables.c \
-@WITH_PCRE32_TRUE@ pcre32_compile.c \
-@WITH_PCRE32_TRUE@ pcre32_config.c \
-@WITH_PCRE32_TRUE@ pcre32_dfa_exec.c \
-@WITH_PCRE32_TRUE@ pcre32_exec.c \
-@WITH_PCRE32_TRUE@ pcre32_fullinfo.c \
-@WITH_PCRE32_TRUE@ pcre32_get.c \
-@WITH_PCRE32_TRUE@ pcre32_globals.c \
-@WITH_PCRE32_TRUE@ pcre32_jit_compile.c \
-@WITH_PCRE32_TRUE@ pcre32_maketables.c \
-@WITH_PCRE32_TRUE@ pcre32_newline.c \
-@WITH_PCRE32_TRUE@ pcre32_ord2utf32.c \
-@WITH_PCRE32_TRUE@ pcre32_refcount.c \
-@WITH_PCRE32_TRUE@ pcre32_string_utils.c \
-@WITH_PCRE32_TRUE@ pcre32_study.c \
-@WITH_PCRE32_TRUE@ pcre32_tables.c \
-@WITH_PCRE32_TRUE@ pcre32_ucd.c \
-@WITH_PCRE32_TRUE@ pcre32_utf32_utils.c \
-@WITH_PCRE32_TRUE@ pcre32_valid_utf32.c \
-@WITH_PCRE32_TRUE@ pcre32_version.c \
-@WITH_PCRE32_TRUE@ pcre32_xclass.c
-
-@WITH_PCRE32_TRUE@libpcre32_la_CFLAGS = $(VISIBILITY_CFLAGS) \
-@WITH_PCRE32_TRUE@ $(AM_CFLAGS) $(am__append_9) \
-@WITH_PCRE32_TRUE@ $(am__append_12)
-@WITH_PCRE32_TRUE@libpcre32_la_LIBADD =
-@WITH_PCRE32_TRUE@nodist_libpcre32_la_SOURCES = \
-@WITH_PCRE32_TRUE@ pcre_chartables.c
-
-@WITH_PCRE8_TRUE@libpcre_la_LDFLAGS = $(EXTRA_LIBPCRE_LDFLAGS)
-@WITH_PCRE16_TRUE@libpcre16_la_LDFLAGS = $(EXTRA_LIBPCRE16_LDFLAGS)
-@WITH_PCRE32_TRUE@libpcre32_la_LDFLAGS = $(EXTRA_LIBPCRE32_LDFLAGS)
-@WITH_JIT_TRUE@pcre_jit_test_SOURCES = pcre_jit_test.c
-@WITH_JIT_TRUE@pcre_jit_test_CFLAGS = $(AM_CFLAGS) $(am__append_18)
-@WITH_JIT_TRUE@pcre_jit_test_LDADD = $(am__append_15) $(am__append_16) \
-@WITH_JIT_TRUE@ $(am__append_17) $(am__append_19)
-@WITH_PCRE8_TRUE@libpcreposix_la_SOURCES = \
-@WITH_PCRE8_TRUE@ pcreposix.c
-
-@WITH_PCRE8_TRUE@libpcreposix_la_CFLAGS = $(VISIBILITY_CFLAGS) \
-@WITH_PCRE8_TRUE@ $(AM_CFLAGS) $(am__append_21)
-@WITH_PCRE8_TRUE@libpcreposix_la_LDFLAGS = $(EXTRA_LIBPCREPOSIX_LDFLAGS)
-@WITH_PCRE8_TRUE@libpcreposix_la_LIBADD = libpcre.la
-@WITH_PCRE_CPP_TRUE@libpcrecpp_la_SOURCES = \
-@WITH_PCRE_CPP_TRUE@ pcrecpp_internal.h \
-@WITH_PCRE_CPP_TRUE@ pcrecpp.cc \
-@WITH_PCRE_CPP_TRUE@ pcre_scanner.cc \
-@WITH_PCRE_CPP_TRUE@ pcre_stringpiece.cc
-
-@WITH_PCRE_CPP_TRUE@libpcrecpp_la_CXXFLAGS = $(VISIBILITY_CXXFLAGS) \
-@WITH_PCRE_CPP_TRUE@ $(AM_CXXFLAGS) $(am__append_25)
-@WITH_PCRE_CPP_TRUE@libpcrecpp_la_LDFLAGS = $(EXTRA_LIBPCRECPP_LDFLAGS)
-@WITH_PCRE_CPP_TRUE@libpcrecpp_la_LIBADD = libpcre.la
-@WITH_PCRE_CPP_TRUE@pcrecpp_unittest_SOURCES = pcrecpp_unittest.cc
-@WITH_PCRE_CPP_TRUE@pcrecpp_unittest_CXXFLAGS = $(AM_CXXFLAGS)
-@WITH_PCRE_CPP_TRUE@pcrecpp_unittest_LDADD = libpcrecpp.la \
-@WITH_PCRE_CPP_TRUE@ $(am__append_26)
-@WITH_PCRE_CPP_TRUE@pcre_scanner_unittest_SOURCES = pcre_scanner_unittest.cc
-@WITH_PCRE_CPP_TRUE@pcre_scanner_unittest_CXXFLAGS = $(AM_CXXFLAGS)
-@WITH_PCRE_CPP_TRUE@pcre_scanner_unittest_LDADD = libpcrecpp.la \
-@WITH_PCRE_CPP_TRUE@ $(am__append_27)
-@WITH_PCRE_CPP_TRUE@pcre_stringpiece_unittest_SOURCES = pcre_stringpiece_unittest.cc
-@WITH_PCRE_CPP_TRUE@pcre_stringpiece_unittest_CXXFLAGS = $(AM_CXXFLAGS)
-@WITH_PCRE_CPP_TRUE@pcre_stringpiece_unittest_LDADD = libpcrecpp.la \
-@WITH_PCRE_CPP_TRUE@ $(am__append_28)
-pcretest_SOURCES = pcretest.c $(am__append_29) $(am__append_31) \
- $(am__append_33)
-pcretest_CFLAGS = $(AM_CFLAGS) $(am__append_35) $(am__append_36)
-pcretest_LDADD = $(LIBREADLINE) $(am__append_30) $(am__append_32) \
- $(am__append_34) $(am__append_37)
-@WITH_PCRE8_TRUE@pcregrep_SOURCES = pcregrep.c
-@WITH_PCRE8_TRUE@pcregrep_CFLAGS = $(AM_CFLAGS) $(am__append_41)
-@WITH_PCRE8_TRUE@pcregrep_LDADD = $(LIBZ) $(LIBBZ2) libpcre.la \
-@WITH_PCRE8_TRUE@ libpcreposix.la $(am__append_42)
-
-# A PCRE user submitted the following addition, saying that it "will allow
-# anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
-# nice DLL for Windows use". (It is used by the pcre.dll target.)
-DLL_OBJS = pcre_byte_order.o pcre_compile.o pcre_config.o \
- pcre_dfa_exec.o pcre_exec.o pcre_fullinfo.o pcre_get.o \
- pcre_globals.o pcre_jit_compile.o pcre_maketables.o \
- pcre_newline.o pcre_ord2utf8.o pcre_refcount.o \
- pcre_study.o pcre_tables.o pcre_ucd.o \
- pcre_valid_utf8.o pcre_version.o pcre_chartables.o \
- pcre_xclass.o
-
-
-# We have .pc files for pkg-config users.
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libpcre.pc libpcreposix.pc $(am__append_43) \
- $(am__append_44) $(am__append_45)
-
-# Note that pcrecpp.3 is not in this list, but is included separately below.
-dist_man_MANS = \
- doc/pcre-config.1 \
- doc/pcre.3 \
- doc/pcre16.3 \
- doc/pcre32.3 \
- doc/pcre_assign_jit_stack.3 \
- doc/pcre_compile.3 \
- doc/pcre_compile2.3 \
- doc/pcre_config.3 \
- doc/pcre_copy_named_substring.3 \
- doc/pcre_copy_substring.3 \
- doc/pcre_dfa_exec.3 \
- doc/pcre_exec.3 \
- doc/pcre_free_study.3 \
- doc/pcre_free_substring.3 \
- doc/pcre_free_substring_list.3 \
- doc/pcre_fullinfo.3 \
- doc/pcre_get_named_substring.3 \
- doc/pcre_get_stringnumber.3 \
- doc/pcre_get_stringtable_entries.3 \
- doc/pcre_get_substring.3 \
- doc/pcre_get_substring_list.3 \
- doc/pcre_jit_exec.3 \
- doc/pcre_jit_stack_alloc.3 \
- doc/pcre_jit_stack_free.3 \
- doc/pcre_maketables.3 \
- doc/pcre_pattern_to_host_byte_order.3 \
- doc/pcre_refcount.3 \
- doc/pcre_study.3 \
- doc/pcre_utf16_to_host_byte_order.3 \
- doc/pcre_utf32_to_host_byte_order.3 \
- doc/pcre_version.3 \
- doc/pcreapi.3 \
- doc/pcrebuild.3 \
- doc/pcrecallout.3 \
- doc/pcrecompat.3 \
- doc/pcredemo.3 \
- doc/pcregrep.1 \
- doc/pcrejit.3 \
- doc/pcrelimits.3 \
- doc/pcrematching.3 \
- doc/pcrepartial.3 \
- doc/pcrepattern.3 \
- doc/pcreperform.3 \
- doc/pcreposix.3 \
- doc/pcreprecompile.3 \
- doc/pcresample.3 \
- doc/pcrestack.3 \
- doc/pcresyntax.3 \
- doc/pcretest.1 \
- doc/pcreunicode.3
-
-pcrecpp_man = doc/pcrecpp.3
-@WITH_PCRE_CPP_TRUE@man_MANS = $(pcrecpp_man)
-
-# gcov/lcov code coverage reporting
-
-# Coverage reporting targets:
-#
-# coverage: Create a coverage report from 'make check'
-# coverage-baseline: Capture baseline coverage information
-# coverage-reset: This zeros the coverage counters only
-# coverage-report: This creates the coverage report only
-# coverage-clean-report: This removes the generated coverage report
-# without cleaning the coverage data itself
-# coverage-clean-data: This removes the captured coverage data without
-# removing the coverage files created at compile time (*.gcno)
-# coverage-clean: This cleans all coverage data including the generated
-# coverage report.
-@WITH_GCOV_TRUE@COVERAGE_TEST_NAME = $(PACKAGE)
-@WITH_GCOV_TRUE@COVERAGE_NAME = $(PACKAGE)-$(VERSION)
-@WITH_GCOV_TRUE@COVERAGE_OUTPUT_FILE = $(COVERAGE_NAME)-coverage.info
-@WITH_GCOV_TRUE@COVERAGE_OUTPUT_DIR = $(COVERAGE_NAME)-coverage
-@WITH_GCOV_TRUE@COVERAGE_LCOV_EXTRA_FLAGS =
-@WITH_GCOV_TRUE@COVERAGE_GENHTML_EXTRA_FLAGS =
-@WITH_GCOV_TRUE@coverage_quiet = $(coverage_quiet_$(V))
-@WITH_GCOV_TRUE@coverage_quiet_ = $(coverage_quiet_$(AM_DEFAULT_VERBOSITY))
-@WITH_GCOV_TRUE@coverage_quiet_0 = --quiet
-all: $(BUILT_SOURCES) config.h
- $(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .cc .lo .log .o .obj .test .test$(EXEEXT) .trs
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *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);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-config.h: stamp-h1
- @test -f $@ || rm -f stamp-h1
- @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-libpcre.pc: $(top_builddir)/config.status $(srcdir)/libpcre.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-libpcre16.pc: $(top_builddir)/config.status $(srcdir)/libpcre16.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-libpcre32.pc: $(top_builddir)/config.status $(srcdir)/libpcre32.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-libpcreposix.pc: $(top_builddir)/config.status $(srcdir)/libpcreposix.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-libpcrecpp.pc: $(top_builddir)/config.status $(srcdir)/libpcrecpp.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-pcre-config: $(top_builddir)/config.status $(srcdir)/pcre-config.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-pcre.h: $(top_builddir)/config.status $(srcdir)/pcre.h.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-pcre_stringpiece.h: $(top_builddir)/config.status $(srcdir)/pcre_stringpiece.h.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-pcrecpparg.h: $(top_builddir)/config.status $(srcdir)/pcrecpparg.h.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- list2=; for p in $$list; do \
- if test -f $$p; then \
- list2="$$list2 $$p"; \
- else :; fi; \
- done; \
- test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
- }
-
-uninstall-libLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
- done
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libpcre.la: $(libpcre_la_OBJECTS) $(libpcre_la_DEPENDENCIES) $(EXTRA_libpcre_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libpcre_la_LINK) $(am_libpcre_la_rpath) $(libpcre_la_OBJECTS) $(libpcre_la_LIBADD) $(LIBS)
-
-libpcre16.la: $(libpcre16_la_OBJECTS) $(libpcre16_la_DEPENDENCIES) $(EXTRA_libpcre16_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libpcre16_la_LINK) $(am_libpcre16_la_rpath) $(libpcre16_la_OBJECTS) $(libpcre16_la_LIBADD) $(LIBS)
-
-libpcre32.la: $(libpcre32_la_OBJECTS) $(libpcre32_la_DEPENDENCIES) $(EXTRA_libpcre32_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libpcre32_la_LINK) $(am_libpcre32_la_rpath) $(libpcre32_la_OBJECTS) $(libpcre32_la_LIBADD) $(LIBS)
-
-libpcrecpp.la: $(libpcrecpp_la_OBJECTS) $(libpcrecpp_la_DEPENDENCIES) $(EXTRA_libpcrecpp_la_DEPENDENCIES)
- $(AM_V_CXXLD)$(libpcrecpp_la_LINK) $(am_libpcrecpp_la_rpath) $(libpcrecpp_la_OBJECTS) $(libpcrecpp_la_LIBADD) $(LIBS)
-
-libpcreposix.la: $(libpcreposix_la_OBJECTS) $(libpcreposix_la_DEPENDENCIES) $(EXTRA_libpcreposix_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libpcreposix_la_LINK) $(am_libpcreposix_la_rpath) $(libpcreposix_la_OBJECTS) $(libpcreposix_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
-
-dftables$(EXEEXT): $(dftables_OBJECTS) $(dftables_DEPENDENCIES) $(EXTRA_dftables_DEPENDENCIES)
- @rm -f dftables$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dftables_OBJECTS) $(dftables_LDADD) $(LIBS)
-
-pcre_jit_test$(EXEEXT): $(pcre_jit_test_OBJECTS) $(pcre_jit_test_DEPENDENCIES) $(EXTRA_pcre_jit_test_DEPENDENCIES)
- @rm -f pcre_jit_test$(EXEEXT)
- $(AM_V_CCLD)$(pcre_jit_test_LINK) $(pcre_jit_test_OBJECTS) $(pcre_jit_test_LDADD) $(LIBS)
-
-pcre_scanner_unittest$(EXEEXT): $(pcre_scanner_unittest_OBJECTS) $(pcre_scanner_unittest_DEPENDENCIES) $(EXTRA_pcre_scanner_unittest_DEPENDENCIES)
- @rm -f pcre_scanner_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(pcre_scanner_unittest_LINK) $(pcre_scanner_unittest_OBJECTS) $(pcre_scanner_unittest_LDADD) $(LIBS)
-
-pcre_stringpiece_unittest$(EXEEXT): $(pcre_stringpiece_unittest_OBJECTS) $(pcre_stringpiece_unittest_DEPENDENCIES) $(EXTRA_pcre_stringpiece_unittest_DEPENDENCIES)
- @rm -f pcre_stringpiece_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(pcre_stringpiece_unittest_LINK) $(pcre_stringpiece_unittest_OBJECTS) $(pcre_stringpiece_unittest_LDADD) $(LIBS)
-
-pcrecpp_unittest$(EXEEXT): $(pcrecpp_unittest_OBJECTS) $(pcrecpp_unittest_DEPENDENCIES) $(EXTRA_pcrecpp_unittest_DEPENDENCIES)
- @rm -f pcrecpp_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(pcrecpp_unittest_LINK) $(pcrecpp_unittest_OBJECTS) $(pcrecpp_unittest_LDADD) $(LIBS)
-
-pcregrep$(EXEEXT): $(pcregrep_OBJECTS) $(pcregrep_DEPENDENCIES) $(EXTRA_pcregrep_DEPENDENCIES)
- @rm -f pcregrep$(EXEEXT)
- $(AM_V_CCLD)$(pcregrep_LINK) $(pcregrep_OBJECTS) $(pcregrep_LDADD) $(LIBS)
-
-pcretest$(EXEEXT): $(pcretest_OBJECTS) $(pcretest_DEPENDENCIES) $(EXTRA_pcretest_DEPENDENCIES)
- @rm -f pcretest$(EXEEXT)
- $(AM_V_CCLD)$(pcretest_LINK) $(pcretest_OBJECTS) $(pcretest_LDADD) $(LIBS)
-install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- @list='$(bin_SCRIPTS)'; 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 \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n' \
- -e 'h;s|.*|.|' \
- -e 'p;x;s,.*/,,;$(transform)' | 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; \
- if (++n[d] == $(am__install_max)) { \
- print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
- else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 's,.*/,,;$(transform)'`; \
- dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dftables.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_byte_order.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_chartables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_config.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_dfa_exec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_exec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_fullinfo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_get.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_globals.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_jit_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_maketables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_newline.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_ord2utf16.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_refcount.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_string_utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_study.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_tables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_ucd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_utf16_utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_valid_utf16.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_version.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre16_xclass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre16_la-pcre_chartables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_byte_order.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_chartables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_config.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_dfa_exec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_exec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_fullinfo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_get.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_globals.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_jit_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_maketables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_newline.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_ord2utf32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_refcount.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_string_utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_study.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_tables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_ucd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_utf32_utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_valid_utf32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_version.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre32_xclass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre32_la-pcre_chartables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_byte_order.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_chartables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_config.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_dfa_exec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_exec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_fullinfo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_get.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_globals.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_jit_compile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_maketables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_newline.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_ord2utf8.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_refcount.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_string_utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_study.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_tables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_ucd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_valid_utf8.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_version.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_xclass.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcrecpp_la-pcre_scanner.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcrecpp_la-pcre_stringpiece.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcrecpp_la-pcrecpp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcreposix_la-pcreposix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcre_jit_test-pcre_jit_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcre_scanner_unittest-pcre_scanner_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcre_stringpiece_unittest-pcre_stringpiece_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcrecpp_unittest-pcrecpp_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcregrep-pcregrep.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcretest-pcre16_printint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcretest-pcre32_printint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcretest-pcre_printint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcretest-pcretest.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-libpcre_la-pcre_byte_order.lo: pcre_byte_order.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_byte_order.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_byte_order.Tpo -c -o libpcre_la-pcre_byte_order.lo `test -f 'pcre_byte_order.c' || echo '$(srcdir)/'`pcre_byte_order.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_byte_order.Tpo $(DEPDIR)/libpcre_la-pcre_byte_order.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_byte_order.c' object='libpcre_la-pcre_byte_order.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_byte_order.lo `test -f 'pcre_byte_order.c' || echo '$(srcdir)/'`pcre_byte_order.c
-
-libpcre_la-pcre_compile.lo: pcre_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_compile.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_compile.Tpo -c -o libpcre_la-pcre_compile.lo `test -f 'pcre_compile.c' || echo '$(srcdir)/'`pcre_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_compile.Tpo $(DEPDIR)/libpcre_la-pcre_compile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_compile.c' object='libpcre_la-pcre_compile.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_compile.lo `test -f 'pcre_compile.c' || echo '$(srcdir)/'`pcre_compile.c
-
-libpcre_la-pcre_config.lo: pcre_config.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_config.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_config.Tpo -c -o libpcre_la-pcre_config.lo `test -f 'pcre_config.c' || echo '$(srcdir)/'`pcre_config.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_config.Tpo $(DEPDIR)/libpcre_la-pcre_config.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_config.c' object='libpcre_la-pcre_config.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_config.lo `test -f 'pcre_config.c' || echo '$(srcdir)/'`pcre_config.c
-
-libpcre_la-pcre_dfa_exec.lo: pcre_dfa_exec.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_dfa_exec.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_dfa_exec.Tpo -c -o libpcre_la-pcre_dfa_exec.lo `test -f 'pcre_dfa_exec.c' || echo '$(srcdir)/'`pcre_dfa_exec.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_dfa_exec.Tpo $(DEPDIR)/libpcre_la-pcre_dfa_exec.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_dfa_exec.c' object='libpcre_la-pcre_dfa_exec.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_dfa_exec.lo `test -f 'pcre_dfa_exec.c' || echo '$(srcdir)/'`pcre_dfa_exec.c
-
-libpcre_la-pcre_exec.lo: pcre_exec.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_exec.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_exec.Tpo -c -o libpcre_la-pcre_exec.lo `test -f 'pcre_exec.c' || echo '$(srcdir)/'`pcre_exec.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_exec.Tpo $(DEPDIR)/libpcre_la-pcre_exec.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_exec.c' object='libpcre_la-pcre_exec.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_exec.lo `test -f 'pcre_exec.c' || echo '$(srcdir)/'`pcre_exec.c
-
-libpcre_la-pcre_fullinfo.lo: pcre_fullinfo.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_fullinfo.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_fullinfo.Tpo -c -o libpcre_la-pcre_fullinfo.lo `test -f 'pcre_fullinfo.c' || echo '$(srcdir)/'`pcre_fullinfo.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_fullinfo.Tpo $(DEPDIR)/libpcre_la-pcre_fullinfo.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_fullinfo.c' object='libpcre_la-pcre_fullinfo.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_fullinfo.lo `test -f 'pcre_fullinfo.c' || echo '$(srcdir)/'`pcre_fullinfo.c
-
-libpcre_la-pcre_get.lo: pcre_get.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_get.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_get.Tpo -c -o libpcre_la-pcre_get.lo `test -f 'pcre_get.c' || echo '$(srcdir)/'`pcre_get.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_get.Tpo $(DEPDIR)/libpcre_la-pcre_get.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_get.c' object='libpcre_la-pcre_get.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_get.lo `test -f 'pcre_get.c' || echo '$(srcdir)/'`pcre_get.c
-
-libpcre_la-pcre_globals.lo: pcre_globals.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_globals.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_globals.Tpo -c -o libpcre_la-pcre_globals.lo `test -f 'pcre_globals.c' || echo '$(srcdir)/'`pcre_globals.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_globals.Tpo $(DEPDIR)/libpcre_la-pcre_globals.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_globals.c' object='libpcre_la-pcre_globals.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_globals.lo `test -f 'pcre_globals.c' || echo '$(srcdir)/'`pcre_globals.c
-
-libpcre_la-pcre_jit_compile.lo: pcre_jit_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_jit_compile.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_jit_compile.Tpo -c -o libpcre_la-pcre_jit_compile.lo `test -f 'pcre_jit_compile.c' || echo '$(srcdir)/'`pcre_jit_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_jit_compile.Tpo $(DEPDIR)/libpcre_la-pcre_jit_compile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_jit_compile.c' object='libpcre_la-pcre_jit_compile.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_jit_compile.lo `test -f 'pcre_jit_compile.c' || echo '$(srcdir)/'`pcre_jit_compile.c
-
-libpcre_la-pcre_maketables.lo: pcre_maketables.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_maketables.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_maketables.Tpo -c -o libpcre_la-pcre_maketables.lo `test -f 'pcre_maketables.c' || echo '$(srcdir)/'`pcre_maketables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_maketables.Tpo $(DEPDIR)/libpcre_la-pcre_maketables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_maketables.c' object='libpcre_la-pcre_maketables.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_maketables.lo `test -f 'pcre_maketables.c' || echo '$(srcdir)/'`pcre_maketables.c
-
-libpcre_la-pcre_newline.lo: pcre_newline.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_newline.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_newline.Tpo -c -o libpcre_la-pcre_newline.lo `test -f 'pcre_newline.c' || echo '$(srcdir)/'`pcre_newline.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_newline.Tpo $(DEPDIR)/libpcre_la-pcre_newline.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_newline.c' object='libpcre_la-pcre_newline.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_newline.lo `test -f 'pcre_newline.c' || echo '$(srcdir)/'`pcre_newline.c
-
-libpcre_la-pcre_ord2utf8.lo: pcre_ord2utf8.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_ord2utf8.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_ord2utf8.Tpo -c -o libpcre_la-pcre_ord2utf8.lo `test -f 'pcre_ord2utf8.c' || echo '$(srcdir)/'`pcre_ord2utf8.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_ord2utf8.Tpo $(DEPDIR)/libpcre_la-pcre_ord2utf8.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_ord2utf8.c' object='libpcre_la-pcre_ord2utf8.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_ord2utf8.lo `test -f 'pcre_ord2utf8.c' || echo '$(srcdir)/'`pcre_ord2utf8.c
-
-libpcre_la-pcre_refcount.lo: pcre_refcount.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_refcount.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_refcount.Tpo -c -o libpcre_la-pcre_refcount.lo `test -f 'pcre_refcount.c' || echo '$(srcdir)/'`pcre_refcount.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_refcount.Tpo $(DEPDIR)/libpcre_la-pcre_refcount.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_refcount.c' object='libpcre_la-pcre_refcount.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_refcount.lo `test -f 'pcre_refcount.c' || echo '$(srcdir)/'`pcre_refcount.c
-
-libpcre_la-pcre_string_utils.lo: pcre_string_utils.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_string_utils.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_string_utils.Tpo -c -o libpcre_la-pcre_string_utils.lo `test -f 'pcre_string_utils.c' || echo '$(srcdir)/'`pcre_string_utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_string_utils.Tpo $(DEPDIR)/libpcre_la-pcre_string_utils.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_string_utils.c' object='libpcre_la-pcre_string_utils.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_string_utils.lo `test -f 'pcre_string_utils.c' || echo '$(srcdir)/'`pcre_string_utils.c
-
-libpcre_la-pcre_study.lo: pcre_study.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_study.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_study.Tpo -c -o libpcre_la-pcre_study.lo `test -f 'pcre_study.c' || echo '$(srcdir)/'`pcre_study.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_study.Tpo $(DEPDIR)/libpcre_la-pcre_study.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_study.c' object='libpcre_la-pcre_study.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_study.lo `test -f 'pcre_study.c' || echo '$(srcdir)/'`pcre_study.c
-
-libpcre_la-pcre_tables.lo: pcre_tables.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_tables.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_tables.Tpo -c -o libpcre_la-pcre_tables.lo `test -f 'pcre_tables.c' || echo '$(srcdir)/'`pcre_tables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_tables.Tpo $(DEPDIR)/libpcre_la-pcre_tables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_tables.c' object='libpcre_la-pcre_tables.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_tables.lo `test -f 'pcre_tables.c' || echo '$(srcdir)/'`pcre_tables.c
-
-libpcre_la-pcre_ucd.lo: pcre_ucd.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_ucd.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_ucd.Tpo -c -o libpcre_la-pcre_ucd.lo `test -f 'pcre_ucd.c' || echo '$(srcdir)/'`pcre_ucd.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_ucd.Tpo $(DEPDIR)/libpcre_la-pcre_ucd.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_ucd.c' object='libpcre_la-pcre_ucd.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_ucd.lo `test -f 'pcre_ucd.c' || echo '$(srcdir)/'`pcre_ucd.c
-
-libpcre_la-pcre_valid_utf8.lo: pcre_valid_utf8.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_valid_utf8.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_valid_utf8.Tpo -c -o libpcre_la-pcre_valid_utf8.lo `test -f 'pcre_valid_utf8.c' || echo '$(srcdir)/'`pcre_valid_utf8.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_valid_utf8.Tpo $(DEPDIR)/libpcre_la-pcre_valid_utf8.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_valid_utf8.c' object='libpcre_la-pcre_valid_utf8.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_valid_utf8.lo `test -f 'pcre_valid_utf8.c' || echo '$(srcdir)/'`pcre_valid_utf8.c
-
-libpcre_la-pcre_version.lo: pcre_version.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_version.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_version.Tpo -c -o libpcre_la-pcre_version.lo `test -f 'pcre_version.c' || echo '$(srcdir)/'`pcre_version.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_version.Tpo $(DEPDIR)/libpcre_la-pcre_version.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_version.c' object='libpcre_la-pcre_version.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_version.lo `test -f 'pcre_version.c' || echo '$(srcdir)/'`pcre_version.c
-
-libpcre_la-pcre_xclass.lo: pcre_xclass.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_xclass.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_xclass.Tpo -c -o libpcre_la-pcre_xclass.lo `test -f 'pcre_xclass.c' || echo '$(srcdir)/'`pcre_xclass.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_xclass.Tpo $(DEPDIR)/libpcre_la-pcre_xclass.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_xclass.c' object='libpcre_la-pcre_xclass.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_xclass.lo `test -f 'pcre_xclass.c' || echo '$(srcdir)/'`pcre_xclass.c
-
-libpcre_la-pcre_chartables.lo: pcre_chartables.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) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_chartables.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_chartables.Tpo -c -o libpcre_la-pcre_chartables.lo `test -f 'pcre_chartables.c' || echo '$(srcdir)/'`pcre_chartables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_chartables.Tpo $(DEPDIR)/libpcre_la-pcre_chartables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_chartables.c' object='libpcre_la-pcre_chartables.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) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_chartables.lo `test -f 'pcre_chartables.c' || echo '$(srcdir)/'`pcre_chartables.c
-
-libpcre16_la-pcre16_byte_order.lo: pcre16_byte_order.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_byte_order.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_byte_order.Tpo -c -o libpcre16_la-pcre16_byte_order.lo `test -f 'pcre16_byte_order.c' || echo '$(srcdir)/'`pcre16_byte_order.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_byte_order.Tpo $(DEPDIR)/libpcre16_la-pcre16_byte_order.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_byte_order.c' object='libpcre16_la-pcre16_byte_order.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_byte_order.lo `test -f 'pcre16_byte_order.c' || echo '$(srcdir)/'`pcre16_byte_order.c
-
-libpcre16_la-pcre16_chartables.lo: pcre16_chartables.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_chartables.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_chartables.Tpo -c -o libpcre16_la-pcre16_chartables.lo `test -f 'pcre16_chartables.c' || echo '$(srcdir)/'`pcre16_chartables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_chartables.Tpo $(DEPDIR)/libpcre16_la-pcre16_chartables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_chartables.c' object='libpcre16_la-pcre16_chartables.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_chartables.lo `test -f 'pcre16_chartables.c' || echo '$(srcdir)/'`pcre16_chartables.c
-
-libpcre16_la-pcre16_compile.lo: pcre16_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_compile.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_compile.Tpo -c -o libpcre16_la-pcre16_compile.lo `test -f 'pcre16_compile.c' || echo '$(srcdir)/'`pcre16_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_compile.Tpo $(DEPDIR)/libpcre16_la-pcre16_compile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_compile.c' object='libpcre16_la-pcre16_compile.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_compile.lo `test -f 'pcre16_compile.c' || echo '$(srcdir)/'`pcre16_compile.c
-
-libpcre16_la-pcre16_config.lo: pcre16_config.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_config.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_config.Tpo -c -o libpcre16_la-pcre16_config.lo `test -f 'pcre16_config.c' || echo '$(srcdir)/'`pcre16_config.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_config.Tpo $(DEPDIR)/libpcre16_la-pcre16_config.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_config.c' object='libpcre16_la-pcre16_config.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_config.lo `test -f 'pcre16_config.c' || echo '$(srcdir)/'`pcre16_config.c
-
-libpcre16_la-pcre16_dfa_exec.lo: pcre16_dfa_exec.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_dfa_exec.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_dfa_exec.Tpo -c -o libpcre16_la-pcre16_dfa_exec.lo `test -f 'pcre16_dfa_exec.c' || echo '$(srcdir)/'`pcre16_dfa_exec.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_dfa_exec.Tpo $(DEPDIR)/libpcre16_la-pcre16_dfa_exec.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_dfa_exec.c' object='libpcre16_la-pcre16_dfa_exec.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_dfa_exec.lo `test -f 'pcre16_dfa_exec.c' || echo '$(srcdir)/'`pcre16_dfa_exec.c
-
-libpcre16_la-pcre16_exec.lo: pcre16_exec.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_exec.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_exec.Tpo -c -o libpcre16_la-pcre16_exec.lo `test -f 'pcre16_exec.c' || echo '$(srcdir)/'`pcre16_exec.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_exec.Tpo $(DEPDIR)/libpcre16_la-pcre16_exec.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_exec.c' object='libpcre16_la-pcre16_exec.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_exec.lo `test -f 'pcre16_exec.c' || echo '$(srcdir)/'`pcre16_exec.c
-
-libpcre16_la-pcre16_fullinfo.lo: pcre16_fullinfo.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_fullinfo.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_fullinfo.Tpo -c -o libpcre16_la-pcre16_fullinfo.lo `test -f 'pcre16_fullinfo.c' || echo '$(srcdir)/'`pcre16_fullinfo.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_fullinfo.Tpo $(DEPDIR)/libpcre16_la-pcre16_fullinfo.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_fullinfo.c' object='libpcre16_la-pcre16_fullinfo.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_fullinfo.lo `test -f 'pcre16_fullinfo.c' || echo '$(srcdir)/'`pcre16_fullinfo.c
-
-libpcre16_la-pcre16_get.lo: pcre16_get.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_get.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_get.Tpo -c -o libpcre16_la-pcre16_get.lo `test -f 'pcre16_get.c' || echo '$(srcdir)/'`pcre16_get.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_get.Tpo $(DEPDIR)/libpcre16_la-pcre16_get.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_get.c' object='libpcre16_la-pcre16_get.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_get.lo `test -f 'pcre16_get.c' || echo '$(srcdir)/'`pcre16_get.c
-
-libpcre16_la-pcre16_globals.lo: pcre16_globals.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_globals.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_globals.Tpo -c -o libpcre16_la-pcre16_globals.lo `test -f 'pcre16_globals.c' || echo '$(srcdir)/'`pcre16_globals.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_globals.Tpo $(DEPDIR)/libpcre16_la-pcre16_globals.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_globals.c' object='libpcre16_la-pcre16_globals.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_globals.lo `test -f 'pcre16_globals.c' || echo '$(srcdir)/'`pcre16_globals.c
-
-libpcre16_la-pcre16_jit_compile.lo: pcre16_jit_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_jit_compile.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_jit_compile.Tpo -c -o libpcre16_la-pcre16_jit_compile.lo `test -f 'pcre16_jit_compile.c' || echo '$(srcdir)/'`pcre16_jit_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_jit_compile.Tpo $(DEPDIR)/libpcre16_la-pcre16_jit_compile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_jit_compile.c' object='libpcre16_la-pcre16_jit_compile.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_jit_compile.lo `test -f 'pcre16_jit_compile.c' || echo '$(srcdir)/'`pcre16_jit_compile.c
-
-libpcre16_la-pcre16_maketables.lo: pcre16_maketables.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_maketables.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_maketables.Tpo -c -o libpcre16_la-pcre16_maketables.lo `test -f 'pcre16_maketables.c' || echo '$(srcdir)/'`pcre16_maketables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_maketables.Tpo $(DEPDIR)/libpcre16_la-pcre16_maketables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_maketables.c' object='libpcre16_la-pcre16_maketables.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_maketables.lo `test -f 'pcre16_maketables.c' || echo '$(srcdir)/'`pcre16_maketables.c
-
-libpcre16_la-pcre16_newline.lo: pcre16_newline.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_newline.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_newline.Tpo -c -o libpcre16_la-pcre16_newline.lo `test -f 'pcre16_newline.c' || echo '$(srcdir)/'`pcre16_newline.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_newline.Tpo $(DEPDIR)/libpcre16_la-pcre16_newline.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_newline.c' object='libpcre16_la-pcre16_newline.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_newline.lo `test -f 'pcre16_newline.c' || echo '$(srcdir)/'`pcre16_newline.c
-
-libpcre16_la-pcre16_ord2utf16.lo: pcre16_ord2utf16.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_ord2utf16.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_ord2utf16.Tpo -c -o libpcre16_la-pcre16_ord2utf16.lo `test -f 'pcre16_ord2utf16.c' || echo '$(srcdir)/'`pcre16_ord2utf16.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_ord2utf16.Tpo $(DEPDIR)/libpcre16_la-pcre16_ord2utf16.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_ord2utf16.c' object='libpcre16_la-pcre16_ord2utf16.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_ord2utf16.lo `test -f 'pcre16_ord2utf16.c' || echo '$(srcdir)/'`pcre16_ord2utf16.c
-
-libpcre16_la-pcre16_refcount.lo: pcre16_refcount.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_refcount.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_refcount.Tpo -c -o libpcre16_la-pcre16_refcount.lo `test -f 'pcre16_refcount.c' || echo '$(srcdir)/'`pcre16_refcount.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_refcount.Tpo $(DEPDIR)/libpcre16_la-pcre16_refcount.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_refcount.c' object='libpcre16_la-pcre16_refcount.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_refcount.lo `test -f 'pcre16_refcount.c' || echo '$(srcdir)/'`pcre16_refcount.c
-
-libpcre16_la-pcre16_string_utils.lo: pcre16_string_utils.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_string_utils.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_string_utils.Tpo -c -o libpcre16_la-pcre16_string_utils.lo `test -f 'pcre16_string_utils.c' || echo '$(srcdir)/'`pcre16_string_utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_string_utils.Tpo $(DEPDIR)/libpcre16_la-pcre16_string_utils.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_string_utils.c' object='libpcre16_la-pcre16_string_utils.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_string_utils.lo `test -f 'pcre16_string_utils.c' || echo '$(srcdir)/'`pcre16_string_utils.c
-
-libpcre16_la-pcre16_study.lo: pcre16_study.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_study.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_study.Tpo -c -o libpcre16_la-pcre16_study.lo `test -f 'pcre16_study.c' || echo '$(srcdir)/'`pcre16_study.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_study.Tpo $(DEPDIR)/libpcre16_la-pcre16_study.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_study.c' object='libpcre16_la-pcre16_study.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_study.lo `test -f 'pcre16_study.c' || echo '$(srcdir)/'`pcre16_study.c
-
-libpcre16_la-pcre16_tables.lo: pcre16_tables.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_tables.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_tables.Tpo -c -o libpcre16_la-pcre16_tables.lo `test -f 'pcre16_tables.c' || echo '$(srcdir)/'`pcre16_tables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_tables.Tpo $(DEPDIR)/libpcre16_la-pcre16_tables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_tables.c' object='libpcre16_la-pcre16_tables.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_tables.lo `test -f 'pcre16_tables.c' || echo '$(srcdir)/'`pcre16_tables.c
-
-libpcre16_la-pcre16_ucd.lo: pcre16_ucd.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_ucd.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_ucd.Tpo -c -o libpcre16_la-pcre16_ucd.lo `test -f 'pcre16_ucd.c' || echo '$(srcdir)/'`pcre16_ucd.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_ucd.Tpo $(DEPDIR)/libpcre16_la-pcre16_ucd.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_ucd.c' object='libpcre16_la-pcre16_ucd.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_ucd.lo `test -f 'pcre16_ucd.c' || echo '$(srcdir)/'`pcre16_ucd.c
-
-libpcre16_la-pcre16_utf16_utils.lo: pcre16_utf16_utils.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_utf16_utils.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_utf16_utils.Tpo -c -o libpcre16_la-pcre16_utf16_utils.lo `test -f 'pcre16_utf16_utils.c' || echo '$(srcdir)/'`pcre16_utf16_utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_utf16_utils.Tpo $(DEPDIR)/libpcre16_la-pcre16_utf16_utils.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_utf16_utils.c' object='libpcre16_la-pcre16_utf16_utils.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_utf16_utils.lo `test -f 'pcre16_utf16_utils.c' || echo '$(srcdir)/'`pcre16_utf16_utils.c
-
-libpcre16_la-pcre16_valid_utf16.lo: pcre16_valid_utf16.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_valid_utf16.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_valid_utf16.Tpo -c -o libpcre16_la-pcre16_valid_utf16.lo `test -f 'pcre16_valid_utf16.c' || echo '$(srcdir)/'`pcre16_valid_utf16.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_valid_utf16.Tpo $(DEPDIR)/libpcre16_la-pcre16_valid_utf16.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_valid_utf16.c' object='libpcre16_la-pcre16_valid_utf16.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_valid_utf16.lo `test -f 'pcre16_valid_utf16.c' || echo '$(srcdir)/'`pcre16_valid_utf16.c
-
-libpcre16_la-pcre16_version.lo: pcre16_version.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_version.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_version.Tpo -c -o libpcre16_la-pcre16_version.lo `test -f 'pcre16_version.c' || echo '$(srcdir)/'`pcre16_version.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_version.Tpo $(DEPDIR)/libpcre16_la-pcre16_version.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_version.c' object='libpcre16_la-pcre16_version.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_version.lo `test -f 'pcre16_version.c' || echo '$(srcdir)/'`pcre16_version.c
-
-libpcre16_la-pcre16_xclass.lo: pcre16_xclass.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre16_xclass.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre16_xclass.Tpo -c -o libpcre16_la-pcre16_xclass.lo `test -f 'pcre16_xclass.c' || echo '$(srcdir)/'`pcre16_xclass.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre16_xclass.Tpo $(DEPDIR)/libpcre16_la-pcre16_xclass.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_xclass.c' object='libpcre16_la-pcre16_xclass.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre16_xclass.lo `test -f 'pcre16_xclass.c' || echo '$(srcdir)/'`pcre16_xclass.c
-
-libpcre16_la-pcre_chartables.lo: pcre_chartables.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -MT libpcre16_la-pcre_chartables.lo -MD -MP -MF $(DEPDIR)/libpcre16_la-pcre_chartables.Tpo -c -o libpcre16_la-pcre_chartables.lo `test -f 'pcre_chartables.c' || echo '$(srcdir)/'`pcre_chartables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre16_la-pcre_chartables.Tpo $(DEPDIR)/libpcre16_la-pcre_chartables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_chartables.c' object='libpcre16_la-pcre_chartables.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) $(libpcre16_la_CFLAGS) $(CFLAGS) -c -o libpcre16_la-pcre_chartables.lo `test -f 'pcre_chartables.c' || echo '$(srcdir)/'`pcre_chartables.c
-
-libpcre32_la-pcre32_byte_order.lo: pcre32_byte_order.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_byte_order.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_byte_order.Tpo -c -o libpcre32_la-pcre32_byte_order.lo `test -f 'pcre32_byte_order.c' || echo '$(srcdir)/'`pcre32_byte_order.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_byte_order.Tpo $(DEPDIR)/libpcre32_la-pcre32_byte_order.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_byte_order.c' object='libpcre32_la-pcre32_byte_order.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_byte_order.lo `test -f 'pcre32_byte_order.c' || echo '$(srcdir)/'`pcre32_byte_order.c
-
-libpcre32_la-pcre32_chartables.lo: pcre32_chartables.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_chartables.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_chartables.Tpo -c -o libpcre32_la-pcre32_chartables.lo `test -f 'pcre32_chartables.c' || echo '$(srcdir)/'`pcre32_chartables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_chartables.Tpo $(DEPDIR)/libpcre32_la-pcre32_chartables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_chartables.c' object='libpcre32_la-pcre32_chartables.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_chartables.lo `test -f 'pcre32_chartables.c' || echo '$(srcdir)/'`pcre32_chartables.c
-
-libpcre32_la-pcre32_compile.lo: pcre32_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_compile.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_compile.Tpo -c -o libpcre32_la-pcre32_compile.lo `test -f 'pcre32_compile.c' || echo '$(srcdir)/'`pcre32_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_compile.Tpo $(DEPDIR)/libpcre32_la-pcre32_compile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_compile.c' object='libpcre32_la-pcre32_compile.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_compile.lo `test -f 'pcre32_compile.c' || echo '$(srcdir)/'`pcre32_compile.c
-
-libpcre32_la-pcre32_config.lo: pcre32_config.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_config.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_config.Tpo -c -o libpcre32_la-pcre32_config.lo `test -f 'pcre32_config.c' || echo '$(srcdir)/'`pcre32_config.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_config.Tpo $(DEPDIR)/libpcre32_la-pcre32_config.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_config.c' object='libpcre32_la-pcre32_config.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_config.lo `test -f 'pcre32_config.c' || echo '$(srcdir)/'`pcre32_config.c
-
-libpcre32_la-pcre32_dfa_exec.lo: pcre32_dfa_exec.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_dfa_exec.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_dfa_exec.Tpo -c -o libpcre32_la-pcre32_dfa_exec.lo `test -f 'pcre32_dfa_exec.c' || echo '$(srcdir)/'`pcre32_dfa_exec.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_dfa_exec.Tpo $(DEPDIR)/libpcre32_la-pcre32_dfa_exec.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_dfa_exec.c' object='libpcre32_la-pcre32_dfa_exec.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_dfa_exec.lo `test -f 'pcre32_dfa_exec.c' || echo '$(srcdir)/'`pcre32_dfa_exec.c
-
-libpcre32_la-pcre32_exec.lo: pcre32_exec.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_exec.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_exec.Tpo -c -o libpcre32_la-pcre32_exec.lo `test -f 'pcre32_exec.c' || echo '$(srcdir)/'`pcre32_exec.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_exec.Tpo $(DEPDIR)/libpcre32_la-pcre32_exec.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_exec.c' object='libpcre32_la-pcre32_exec.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_exec.lo `test -f 'pcre32_exec.c' || echo '$(srcdir)/'`pcre32_exec.c
-
-libpcre32_la-pcre32_fullinfo.lo: pcre32_fullinfo.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_fullinfo.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_fullinfo.Tpo -c -o libpcre32_la-pcre32_fullinfo.lo `test -f 'pcre32_fullinfo.c' || echo '$(srcdir)/'`pcre32_fullinfo.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_fullinfo.Tpo $(DEPDIR)/libpcre32_la-pcre32_fullinfo.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_fullinfo.c' object='libpcre32_la-pcre32_fullinfo.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_fullinfo.lo `test -f 'pcre32_fullinfo.c' || echo '$(srcdir)/'`pcre32_fullinfo.c
-
-libpcre32_la-pcre32_get.lo: pcre32_get.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_get.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_get.Tpo -c -o libpcre32_la-pcre32_get.lo `test -f 'pcre32_get.c' || echo '$(srcdir)/'`pcre32_get.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_get.Tpo $(DEPDIR)/libpcre32_la-pcre32_get.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_get.c' object='libpcre32_la-pcre32_get.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_get.lo `test -f 'pcre32_get.c' || echo '$(srcdir)/'`pcre32_get.c
-
-libpcre32_la-pcre32_globals.lo: pcre32_globals.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_globals.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_globals.Tpo -c -o libpcre32_la-pcre32_globals.lo `test -f 'pcre32_globals.c' || echo '$(srcdir)/'`pcre32_globals.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_globals.Tpo $(DEPDIR)/libpcre32_la-pcre32_globals.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_globals.c' object='libpcre32_la-pcre32_globals.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_globals.lo `test -f 'pcre32_globals.c' || echo '$(srcdir)/'`pcre32_globals.c
-
-libpcre32_la-pcre32_jit_compile.lo: pcre32_jit_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_jit_compile.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_jit_compile.Tpo -c -o libpcre32_la-pcre32_jit_compile.lo `test -f 'pcre32_jit_compile.c' || echo '$(srcdir)/'`pcre32_jit_compile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_jit_compile.Tpo $(DEPDIR)/libpcre32_la-pcre32_jit_compile.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_jit_compile.c' object='libpcre32_la-pcre32_jit_compile.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_jit_compile.lo `test -f 'pcre32_jit_compile.c' || echo '$(srcdir)/'`pcre32_jit_compile.c
-
-libpcre32_la-pcre32_maketables.lo: pcre32_maketables.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_maketables.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_maketables.Tpo -c -o libpcre32_la-pcre32_maketables.lo `test -f 'pcre32_maketables.c' || echo '$(srcdir)/'`pcre32_maketables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_maketables.Tpo $(DEPDIR)/libpcre32_la-pcre32_maketables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_maketables.c' object='libpcre32_la-pcre32_maketables.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_maketables.lo `test -f 'pcre32_maketables.c' || echo '$(srcdir)/'`pcre32_maketables.c
-
-libpcre32_la-pcre32_newline.lo: pcre32_newline.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_newline.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_newline.Tpo -c -o libpcre32_la-pcre32_newline.lo `test -f 'pcre32_newline.c' || echo '$(srcdir)/'`pcre32_newline.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_newline.Tpo $(DEPDIR)/libpcre32_la-pcre32_newline.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_newline.c' object='libpcre32_la-pcre32_newline.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_newline.lo `test -f 'pcre32_newline.c' || echo '$(srcdir)/'`pcre32_newline.c
-
-libpcre32_la-pcre32_ord2utf32.lo: pcre32_ord2utf32.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_ord2utf32.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_ord2utf32.Tpo -c -o libpcre32_la-pcre32_ord2utf32.lo `test -f 'pcre32_ord2utf32.c' || echo '$(srcdir)/'`pcre32_ord2utf32.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_ord2utf32.Tpo $(DEPDIR)/libpcre32_la-pcre32_ord2utf32.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_ord2utf32.c' object='libpcre32_la-pcre32_ord2utf32.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_ord2utf32.lo `test -f 'pcre32_ord2utf32.c' || echo '$(srcdir)/'`pcre32_ord2utf32.c
-
-libpcre32_la-pcre32_refcount.lo: pcre32_refcount.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_refcount.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_refcount.Tpo -c -o libpcre32_la-pcre32_refcount.lo `test -f 'pcre32_refcount.c' || echo '$(srcdir)/'`pcre32_refcount.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_refcount.Tpo $(DEPDIR)/libpcre32_la-pcre32_refcount.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_refcount.c' object='libpcre32_la-pcre32_refcount.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_refcount.lo `test -f 'pcre32_refcount.c' || echo '$(srcdir)/'`pcre32_refcount.c
-
-libpcre32_la-pcre32_string_utils.lo: pcre32_string_utils.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_string_utils.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_string_utils.Tpo -c -o libpcre32_la-pcre32_string_utils.lo `test -f 'pcre32_string_utils.c' || echo '$(srcdir)/'`pcre32_string_utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_string_utils.Tpo $(DEPDIR)/libpcre32_la-pcre32_string_utils.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_string_utils.c' object='libpcre32_la-pcre32_string_utils.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_string_utils.lo `test -f 'pcre32_string_utils.c' || echo '$(srcdir)/'`pcre32_string_utils.c
-
-libpcre32_la-pcre32_study.lo: pcre32_study.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_study.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_study.Tpo -c -o libpcre32_la-pcre32_study.lo `test -f 'pcre32_study.c' || echo '$(srcdir)/'`pcre32_study.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_study.Tpo $(DEPDIR)/libpcre32_la-pcre32_study.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_study.c' object='libpcre32_la-pcre32_study.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_study.lo `test -f 'pcre32_study.c' || echo '$(srcdir)/'`pcre32_study.c
-
-libpcre32_la-pcre32_tables.lo: pcre32_tables.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_tables.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_tables.Tpo -c -o libpcre32_la-pcre32_tables.lo `test -f 'pcre32_tables.c' || echo '$(srcdir)/'`pcre32_tables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_tables.Tpo $(DEPDIR)/libpcre32_la-pcre32_tables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_tables.c' object='libpcre32_la-pcre32_tables.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_tables.lo `test -f 'pcre32_tables.c' || echo '$(srcdir)/'`pcre32_tables.c
-
-libpcre32_la-pcre32_ucd.lo: pcre32_ucd.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_ucd.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_ucd.Tpo -c -o libpcre32_la-pcre32_ucd.lo `test -f 'pcre32_ucd.c' || echo '$(srcdir)/'`pcre32_ucd.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_ucd.Tpo $(DEPDIR)/libpcre32_la-pcre32_ucd.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_ucd.c' object='libpcre32_la-pcre32_ucd.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_ucd.lo `test -f 'pcre32_ucd.c' || echo '$(srcdir)/'`pcre32_ucd.c
-
-libpcre32_la-pcre32_utf32_utils.lo: pcre32_utf32_utils.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_utf32_utils.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_utf32_utils.Tpo -c -o libpcre32_la-pcre32_utf32_utils.lo `test -f 'pcre32_utf32_utils.c' || echo '$(srcdir)/'`pcre32_utf32_utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_utf32_utils.Tpo $(DEPDIR)/libpcre32_la-pcre32_utf32_utils.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_utf32_utils.c' object='libpcre32_la-pcre32_utf32_utils.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_utf32_utils.lo `test -f 'pcre32_utf32_utils.c' || echo '$(srcdir)/'`pcre32_utf32_utils.c
-
-libpcre32_la-pcre32_valid_utf32.lo: pcre32_valid_utf32.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_valid_utf32.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_valid_utf32.Tpo -c -o libpcre32_la-pcre32_valid_utf32.lo `test -f 'pcre32_valid_utf32.c' || echo '$(srcdir)/'`pcre32_valid_utf32.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_valid_utf32.Tpo $(DEPDIR)/libpcre32_la-pcre32_valid_utf32.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_valid_utf32.c' object='libpcre32_la-pcre32_valid_utf32.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_valid_utf32.lo `test -f 'pcre32_valid_utf32.c' || echo '$(srcdir)/'`pcre32_valid_utf32.c
-
-libpcre32_la-pcre32_version.lo: pcre32_version.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_version.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_version.Tpo -c -o libpcre32_la-pcre32_version.lo `test -f 'pcre32_version.c' || echo '$(srcdir)/'`pcre32_version.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_version.Tpo $(DEPDIR)/libpcre32_la-pcre32_version.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_version.c' object='libpcre32_la-pcre32_version.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_version.lo `test -f 'pcre32_version.c' || echo '$(srcdir)/'`pcre32_version.c
-
-libpcre32_la-pcre32_xclass.lo: pcre32_xclass.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre32_xclass.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre32_xclass.Tpo -c -o libpcre32_la-pcre32_xclass.lo `test -f 'pcre32_xclass.c' || echo '$(srcdir)/'`pcre32_xclass.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre32_xclass.Tpo $(DEPDIR)/libpcre32_la-pcre32_xclass.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_xclass.c' object='libpcre32_la-pcre32_xclass.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre32_xclass.lo `test -f 'pcre32_xclass.c' || echo '$(srcdir)/'`pcre32_xclass.c
-
-libpcre32_la-pcre_chartables.lo: pcre_chartables.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -MT libpcre32_la-pcre_chartables.lo -MD -MP -MF $(DEPDIR)/libpcre32_la-pcre_chartables.Tpo -c -o libpcre32_la-pcre_chartables.lo `test -f 'pcre_chartables.c' || echo '$(srcdir)/'`pcre_chartables.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcre32_la-pcre_chartables.Tpo $(DEPDIR)/libpcre32_la-pcre_chartables.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_chartables.c' object='libpcre32_la-pcre_chartables.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) $(libpcre32_la_CFLAGS) $(CFLAGS) -c -o libpcre32_la-pcre_chartables.lo `test -f 'pcre_chartables.c' || echo '$(srcdir)/'`pcre_chartables.c
-
-libpcreposix_la-pcreposix.lo: pcreposix.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) $(libpcreposix_la_CFLAGS) $(CFLAGS) -MT libpcreposix_la-pcreposix.lo -MD -MP -MF $(DEPDIR)/libpcreposix_la-pcreposix.Tpo -c -o libpcreposix_la-pcreposix.lo `test -f 'pcreposix.c' || echo '$(srcdir)/'`pcreposix.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcreposix_la-pcreposix.Tpo $(DEPDIR)/libpcreposix_la-pcreposix.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcreposix.c' object='libpcreposix_la-pcreposix.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) $(libpcreposix_la_CFLAGS) $(CFLAGS) -c -o libpcreposix_la-pcreposix.lo `test -f 'pcreposix.c' || echo '$(srcdir)/'`pcreposix.c
-
-pcre_jit_test-pcre_jit_test.o: pcre_jit_test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_jit_test_CFLAGS) $(CFLAGS) -MT pcre_jit_test-pcre_jit_test.o -MD -MP -MF $(DEPDIR)/pcre_jit_test-pcre_jit_test.Tpo -c -o pcre_jit_test-pcre_jit_test.o `test -f 'pcre_jit_test.c' || echo '$(srcdir)/'`pcre_jit_test.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcre_jit_test-pcre_jit_test.Tpo $(DEPDIR)/pcre_jit_test-pcre_jit_test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_jit_test.c' object='pcre_jit_test-pcre_jit_test.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_jit_test_CFLAGS) $(CFLAGS) -c -o pcre_jit_test-pcre_jit_test.o `test -f 'pcre_jit_test.c' || echo '$(srcdir)/'`pcre_jit_test.c
-
-pcre_jit_test-pcre_jit_test.obj: pcre_jit_test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_jit_test_CFLAGS) $(CFLAGS) -MT pcre_jit_test-pcre_jit_test.obj -MD -MP -MF $(DEPDIR)/pcre_jit_test-pcre_jit_test.Tpo -c -o pcre_jit_test-pcre_jit_test.obj `if test -f 'pcre_jit_test.c'; then $(CYGPATH_W) 'pcre_jit_test.c'; else $(CYGPATH_W) '$(srcdir)/pcre_jit_test.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcre_jit_test-pcre_jit_test.Tpo $(DEPDIR)/pcre_jit_test-pcre_jit_test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_jit_test.c' object='pcre_jit_test-pcre_jit_test.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_jit_test_CFLAGS) $(CFLAGS) -c -o pcre_jit_test-pcre_jit_test.obj `if test -f 'pcre_jit_test.c'; then $(CYGPATH_W) 'pcre_jit_test.c'; else $(CYGPATH_W) '$(srcdir)/pcre_jit_test.c'; fi`
-
-pcregrep-pcregrep.o: pcregrep.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcregrep_CFLAGS) $(CFLAGS) -MT pcregrep-pcregrep.o -MD -MP -MF $(DEPDIR)/pcregrep-pcregrep.Tpo -c -o pcregrep-pcregrep.o `test -f 'pcregrep.c' || echo '$(srcdir)/'`pcregrep.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcregrep-pcregrep.Tpo $(DEPDIR)/pcregrep-pcregrep.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcregrep.c' object='pcregrep-pcregrep.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcregrep_CFLAGS) $(CFLAGS) -c -o pcregrep-pcregrep.o `test -f 'pcregrep.c' || echo '$(srcdir)/'`pcregrep.c
-
-pcregrep-pcregrep.obj: pcregrep.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcregrep_CFLAGS) $(CFLAGS) -MT pcregrep-pcregrep.obj -MD -MP -MF $(DEPDIR)/pcregrep-pcregrep.Tpo -c -o pcregrep-pcregrep.obj `if test -f 'pcregrep.c'; then $(CYGPATH_W) 'pcregrep.c'; else $(CYGPATH_W) '$(srcdir)/pcregrep.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcregrep-pcregrep.Tpo $(DEPDIR)/pcregrep-pcregrep.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcregrep.c' object='pcregrep-pcregrep.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcregrep_CFLAGS) $(CFLAGS) -c -o pcregrep-pcregrep.obj `if test -f 'pcregrep.c'; then $(CYGPATH_W) 'pcregrep.c'; else $(CYGPATH_W) '$(srcdir)/pcregrep.c'; fi`
-
-pcretest-pcretest.o: pcretest.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -MT pcretest-pcretest.o -MD -MP -MF $(DEPDIR)/pcretest-pcretest.Tpo -c -o pcretest-pcretest.o `test -f 'pcretest.c' || echo '$(srcdir)/'`pcretest.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcretest-pcretest.Tpo $(DEPDIR)/pcretest-pcretest.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcretest.c' object='pcretest-pcretest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -c -o pcretest-pcretest.o `test -f 'pcretest.c' || echo '$(srcdir)/'`pcretest.c
-
-pcretest-pcretest.obj: pcretest.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -MT pcretest-pcretest.obj -MD -MP -MF $(DEPDIR)/pcretest-pcretest.Tpo -c -o pcretest-pcretest.obj `if test -f 'pcretest.c'; then $(CYGPATH_W) 'pcretest.c'; else $(CYGPATH_W) '$(srcdir)/pcretest.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcretest-pcretest.Tpo $(DEPDIR)/pcretest-pcretest.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcretest.c' object='pcretest-pcretest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -c -o pcretest-pcretest.obj `if test -f 'pcretest.c'; then $(CYGPATH_W) 'pcretest.c'; else $(CYGPATH_W) '$(srcdir)/pcretest.c'; fi`
-
-pcretest-pcre_printint.o: pcre_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -MT pcretest-pcre_printint.o -MD -MP -MF $(DEPDIR)/pcretest-pcre_printint.Tpo -c -o pcretest-pcre_printint.o `test -f 'pcre_printint.c' || echo '$(srcdir)/'`pcre_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcretest-pcre_printint.Tpo $(DEPDIR)/pcretest-pcre_printint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_printint.c' object='pcretest-pcre_printint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -c -o pcretest-pcre_printint.o `test -f 'pcre_printint.c' || echo '$(srcdir)/'`pcre_printint.c
-
-pcretest-pcre_printint.obj: pcre_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -MT pcretest-pcre_printint.obj -MD -MP -MF $(DEPDIR)/pcretest-pcre_printint.Tpo -c -o pcretest-pcre_printint.obj `if test -f 'pcre_printint.c'; then $(CYGPATH_W) 'pcre_printint.c'; else $(CYGPATH_W) '$(srcdir)/pcre_printint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcretest-pcre_printint.Tpo $(DEPDIR)/pcretest-pcre_printint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre_printint.c' object='pcretest-pcre_printint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -c -o pcretest-pcre_printint.obj `if test -f 'pcre_printint.c'; then $(CYGPATH_W) 'pcre_printint.c'; else $(CYGPATH_W) '$(srcdir)/pcre_printint.c'; fi`
-
-pcretest-pcre16_printint.o: pcre16_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -MT pcretest-pcre16_printint.o -MD -MP -MF $(DEPDIR)/pcretest-pcre16_printint.Tpo -c -o pcretest-pcre16_printint.o `test -f 'pcre16_printint.c' || echo '$(srcdir)/'`pcre16_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcretest-pcre16_printint.Tpo $(DEPDIR)/pcretest-pcre16_printint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_printint.c' object='pcretest-pcre16_printint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -c -o pcretest-pcre16_printint.o `test -f 'pcre16_printint.c' || echo '$(srcdir)/'`pcre16_printint.c
-
-pcretest-pcre16_printint.obj: pcre16_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -MT pcretest-pcre16_printint.obj -MD -MP -MF $(DEPDIR)/pcretest-pcre16_printint.Tpo -c -o pcretest-pcre16_printint.obj `if test -f 'pcre16_printint.c'; then $(CYGPATH_W) 'pcre16_printint.c'; else $(CYGPATH_W) '$(srcdir)/pcre16_printint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcretest-pcre16_printint.Tpo $(DEPDIR)/pcretest-pcre16_printint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre16_printint.c' object='pcretest-pcre16_printint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -c -o pcretest-pcre16_printint.obj `if test -f 'pcre16_printint.c'; then $(CYGPATH_W) 'pcre16_printint.c'; else $(CYGPATH_W) '$(srcdir)/pcre16_printint.c'; fi`
-
-pcretest-pcre32_printint.o: pcre32_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -MT pcretest-pcre32_printint.o -MD -MP -MF $(DEPDIR)/pcretest-pcre32_printint.Tpo -c -o pcretest-pcre32_printint.o `test -f 'pcre32_printint.c' || echo '$(srcdir)/'`pcre32_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcretest-pcre32_printint.Tpo $(DEPDIR)/pcretest-pcre32_printint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_printint.c' object='pcretest-pcre32_printint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -c -o pcretest-pcre32_printint.o `test -f 'pcre32_printint.c' || echo '$(srcdir)/'`pcre32_printint.c
-
-pcretest-pcre32_printint.obj: pcre32_printint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -MT pcretest-pcre32_printint.obj -MD -MP -MF $(DEPDIR)/pcretest-pcre32_printint.Tpo -c -o pcretest-pcre32_printint.obj `if test -f 'pcre32_printint.c'; then $(CYGPATH_W) 'pcre32_printint.c'; else $(CYGPATH_W) '$(srcdir)/pcre32_printint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcretest-pcre32_printint.Tpo $(DEPDIR)/pcretest-pcre32_printint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcre32_printint.c' object='pcretest-pcre32_printint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcretest_CFLAGS) $(CFLAGS) -c -o pcretest-pcre32_printint.obj `if test -f 'pcre32_printint.c'; then $(CYGPATH_W) 'pcre32_printint.c'; else $(CYGPATH_W) '$(srcdir)/pcre32_printint.c'; fi`
-
-.cc.o:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cc.obj:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cc.lo:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-
-libpcrecpp_la-pcrecpp.lo: pcrecpp.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcrecpp_la_CXXFLAGS) $(CXXFLAGS) -MT libpcrecpp_la-pcrecpp.lo -MD -MP -MF $(DEPDIR)/libpcrecpp_la-pcrecpp.Tpo -c -o libpcrecpp_la-pcrecpp.lo `test -f 'pcrecpp.cc' || echo '$(srcdir)/'`pcrecpp.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcrecpp_la-pcrecpp.Tpo $(DEPDIR)/libpcrecpp_la-pcrecpp.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcrecpp.cc' object='libpcrecpp_la-pcrecpp.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcrecpp_la_CXXFLAGS) $(CXXFLAGS) -c -o libpcrecpp_la-pcrecpp.lo `test -f 'pcrecpp.cc' || echo '$(srcdir)/'`pcrecpp.cc
-
-libpcrecpp_la-pcre_scanner.lo: pcre_scanner.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcrecpp_la_CXXFLAGS) $(CXXFLAGS) -MT libpcrecpp_la-pcre_scanner.lo -MD -MP -MF $(DEPDIR)/libpcrecpp_la-pcre_scanner.Tpo -c -o libpcrecpp_la-pcre_scanner.lo `test -f 'pcre_scanner.cc' || echo '$(srcdir)/'`pcre_scanner.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcrecpp_la-pcre_scanner.Tpo $(DEPDIR)/libpcrecpp_la-pcre_scanner.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcre_scanner.cc' object='libpcrecpp_la-pcre_scanner.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcrecpp_la_CXXFLAGS) $(CXXFLAGS) -c -o libpcrecpp_la-pcre_scanner.lo `test -f 'pcre_scanner.cc' || echo '$(srcdir)/'`pcre_scanner.cc
-
-libpcrecpp_la-pcre_stringpiece.lo: pcre_stringpiece.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcrecpp_la_CXXFLAGS) $(CXXFLAGS) -MT libpcrecpp_la-pcre_stringpiece.lo -MD -MP -MF $(DEPDIR)/libpcrecpp_la-pcre_stringpiece.Tpo -c -o libpcrecpp_la-pcre_stringpiece.lo `test -f 'pcre_stringpiece.cc' || echo '$(srcdir)/'`pcre_stringpiece.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpcrecpp_la-pcre_stringpiece.Tpo $(DEPDIR)/libpcrecpp_la-pcre_stringpiece.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcre_stringpiece.cc' object='libpcrecpp_la-pcre_stringpiece.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcrecpp_la_CXXFLAGS) $(CXXFLAGS) -c -o libpcrecpp_la-pcre_stringpiece.lo `test -f 'pcre_stringpiece.cc' || echo '$(srcdir)/'`pcre_stringpiece.cc
-
-pcre_scanner_unittest-pcre_scanner_unittest.o: pcre_scanner_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_scanner_unittest_CXXFLAGS) $(CXXFLAGS) -MT pcre_scanner_unittest-pcre_scanner_unittest.o -MD -MP -MF $(DEPDIR)/pcre_scanner_unittest-pcre_scanner_unittest.Tpo -c -o pcre_scanner_unittest-pcre_scanner_unittest.o `test -f 'pcre_scanner_unittest.cc' || echo '$(srcdir)/'`pcre_scanner_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcre_scanner_unittest-pcre_scanner_unittest.Tpo $(DEPDIR)/pcre_scanner_unittest-pcre_scanner_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcre_scanner_unittest.cc' object='pcre_scanner_unittest-pcre_scanner_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_scanner_unittest_CXXFLAGS) $(CXXFLAGS) -c -o pcre_scanner_unittest-pcre_scanner_unittest.o `test -f 'pcre_scanner_unittest.cc' || echo '$(srcdir)/'`pcre_scanner_unittest.cc
-
-pcre_scanner_unittest-pcre_scanner_unittest.obj: pcre_scanner_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_scanner_unittest_CXXFLAGS) $(CXXFLAGS) -MT pcre_scanner_unittest-pcre_scanner_unittest.obj -MD -MP -MF $(DEPDIR)/pcre_scanner_unittest-pcre_scanner_unittest.Tpo -c -o pcre_scanner_unittest-pcre_scanner_unittest.obj `if test -f 'pcre_scanner_unittest.cc'; then $(CYGPATH_W) 'pcre_scanner_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/pcre_scanner_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcre_scanner_unittest-pcre_scanner_unittest.Tpo $(DEPDIR)/pcre_scanner_unittest-pcre_scanner_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcre_scanner_unittest.cc' object='pcre_scanner_unittest-pcre_scanner_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_scanner_unittest_CXXFLAGS) $(CXXFLAGS) -c -o pcre_scanner_unittest-pcre_scanner_unittest.obj `if test -f 'pcre_scanner_unittest.cc'; then $(CYGPATH_W) 'pcre_scanner_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/pcre_scanner_unittest.cc'; fi`
-
-pcre_stringpiece_unittest-pcre_stringpiece_unittest.o: pcre_stringpiece_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_stringpiece_unittest_CXXFLAGS) $(CXXFLAGS) -MT pcre_stringpiece_unittest-pcre_stringpiece_unittest.o -MD -MP -MF $(DEPDIR)/pcre_stringpiece_unittest-pcre_stringpiece_unittest.Tpo -c -o pcre_stringpiece_unittest-pcre_stringpiece_unittest.o `test -f 'pcre_stringpiece_unittest.cc' || echo '$(srcdir)/'`pcre_stringpiece_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcre_stringpiece_unittest-pcre_stringpiece_unittest.Tpo $(DEPDIR)/pcre_stringpiece_unittest-pcre_stringpiece_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcre_stringpiece_unittest.cc' object='pcre_stringpiece_unittest-pcre_stringpiece_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_stringpiece_unittest_CXXFLAGS) $(CXXFLAGS) -c -o pcre_stringpiece_unittest-pcre_stringpiece_unittest.o `test -f 'pcre_stringpiece_unittest.cc' || echo '$(srcdir)/'`pcre_stringpiece_unittest.cc
-
-pcre_stringpiece_unittest-pcre_stringpiece_unittest.obj: pcre_stringpiece_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_stringpiece_unittest_CXXFLAGS) $(CXXFLAGS) -MT pcre_stringpiece_unittest-pcre_stringpiece_unittest.obj -MD -MP -MF $(DEPDIR)/pcre_stringpiece_unittest-pcre_stringpiece_unittest.Tpo -c -o pcre_stringpiece_unittest-pcre_stringpiece_unittest.obj `if test -f 'pcre_stringpiece_unittest.cc'; then $(CYGPATH_W) 'pcre_stringpiece_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/pcre_stringpiece_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcre_stringpiece_unittest-pcre_stringpiece_unittest.Tpo $(DEPDIR)/pcre_stringpiece_unittest-pcre_stringpiece_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcre_stringpiece_unittest.cc' object='pcre_stringpiece_unittest-pcre_stringpiece_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcre_stringpiece_unittest_CXXFLAGS) $(CXXFLAGS) -c -o pcre_stringpiece_unittest-pcre_stringpiece_unittest.obj `if test -f 'pcre_stringpiece_unittest.cc'; then $(CYGPATH_W) 'pcre_stringpiece_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/pcre_stringpiece_unittest.cc'; fi`
-
-pcrecpp_unittest-pcrecpp_unittest.o: pcrecpp_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcrecpp_unittest_CXXFLAGS) $(CXXFLAGS) -MT pcrecpp_unittest-pcrecpp_unittest.o -MD -MP -MF $(DEPDIR)/pcrecpp_unittest-pcrecpp_unittest.Tpo -c -o pcrecpp_unittest-pcrecpp_unittest.o `test -f 'pcrecpp_unittest.cc' || echo '$(srcdir)/'`pcrecpp_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcrecpp_unittest-pcrecpp_unittest.Tpo $(DEPDIR)/pcrecpp_unittest-pcrecpp_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcrecpp_unittest.cc' object='pcrecpp_unittest-pcrecpp_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcrecpp_unittest_CXXFLAGS) $(CXXFLAGS) -c -o pcrecpp_unittest-pcrecpp_unittest.o `test -f 'pcrecpp_unittest.cc' || echo '$(srcdir)/'`pcrecpp_unittest.cc
-
-pcrecpp_unittest-pcrecpp_unittest.obj: pcrecpp_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcrecpp_unittest_CXXFLAGS) $(CXXFLAGS) -MT pcrecpp_unittest-pcrecpp_unittest.obj -MD -MP -MF $(DEPDIR)/pcrecpp_unittest-pcrecpp_unittest.Tpo -c -o pcrecpp_unittest-pcrecpp_unittest.obj `if test -f 'pcrecpp_unittest.cc'; then $(CYGPATH_W) 'pcrecpp_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/pcrecpp_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pcrecpp_unittest-pcrecpp_unittest.Tpo $(DEPDIR)/pcrecpp_unittest-pcrecpp_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pcrecpp_unittest.cc' object='pcrecpp_unittest-pcrecpp_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pcrecpp_unittest_CXXFLAGS) $(CXXFLAGS) -c -o pcrecpp_unittest-pcrecpp_unittest.obj `if test -f 'pcrecpp_unittest.cc'; then $(CYGPATH_W) 'pcrecpp_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/pcrecpp_unittest.cc'; fi`
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool config.lt
-install-man1: $(dist_man_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- @list1=''; \
- list2='$(dist_man_MANS) $(man_MANS)'; \
- test -n "$(man1dir)" \
- && test -n "`echo $$list1$$list2`" \
- || exit 0; \
- echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
- { for i in $$list1; do echo "$$i"; done; \
- if test -n "$$list2"; then \
- for i in $$list2; do echo "$$i"; done \
- | sed -n '/\.1[a-z]*$$/p'; \
- fi; \
- } | while read p; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; echo "$$p"; \
- done | \
- sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
- sed 'N;N;s,\n, ,g' | { \
- list=; while read file base inst; do \
- if test "$$base" = "$$inst"; then list="$$list $$file"; else \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
- fi; \
- done; \
- for i in $$list; do echo "$$i"; done | $(am__base_list) | \
- while read files; do \
- test -z "$$files" || { \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
- done; }
-
-uninstall-man1:
- @$(NORMAL_UNINSTALL)
- @list=''; test -n "$(man1dir)" || exit 0; \
- files=`{ for i in $$list; do echo "$$i"; done; \
- l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.1[a-z]*$$/p'; \
- } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
-install-man3: $(dist_man_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- @list1=''; \
- list2='$(dist_man_MANS) $(man_MANS)'; \
- test -n "$(man3dir)" \
- && test -n "`echo $$list1$$list2`" \
- || exit 0; \
- echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
- { for i in $$list1; do echo "$$i"; done; \
- if test -n "$$list2"; then \
- for i in $$list2; do echo "$$i"; done \
- | sed -n '/\.3[a-z]*$$/p'; \
- fi; \
- } | while read p; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; echo "$$p"; \
- done | \
- sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
- sed 'N;N;s,\n, ,g' | { \
- list=; while read file base inst; do \
- if test "$$base" = "$$inst"; then list="$$list $$file"; else \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
- fi; \
- done; \
- for i in $$list; do echo "$$i"; done | $(am__base_list) | \
- while read files; do \
- test -z "$$files" || { \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
- done; }
-
-uninstall-man3:
- @$(NORMAL_UNINSTALL)
- @list=''; test -n "$(man3dir)" || exit 0; \
- files=`{ for i in $$list; do echo "$$i"; done; \
- l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.3[a-z]*$$/p'; \
- } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
-install-dist_docDATA: $(dist_doc_DATA)
- @$(NORMAL_INSTALL)
- @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
- done
-
-uninstall-dist_docDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
-install-dist_htmlDATA: $(dist_html_DATA)
- @$(NORMAL_INSTALL)
- @list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
- done
-
-uninstall-dist_htmlDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
-install-htmlDATA: $(html_DATA)
- @$(NORMAL_INSTALL)
- @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
- done
-
-uninstall-htmlDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
-install-pkgconfigDATA: $(pkgconfig_DATA)
- @$(NORMAL_INSTALL)
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
- done
-
-uninstall-pkgconfigDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
-install-includeHEADERS: $(include_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
- done
-
-uninstall-includeHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-install-nodist_includeHEADERS: $(nodist_include_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
- done
-
-uninstall-nodist_includeHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscope: cscope.files
- test ! -s cscope.files \
- || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-clean-cscope:
- -rm -f cscope.files
-cscope.files: clean-cscope cscopelist
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
- -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
-# Recover from deleted '.trs' file; this should ensure that
-# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
-# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
-# to avoid problems with "make -n".
-.log.trs:
- rm -f $< $@
- $(MAKE) $(AM_MAKEFLAGS) $<
-
-# Leading 'am--fnord' is there to ensure the list of targets does not
-# expand to empty, as could happen e.g. with make check TESTS=''.
-am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
-am--force-recheck:
- @:
-
-$(TEST_SUITE_LOG): $(TEST_LOGS)
- @$(am__set_TESTS_bases); \
- am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
- redo_bases=`for i in $$bases; do \
- am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
- done`; \
- if test -n "$$redo_bases"; then \
- redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
- redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
- if $(am__make_dryrun); then :; else \
- rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
- fi; \
- fi; \
- if test -n "$$am__remaking_logs"; then \
- echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
- "recursion detected" >&2; \
- else \
- am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
- fi; \
- if $(am__make_dryrun); then :; else \
- st=0; \
- errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
- for i in $$redo_bases; do \
- test -f $$i.trs && test -r $$i.trs \
- || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
- test -f $$i.log && test -r $$i.log \
- || { echo "$$errmsg $$i.log" >&2; st=1; }; \
- done; \
- test $$st -eq 0 || exit 1; \
- fi
- @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
- ws='[ ]'; \
- results=`for b in $$bases; do echo $$b.trs; done`; \
- test -n "$$results" || results=/dev/null; \
- all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
- pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
- fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
- skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
- xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
- xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
- error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
- if test `expr $$fail + $$xpass + $$error` -eq 0; then \
- success=true; \
- else \
- success=false; \
- fi; \
- br='==================='; br=$$br$$br$$br$$br; \
- result_count () \
- { \
- if test x"$$1" = x"--maybe-color"; then \
- maybe_colorize=yes; \
- elif test x"$$1" = x"--no-color"; then \
- maybe_colorize=no; \
- else \
- echo "$@: invalid 'result_count' usage" >&2; exit 4; \
- fi; \
- shift; \
- desc=$$1 count=$$2; \
- if test $$maybe_colorize = yes && test $$count -gt 0; then \
- color_start=$$3 color_end=$$std; \
- else \
- color_start= color_end=; \
- fi; \
- echo "$${color_start}# $$desc $$count$${color_end}"; \
- }; \
- create_testsuite_report () \
- { \
- result_count $$1 "TOTAL:" $$all "$$brg"; \
- result_count $$1 "PASS: " $$pass "$$grn"; \
- result_count $$1 "SKIP: " $$skip "$$blu"; \
- result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
- result_count $$1 "FAIL: " $$fail "$$red"; \
- result_count $$1 "XPASS:" $$xpass "$$red"; \
- result_count $$1 "ERROR:" $$error "$$mgn"; \
- }; \
- { \
- echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
- $(am__rst_title); \
- create_testsuite_report --no-color; \
- echo; \
- echo ".. contents:: :depth: 2"; \
- echo; \
- for b in $$bases; do echo $$b; done \
- | $(am__create_global_log); \
- } >$(TEST_SUITE_LOG).tmp || exit 1; \
- mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
- if $$success; then \
- col="$$grn"; \
- else \
- col="$$red"; \
- test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
- fi; \
- echo "$${col}$$br$${std}"; \
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
- echo "$${col}$$br$${std}"; \
- create_testsuite_report --maybe-color; \
- echo "$$col$$br$$std"; \
- if $$success; then :; else \
- echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
- if test -n "$(PACKAGE_BUGREPORT)"; then \
- echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
- fi; \
- echo "$$col$$br$$std"; \
- fi; \
- $$success || exit 1
-
-check-TESTS:
- @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)
- @set +e; $(am__set_TESTS_bases); \
- log_list=`for i in $$bases; do echo $$i.log; done`; \
- trs_list=`for i in $$bases; do echo $$i.trs; done`; \
- log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
- $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
- exit $$?;
-recheck: all $(check_SCRIPTS)
- @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
- @set +e; $(am__set_TESTS_bases); \
- bases=`for i in $$bases; do echo $$i; done \
- | $(am__list_recheck_tests)` || exit 1; \
- log_list=`for i in $$bases; do echo $$i.log; done`; \
- log_list=`echo $$log_list`; \
- $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
- am__force_recheck=am--force-recheck \
- TEST_LOGS="$$log_list"; \
- exit $$?
-pcre_jit_test.log: pcre_jit_test$(EXEEXT)
- @p='pcre_jit_test$(EXEEXT)'; \
- b='pcre_jit_test'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-pcrecpp_unittest.log: pcrecpp_unittest$(EXEEXT)
- @p='pcrecpp_unittest$(EXEEXT)'; \
- b='pcrecpp_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-pcre_scanner_unittest.log: pcre_scanner_unittest$(EXEEXT)
- @p='pcre_scanner_unittest$(EXEEXT)'; \
- b='pcre_scanner_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-pcre_stringpiece_unittest.log: pcre_stringpiece_unittest$(EXEEXT)
- @p='pcre_stringpiece_unittest$(EXEEXT)'; \
- b='pcre_stringpiece_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-RunTest.log: RunTest
- @p='RunTest'; \
- b='RunTest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-RunGrepTest.log: RunGrepTest
- @p='RunGrepTest'; \
- b='RunGrepTest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-.test.log:
- @p='$<'; \
- $(am__set_b); \
- $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-@am__EXEEXT_TRUE@.test$(EXEEXT).log:
-@am__EXEEXT_TRUE@ @p='$<'; \
-@am__EXEEXT_TRUE@ $(am__set_b); \
-@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
-@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
-@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)
- $(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- -test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r "$(distdir)"
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__post_remove_distdir)
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__post_remove_distdir)
-
-dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__post_remove_distdir)
-
-dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
- $(am__post_remove_distdir)
-
-dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
- @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__post_remove_distdir)
-
-dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
- @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__post_remove_distdir)
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__post_remove_distdir)
-
-dist dist-all:
- $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
- $(am__post_remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lz*) \
- lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
- *.tar.xz*) \
- xz -dc $(distdir).tar.xz | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir)
- chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
- chmod a-w $(distdir)
- test -d $(distdir)/_build || exit 0; \
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
- $(AM_DISTCHECK_CONFIGURE_FLAGS) \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
- && cd "$$am__cwd" \
- || exit 1
- $(am__post_remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
- @test -n '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: trying to run $@ with an empty' \
- '$$(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- $(am__cd) '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS)
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \
- $(HEADERS) config.h
-install-binPROGRAMS: install-libLTLIBRARIES
-
-installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
- -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
- -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
- -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-@WITH_GCOV_FALSE@clean-local:
-@WITH_GCOV_FALSE@distclean-local:
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
- clean-libtool clean-local clean-noinstPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-hdr distclean-libtool distclean-local distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-dist_docDATA install-dist_htmlDATA \
- install-htmlDATA install-includeHEADERS install-man \
- install-nodist_includeHEADERS install-pkgconfigDATA
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS install-binSCRIPTS \
- install-libLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man1 install-man3
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
- uninstall-dist_docDATA uninstall-dist_htmlDATA \
- uninstall-htmlDATA uninstall-includeHEADERS \
- uninstall-libLTLIBRARIES uninstall-man \
- uninstall-nodist_includeHEADERS uninstall-pkgconfigDATA
-
-uninstall-man: uninstall-man1 uninstall-man3
-
-.MAKE: all check check-am install install-am install-data-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 \
- 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 distcheck distclean distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-local distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-binPROGRAMS install-binSCRIPTS \
- install-data install-data-am install-data-hook \
- install-dist_docDATA install-dist_htmlDATA install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-htmlDATA install-includeHEADERS \
- install-info install-info-am install-libLTLIBRARIES \
- install-man install-man1 install-man3 \
- install-nodist_includeHEADERS install-pdf install-pdf-am \
- install-pkgconfigDATA install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- recheck tags tags-am uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-binSCRIPTS \
- uninstall-dist_docDATA uninstall-dist_htmlDATA \
- uninstall-htmlDATA uninstall-includeHEADERS \
- uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \
- uninstall-man3 uninstall-nodist_includeHEADERS \
- uninstall-pkgconfigDATA
-
-
-# The only difference between pcre.h.in and pcre.h is the setting of the PCRE
-# version number. Therefore, we can create the generic version just by copying.
-pcre.h.generic: pcre.h.in configure.ac
- rm -f $@
- cp -p pcre.h $@
-
-# It is more complicated for config.h.generic. We need the version that results
-# from a default configuration so as to get all the default values for PCRE
-# configuration macros such as MATCH_LIMIT and NEWLINE. We can get this by
-# doing a configure in a temporary directory. However, some trickery is needed,
-# because the source directory may already be configured. If you just try
-# running configure in a new directory, it complains. For this reason, we move
-# config.status out of the way while doing the default configuration. The
-# resulting config.h is munged by perl to put #ifdefs round any #defines for
-# macros with values, and to #undef all boolean macros such as HAVE_xxx and
-# SUPPORT_xxx. We also get rid of any gcc-specific visibility settings. Make
-# sure that PCRE_EXP_DEFN is unset (in case it has visibility settings).
-config.h.generic: configure.ac
- rm -rf $@ _generic
- mkdir _generic
- cs=$(srcdir)/config.status; test ! -f $$cs || mv -f $$cs $$cs.aside
- cd _generic && $(abs_top_srcdir)/configure || :
- cs=$(srcdir)/config.status; test ! -f $$cs.aside || mv -f $$cs.aside $$cs
- test -f _generic/config.h
- perl -n \
- -e 'BEGIN{$$blank=0;}' \
- -e 'if(/PCRE_EXP_DEFN/){print"/* #undef PCRE_EXP_DEFN */\n";$$blank=0;next;}' \
- -e 'if(/to make a symbol visible/){next;}' \
- -e 'if(/__attribute__ \(\(visibility/){next;}' \
- -e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \
- -e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \
- -e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \
- -e 'if(/^\s*$$/){print unless $$blank; $$blank=1;} else{print;$$blank=0;}' \
- _generic/config.h >$@
- rm -rf _generic
-
-@WITH_REBUILD_CHARTABLES_TRUE@pcre_chartables.c: dftables$(EXEEXT)
-@WITH_REBUILD_CHARTABLES_TRUE@ ./dftables$(EXEEXT) $@
-
-@WITH_REBUILD_CHARTABLES_FALSE@pcre_chartables.c: $(srcdir)/pcre_chartables.c.dist
-@WITH_REBUILD_CHARTABLES_FALSE@ rm -f $@
-@WITH_REBUILD_CHARTABLES_FALSE@ $(LN_S) $(srcdir)/pcre_chartables.c.dist $@
-
-# A compatibility line, the old build system worked with 'make test'
-test: check ;
-
-# A PCRE user submitted the following addition, saying that it "will allow
-# anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
-# nice DLL for Windows use".
-pcre.dll: $(DLL_OBJS)
- $(CC) -shared -o pcre.dll -Wl,"--strip-all" -Wl,"--export-all-symbols" $(DLL_OBJS)
-
-# Arrange for the per-function man pages to have 16- and 32-bit names as well.
-install-data-hook:
- ln -sf pcre_assign_jit_stack.3 $(DESTDIR)$(man3dir)/pcre16_assign_jit_stack.3
- ln -sf pcre_compile.3 $(DESTDIR)$(man3dir)/pcre16_compile.3
- ln -sf pcre_compile2.3 $(DESTDIR)$(man3dir)/pcre16_compile2.3
- ln -sf pcre_config.3 $(DESTDIR)$(man3dir)/pcre16_config.3
- ln -sf pcre_copy_named_substring.3 $(DESTDIR)$(man3dir)/pcre16_copy_named_substring.3
- ln -sf pcre_copy_substring.3 $(DESTDIR)$(man3dir)/pcre16_copy_substring.3
- ln -sf pcre_dfa_exec.3 $(DESTDIR)$(man3dir)/pcre16_dfa_exec.3
- ln -sf pcre_exec.3 $(DESTDIR)$(man3dir)/pcre16_exec.3
- ln -sf pcre_free_study.3 $(DESTDIR)$(man3dir)/pcre16_free_study.3
- ln -sf pcre_free_substring.3 $(DESTDIR)$(man3dir)/pcre16_free_substring.3
- ln -sf pcre_free_substring_list.3 $(DESTDIR)$(man3dir)/pcre16_free_substring_list.3
- ln -sf pcre_fullinfo.3 $(DESTDIR)$(man3dir)/pcre16_fullinfo.3
- ln -sf pcre_get_named_substring.3 $(DESTDIR)$(man3dir)/pcre16_get_named_substring.3
- ln -sf pcre_get_stringnumber.3 $(DESTDIR)$(man3dir)/pcre16_get_stringnumber.3
- ln -sf pcre_get_stringtable_entries.3 $(DESTDIR)$(man3dir)/pcre16_get_stringtable_entries.3
- ln -sf pcre_get_substring.3 $(DESTDIR)$(man3dir)/pcre16_get_substring.3
- ln -sf pcre_get_substring_list.3 $(DESTDIR)$(man3dir)/pcre16_get_substring_list.3
- ln -sf pcre_jit_exec.3 $(DESTDIR)$(man3dir)/pcre16_jit_exec.3
- ln -sf pcre_jit_stack_alloc.3 $(DESTDIR)$(man3dir)/pcre16_jit_stack_alloc.3
- ln -sf pcre_jit_stack_free.3 $(DESTDIR)$(man3dir)/pcre16_jit_stack_free.3
- ln -sf pcre_maketables.3 $(DESTDIR)$(man3dir)/pcre16_maketables.3
- ln -sf pcre_pattern_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre16_pattern_to_host_byte_order.3
- ln -sf pcre_refcount.3 $(DESTDIR)$(man3dir)/pcre16_refcount.3
- ln -sf pcre_study.3 $(DESTDIR)$(man3dir)/pcre16_study.3
- ln -sf pcre_utf16_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre16_utf16_to_host_byte_order.3
- ln -sf pcre_version.3 $(DESTDIR)$(man3dir)/pcre16_version.3
- ln -sf pcre_assign_jit_stack.3 $(DESTDIR)$(man3dir)/pcre32_assign_jit_stack.3
- ln -sf pcre_compile.3 $(DESTDIR)$(man3dir)/pcre32_compile.3
- ln -sf pcre_compile2.3 $(DESTDIR)$(man3dir)/pcre32_compile2.3
- ln -sf pcre_config.3 $(DESTDIR)$(man3dir)/pcre32_config.3
- ln -sf pcre_copy_named_substring.3 $(DESTDIR)$(man3dir)/pcre32_copy_named_substring.3
- ln -sf pcre_copy_substring.3 $(DESTDIR)$(man3dir)/pcre32_copy_substring.3
- ln -sf pcre_dfa_exec.3 $(DESTDIR)$(man3dir)/pcre32_dfa_exec.3
- ln -sf pcre_exec.3 $(DESTDIR)$(man3dir)/pcre32_exec.3
- ln -sf pcre_free_study.3 $(DESTDIR)$(man3dir)/pcre32_free_study.3
- ln -sf pcre_free_substring.3 $(DESTDIR)$(man3dir)/pcre32_free_substring.3
- ln -sf pcre_free_substring_list.3 $(DESTDIR)$(man3dir)/pcre32_free_substring_list.3
- ln -sf pcre_fullinfo.3 $(DESTDIR)$(man3dir)/pcre32_fullinfo.3
- ln -sf pcre_get_named_substring.3 $(DESTDIR)$(man3dir)/pcre32_get_named_substring.3
- ln -sf pcre_get_stringnumber.3 $(DESTDIR)$(man3dir)/pcre32_get_stringnumber.3
- ln -sf pcre_get_stringtable_entries.3 $(DESTDIR)$(man3dir)/pcre32_get_stringtable_entries.3
- ln -sf pcre_get_substring.3 $(DESTDIR)$(man3dir)/pcre32_get_substring.3
- ln -sf pcre_get_substring_list.3 $(DESTDIR)$(man3dir)/pcre32_get_substring_list.3
- ln -sf pcre_jit_exec.3 $(DESTDIR)$(man3dir)/pcre32_jit_exec.3
- ln -sf pcre_jit_stack_alloc.3 $(DESTDIR)$(man3dir)/pcre32_jit_stack_alloc.3
- ln -sf pcre_jit_stack_free.3 $(DESTDIR)$(man3dir)/pcre32_jit_stack_free.3
- ln -sf pcre_maketables.3 $(DESTDIR)$(man3dir)/pcre32_maketables.3
- ln -sf pcre_pattern_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre32_pattern_to_host_byte_order.3
- ln -sf pcre_refcount.3 $(DESTDIR)$(man3dir)/pcre32_refcount.3
- ln -sf pcre_study.3 $(DESTDIR)$(man3dir)/pcre32_study.3
- ln -sf pcre_utf32_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre32_utf32_to_host_byte_order.3
- ln -sf pcre_version.3 $(DESTDIR)$(man3dir)/pcre32_version.3
-
-@WITH_GCOV_TRUE@coverage-check: all
-@WITH_GCOV_TRUE@ -$(MAKE) $(AM_MAKEFLAGS) -k check
-
-@WITH_GCOV_TRUE@coverage-baseline:
-@WITH_GCOV_TRUE@ $(LCOV) $(coverage_quiet) \
-@WITH_GCOV_TRUE@ --directory $(top_builddir) \
-@WITH_GCOV_TRUE@ --output-file "$(COVERAGE_OUTPUT_FILE)" \
-@WITH_GCOV_TRUE@ --capture \
-@WITH_GCOV_TRUE@ --initial
-
-@WITH_GCOV_TRUE@coverage-report:
-@WITH_GCOV_TRUE@ $(LCOV) $(coverage_quiet) \
-@WITH_GCOV_TRUE@ --directory $(top_builddir) \
-@WITH_GCOV_TRUE@ --capture \
-@WITH_GCOV_TRUE@ --output-file "$(COVERAGE_OUTPUT_FILE).tmp" \
-@WITH_GCOV_TRUE@ --test-name "$(COVERAGE_TEST_NAME)" \
-@WITH_GCOV_TRUE@ --no-checksum \
-@WITH_GCOV_TRUE@ --compat-libtool \
-@WITH_GCOV_TRUE@ $(COVERAGE_LCOV_EXTRA_FLAGS)
-@WITH_GCOV_TRUE@ $(LCOV) $(coverage_quiet) \
-@WITH_GCOV_TRUE@ --directory $(top_builddir) \
-@WITH_GCOV_TRUE@ --output-file "$(COVERAGE_OUTPUT_FILE)" \
-@WITH_GCOV_TRUE@ --remove "$(COVERAGE_OUTPUT_FILE).tmp" \
-@WITH_GCOV_TRUE@ "/tmp/*" \
-@WITH_GCOV_TRUE@ "/usr/include/*" \
-@WITH_GCOV_TRUE@ "$(includedir)/*"
-@WITH_GCOV_TRUE@ -@rm -f "$(COVERAGE_OUTPUT_FILE).tmp"
-@WITH_GCOV_TRUE@ LANG=C $(GENHTML) $(coverage_quiet) \
-@WITH_GCOV_TRUE@ --prefix $(top_builddir) \
-@WITH_GCOV_TRUE@ --output-directory "$(COVERAGE_OUTPUT_DIR)" \
-@WITH_GCOV_TRUE@ --title "$(PACKAGE) $(VERSION) Code Coverage Report" \
-@WITH_GCOV_TRUE@ --show-details "$(COVERAGE_OUTPUT_FILE)" \
-@WITH_GCOV_TRUE@ --legend \
-@WITH_GCOV_TRUE@ $(COVERAGE_GENHTML_EXTRA_FLAGS)
-@WITH_GCOV_TRUE@ @echo "Code coverage report written to file://$(abs_builddir)/$(COVERAGE_OUTPUT_DIR)/index.html"
-
-@WITH_GCOV_TRUE@coverage-reset:
-@WITH_GCOV_TRUE@ -$(LCOV) $(coverage_quiet) --zerocounters --directory $(top_builddir)
-
-@WITH_GCOV_TRUE@coverage-clean-report:
-@WITH_GCOV_TRUE@ -rm -f "$(COVERAGE_OUTPUT_FILE)" "$(COVERAGE_OUTPUT_FILE).tmp"
-@WITH_GCOV_TRUE@ -rm -rf "$(COVERAGE_OUTPUT_DIR)"
-
-@WITH_GCOV_TRUE@coverage-clean-data:
-@WITH_GCOV_TRUE@ -find $(top_builddir) -name "*.gcda" -delete
-
-@WITH_GCOV_TRUE@coverage-clean: coverage-reset coverage-clean-report coverage-clean-data
-@WITH_GCOV_TRUE@ -find $(top_builddir) -name "*.gcno" -delete
-
-@WITH_GCOV_TRUE@coverage-distclean: coverage-clean
-
-@WITH_GCOV_TRUE@coverage: coverage-reset coverage-baseline coverage-check coverage-report
-@WITH_GCOV_TRUE@clean-local: coverage-clean
-@WITH_GCOV_TRUE@distclean-local: coverage-distclean
-
-@WITH_GCOV_TRUE@.PHONY: coverage coverage-baseline coverage-check coverage-report coverage-reset coverage-clean-report coverage-clean-data coverage-clean coverage-distclean
-
-@WITH_GCOV_FALSE@coverage:
-@WITH_GCOV_FALSE@ @echo "Configuring with --enable-coverage required to generate code coverage report."
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/.pc/pcre_info.patch/pcre_info.c b/.pc/pcre_info.patch/pcre_info.c
deleted file mode 100644
index e69de29..0000000
--- a/.pc/pcre_info.patch/pcre_info.c
+++ /dev/null
diff --git a/.pc/pcregrep.1-patch/doc/pcregrep.1 b/.pc/pcregrep.1-patch/doc/pcregrep.1
deleted file mode 100644
index 9886675..0000000
--- a/.pc/pcregrep.1-patch/doc/pcregrep.1
+++ /dev/null
@@ -1,683 +0,0 @@
-.TH PCREGREP 1 "03 April 2014" "PCRE 8.35"
-.SH NAME
-pcregrep - a grep with Perl-compatible regular expressions.
-.SH SYNOPSIS
-.B pcregrep [options] [long options] [pattern] [path1 path2 ...]
-.
-.SH DESCRIPTION
-.rs
-.sp
-\fBpcregrep\fP searches files for character patterns, in the same way as other
-grep commands do, but it uses the PCRE regular expression library to support
-patterns that are compatible with the regular expressions of Perl 5. See
-.\" HREF
-\fBpcresyntax\fP(3)
-.\"
-for a quick-reference summary of pattern syntax, or
-.\" HREF
-\fBpcrepattern\fP(3)
-.\"
-for a full description of the syntax and semantics of the regular expressions
-that PCRE supports.
-.P
-Patterns, whether supplied on the command line or in a separate file, are given
-without delimiters. For example:
-.sp
- pcregrep Thursday /etc/motd
-.sp
-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 metacharacters.
-.P
-The first argument that follows any option settings is treated as the single
-pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present.
-Conversely, when one or both of these options are used to specify patterns, all
-arguments are treated as path names. At least one of \fB-e\fP, \fB-f\fP, or an
-argument pattern must be provided.
-.P
-If no files are specified, \fBpcregrep\fP reads the standard input. The
-standard input can also be referenced by a name consisting of a single hyphen.
-For example:
-.sp
- pcregrep some-pattern /file1 - /file3
-.sp
-By default, each line that matches a pattern is copied to the standard
-output, and if there is more than one file, the file name is output at the
-start of each line, followed by a colon. However, there are options that can
-change how \fBpcregrep\fP behaves. In particular, the \fB-M\fP option makes it
-possible to search for patterns that span line boundaries. What defines a line
-boundary is controlled by the \fB-N\fP (\fB--newline\fP) option.
-.P
-The amount of memory used for buffering files that are being scanned is
-controlled by a parameter that can be set by the \fB--buffer-size\fP option.
-The default value for this parameter is specified when \fBpcregrep\fP is built,
-with the default default being 20K. A block of memory three times this size is
-used (to allow for buffering "before" and "after" lines). An error occurs if a
-line overflows the buffer.
-.P
-Patterns can be no longer than 8K or BUFSIZ bytes, whichever is the greater.
-BUFSIZ is defined in \fB<stdio.h>\fP. When there is more than one pattern
-(specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to
-each line in the order in which they are defined, except that all the \fB-e\fP
-patterns are tried before the \fB-f\fP patterns.
-.P
-By default, as soon as one pattern matches a line, no further patterns are
-considered. However, if \fB--colour\fP (or \fB--color\fP) is used to colour the
-matching substrings, or if \fB--only-matching\fP, \fB--file-offsets\fP, or
-\fB--line-offsets\fP is used to output only the part of the line that matched
-(either 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.
-.P
-This behaviour means that the order in which multiple patterns are specified
-can affect the output when one of the above options is used. This is no longer
-the same behaviour as GNU grep, which now manages to display earlier matches
-for later patterns (as long as there is no overlap).
-.P
-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.
-.P
-If the \fBLC_ALL\fP or \fBLC_CTYPE\fP environment variable is set,
-\fBpcregrep\fP uses the value to set a locale when calling the PCRE library.
-The \fB--locale\fP option can be used to override this.
-.
-.
-.SH "SUPPORT FOR COMPRESSED FILES"
-.rs
-.sp
-It is possible to compile \fBpcregrep\fP so that it uses \fBlibz\fP or
-\fBlibbz2\fP to read files whose names end in \fB.gz\fP or \fB.bz2\fP,
-respectively. You can find out whether your binary has support for one or both
-of these file types by running it with the \fB--help\fP option. If the
-appropriate support is not present, files are treated as plain text. The
-standard input is always so treated.
-.
-.
-.SH "BINARY FILES"
-.rs
-.sp
-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 also
-identifies binary files in this manner.) See the \fB--binary-files\fP option
-for a means of changing the way binary files are handled.
-.
-.
-.SH OPTIONS
-.rs
-.sp
-The order in which some of the options appear can affect the output. For
-example, both the \fB-h\fP and \fB-l\fP 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.
-.TP 10
-\fB--\fP
-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 filenames that start with hyphens.
-.TP
-\fB-A\fP \fInumber\fP, \fB--after-context=\fP\fInumber\fP
-Output \fInumber\fP lines of context after each matching line. If filenames
-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 \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP
-guarantees to have up to 8K of following text available for context output.
-.TP
-\fB-a\fP, \fB--text\fP
-Treat binary files as text. This is equivalent to
-\fB--binary-files\fP=\fItext\fP.
-.TP
-\fB-B\fP \fInumber\fP, \fB--before-context=\fP\fInumber\fP
-Output \fInumber\fP lines of context before each matching line. If filenames
-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 \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP
-guarantees to have up to 8K of preceding text available for context output.
-.TP
-\fB--binary-files=\fP\fIword\fP
-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 \fB-a\fP or \fB--text\fP 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
-\fB-I\fP option, binary files are not processed at all; they are assumed not to
-be of interest.
-.TP
-\fB--buffer-size=\fP\fInumber\fP
-Set the parameter that controls how much memory is used for buffering files
-that are being scanned.
-.TP
-\fB-C\fP \fInumber\fP, \fB--context=\fP\fInumber\fP
-Output \fInumber\fP lines of context both before and after each matching line.
-This is equivalent to setting both \fB-A\fP and \fB-B\fP to the same value.
-.TP
-\fB-c\fP, \fB--count\fP
-Do not output individual lines from the files that are being scanned; instead
-output the number of lines that would otherwise have been shown. If no lines
-are selected, the number zero is output. If several files are are being
-scanned, a count is output for each of them. However, if the
-\fB--files-with-matches\fP option is also used, only those files whose counts
-are greater than zero are listed. When \fB-c\fP is used, the \fB-A\fP,
-\fB-B\fP, and \fB-C\fP options are ignored.
-.TP
-\fB--colour\fP, \fB--color\fP
-If this option is given without any data, it is equivalent to "--colour=auto".
-If data is required, it must be given in the same shell item, separated by an
-equals sign.
-.TP
-\fB--colour=\fP\fIvalue\fP, \fB--color=\fP\fIvalue\fP
-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 output is
-connected to a terminal. More resources are used when colouring is enabled,
-because \fBpcregrep\fP has to search for all possible matches in a line, not
-just one, in order to colour them all.
-.sp
-The colour that is used can be specified by setting the environment variable
-PCREGREP_COLOUR or PCREGREP_COLOR. The value of this variable should be a
-string of two numbers, separated by a semicolon. They are copied directly into
-the control string for setting colour on a terminal, so it is your
-responsibility to ensure that they make sense. If neither of the environment
-variables is set, the default is "1;31", which gives red.
-.TP
-\fB-D\fP \fIaction\fP, \fB--devices=\fP\fIaction\fP
-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).
-.TP
-\fB-d\fP \fIaction\fP, \fB--directories=\fP\fIaction\fP
-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 \fB-r\fP 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 may provoke an error.
-.TP
-\fB-e\fP \fIpattern\fP, \fB--regex=\fP\fIpattern\fP, \fB--regexp=\fP\fIpattern\fP
-Specify a pattern to be matched. This option can be used multiple 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 \fB-e\fP 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.
-.sp
-If \fB-f\fP is used with \fB-e\fP, 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 \fB-e\fP 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
-separately, with X first, \fBpcregrep\fP 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 \fB-o\fP or \fB--colo(u)r\fP to show the part(s)
-of the line that matched.
-.TP
-\fB--exclude\fP=\fIpattern\fP
-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 \fB--file-list\fP, or by scanning a directory. The pattern is a
-PCRE regular expression, and is matched against the final component of the file
-name, not the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options 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 \fB--include\fP
-and an \fB--exclude\fP pattern, it is excluded. There is no short form for this
-option.
-.TP
-\fB--exclude-from=\fP\fIfilename\fP
-Treat each non-empty line of the file as the data for an \fB--exclude\fP
-option. What constitutes a newline when reading the file is the operating
-system's default. The \fB--newline\fP 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.
-.TP
-\fB--exclude-dir\fP=\fIpattern\fP
-Directories whose names match the pattern are skipped without being processed,
-whatever the setting of the \fB--recursive\fP option. This applies to all
-directories, whether listed on the command line, obtained from
-\fB--file-list\fP, or by scanning a parent directory. The pattern is a PCRE
-regular expression, and is matched against the final component of the directory
-name, not the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP 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 directory matches both \fB--include-dir\fP
-and \fB--exclude-dir\fP, it is excluded. There is no short form for this
-option.
-.TP
-\fB-F\fP, \fB--fixed-strings\fP
-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 \fB--newline\fP option. The \fB-w\fP (match
-as a word) and \fB-x\fP (match whole line) options can be used with \fB-F\fP.
-They apply to each of the fixed strings. A line is selected if any of the fixed
-strings are found in it (subject to \fB-w\fP or \fB-x\fP, 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 \fB--include\fP or
-\fB--exclude\fP options.
-.TP
-\fB-f\fP \fIfilename\fP, \fB--file=\fP\fIfilename\fP
-Read patterns from the file, one per line, and match them against
-each line of input. What constitutes a newline when reading the file is the
-operating system's default. The \fB--newline\fP 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. See
-also the comments about multiple patterns versus a single pattern with
-alternatives in the description of \fB-e\fP above.
-.sp
-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 filename can
-be given as "-" to refer to the standard input. When \fB-f\fP is used, patterns
-specified on the command line using \fB-e\fP 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.
-.TP
-\fB--file-list\fP=\fIfilename\fP
-Read a list of files and/or directories that are to be scanned from the given
-file, one per line. 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 filename can be given as "-" to refer to the standard input.
-If \fB--file\fP and \fB--file-list\fP are both specified as "-", patterns are
-read first. This is useful only when the standard input is a terminal, 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.
-.TP
-\fB--file-offsets\fP
-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 \fB-A\fP, \fB-B\fP, and \fB-C\fP
-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 \fB--line-offsets\fP
-and \fB--only-matching\fP.
-.TP
-\fB-H\fP, \fB--with-filename\fP
-Force the inclusion of the filename at the start of output lines when searching
-a single file. By default, the filename is not shown in this case. For matching
-lines, the filename 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.
-.TP
-\fB-h\fP, \fB--no-filename\fP
-Suppress the output filenames when searching multiple files. By default,
-filenames are shown when multiple files are searched. For matching lines, the
-filename 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.
-.TP
-\fB--help\fP
-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.
-.TP
-\fB-I\fP
-Treat binary files as never matching. This is equivalent to
-\fB--binary-files\fP=\fIwithout-match\fP.
-.TP
-\fB-i\fP, \fB--ignore-case\fP
-Ignore upper/lower case distinctions during comparisons.
-.TP
-\fB--include\fP=\fIpattern\fP
-If any \fB--include\fP patterns are specified, the only files that are
-processed are those that match one of the patterns (and do not match an
-\fB--exclude\fP pattern). This option does not affect directories, but it
-applies to all files, whether listed on the command line, obtained from
-\fB--file-list\fP, or by scanning a directory. The pattern is a PCRE regular
-expression, and is matched against the final component of the file name, not
-the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do not apply to
-this pattern. The option may be given any number of times. If a file name
-matches both an \fB--include\fP and an \fB--exclude\fP pattern, it is excluded.
-There is no short form for this option.
-.TP
-\fB--include-from=\fP\fIfilename\fP
-Treat each non-empty line of the file as the data for an \fB--include\fP
-option. What constitutes a newline for this purpose is the operating system's
-default. The \fB--newline\fP option has no effect on this option. This option
-may be given any number of times; all the files are read.
-.TP
-\fB--include-dir\fP=\fIpattern\fP
-If any \fB--include-dir\fP patterns are specified, the only directories that
-are processed are those that match one of the patterns (and do not match an
-\fB--exclude-dir\fP pattern). This applies to all directories, whether listed
-on the command line, obtained from \fB--file-list\fP, or by scanning a parent
-directory. The pattern is a PCRE regular expression, and is matched against the
-final component of the directory name, not the entire path. The \fB-F\fP,
-\fB-w\fP, and \fB-x\fP options do not apply to this pattern. The option may be
-given any number of times. If a directory matches both \fB--include-dir\fP and
-\fB--exclude-dir\fP, it is excluded. There is no short form for this option.
-.TP
-\fB-L\fP, \fB--files-without-match\fP
-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 separate line.
-.TP
-\fB-l\fP, \fB--files-with-matches\fP
-Instead of outputting lines from the files, just output the names of the files
-containing lines that would have been output. 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 \fB-c\fP (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 \fB-c\fP is a way of suppressing the listing of files with no matches.
-.TP
-\fB--label\fP=\fIname\fP
-This option supplies a name to be used for the standard input when file names
-are being output. If not supplied, "(standard input)" is used. There is no
-short form for this option.
-.TP
-\fB--line-buffered\fP
-When this option is given, 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 \fBpcregrep\fP can determine that it is reading from a terminal (which
-is currently possible only in Unix-like environments). 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
-\fBpcregrep\fP to buffer up large amounts of data. However, its use will affect
-performance, and the \fB-M\fP (multiline) option ceases to work.
-.TP
-\fB--line-offsets\fP
-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 \fB-n\fP option), and the
-offset and length are separated by a comma. In this mode, no context is shown.
-That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP 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 \fB--file-offsets\fP and \fB--only-matching\fP.
-.TP
-\fB--locale\fP=\fIlocale-name\fP
-This option specifies a locale to be used for pattern matching. It overrides
-the value in the \fBLC_ALL\fP or \fBLC_CTYPE\fP environment variables. If no
-locale is specified, the PCRE library's default (usually the "C" locale) is
-used. There is no short form for this option.
-.TP
-\fB--match-limit\fP=\fInumber\fP
-Processing some regular expression patterns can require a very large amount of
-memory, leading in some cases to a program crash if not enough is available.
-Other patterns may take a very long time to search for all possible matching
-strings. The \fBpcre_exec()\fP function that is called by \fBpcregrep\fP to do
-the matching has two parameters that can limit the resources that it uses.
-.sp
-The \fB--match-limit\fP option provides a means of limiting resource usage
-when processing patterns that are not going to match, but which have a very
-large number of possibilities in their search trees. The classic example is a
-pattern that uses nested unlimited repeats. Internally, PCRE uses a function
-called \fBmatch()\fP which it calls repeatedly (sometimes recursively). The
-limit set by \fB--match-limit\fP is imposed on the number of times this
-function is called during a match, which has the effect of limiting the amount
-of backtracking that can take place.
-.sp
-The \fB--recursion-limit\fP option is similar to \fB--match-limit\fP, but
-instead of limiting the total number of times that \fBmatch()\fP is called, it
-limits the depth of recursive calls, which in turn limits the amount of memory
-that can be used. The recursion depth is a smaller number than the total number
-of calls, because not all calls to \fBmatch()\fP are recursive. This limit is
-of use only if it is set smaller than \fB--match-limit\fP.
-.sp
-There are no short forms for these options. The default settings are specified
-when the PCRE library is compiled, with the default default being 10 million.
-.TP
-\fB-M\fP, \fB--multiline\fP
-Allow patterns to match more than one line. When this option is given, patterns
-may usefully contain literal newline characters and internal occurrences of ^
-and $ characters. The output for a successful match may consist of more than
-one line, the last of which is the one in which the match ended. If the matched
-string ends with a newline sequence the output ends at the end of that line.
-.sp
-When this option is set, the PCRE library is called in "multiline" mode.
-There is a limit to the number of lines that can be matched, imposed by the way
-that \fBpcregrep\fP buffers the input file as it scans it. However,
-\fBpcregrep\fP ensures that at least 8K characters or the rest of the document
-(whichever is the shorter) are available for forward matching, and similarly
-the previous 8K characters (or all the previous characters, if fewer than 8K)
-are guaranteed to be available for lookbehind assertions. This option does not
-work when input is read line by line (see \fP--line-buffered\fP.)
-.TP
-\fB-N\fP \fInewline-type\fP, \fB--newline\fP=\fInewline-type\fP
-The PCRE 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 recognizes any of the preceding three types, and an "any" convention, in
-which any Unicode line ending sequence is assumed to end a line. The Unicode
-sequences are the three just mentioned, 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).
-.sp
-When the PCRE 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, \fBpcregrep\fP uses the library's default.
-The possible values for this option are CR, LF, CRLF, ANYCRLF, or ANY. This
-makes it possible to use \fBpcregrep\fP 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,
-\fBpcregrep\fP may behave in strange ways. Note that this option does not
-apply to files specified by the \fB-f\fP, \fB--exclude-from\fP, or
-\fB--include-from\fP options, which are expected to use the operating system's
-standard newline sequence.
-.TP
-\fB-n\fP, \fB--line-number\fP
-Precede each output line by its line number in the file, followed by a colon
-for matching lines or a hyphen for context lines. If the filename is also being
-output, it precedes the line number. This option is forced if
-\fB--line-offsets\fP is used.
-.TP
-\fB--no-jit\fP
-If the PCRE library is built with support for just-in-time compiling (which
-speeds up matching), \fBpcregrep\fP 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 problems.
-It should never be needed in normal use.
-.TP
-\fB-o\fP, \fB--only-matching\fP
-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 \fB-A\fP, \fB-B\fP, and
-\fB-C\fP options are ignored. If there is more than one match in a line, each
-of them is shown separately. If \fB-o\fP is combined with \fB-v\fP (invert the
-sense of the match to find non-matching lines), no output is generated, but the
-return code is set appropriately. 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 \fB--file-offsets\fP and \fB--line-offsets\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 case. 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 printed.
-.sp
-If this option is given multiple times, multiple substrings are output, in the
-order the options are given. 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).
-.TP
-\fB--om-separator\fP=\fItext\fP
-Specify a separating string for multiple occurrences of \fB-o\fP. The default
-is an empty string. Separating strings are never coloured.
-.TP
-\fB-q\fP, \fB--quiet\fP
-Work quietly, that is, display nothing except error messages. The exit
-status indicates whether or not any matches were found.
-.TP
-\fB-r\fP, \fB--recursive\fP
-If any given path is a directory, recursively scan the files it contains,
-taking note of any \fB--include\fP and \fB--exclude\fP settings. 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 \fB-d\fP
-option to "recurse".
-.TP
-\fB--recursion-limit\fP=\fInumber\fP
-See \fB--match-limit\fP above.
-.TP
-\fB-s\fP, \fB--no-messages\fP
-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.
-.TP
-\fB-u\fP, \fB--utf-8\fP
-Operate in UTF-8 mode. This option is available only if PCRE 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-V\fP, \fB--version\fP
-Write the version numbers of \fBpcregrep\fP and the PCRE library to the
-standard output and then exit. Anything else on the command line is
-ignored.
-.TP
-\fB-v\fP, \fB--invert-match\fP
-Invert the sense of the match, so that lines which do \fInot\fP match any of
-the patterns are the ones that are found.
-.TP
-\fB-w\fP, \fB--word-regex\fP, \fB--word-regexp\fP
-Force the patterns to match only whole words. This is equivalent to having \eb
-at the start and end of the pattern. 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 \fB--include\fP or \fB--exclude\fP options.
-.TP
-\fB-x\fP, \fB--line-regex\fP, \fB--line-regexp\fP
-Force the patterns to be anchored (each must start matching at the beginning of
-a line) and in addition, require them to match entire lines. This is equivalent
-to having ^ and $ characters at the start and end of each alternative branch in
-every pattern. 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 \fB--include\fP or \fB--exclude\fP options.
-.
-.
-.SH "ENVIRONMENT VARIABLES"
-.rs
-.sp
-The environment variables \fBLC_ALL\fP and \fBLC_CTYPE\fP are examined, in that
-order, for a locale. The first one that is set is used. This can be overridden
-by the \fB--locale\fP option. If no locale is set, the PCRE library's default
-(usually the "C" locale) is used.
-.
-.
-.SH "NEWLINES"
-.rs
-.sp
-The \fB-N\fP (\fB--newline\fP) option allows \fBpcregrep\fP to scan files with
-different newline conventions from the default. Any parts of the input files
-that are written to the standard output are copied identically, with whatever
-newline sequences they have in the input. However, the setting of this option
-does not affect the interpretation of files specified by the \fB-f\fP,
-\fB--exclude-from\fP, or \fB--include-from\fP options, which are assumed to use
-the operating system's standard newline sequence, nor does it affect the way in
-which \fBpcregrep\fP writes informational messages to the standard error and
-output streams. For these it uses the string "\en" to indicate newlines,
-relying on the C I/O library to convert this to an appropriate sequence.
-.
-.
-.SH "OPTIONS COMPATIBILITY"
-.rs
-.sp
-Many of the short and long forms of \fBpcregrep\fP's options are the same
-as in the GNU \fBgrep\fP program. Any long option of the form
-\fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP
-(PCRE terminology). However, the \fB--file-list\fP, \fB--file-offsets\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--recursion-limit\fP, \fB-u\fP, and \fB--utf-8\fP options are specific to
-\fBpcregrep\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
-\fBpcregrep\fP. For example, the \fB--include\fP option's argument is a glob
-for GNU \fBgrep\fP, but a regular expression for \fBpcregrep\fP. If both the
-\fB-c\fP and \fB-l\fP options are given, GNU grep lists only file names,
-without counts, but \fBpcregrep\fP gives the counts.
-.
-.
-.SH "OPTIONS WITH DATA"
-.rs
-.sp
-There are four different ways in which an option with data can be specified.
-If a short form option is used, the data may follow immediately, or (with one
-exception) in the next command line item. For example:
-.sp
- -f/some/file
- -f /some/file
-.sp
-The exception is the \fB-o\fP option, which may appear with or without data.
-Because of this, if data is present, it must follow immediately in the same
-item, for example -o3.
-.P
-If a long form option is used, the data may appear in the same command line
-item, separated by an equals character, or (with two exceptions) it may appear
-in the next command line item. For example:
-.sp
- --file=/some/file
- --file /some/file
-.sp
-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 shell does not treat ~
-specially unless it is at the start of an item.
-.P
-The exceptions to the above are the \fB--colour\fP (or \fB--color\fP) and
-\fB--only-matching\fP 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 equals
-character. Otherwise \fBpcregrep\fP will assume that it has no data.
-.
-.
-.SH "MATCHING ERRORS"
-.rs
-.sp
-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+)*\ed when matched against a line of a's with no final
-digit. The PCRE matching function has a resource limit that causes it to abort
-in these circumstances. If this happens, \fBpcregrep\fP outputs an error
-message and the line that caused the problem to the standard error stream. If
-there are more than 20 such errors, \fBpcregrep\fP gives up.
-.P
-The \fB--match-limit\fP option of \fBpcregrep\fP can be used to set the overall
-resource limit; there is a second option called \fB--recursion-limit\fP that
-sets a limit on the amount of memory (usually stack) that is used (see the
-discussion of these options above).
-.
-.
-.SH DIAGNOSTICS
-.rs
-.sp
-Exit status is 0 if any matches were found, 1 if no matches were found, and 2
-for syntax errors, overlong lines, non-existent or inaccessible files (even if
-matches were found in other files) or too many matching errors. Using the
-\fB-s\fP option to suppress error messages about inaccessible files does not
-affect the return code.
-.
-.
-.SH "SEE ALSO"
-.rs
-.sp
-\fBpcrepattern\fP(3), \fBpcresyntax\fP(3), \fBpcretest\fP(1).
-.
-.
-.SH AUTHOR
-.rs
-.sp
-.nf
-Philip Hazel
-University Computing Service
-Cambridge CB2 3QH, England.
-.fi
-.
-.
-.SH REVISION
-.rs
-.sp
-.nf
-Last updated: 03 April 2014
-Copyright (c) 1997-2014 University of Cambridge.
-.fi
diff --git a/.pc/pcreposix.patch/pcreposix.h b/.pc/pcreposix.patch/pcreposix.h
deleted file mode 100644
index c77c0b0..0000000
--- a/.pc/pcreposix.patch/pcreposix.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*************************************************
-* Perl-Compatible Regular Expressions *
-*************************************************/
-
-#ifndef _PCREPOSIX_H
-#define _PCREPOSIX_H
-
-/* This is the header for the POSIX wrapper interface to the PCRE Perl-
-Compatible Regular Expression library. It defines the things POSIX says should
-be there. I hope.
-
- Copyright (c) 1997-2012 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.
------------------------------------------------------------------------------
-*/
-
-/* Have to include stdlib.h in order to ensure that size_t is defined. */
-
-#include <stdlib.h>
-
-/* Allow for C++ users */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Options, mostly defined by POSIX, but with some extras. */
-
-#define REG_ICASE 0x0001 /* Maps to PCRE_CASELESS */
-#define REG_NEWLINE 0x0002 /* Maps to PCRE_MULTILINE */
-#define REG_NOTBOL 0x0004 /* Maps to PCRE_NOTBOL */
-#define REG_NOTEOL 0x0008 /* Maps to PCRE_NOTEOL */
-#define REG_DOTALL 0x0010 /* NOT defined by POSIX; maps to PCRE_DOTALL */
-#define REG_NOSUB 0x0020 /* Maps to PCRE_NO_AUTO_CAPTURE */
-#define REG_UTF8 0x0040 /* NOT defined by POSIX; maps to PCRE_UTF8 */
-#define REG_STARTEND 0x0080 /* BSD feature: pass subject string by so,eo */
-#define REG_NOTEMPTY 0x0100 /* NOT defined by POSIX; maps to PCRE_NOTEMPTY */
-#define REG_UNGREEDY 0x0200 /* NOT defined by POSIX; maps to PCRE_UNGREEDY */
-#define REG_UCP 0x0400 /* NOT defined by POSIX; maps to PCRE_UCP */
-
-/* This is not used by PCRE, but by defining it we make it easier
-to slot PCRE into existing programs that make POSIX calls. */
-
-#define REG_EXTENDED 0
-
-/* Error values. Not all these are relevant or used by the wrapper. */
-
-enum {
- REG_ASSERT = 1, /* internal error ? */
- REG_BADBR, /* invalid repeat counts in {} */
- REG_BADPAT, /* pattern error */
- REG_BADRPT, /* ? * + invalid */
- REG_EBRACE, /* unbalanced {} */
- REG_EBRACK, /* unbalanced [] */
- REG_ECOLLATE, /* collation error - not relevant */
- REG_ECTYPE, /* bad class */
- REG_EESCAPE, /* bad escape sequence */
- REG_EMPTY, /* empty expression */
- REG_EPAREN, /* unbalanced () */
- REG_ERANGE, /* bad range inside [] */
- REG_ESIZE, /* expression too big */
- REG_ESPACE, /* failed to get memory */
- REG_ESUBREG, /* bad back reference */
- REG_INVARG, /* bad argument */
- REG_NOMATCH /* match failed */
-};
-
-
-/* The structure representing a compiled regular expression. */
-
-typedef struct {
- void *re_pcre;
- size_t re_nsub;
- size_t re_erroffset;
-} regex_t;
-
-/* The structure in which a captured offset is returned. */
-
-typedef int regoff_t;
-
-typedef struct {
- regoff_t rm_so;
- regoff_t rm_eo;
-} regmatch_t;
-
-/* When an application links to a PCRE DLL in Windows, the symbols that are
-imported have to be identified as such. When building PCRE, the appropriate
-export settings are needed, and are set in pcreposix.c before including this
-file. */
-
-#if defined(_WIN32) && !defined(PCRE_STATIC) && !defined(PCREPOSIX_EXP_DECL)
-# define PCREPOSIX_EXP_DECL extern __declspec(dllimport)
-# define PCREPOSIX_EXP_DEFN __declspec(dllimport)
-#endif
-
-/* By default, we use the standard "extern" declarations. */
-
-#ifndef PCREPOSIX_EXP_DECL
-# ifdef __cplusplus
-# define PCREPOSIX_EXP_DECL extern "C"
-# define PCREPOSIX_EXP_DEFN extern "C"
-# else
-# define PCREPOSIX_EXP_DECL extern
-# define PCREPOSIX_EXP_DEFN extern
-# endif
-#endif
-
-/* The functions */
-
-PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
-PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
- regmatch_t *, int);
-PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
-PCREPOSIX_EXP_DECL void regfree(regex_t *);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* End of pcreposix.h */
diff --git a/.pc/soname.patch/configure.ac b/.pc/soname.patch/configure.ac
deleted file mode 100644
index aab2f56..0000000
--- a/.pc/soname.patch/configure.ac
+++ /dev/null
@@ -1,1111 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-
-dnl NOTE FOR MAINTAINERS: Do not use minor version numbers 08 or 09 because
-dnl the leading zeros may cause them to be treated as invalid octal constants
-dnl if a PCRE user writes code that uses PCRE_MINOR as a number. There is now
-dnl a check further down that throws an error if 08 or 09 are used.
-
-dnl The PCRE_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(pcre_major, [8])
-m4_define(pcre_minor, [35])
-m4_define(pcre_prerelease, [])
-m4_define(pcre_date, [2014-04-04])
-
-# 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(libpcre_version, [3:3:2])
-m4_define(libpcre16_version, [2:3:2])
-m4_define(libpcre32_version, [0:3:0])
-m4_define(libpcreposix_version, [0:2:0])
-m4_define(libpcrecpp_version, [0:0:0])
-
-AC_PREREQ(2.57)
-AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
-AC_CONFIG_SRCDIR([pcre.h.in])
-AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-AC_CONFIG_HEADERS(config.h)
-
-# This is a new thing required to stop a warning from automake 1.12
-m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
-
-# This was added at the suggestion of libtoolize (03-Jan-10)
-AC_CONFIG_MACRO_DIR([m4])
-
-# The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just
-# "-g" for any other compiler. There doesn't seem to be a standard way of
-# getting rid of the -g (which I don't think is needed for a production
-# library). This fudge seems to achieve the necessary. First, we remember the
-# externally set values of CFLAGS and CXXFLAGS. Then call the AC_PROG_CC and
-# AC_PROG_CXX macros to find the compilers - if CFLAGS and CXXFLAGS are not
-# set, they will be set to Autoconf's defaults. Afterwards, if the original
-# values were not set, remove the -g from the Autoconf defaults.
-# (PH 02-May-07)
-
-remember_set_CFLAGS="$CFLAGS"
-remember_set_CXXFLAGS="$CXXFLAGS"
-
-AC_PROG_CC
-AC_PROG_CXX
-AM_PROG_CC_C_O
-
-if test "x$remember_set_CFLAGS" = "x"
-then
- if test "$CFLAGS" = "-g -O2"
- then
- CFLAGS="-O2"
- elif test "$CFLAGS" = "-g"
- then
- CFLAGS=""
- fi
-fi
-
-if test "x$remember_set_CXXFLAGS" = "x"
-then
- if test "$CXXFLAGS" = "-g -O2"
- then
- CXXFLAGS="-O2"
- elif test "$CXXFLAGS" = "-g"
- then
- CXXFLAGS=""
- fi
-fi
-
-# AC_PROG_CXX will return "g++" even if no c++ compiler is installed.
-# Check for that case, and just disable c++ code if g++ doesn't run.
-AC_LANG_PUSH(C++)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],, CXX=""; CXXCP=""; CXXFLAGS="")
-AC_LANG_POP
-
-# Check for a 64-bit integer type
-AC_TYPE_INT64_T
-
-AC_PROG_INSTALL
-AC_LIBTOOL_WIN32_DLL
-LT_INIT
-AC_PROG_LN_S
-
-# Check for GCC visibility feature
-
-PCRE_VISIBILITY
-
-# Versioning
-
-PCRE_MAJOR="pcre_major"
-PCRE_MINOR="pcre_minor"
-PCRE_PRERELEASE="pcre_prerelease"
-PCRE_DATE="pcre_date"
-
-if test "$PCRE_MINOR" = "08" -o "$PCRE_MINOR" = "09"
-then
- echo "***"
- echo "*** Minor version number $PCRE_MINOR must not be used. ***"
- echo "*** Use only 01 to 07 or 10 onwards, to avoid octal issues. ***"
- echo "***"
- exit 1
-fi
-
-AC_SUBST(PCRE_MAJOR)
-AC_SUBST(PCRE_MINOR)
-AC_SUBST(PCRE_PRERELEASE)
-AC_SUBST(PCRE_DATE)
-
-# Set a more sensible default value for $(htmldir).
-if test "x$htmldir" = 'x${docdir}'
-then
- htmldir='${docdir}/html'
-fi
-
-# Handle --disable-pcre8 (enabled by default)
-AC_ARG_ENABLE(pcre8,
- AS_HELP_STRING([--disable-pcre8],
- [disable 8 bit character support]),
- , enable_pcre8=unset)
-AC_SUBST(enable_pcre8)
-
-# Handle --enable-pcre16 (disabled by default)
-AC_ARG_ENABLE(pcre16,
- AS_HELP_STRING([--enable-pcre16],
- [enable 16 bit character support]),
- , enable_pcre16=unset)
-AC_SUBST(enable_pcre16)
-
-# Handle --enable-pcre32 (disabled by default)
-AC_ARG_ENABLE(pcre32,
- AS_HELP_STRING([--enable-pcre32],
- [enable 32 bit character support]),
- , enable_pcre32=unset)
-AC_SUBST(enable_pcre32)
-
-# Handle --disable-cpp. The substitution of enable_cpp is needed for use in
-# pcre-config.
-AC_ARG_ENABLE(cpp,
- AS_HELP_STRING([--disable-cpp],
- [disable C++ support]),
- , enable_cpp=unset)
-AC_SUBST(enable_cpp)
-
-# Handle --enable-jit (disabled by default)
-AC_ARG_ENABLE(jit,
- AS_HELP_STRING([--enable-jit],
- [enable Just-In-Time compiling support]),
- , enable_jit=no)
-
-# Handle --disable-pcregrep-jit (enabled by default)
-AC_ARG_ENABLE(pcregrep-jit,
- AS_HELP_STRING([--disable-pcregrep-jit],
- [disable JIT support in pcregrep]),
- , enable_pcregrep_jit=yes)
-
-# Handle --enable-rebuild-chartables
-AC_ARG_ENABLE(rebuild-chartables,
- AS_HELP_STRING([--enable-rebuild-chartables],
- [rebuild character tables in current locale]),
- , enable_rebuild_chartables=no)
-
-# Handle --enable-utf8 (disabled by default)
-AC_ARG_ENABLE(utf8,
- AS_HELP_STRING([--enable-utf8],
- [another name for --enable-utf. Kept only for compatibility reasons]),
- , enable_utf8=unset)
-
-# Handle --enable-utf (disabled by default)
-AC_ARG_ENABLE(utf,
- AS_HELP_STRING([--enable-utf],
- [enable UTF-8/16/32 support (incompatible with --enable-ebcdic)]),
- , enable_utf=unset)
-
-# Handle --enable-unicode-properties
-AC_ARG_ENABLE(unicode-properties,
- AS_HELP_STRING([--enable-unicode-properties],
- [enable Unicode properties support (implies --enable-utf)]),
- , enable_unicode_properties=no)
-
-# Handle newline options
-ac_pcre_newline=lf
-AC_ARG_ENABLE(newline-is-cr,
- AS_HELP_STRING([--enable-newline-is-cr],
- [use CR as newline character]),
- ac_pcre_newline=cr)
-AC_ARG_ENABLE(newline-is-lf,
- AS_HELP_STRING([--enable-newline-is-lf],
- [use LF as newline character (default)]),
- ac_pcre_newline=lf)
-AC_ARG_ENABLE(newline-is-crlf,
- AS_HELP_STRING([--enable-newline-is-crlf],
- [use CRLF as newline sequence]),
- ac_pcre_newline=crlf)
-AC_ARG_ENABLE(newline-is-anycrlf,
- AS_HELP_STRING([--enable-newline-is-anycrlf],
- [use CR, LF, or CRLF as newline sequence]),
- ac_pcre_newline=anycrlf)
-AC_ARG_ENABLE(newline-is-any,
- AS_HELP_STRING([--enable-newline-is-any],
- [use any valid Unicode newline sequence]),
- ac_pcre_newline=any)
-enable_newline="$ac_pcre_newline"
-
-# Handle --enable-bsr-anycrlf
-AC_ARG_ENABLE(bsr-anycrlf,
- AS_HELP_STRING([--enable-bsr-anycrlf],
- [\R matches only CR, LF, CRLF by default]),
- , enable_bsr_anycrlf=no)
-
-# Handle --enable-ebcdic
-AC_ARG_ENABLE(ebcdic,
- AS_HELP_STRING([--enable-ebcdic],
- [assume EBCDIC coding rather than ASCII; incompatible with --enable-utf; use only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]),
- , enable_ebcdic=no)
-
-# Handle --enable-ebcdic-nl25
-AC_ARG_ENABLE(ebcdic-nl25,
- AS_HELP_STRING([--enable-ebcdic-nl25],
- [set EBCDIC code for NL to 0x25 instead of 0x15; it implies --enable-ebcdic]),
- , enable_ebcdic_nl25=no)
-
-# Handle --disable-stack-for-recursion
-AC_ARG_ENABLE(stack-for-recursion,
- AS_HELP_STRING([--disable-stack-for-recursion],
- [don't use stack recursion when matching]),
- , enable_stack_for_recursion=yes)
-
-# Handle --enable-pcregrep-libz
-AC_ARG_ENABLE(pcregrep-libz,
- AS_HELP_STRING([--enable-pcregrep-libz],
- [link pcregrep with libz to handle .gz files]),
- , enable_pcregrep_libz=no)
-
-# Handle --enable-pcregrep-libbz2
-AC_ARG_ENABLE(pcregrep-libbz2,
- AS_HELP_STRING([--enable-pcregrep-libbz2],
- [link pcregrep with libbz2 to handle .bz2 files]),
- , enable_pcregrep_libbz2=no)
-
-# Handle --with-pcregrep-bufsize=N
-AC_ARG_WITH(pcregrep-bufsize,
- AS_HELP_STRING([--with-pcregrep-bufsize=N],
- [pcregrep buffer size (default=20480, minimum=8192)]),
- , with_pcregrep_bufsize=20480)
-
-# Handle --enable-pcretest-libedit
-AC_ARG_ENABLE(pcretest-libedit,
- AS_HELP_STRING([--enable-pcretest-libedit],
- [link pcretest with libedit]),
- , enable_pcretest_libedit=no)
-
-# Handle --enable-pcretest-libreadline
-AC_ARG_ENABLE(pcretest-libreadline,
- AS_HELP_STRING([--enable-pcretest-libreadline],
- [link pcretest with libreadline]),
- , enable_pcretest_libreadline=no)
-
-# Handle --with-posix-malloc-threshold=NBYTES
-AC_ARG_WITH(posix-malloc-threshold,
- AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],
- [threshold for POSIX malloc usage (default=10)]),
- , with_posix_malloc_threshold=10)
-
-# Handle --with-link-size=N
-AC_ARG_WITH(link-size,
- AS_HELP_STRING([--with-link-size=N],
- [internal link size (2, 3, or 4 allowed; default=2)]),
- , with_link_size=2)
-
-# Handle --with-parens-nest-limit=N
-AC_ARG_WITH(parens-nest-limit,
- AS_HELP_STRING([--with-parens-nest-limit=N],
- [nested parentheses limit (default=250)]),
- , with_parens_nest_limit=250)
-
-# Handle --with-match-limit=N
-AC_ARG_WITH(match-limit,
- AS_HELP_STRING([--with-match-limit=N],
- [default limit on internal looping (default=10000000)]),
- , with_match_limit=10000000)
-
-# Handle --with-match-limit_recursion=N
-#
-# Note: In config.h, the default is to define MATCH_LIMIT_RECURSION
-# symbolically as MATCH_LIMIT, which in turn is defined to be some numeric
-# value (e.g. 10000000). MATCH_LIMIT_RECURSION can otherwise be set to some
-# different numeric value (or even the same numeric value as MATCH_LIMIT,
-# though no longer defined in terms of the latter).
-#
-AC_ARG_WITH(match-limit-recursion,
- AS_HELP_STRING([--with-match-limit-recursion=N],
- [default limit on internal recursion (default=MATCH_LIMIT)]),
- , with_match_limit_recursion=MATCH_LIMIT)
-
-# Handle --enable-valgrind
-AC_ARG_ENABLE(valgrind,
- AS_HELP_STRING([--enable-valgrind],
- [valgrind support]),
- , enable_valgrind=no)
-
-# Enable code coverage reports using gcov
-AC_ARG_ENABLE(coverage,
- AS_HELP_STRING([--enable-coverage],
- [enable code coverage reports using gcov]),
- , enable_coverage=no)
-
-# Copy enable_utf8 value to enable_utf for compatibility reasons
-if test "x$enable_utf8" != "xunset"
-then
- if test "x$enable_utf" != "xunset"
- then
- AC_MSG_ERROR([--enable/disable-utf8 is kept only for compatibility reasons and its value is copied to --enable/disable-utf. Newer code must use --enable/disable-utf alone.])
- fi
- enable_utf=$enable_utf8
-fi
-
-# Set the default value for pcre8
-if test "x$enable_pcre8" = "xunset"
-then
- enable_pcre8=yes
-fi
-
-# Set the default value for pcre16
-if test "x$enable_pcre16" = "xunset"
-then
- enable_pcre16=no
-fi
-
-# Set the default value for pcre32
-if test "x$enable_pcre32" = "xunset"
-then
- enable_pcre32=no
-fi
-
-# Make sure enable_pcre8 or enable_pcre16 was set
-if test "x$enable_pcre8$enable_pcre16$enable_pcre32" = "xnonono"
-then
- AC_MSG_ERROR([At least one of 8, 16 or 32 bit pcre library must be enabled])
-fi
-
-# Make sure that if enable_unicode_properties was set, that UTF support is enabled.
-if test "x$enable_unicode_properties" = "xyes"
-then
- if test "x$enable_utf" = "xno"
- then
- AC_MSG_ERROR([support for Unicode properties requires UTF-8/16/32 support])
- fi
- enable_utf=yes
-fi
-
-# enable_utf is disabled by default.
-if test "x$enable_utf" = "xunset"
-then
- enable_utf=no
-fi
-
-# enable_cpp copies the value of enable_pcre8 by default
-if test "x$enable_cpp" = "xunset"
-then
- enable_cpp=$enable_pcre8
-fi
-
-# Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
-if test "x$enable_cpp" = "xyes"
-then
- if test "x$enable_pcre8" = "xno"
- then
- AC_MSG_ERROR([C++ library requires pcre library with 8 bit characters])
- fi
-fi
-
-# Convert the newline identifier into the appropriate integer value. The first
-# three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they
-# are changed below.
-
-case "$enable_newline" in
- lf) ac_pcre_newline_value=10 ;;
- cr) ac_pcre_newline_value=13 ;;
- crlf) ac_pcre_newline_value=3338 ;;
- anycrlf) ac_pcre_newline_value=-2 ;;
- any) ac_pcre_newline_value=-1 ;;
- *)
- AC_MSG_ERROR([invalid argument \"$enable_newline\" to --enable-newline option])
- ;;
-esac
-
-# --enable-ebcdic-nl25 implies --enable-ebcdic
-if test "x$enable_ebcdic_nl25" = "xyes"; then
- enable_ebcdic=yes
-fi
-
-# Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled,
-# and the newline value is adjusted appropriately (CR is still 13, but LF is
-# 21 or 37). Also check that UTF support is not requested, because PCRE cannot
-# handle EBCDIC and UTF in the same build. To do so it would need to use
-# different character constants depending on the mode.
-#
-if test "x$enable_ebcdic" = "xyes"; then
- enable_rebuild_chartables=yes
-
- if test "x$enable_utf" = "xyes"; then
- AC_MSG_ERROR([support for EBCDIC and UTF-8/16/32 cannot be enabled at the same time])
- fi
-
- if test "x$enable_ebcdic_nl25" = "xno"; then
- case "$ac_pcre_newline_value" in
- 10) ac_pcre_newline_value=21 ;;
- 3338) ac_pcre_newline_value=3349 ;;
- esac
- else
- case "$ac_pcre_newline_value" in
- 10) ac_pcre_newline_value=37 ;;
- 3338) ac_pcre_newline_value=3365 ;;
- esac
- fi
-fi
-
-# Check argument to --with-link-size
-case "$with_link_size" in
- 2|3|4) ;;
- *)
- AC_MSG_ERROR([invalid argument \"$with_link_size\" to --with-link-size option])
- ;;
-esac
-
-AH_TOP([
-/* PCRE is written in Standard C, but there are a few non-standard things it
-can cope with, allowing it to run on SunOS4 and other "close to standard"
-systems.
-
-In environments that support the GNU autotools, config.h.in is converted into
-config.h by the "configure" script. In environments that use CMake,
-config-cmake.in is converted into config.h. If you are going to build PCRE "by
-hand" without using "configure" or CMake, you should copy the distributed
-config.h.generic to config.h, and edit the macro definitions to be the way you
-need them. You must then add -DHAVE_CONFIG_H to all of your compile commands,
-so that config.h is included at the start of every source.
-
-Alternatively, you can avoid editing by using -D on the compiler command line
-to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H,
-but if you do, default values will be taken from config.h for non-boolean
-macros that are not defined on the command line.
-
-Boolean macros such as HAVE_STDLIB_H and SUPPORT_PCRE8 should either be defined
-(conventionally to 1) for TRUE, and not defined at all for FALSE. All such
-macros are listed as a commented #undef in config.h.generic. Macros such as
-MATCH_LIMIT, whose actual value is relevant, have defaults defined, but are
-surrounded by #ifndef/#endif lines so that the value can be overridden by -D.
-
-PCRE uses memmove() if HAVE_MEMMOVE is defined; otherwise it uses bcopy() if
-HAVE_BCOPY is defined. If your system has neither bcopy() nor memmove(), make
-sure both macros are undefined; an emulation function will then be used. */])
-
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(limits.h sys/types.h sys/stat.h dirent.h)
-AC_CHECK_HEADERS([windows.h], [HAVE_WINDOWS_H=1])
-
-# The files below are C++ header files.
-pcre_have_type_traits="0"
-pcre_have_bits_type_traits="0"
-
-if test "x$enable_cpp" = "xyes" -a -z "$CXX"; then
- AC_MSG_ERROR([You need a C++ compiler for C++ support.])
-fi
-
-if test "x$enable_cpp" = "xyes" -a -n "$CXX"
-then
-AC_LANG_PUSH(C++)
-
-# Older versions of pcre defined pcrecpp::no_arg, but in new versions
-# it's called pcrecpp::RE::no_arg. For backwards ABI compatibility,
-# we want to make one an alias for the other. Different systems do
-# this in different ways. Some systems, for instance, can do it via
-# a linker flag: -alias (for os x 10.5) or -i (for os x <=10.4).
-OLD_LDFLAGS="$LDFLAGS"
-for flag in "-alias,__ZN7pcrecpp2RE6no_argE,__ZN7pcrecpp6no_argE" \
- "-i__ZN7pcrecpp6no_argE:__ZN7pcrecpp2RE6no_argE"; do
- AC_MSG_CHECKING([for alias support in the linker])
- LDFLAGS="$OLD_LDFLAGS -Wl,$flag"
- # We try to run the linker with this new ld flag. If the link fails,
- # we give up and remove the new flag from LDFLAGS.
- AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace pcrecpp {
- class RE { static int no_arg; };
- int RE::no_arg;
- }],
- [])],
- [AC_MSG_RESULT([yes]);
- EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";
- break;],
- AC_MSG_RESULT([no]))
-done
-LDFLAGS="$OLD_LDFLAGS"
-
-# We could be more clever here, given we're doing AC_SUBST with this
-# (eg set a var to be the name of the include file we want). But we're not
-# so it's easy to change back to 'regular' autoconf vars if we needed to.
-AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"],
- [pcre_have_cpp_headers="0"])
-AC_CHECK_HEADERS(bits/type_traits.h, [pcre_have_bits_type_traits="1"],
- [pcre_have_bits_type_traits="0"])
-AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],
- [pcre_have_type_traits="0"])
-
-# (This isn't c++-specific, but is only used in pcrecpp.cc, so try this
-# in a c++ context. This matters becuase strtoimax is C99 and may not
-# be supported by the C++ compiler.)
-# Figure out how to create a longlong from a string: strtoll and
-# equiv. It's not enough to call AC_CHECK_FUNCS: hpux has a
-# strtoll, for instance, but it only takes 2 args instead of 3!
-# We have to call AH_TEMPLATE since AC_DEFINE_UNQUOTED below is complex.
-AH_TEMPLATE(HAVE_STRTOQ, [Define to 1 if you have `strtoq'.])
-AH_TEMPLATE(HAVE_STRTOLL, [Define to 1 if you have `strtoll'.])
-AH_TEMPLATE(HAVE__STRTOI64, [Define to 1 if you have `_strtoi64'.])
-AH_TEMPLATE(HAVE_STRTOIMAX, [Define to 1 if you have `strtoimax'.])
-have_strto_fn=0
-for fn in strtoq strtoll _strtoi64 strtoimax; do
- AC_MSG_CHECKING([for $fn])
- if test "$fn" = strtoimax; then
- include=stdint.h
- else
- include=stdlib.h
- fi
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$include>],
- [char* e; return $fn("100", &e, 10)])],
- [AC_MSG_RESULT(yes)
- AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,
- [Define to 1 if you have `$fn'.])
- have_strto_fn=1
- break],
- [AC_MSG_RESULT(no)])
-done
-
-if test "$have_strto_fn" = 1; then
- AC_CHECK_TYPES([long long],
- [pcre_have_long_long="1"],
- [pcre_have_long_long="0"])
- AC_CHECK_TYPES([unsigned long long],
- [pcre_have_ulong_long="1"],
- [pcre_have_ulong_long="0"])
-else
- pcre_have_long_long="0"
- pcre_have_ulong_long="0"
-fi
-AC_SUBST(pcre_have_long_long)
-AC_SUBST(pcre_have_ulong_long)
-
-AC_LANG_POP
-fi
-# Using AC_SUBST eliminates the need to include config.h in a public .h file
-AC_SUBST(pcre_have_type_traits)
-AC_SUBST(pcre_have_bits_type_traits)
-
-# Conditional compilation
-AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes")
-AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes")
-AM_CONDITIONAL(WITH_PCRE32, test "x$enable_pcre32" = "xyes")
-AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
-AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
-AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
-AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
-AM_CONDITIONAL(WITH_VALGRIND, test "x$enable_valgrind" = "xyes")
-
-# Checks for typedefs, structures, and compiler characteristics.
-
-AC_C_CONST
-AC_TYPE_SIZE_T
-
-# Checks for library functions.
-
-AC_CHECK_FUNCS(bcopy memmove strerror)
-
-# Check for the availability of libz (aka zlib)
-
-AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1])
-AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1])
-
-# Check for the availability of libbz2. Originally we just used AC_CHECK_LIB,
-# as for libz. However, this had the following problem, diagnosed and fixed by
-# a user:
-#
-# - libbz2 uses the Pascal calling convention (WINAPI) for the functions
-# under Win32.
-# - The standard autoconf AC_CHECK_LIB fails to include "bzlib.h",
-# therefore missing the function definition.
-# - The compiler thus generates a "C" signature for the test function.
-# - The linker fails to find the "C" function.
-# - PCRE fails to configure if asked to do so against libbz2.
-#
-# Solution:
-#
-# - Replace the AC_CHECK_LIB test with a custom test.
-
-AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1])
-# Original test
-# AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1])
-#
-# Custom test follows
-
-AC_MSG_CHECKING([for libbz2])
-OLD_LIBS="$LIBS"
-LIBS="$LIBS -lbz2"
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_BZLIB_H
-#include <bzlib.h>
-#endif]],
-[[return (int)BZ2_bzopen("conftest", "rb");]])],
-[AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;],
-AC_MSG_RESULT([no]))
-LIBS="$OLD_LIBS"
-
-# Check for the availabiity of libreadline
-
-if test "$enable_pcretest_libreadline" = "yes"; then
- AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
- AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
- AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],
- [unset ac_cv_lib_readline_readline;
- AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],
- [unset ac_cv_lib_readline_readline;
- AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],
- [unset ac_cv_lib_readline_readline;
- AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],
- [unset ac_cv_lib_readline_readline;
- AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],
- [unset ac_cv_lib_readline_readline;
- AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],
- [LIBREADLINE=""],
- [-ltermcap])],
- [-lncursesw])],
- [-lncurses])],
- [-lcurses])],
- [-ltinfo])])
- AC_SUBST(LIBREADLINE)
- if test -n "$LIBREADLINE"; then
- if test "$LIBREADLINE" != "-lreadline"; then
- echo "-lreadline needs $LIBREADLINE"
- LIBREADLINE="-lreadline $LIBREADLINE"
- fi
- fi
-fi
-
-
-# Check for the availability of libedit. Different distributions put its
-# headers in different places. Try to cover the most common ones.
-
-if test "$enable_pcretest_libedit" = "yes"; then
- AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1],
- [AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1],
- [AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])])
- AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"])
-fi
-
-# This facilitates -ansi builds under Linux
-dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
-
-PCRE_STATIC_CFLAG=""
-if test "x$enable_shared" = "xno" ; then
- AC_DEFINE([PCRE_STATIC], [1], [
- Define to any value if linking statically (TODO: make nice with Libtool)])
- PCRE_STATIC_CFLAG="-DPCRE_STATIC"
-fi
-AC_SUBST(PCRE_STATIC_CFLAG)
-
-# Here is where pcre specific defines are handled
-
-if test "$enable_pcre8" = "yes"; then
- AC_DEFINE([SUPPORT_PCRE8], [], [
- Define to any value to enable the 8 bit PCRE library.])
-fi
-
-if test "$enable_pcre16" = "yes"; then
- AC_DEFINE([SUPPORT_PCRE16], [], [
- Define to any value to enable the 16 bit PCRE library.])
-fi
-
-if test "$enable_pcre32" = "yes"; then
- AC_DEFINE([SUPPORT_PCRE32], [], [
- Define to any value to enable the 32 bit PCRE library.])
-fi
-
-# Unless running under Windows, JIT support requires pthreads.
-
-if test "$enable_jit" = "yes"; then
- if test "$HAVE_WINDOWS_H" != "1"; then
- AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
- CC="$PTHREAD_CC"
- CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
- LIBS="$PTHREAD_LIBS $LIBS"
- fi
- AC_DEFINE([SUPPORT_JIT], [], [
- Define to any value to enable support for Just-In-Time compiling.])
-else
- enable_pcregrep_jit="no"
-fi
-
-if test "$enable_pcregrep_jit" = "yes"; then
- AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [
- Define to any value to enable JIT support in pcregrep.])
-fi
-
-if test "$enable_utf" = "yes"; then
- AC_DEFINE([SUPPORT_UTF], [], [
- Define to any value to enable support for the UTF-8/16/32 Unicode encoding.
- This will work even in an EBCDIC environment, but it is incompatible
- with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
- code *or* ASCII/UTF-8/16/32, but not both at once.])
-fi
-
-if test "$enable_unicode_properties" = "yes"; then
- AC_DEFINE([SUPPORT_UCP], [], [
- Define to any value to enable support for Unicode properties.])
-fi
-
-if test "$enable_stack_for_recursion" = "no"; then
- AC_DEFINE([NO_RECURSE], [], [
- PCRE uses recursive function calls to handle backtracking while
- matching. This can sometimes be a problem on systems that have
- stacks of limited size. Define NO_RECURSE to any value to get a
- version that doesn't use recursion in the match() function; instead
- it creates its own stack by steam using pcre_recurse_malloc() to obtain
- memory from the heap. For more detail, see the comments and other stuff
- just above the match() function.])
-fi
-
-if test "$enable_pcregrep_libz" = "yes"; then
- AC_DEFINE([SUPPORT_LIBZ], [], [
- Define to any value to allow pcregrep to be linked with libz, so that it is
- able to handle .gz files.])
-fi
-
-if test "$enable_pcregrep_libbz2" = "yes"; then
- AC_DEFINE([SUPPORT_LIBBZ2], [], [
- Define to any value to allow pcregrep to be linked with libbz2, so that it
- is able to handle .bz2 files.])
-fi
-
-if test $with_pcregrep_bufsize -lt 8192 ; then
- AC_MSG_WARN([$with_pcregrep_bufsize is too small for --with-pcregrep-bufsize; using 8192])
- with_pcregrep_bufsize="8192"
-else
- if test $? -gt 1 ; then
- AC_MSG_ERROR([Bad value for --with-pcregrep-bufsize])
- fi
-fi
-
-AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [
- The value of PCREGREP_BUFSIZE determines the size of buffer used by pcregrep
- to hold parts of the file it is searching. This is also the minimum value.
- The actual amount of memory used by pcregrep is three times this number,
- because it allows for the buffering of "before" and "after" lines.])
-
-if test "$enable_pcretest_libedit" = "yes"; then
- AC_DEFINE([SUPPORT_LIBEDIT], [], [
- Define to any value to allow pcretest to be linked with libedit.])
- LIBREADLINE="$LIBEDIT"
-elif test "$enable_pcretest_libreadline" = "yes"; then
- AC_DEFINE([SUPPORT_LIBREADLINE], [], [
- Define to any value to allow pcretest to be linked with libreadline.])
-fi
-
-AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
- The value of NEWLINE determines the default newline character sequence. PCRE
- client programs can override this by selecting other values at run time. In
- ASCII environments, the value can be 10 (LF), 13 (CR), or 3338 (CRLF); in
- EBCDIC environments the value can be 21 or 37 (LF), 13 (CR), or 3349 or 3365
- (CRLF) because there are two alternative codepoints (0x15 and 0x25) that are
- used as the NL line terminator that is equivalent to ASCII LF. In both ASCII
- and EBCDIC environments the value can also be -1 (ANY), or -2 (ANYCRLF).])
-
-if test "$enable_bsr_anycrlf" = "yes"; then
- AC_DEFINE([BSR_ANYCRLF], [], [
- By default, the \R escape sequence matches any Unicode line ending
- character or sequence of characters. If BSR_ANYCRLF is defined (to any
- value), this is changed so that backslash-R matches only CR, LF, or CRLF.
- The build-time default can be overridden by the user of PCRE at runtime.])
-fi
-
-AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
- The value of LINK_SIZE determines the number of bytes used to store
- links as offsets within the compiled regex. The default is 2, which
- allows for compiled patterns up to 64K long. This covers the vast
- majority of cases. However, PCRE can also be compiled to use 3 or 4
- bytes instead. This allows for longer patterns in extreme cases.])
-
-AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [
- When calling PCRE via the POSIX interface, additional working storage
- is required for holding the pointers to capturing substrings because
- PCRE requires three integers per substring, whereas the POSIX
- interface provides only two. If the number of expected substrings is
- small, the wrapper function uses space on the stack, because this is
- faster than using malloc() for each call. The threshold above which
- the stack is no longer used is defined by POSIX_MALLOC_THRESHOLD.])
-
-AC_DEFINE_UNQUOTED([PARENS_NEST_LIMIT], [$with_parens_nest_limit], [
- 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
- stack that is used while compiling a pattern.])
-
-AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
- The value of MATCH_LIMIT determines the default number of times the
- internal match() function can be called during a single execution of
- pcre_exec(). There is a runtime interface for setting a different
- limit. The limit exists in order to catch runaway regular
- expressions that take for ever to determine that they do not match.
- The default is set very large so that it does not accidentally catch
- legitimate cases.])
-
-AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [
- The above limit applies to all calls of match(), whether or not they
- increase the recursion depth. In some environments it is desirable
- to limit the depth of recursive calls of match() more strictly, in
- order to restrict the maximum amount of stack (or heap, if
- NO_RECURSE is defined) that is used. The value of
- MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
- have any useful effect, it must be less than the value of
- MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT.
- There is a runtime method for setting a different limit.])
-
-AC_DEFINE([MAX_NAME_SIZE], [32], [
- This limit is parameterized just in case anybody ever wants to
- change it. Care must be taken if it is increased, because it guards
- against integer overflow caused by enormously large patterns.])
-
-AC_DEFINE([MAX_NAME_COUNT], [10000], [
- This limit is parameterized just in case anybody ever wants to
- change it. Care must be taken if it is increased, because it guards
- against integer overflow caused by enormously large patterns.])
-
-AH_VERBATIM([PCRE_EXP_DEFN], [
-/* If you are compiling for a system other than a Unix-like system or
- Win32, and it needs some magic to be inserted before the definition
- of a function that is exported by the library, define this macro to
- contain the relevant magic. If you do not define this macro, a suitable
- __declspec value is used for Windows systems; in other environments
- "extern" is used for a C compiler and "extern C" for a C++ compiler.
- This macro apears at the start of every exported function that is part
- of the external API. It does not appear on functions that are "external"
- in the C sense, but which are internal to the library. */
-#undef PCRE_EXP_DEFN])
-
-if test "$enable_ebcdic" = "yes"; then
- AC_DEFINE_UNQUOTED([EBCDIC], [], [
- If you are compiling for a system that uses EBCDIC instead of ASCII
- character codes, define this macro to any value. You must also edit the
- NEWLINE macro below to set a suitable EBCDIC newline, commonly 21 (0x15).
- On systems that can use "configure" or CMake to set EBCDIC, NEWLINE is
- automatically adjusted. When EBCDIC is set, PCRE assumes that all input
- strings are in EBCDIC. If you do not define this macro, PCRE will assume
- input strings are ASCII or UTF-8/16/32 Unicode. It is not possible to build
- a version of PCRE that supports both EBCDIC and UTF-8/16/32.])
-fi
-
-if test "$enable_ebcdic_nl25" = "yes"; then
- AC_DEFINE_UNQUOTED([EBCDIC_NL25], [], [
- In an EBCDIC environment, define this macro to any value to arrange for
- the NL character to be 0x25 instead of the default 0x15. NL plays the role
- that LF does in an ASCII/Unicode environment. The value must also be set in
- the NEWLINE macro below. On systems that can use "configure" or CMake to
- set EBCDIC_NL25, the adjustment of NEWLINE is automatic.])
-fi
-
-if test "$enable_valgrind" = "yes"; then
- AC_DEFINE_UNQUOTED([SUPPORT_VALGRIND], [], [
- Define to any value for valgrind support to find invalid memory reads.])
-fi
-
-# Platform specific issues
-NO_UNDEFINED=
-EXPORT_ALL_SYMBOLS=
-case $host_os in
- cygwin* | mingw* )
- if test X"$enable_shared" = Xyes; then
- NO_UNDEFINED="-no-undefined"
- EXPORT_ALL_SYMBOLS="-Wl,--export-all-symbols"
- fi
- ;;
-esac
-
-# The extra LDFLAGS for each particular library
-# (Note: The libpcre*_version bits are m4 variables, assigned above)
-
-EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
- $NO_UNDEFINED -version-info libpcre_version"
-
-EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \
- $NO_UNDEFINED -version-info libpcre16_version"
-
-EXTRA_LIBPCRE32_LDFLAGS="$EXTRA_LIBPCRE32_LDFLAGS \
- $NO_UNDEFINED -version-info libpcre32_version"
-
-EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
- $NO_UNDEFINED -version-info libpcreposix_version"
-
-EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS \
- $NO_UNDEFINED -version-info libpcrecpp_version \
- $EXPORT_ALL_SYMBOLS"
-
-AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
-AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS)
-AC_SUBST(EXTRA_LIBPCRE32_LDFLAGS)
-AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
-AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
-
-# When we run 'make distcheck', use these arguments. Turning off compiler
-# optimization makes it run faster.
-DISTCHECK_CONFIGURE_FLAGS="CFLAGS='' CXXFLAGS='' --enable-pcre16 --enable-pcre32 --enable-jit --enable-cpp --enable-unicode-properties"
-AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
-
-# Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
-# specified, the relevant library is available.
-
-if test "$enable_pcregrep_libz" = "yes"; then
- if test "$HAVE_ZLIB_H" != "1"; then
- echo "** Cannot --enable-pcregrep-libz because zlib.h was not found"
- exit 1
- fi
- if test "$HAVE_LIBZ" != "1"; then
- echo "** Cannot --enable-pcregrep-libz because libz was not found"
- exit 1
- fi
- LIBZ="-lz"
-fi
-AC_SUBST(LIBZ)
-
-if test "$enable_pcregrep_libbz2" = "yes"; then
- if test "$HAVE_BZLIB_H" != "1"; then
- echo "** Cannot --enable-pcregrep-libbz2 because bzlib.h was not found"
- exit 1
- fi
- if test "$HAVE_LIBBZ2" != "1"; then
- echo "** Cannot --enable-pcregrep-libbz2 because libbz2 was not found"
- exit 1
- fi
- LIBBZ2="-lbz2"
-fi
-AC_SUBST(LIBBZ2)
-
-# Similarly for --enable-pcretest-readline
-
-if test "$enable_pcretest_libedit" = "yes"; then
- if test "$enable_pcretest_libreadline" = "yes"; then
- echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline"
- exit 1
- fi
- if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \
- "$HAVE_READLINE_READLINE_H" != "1"; then
- echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h"
- echo "** nor readline/readline.h was found."
- exit 1
- fi
- if test -z "$LIBEDIT"; then
- echo "** Cannot --enable-pcretest-libedit because libedit library was not found."
- exit 1
- fi
-fi
-
-if test "$enable_pcretest_libreadline" = "yes"; then
- if test "$HAVE_READLINE_H" != "1"; then
- echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."
- exit 1
- fi
- if test "$HAVE_HISTORY_H" != "1"; then
- echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
- exit 1
- fi
- if test -z "$LIBREADLINE"; then
- echo "** Cannot --enable-pcretest-readline because readline library was not found."
- exit 1
- fi
-fi
-
-# Handle valgrind support
-
-if test "$enable_valgrind" = "yes"; then
- m4_ifdef([PKG_CHECK_MODULES],
- [PKG_CHECK_MODULES([VALGRIND],[valgrind])],
- [AC_MSG_ERROR([pkg-config not supported])])
-fi
-
-# Handle code coverage reporting support
-if test "$enable_coverage" = "yes"; then
- if test "x$GCC" != "xyes"; then
- AC_MSG_ERROR([Code coverage reports can only be generated when using GCC])
- fi
-
- # ccache is incompatible with gcov
- AC_PATH_PROG([SHTOOL],[shtool],[false])
- case `$SHTOOL path $CC` in
- *ccache*) cc_ccache=yes;;
- *) cc_ccache=no;;
- esac
-
- if test "$cc_ccache" = "yes"; then
- if test -z "$CCACHE_DISABLE" -o "$CCACHE_DISABLE" != "1"; then
- AC_MSG_ERROR([must export CCACHE_DISABLE=1 to disable ccache for code coverage])
- fi
- fi
-
- AC_ARG_VAR([LCOV],[the ltp lcov program])
- AC_PATH_PROG([LCOV],[lcov],[false])
- if test "x$LCOV" = "xfalse"; then
- AC_MSG_ERROR([lcov not found])
- fi
-
- AC_ARG_VAR([GENHTML],[the ltp genhtml program])
- AC_PATH_PROG([GENHTML],[genhtml],[false])
- if test "x$GENHTML" = "xfalse"; then
- AC_MSG_ERROR([genhtml not found])
- fi
-
- # Set flags needed for gcov
- GCOV_CFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
- GCOV_CXXFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
- GCOV_LIBS="-lgcov"
- AC_SUBST([GCOV_CFLAGS])
- AC_SUBST([GCOV_CXXFLAGS])
- AC_SUBST([GCOV_LIBS])
-fi # enable_coverage
-
-AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"])
-
-# Produce these files, in addition to config.h.
-AC_CONFIG_FILES(
- Makefile
- libpcre.pc
- libpcre16.pc
- libpcre32.pc
- libpcreposix.pc
- libpcrecpp.pc
- pcre-config
- pcre.h
- pcre_stringpiece.h
- pcrecpparg.h
-)
-
-# Make the generated script files executable.
-AC_CONFIG_COMMANDS([script-chmod], [chmod a+x pcre-config])
-
-# Make sure that pcre_chartables.c is removed in case the method for
-# creating it was changed by reconfiguration.
-AC_CONFIG_COMMANDS([delete-old-chartables], [rm -f pcre_chartables.c])
-
-AC_OUTPUT
-
-# Print out a nice little message after configure is run displaying the
-# chosen options.
-
-ebcdic_nl_code=n/a
-if test "$enable_ebcdic_nl25" = "yes"; then
- ebcdic_nl_code=0x25
-elif test "$enable_ebcdic" = "yes"; then
- ebcdic_nl_code=0x15
-fi
-
-cat <<EOF
-
-$PACKAGE-$VERSION configuration summary:
-
- Install prefix .................. : ${prefix}
- C preprocessor .................. : ${CPP}
- C compiler ...................... : ${CC}
- C++ preprocessor ................ : ${CXXCPP}
- C++ compiler .................... : ${CXX}
- Linker .......................... : ${LD}
- C preprocessor flags ............ : ${CPPFLAGS}
- C compiler flags ................ : ${CFLAGS} ${VISIBILITY_CFLAGS}
- C++ compiler flags .............. : ${CXXFLAGS} ${VISIBILITY_CXXFLAGS}
- Linker flags .................... : ${LDFLAGS}
- Extra libraries ................. : ${LIBS}
-
- Build 8 bit pcre library ........ : ${enable_pcre8}
- Build 16 bit pcre library ....... : ${enable_pcre16}
- Build 32 bit pcre library ....... : ${enable_pcre32}
- Build C++ library ............... : ${enable_cpp}
- Enable JIT compiling support .... : ${enable_jit}
- Enable UTF-8/16/32 support ...... : ${enable_utf}
- Unicode properties .............. : ${enable_unicode_properties}
- Newline char/sequence ........... : ${enable_newline}
- \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
- EBCDIC coding ................... : ${enable_ebcdic}
- EBCDIC code for NL .............. : ${ebcdic_nl_code}
- Rebuild char tables ............. : ${enable_rebuild_chartables}
- Use stack recursion ............. : ${enable_stack_for_recursion}
- POSIX mem threshold ............. : ${with_posix_malloc_threshold}
- Internal link size .............. : ${with_link_size}
- Nested parentheses limit ........ : ${with_parens_nest_limit}
- Match limit ..................... : ${with_match_limit}
- Match limit recursion ........... : ${with_match_limit_recursion}
- Build shared libs ............... : ${enable_shared}
- Build static libs ............... : ${enable_static}
- Use JIT in pcregrep ............. : ${enable_pcregrep_jit}
- Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}
- Link pcregrep with libz ......... : ${enable_pcregrep_libz}
- Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
- Link pcretest with libedit ...... : ${enable_pcretest_libedit}
- Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
- Valgrind support ................ : ${enable_valgrind}
- Code coverage ................... : ${enable_coverage}
-
-EOF
-
-dnl end configure.ac
diff --git a/debian/changelog b/debian/changelog
index 5c671ee..190252c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,15 @@
+pcre3 (2:8.35-7.1) unstable; urgency=medium
+
+ * Rename libpcrecpp0 to libpcrecpp0v5. Addresses: #791236.
+ * Add Conflict/Replaces to the old library.
+ * Add libpcrecpp0v5 symbols file for GCC 5.
+
+ -- Matthias Klose <doko@debian.org> Tue, 04 Aug 2015 20:23:03 +0200
+
pcre3 (2:8.35-7) unstable; urgency=medium
* Apply upstream patch to fix buffer overflow for forward reference
- within backward assertion with excess closing parenthesis
+ within backward assertion with excess closing parenthesis
(Closes: #790000)
-- Matthew Vernon <matthew@debian.org> Fri, 26 Jun 2015 08:08:55 +0100
diff --git a/debian/control b/debian/control
index 4f372e5..d4690c0 100644
--- a/debian/control
+++ b/debian/control
@@ -40,13 +40,13 @@ Description: Perl 5 Compatible Regular Expression Library - runtime files (udeb)
.
This package contains the runtime libraries for the Debian Installer (udeb).
-Package: libpcrecpp0
+Package: libpcrecpp0v5
Section: libs
Architecture: any
Priority: optional
Depends: ${shlibs:Depends}, ${misc:Depends}
-Conflicts: libpcre3 (<< 6.4-1.1)
-Replaces: libpcre3 (<< 6.4-1.1)
+Conflicts: libpcre3 (<< 6.4-1.1), libpcrecpp0
+Replaces: libpcre3 (<< 6.4-1.1), libpcrecpp0
Multi-Arch: same
Pre-Depends: multiarch-support
Description: Perl 5 Compatible Regular Expression Library - C++ runtime files
@@ -59,7 +59,7 @@ Package: libpcre3-dev
Section: libdevel
Architecture: any
Multi-Arch: same
-Depends: libc6-dev, libpcre3 (= ${binary:Version}), libpcre16-3 (= ${binary:Version}), libpcre32-3 (= ${binary:Version}), libpcrecpp0 (= ${binary:Version}), ${misc:Depends}
+Depends: libc6-dev, libpcre3 (= ${binary:Version}), libpcre16-3 (= ${binary:Version}), libpcre32-3 (= ${binary:Version}), libpcrecpp0v5 (= ${binary:Version}), ${misc:Depends}
Conflicts: libpcre1-dev, libpcre2-dev
Description: Perl 5 Compatible Regular Expression Library - development files
This is a library of functions to support regular expressions whose syntax
@@ -72,7 +72,7 @@ Package: libpcre3-dbg
Section: debug
Priority: extra
Architecture: any
-Depends: libpcre3 (= ${binary:Version}), libpcrecpp0 (= ${binary:Version}), ${misc:Depends}
+Depends: libpcre3 (= ${binary:Version}), libpcrecpp0v5 (= ${binary:Version}), ${misc:Depends}
Multi-Arch: same
Description: Perl 5 Compatible Regular Expression Library - debug symbols
This is a library of functions to support regular expressions whose syntax
diff --git a/debian/libpcrecpp0.docs b/debian/libpcrecpp0v5.docs
index 9920811..9920811 100644
--- a/debian/libpcrecpp0.docs
+++ b/debian/libpcrecpp0v5.docs
diff --git a/debian/libpcrecpp0.install b/debian/libpcrecpp0v5.install
index 6b2eb62..6b2eb62 100644
--- a/debian/libpcrecpp0.install
+++ b/debian/libpcrecpp0v5.install
diff --git a/debian/libpcrecpp0v5.symbols b/debian/libpcrecpp0v5.symbols
new file mode 100644
index 0000000..d9659d4
--- /dev/null
+++ b/debian/libpcrecpp0v5.symbols
@@ -0,0 +1,86 @@
+libpcrecpp.so.0 libpcrecpp0v5 #MINVER#
+ (c++)"pcrecpp::Arg::parse_char(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_double(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_float(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_int(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_int_cradix(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_int_hex(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_int_octal(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_int_radix(char const*, int, void*, int)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_long(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_long_cradix(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_long_hex(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_longlong(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_longlong_cradix(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_longlong_hex(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_longlong_octal(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_longlong_radix(char const*, int, void*, int)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_long_octal(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_long_radix(char const*, int, void*, int)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_null(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_short(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_short_cradix(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_short_hex(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_short_octal(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_short_radix(char const*, int, void*, int)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_string(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_stringpiece(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_uchar(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_uint(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_uint_cradix(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_uint_hex(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_uint_octal(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_uint_radix(char const*, int, void*, int)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulong(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulong_cradix(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulong_hex(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulonglong(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulonglong_cradix(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulonglong_hex(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulonglong_octal(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulonglong_radix(char const*, int, void*, int)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulong_octal(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ulong_radix(char const*, int, void*, int)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ushort(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ushort_cradix(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ushort_hex(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ushort_octal(char const*, int, void*)@Base" 7.7
+ (c++)"pcrecpp::Arg::parse_ushort_radix(char const*, int, void*, int)@Base" 7.7
+ (c++)"pcrecpp::RE::Cleanup()@Base" 7.7
+ (c++)"pcrecpp::RE::Compile(pcrecpp::RE::Anchor)@Base" 7.7
+ (c++)"pcrecpp::RE::Consume(pcrecpp::StringPiece*, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&) const@Base" 7.7
+ (c++)"pcrecpp::Scanner::Consume(pcrecpp::RE const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&)@Base" 7.7
+ (c++)"pcrecpp::RE::DoMatchImpl(pcrecpp::StringPiece const&, pcrecpp::RE::Anchor, int*, pcrecpp::Arg const* const*, int, int*, int) const@Base" 7.7
+ (c++)"pcrecpp::RE::DoMatch(pcrecpp::StringPiece const&, pcrecpp::RE::Anchor, int*, pcrecpp::Arg const* const*, int) const@Base" 7.7
+ (c++)"pcrecpp::RE::Extract(pcrecpp::StringPiece const&, pcrecpp::StringPiece const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const@Base" 7.7
+ (c++)"pcrecpp::RE::FindAndConsume(pcrecpp::StringPiece*, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&) const@Base" 7.7
+ (c++)"pcrecpp::RE::FullMatch(pcrecpp::StringPiece const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&) const@Base" 7.7
+ (c++)"pcrecpp::RE::GlobalReplace(pcrecpp::StringPiece const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const@Base" 7.7
+ (c++)"pcrecpp::RE::Init(char const*, pcrecpp::RE_Options const*)@Base" 7.7
+ (c++)"pcrecpp::RE::Init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pcrecpp::RE_Options const*)@Base" 7.7
+ (c++)"pcrecpp::RE::no_arg@Base" 7.7
+ (c++)"pcrecpp::RE::NumberOfCapturingGroups() const@Base" 7.7
+ (c++)"pcrecpp::RE::PartialMatch(pcrecpp::StringPiece const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&) const@Base" 7.7
+ (c++)"pcrecpp::RE::QuoteMeta[abi:cxx11](pcrecpp::StringPiece const&)@Base" 7.7
+ (c++)"pcrecpp::RE::~RE()@Base" 7.7
+ (c++)"pcrecpp::RE::~RE()@Base" 7.7
+ (c++)"pcrecpp::RE::Replace(pcrecpp::StringPiece const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const@Base" 7.7
+ (c++)"pcrecpp::RE::Rewrite(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, pcrecpp::StringPiece const&, pcrecpp::StringPiece const&, int*, int) const@Base" 7.7
+ (c++)"pcrecpp::RE::TryMatch(pcrecpp::StringPiece const&, int, pcrecpp::RE::Anchor, bool, int*, int) const@Base" 7.7
+ (c++)"pcrecpp::Scanner::ConsumeSkip()@Base" 7.7
+ (c++)"pcrecpp::Scanner::DisableSkip()@Base" 7.7
+ (c++)"pcrecpp::Scanner::EnableSkip()@Base" 7.7
+ (c++)"pcrecpp::Scanner::GetComments(int, int, std::vector<pcrecpp::StringPiece, std::allocator<pcrecpp::StringPiece> >*)@Base" 7.7
+ (c++)"pcrecpp::Scanner::GetNextComments(std::vector<pcrecpp::StringPiece, std::allocator<pcrecpp::StringPiece> >*)@Base" 7.7
+ (c++)"pcrecpp::Scanner::LineNumber() const@Base" 7.7
+ (c++)"pcrecpp::Scanner::LookingAt(pcrecpp::RE const&) const@Base" 7.7
+ (c++)"pcrecpp::Scanner::Offset() const@Base" 7.7
+ (c++)"pcrecpp::Scanner::~Scanner()@Base" 7.7
+ (c++)"pcrecpp::Scanner::~Scanner()@Base" 7.7
+ (c++)"pcrecpp::Scanner::Scanner()@Base" 7.7
+ (c++)"pcrecpp::Scanner::Scanner()@Base" 7.7
+ (c++)"pcrecpp::Scanner::Scanner(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 7.7
+ (c++)"pcrecpp::Scanner::Scanner(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 7.7
+ (c++)"pcrecpp::Scanner::SetSkipExpression(char const*)@Base" 7.7
+ (c++)"pcrecpp::Scanner::Skip(char const*)@Base" 7.7
+ (c++)"std::vector<pcrecpp::StringPiece, std::allocator<pcrecpp::StringPiece> >::_M_insert_aux(__gnu_cxx::__normal_iterator<pcrecpp::StringPiece*, std::vector<pcrecpp::StringPiece, std::allocator<pcrecpp::StringPiece> > >, pcrecpp::StringPiece const&)@Base" 7.7
diff --git a/debian/rules b/debian/rules
index 9cd4df8..fa177e9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -113,7 +113,7 @@ binary-arch: build install
dh_compress -a
dh_fixperms -a
dh_makeshlibs -plibpcre3 --add-udeb="libpcre3-udeb" -V 'libpcre3 (>= 1:8.35)'
- dh_makeshlibs -plibpcrecpp0 -V 'libpcrecpp0 (>= 7.7)'
+ dh_makeshlibs -plibpcrecpp0v5 -V 'libpcrecpp0v5 (>= 7.7)' -- -c4
dh_makeshlibs -plibpcre16-3 -plibpcre32-3
dh_installdeb -a
# dh_perl -a