From 5a6bc29d7ccd68af63fcf2ad0bc6c2554fd889ce Mon Sep 17 00:00:00 2001
From: John Maddock
-
+
Test
Programs
@@ -107,7 +107,7 @@
Files: captures_test.cpp.
<boost/regex/user.hpp>
.
@@ -36,7 +36,7 @@ Report on C++ Library Extensions.
@@ -62,7 +62,7 @@ (??{code}) Not implementable in a compiled strongly typed language.
@@ -82,7 +82,7 @@ a custom traits class.
diff --git a/doc/html/boost_regex/captures.html b/doc/html/boost_regex/captures.html index 613c1b0a..1b9c755b 100644 --- a/doc/html/boost_regex/captures.html +++ b/doc/html/boost_regex/captures.html @@ -35,7 +35,7 @@ accessed.
@@ -218,7 +218,7 @@ output stream.
@@ -231,7 +231,7 @@
you can determine which sub-expressions matched by accessing the sub_match::matched
data member.
diff --git a/doc/html/boost_regex/format/boost_format_syntax.html b/doc/html/boost_regex/format/boost_format_syntax.html index a98f3691..a927f24b 100644 --- a/doc/html/boost_regex/format/boost_format_syntax.html +++ b/doc/html/boost_regex/format/boost_format_syntax.html @@ -32,7 +32,7 @@ '$', '\', '(', ')', '?', and ':'.
@@ -40,7 +40,7 @@ you want a to output literal parenthesis.
@@ -79,7 +79,7 @@ ?{NAME}true-expression:false-expression
@@ -58,7 +58,7 @@ started guide for more information.
@@ -302,7 +302,7 @@ see the config library documentation.
@@ -347,7 +347,7 @@ will build v9 variants of the regex library named libboost_regex_v9.a etc.
#include <boost/pattern_except.hpp> @@ -54,7 +54,7 @@ } // namespace boost
regex_error(const std::string& s, regex_constants::error_type err, std::ptrdiff_t pos); diff --git a/doc/html/boost_regex/ref/basic_regex.html b/doc/html/boost_regex/ref/basic_regex.html index dabf17a1..eb7cb84c 100644 --- a/doc/html/boost_regex/ref/basic_regex.html +++ b/doc/html/boost_regex/ref/basic_regex.html @@ -27,7 +27,7 @@ basic_regex- + Synopsis
#include <boost/regex.hpp> @@ -244,7 +244,7 @@ } // namespace boost- + Description
@@ -327,7 +327,7 @@
basic_regex
.-Table 1. basic_regex default construction postconditions
+Table 1. basic_regex default construction postconditions
@@ -407,7 +407,7 @@ flags specified in f. -Table 2. Postconditions for basic_regex construction
+Table 2. Postconditions for basic_regex construction
@@ -512,7 +512,7 @@ specified in f. -Table 3. Postconditions for basic_regex construction
+Table 3. Postconditions for basic_regex construction
@@ -616,7 +616,7 @@ according the option flags specified in f. -Table 4. Postconditions for basic_regex construction
+Table 4. Postconditions for basic_regex construction
@@ -727,7 +727,7 @@ flags specified in f. -Table 5. Postconditions for basic_regex construction
+Table 5. Postconditions for basic_regex construction
@@ -829,7 +829,7 @@ flags specified in f. -Table 6. Postconditions for basic_regex construction
+Table 6. Postconditions for basic_regex construction
@@ -1043,7 +1043,7 @@ in f. -Table 7. Postconditions for basic_regex::assign
+Table 7. Postconditions for basic_regex::assign
diff --git a/doc/html/boost_regex/ref/concepts/traits_concept.html b/doc/html/boost_regex/ref/concepts/traits_concept.html index c517de45..1dcd410c 100644 --- a/doc/html/boost_regex/ref/concepts/traits_concept.html +++ b/doc/html/boost_regex/ref/concepts/traits_concept.html @@ -34,7 +34,7 @@ Boost-specific enhanced interface. - + Minimal requirements.
@@ -381,7 +381,7 @@- + Additional Optional Requirements
diff --git a/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html b/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html index 7c3b91e6..fab2dea1 100644 --- a/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html +++ b/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html @@ -34,7 +34,7 @@ previous version of Boost.Regex and will not be further updated:- + Algorithm regex_format
diff --git a/doc/html/boost_regex/ref/error_type.html b/doc/html/boost_regex/ref/error_type.html index 260f3c72..26ce70d1 100644 --- a/doc/html/boost_regex/ref/error_type.html +++ b/doc/html/boost_regex/ref/error_type.html @@ -27,7 +27,7 @@ error_type- + Synopsis
@@ -57,7 +57,7 @@ } // namespace boost
- + Description
diff --git a/doc/html/boost_regex/ref/match_flag_type.html b/doc/html/boost_regex/ref/match_flag_type.html index a7152b4d..941bdcb9 100644 --- a/doc/html/boost_regex/ref/match_flag_type.html +++ b/doc/html/boost_regex/ref/match_flag_type.html @@ -69,7 +69,7 @@ } // namespace boost
- + Description
diff --git a/doc/html/boost_regex/ref/match_results.html b/doc/html/boost_regex/ref/match_results.html index 8d065dae..2d1c346c 100644 --- a/doc/html/boost_regex/ref/match_results.html +++ b/doc/html/boost_regex/ref/match_results.html @@ -27,7 +27,7 @@ match_results
- + Synopsis
#include <boost/regex.hpp> @@ -166,7 +166,7 @@ match_results<BidirectionalIterator, Allocator>& m2);- + Description
diff --git a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html index 0a7705fc..8a5e4325 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html @@ -43,7 +43,7 @@ on to the "real" algorithm.
- + u32regex_match
- + u32regex_search
- + u32regex_replace
diff --git a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html index b179c8e4..f1fd4fed 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html @@ -28,7 +28,7 @@ Unicode Aware Regex Iterators
- + u32regex_iterator
@@ -126,7 +126,7 @@ Provided of course that the input is encoded as UTF-8.
- + u32regex_token_iterator
diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html index d62ab666..4a6b3297 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html @@ -34,7 +34,7 @@ here they are anyway:
- + regex_match
- + regex_match (second overload)
@@ -110,7 +110,7 @@ }- + regex_search
- + regex_search (second overload)
@@ -164,7 +164,7 @@ + s.GetLength(), e, f);- + regex_replace
diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html index 74043549..a2df7d3d 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html @@ -32,7 +32,7 @@ an MFC/ATL string to a
regex_iterator
orregex_token_iterator
:- + regex_iterator creation helper
@@ -68,7 +68,7 @@ }- + regex_token_iterator creation helpers
diff --git a/doc/html/boost_regex/ref/posix.html b/doc/html/boost_regex/ref/posix.html index a7456c78..d8b73499 100644 --- a/doc/html/boost_regex/ref/posix.html +++ b/doc/html/boost_regex/ref/posix.html @@ -165,7 +165,7 @@
- + regcomp
- + regerror
- + regexec
- + regfree
diff --git a/doc/html/boost_regex/ref/regex_iterator.html b/doc/html/boost_regex/ref/regex_iterator.html index 33a69671..9930174b 100644 --- a/doc/html/boost_regex/ref/regex_iterator.html +++ b/doc/html/boost_regex/ref/regex_iterator.html @@ -78,7 +78,7 @@ regex_constants::match_flag_type m = regex_constants::match_default);
- + Description
@@ -436,7 +436,7 @@ m.
- + Examples
diff --git a/doc/html/boost_regex/ref/regex_match.html b/doc/html/boost_regex/ref/regex_match.html index 7647ea87..5f432601 100644 --- a/doc/html/boost_regex/ref/regex_match.html +++ b/doc/html/boost_regex/ref/regex_match.html @@ -80,7 +80,7 @@ match_flag_type flags = match_default);
- + Description
template <class BidirectionalIterator, class Allocator, class charT, class traits> @@ -360,7 +360,7 @@ Effects: Returns the result ofregex_match(s.begin(), s.end(), e, flags)
.- + Examples
diff --git a/doc/html/boost_regex/ref/regex_replace.html b/doc/html/boost_regex/ref/regex_replace.html index 2e4551f9..650c1178 100644 --- a/doc/html/boost_regex/ref/regex_replace.html +++ b/doc/html/boost_regex/ref/regex_replace.html @@ -53,7 +53,7 @@ match_flag_type flags = match_default);
- + Description
template <class OutputIterator, class BidirectionalIterator, class traits, class charT> @@ -163,7 +163,7 @@ and then returnsresult
.- + Examples
diff --git a/doc/html/boost_regex/ref/regex_search.html b/doc/html/boost_regex/ref/regex_search.html index 4017b942..282023dd 100644 --- a/doc/html/boost_regex/ref/regex_search.html +++ b/doc/html/boost_regex/ref/regex_search.html @@ -73,7 +73,7 @@ match_flag_type flags = match_default);
- + Description
template <class BidirectionalIterator, class Allocator, class charT, class traits> @@ -355,7 +355,7 @@ Effects: Returns the result ofregex_search(s.begin(), s.end(), e, flags)
.- + Examples
diff --git a/doc/html/boost_regex/ref/regex_token_iterator.html b/doc/html/boost_regex/ref/regex_token_iterator.html index d837fb03..864905fd 100644 --- a/doc/html/boost_regex/ref/regex_token_iterator.html +++ b/doc/html/boost_regex/ref/regex_token_iterator.html @@ -136,7 +136,7 @@ regex_constants::match_flag_type m = regex_constants::match_default);
- + Description
@@ -383,7 +383,7 @@ m.
- + Examples
diff --git a/doc/html/boost_regex/ref/regex_traits.html b/doc/html/boost_regex/ref/regex_traits.html index 43fc043e..eeb38e8e 100644 --- a/doc/html/boost_regex/ref/regex_traits.html +++ b/doc/html/boost_regex/ref/regex_traits.html @@ -46,7 +46,7 @@ } // namespace boost
- + Description
diff --git a/doc/html/boost_regex/ref/sub_match.html b/doc/html/boost_regex/ref/sub_match.html index 4360bb0d..becc2a20 100644 --- a/doc/html/boost_regex/ref/sub_match.html +++ b/doc/html/boost_regex/ref/sub_match.html @@ -329,11 +329,11 @@ } // namespace boost
- + Description
- + Members
- + sub_match non-member operators
@@ -1008,7 +1008,7 @@ + m2.str().- + Stream inserter
diff --git a/doc/html/boost_regex/syntax/basic_extended.html b/doc/html/boost_regex/syntax/basic_extended.html index afaca7c9..787c411f 100644 --- a/doc/html/boost_regex/syntax/basic_extended.html +++ b/doc/html/boost_regex/syntax/basic_extended.html @@ -28,7 +28,7 @@ Expression Syntax
- + Synopsis
- + POSIX Extended Syntax
@@ -56,7 +56,7 @@.[{()\*+?|^$- + Wildcard:
- + Anchors:
@@ -86,7 +86,7 @@ of an expression, or the last character of a sub-expression.
- + Marked sub-expressions:
@@ -98,7 +98,7 @@ to by a back-reference.- + Repeats:
@@ -184,7 +184,7 @@ cab operator to be applied to.
- + Back references:
@@ -214,7 +214,7 @@ cab
- + Alternation
@@ -227,7 +227,7 @@ cab will match either of "abd" or "abef".
- + Character sets:
@@ -240,7 +240,7 @@ cab A bracket expression may contain any combination of the following:- + Single characters:
@@ -249,7 +249,7 @@ cab or 'c'.- + Character ranges:
@@ -265,7 +265,7 @@ cab the code points of the characters only.- + Negation:
@@ -274,7 +274,7 @@ cab range
a-c
.- + Character classes:
@@ -284,7 +284,7 @@ cab character class names.- + Collating Elements:
@@ -312,7 +312,7 @@ cab matches a NUL character.- + Equivalence classes:
@@ -329,7 +329,7 @@ cab or even all locales on one platform.- + Combinations:
@@ -337,7 +337,7 @@ cab
[[:digit:]a-c[.NUL.]]
.- + Escapes
@@ -363,7 +363,7 @@ cab extensions are also supported by Boost.Regex:
- + Escapes matching a specific character
@@ -552,7 +552,7 @@ cab- + "Single character" character classes:
@@ -706,7 +706,7 @@ cab- + Character Properties
@@ -813,7 +813,7 @@ cab matches any "digit" character, as does\p{digit}
.- + Word Boundaries
@@ -888,7 +888,7 @@ cab
- + Buffer boundaries
@@ -979,7 +979,7 @@ cab- + Continuation Escape
@@ -991,7 +991,7 @@ cab match to start where the last one ended.- + Quoting escape
@@ -1005,7 +1005,7 @@ cab \*+aaa- + Unicode escapes
@@ -1056,7 +1056,7 @@ cab- + Any other escape
@@ -1065,7 +1065,7 @@ cab \@ matches a literal '@'.- + Operator precedence
@@ -1101,7 +1101,7 @@ cab- + What Gets Matched
@@ -1111,11 +1111,11 @@ cab rule.- + Variations
- + Egrep
@@ -1136,7 +1136,7 @@ cab used with the -E option.
- + awk
@@ -1150,7 +1150,7 @@ cab these by default anyway.
- + Options
@@ -1163,7 +1163,7 @@ cab modify how the case and locale sensitivity are to be applied.
- + References
diff --git a/doc/html/boost_regex/syntax/basic_syntax.html b/doc/html/boost_regex/syntax/basic_syntax.html index 47bc62d0..eeb9ef51 100644 --- a/doc/html/boost_regex/syntax/basic_syntax.html +++ b/doc/html/boost_regex/syntax/basic_syntax.html @@ -28,7 +28,7 @@ Expression Syntax
- + Synopsis
- + POSIX Basic Syntax
@@ -55,7 +55,7 @@.[\*^$- + Wildcard:
- + Anchors:
@@ -85,7 +85,7 @@ of an expression, or the last character of a sub-expression.
- + Marked sub-expressions:
@@ -97,7 +97,7 @@ by a back-reference.- + Repeats:
@@ -155,7 +155,7 @@ aaaa to.
- + Back references:
@@ -173,7 +173,7 @@ aaaa
aaabba- + Character sets:
@@ -186,7 +186,7 @@ aaaa A bracket expression may contain any combination of the following:- + Single characters:
@@ -195,7 +195,7 @@ aaaa or 'c'.- + Character ranges:
@@ -211,7 +211,7 @@ aaaa of the characters only.- + Negation:
@@ -220,7 +220,7 @@ aaaa range a-c.
- + Character classes:
@@ -230,7 +230,7 @@ aaaa character class names.- + Collating Elements:
@@ -259,7 +259,7 @@ aaaa element names.- + Equivalence classes:
@@ -276,7 +276,7 @@ aaaa or even all locales on one platform.- + Combinations:
@@ -284,7 +284,7 @@ aaaa
[[:digit:]a-c[.NUL.]].
- + Escapes
@@ -299,7 +299,7 @@ aaaa will match either a literal '\' or a '^'.
- + What Gets Matched
@@ -309,13 +309,13 @@ aaaa rule.- + Variations
- + Grep
@@ -333,7 +333,7 @@ aaaa As its name suggests, this behavior is consistent with the Unix utility grep.
- + emacs
@@ -613,7 +613,7 @@ aaaa leftmost-longest rule.
- + Options
@@ -627,7 +627,7 @@ aaaa options modify how the case and locale sensitivity are to be applied.
- + References
diff --git a/doc/html/boost_regex/syntax/perl_syntax.html b/doc/html/boost_regex/syntax/perl_syntax.html index f257a5d0..46aa35e1 100644 --- a/doc/html/boost_regex/syntax/perl_syntax.html +++ b/doc/html/boost_regex/syntax/perl_syntax.html @@ -28,7 +28,7 @@ Syntax
- + Synopsis
@@ -43,7 +43,7 @@ boost::regex e2(my_expression, boost::regex::perl|boost::regex::icase);
.[{()\*+?|^$
@@ -83,7 +83,7 @@ A '$' character shall match the end of a line.
@@ -188,7 +188,7 @@ to be applied to.
@@ -360,7 +360,7 @@ named "two".
@@ -387,7 +387,7 @@
(?:abc)??
has exactly the same effect.
@@ -399,7 +399,7 @@ A bracket expression may contain any combination of the following:
@@ -407,7 +407,7 @@ 'b', or 'c'.
@@ -430,7 +430,7 @@
matches any character that is not in the range a-c
.
\0
character.
@@ -500,7 +500,7 @@
[[:digit:]a-c[.NUL.]]
.
\p{digit}
.
@@ -1021,7 +1021,7 @@
\B
Matches only when not at a word boundary.
@@ -1046,7 +1046,7 @@
to the regular expression \n*\z
@@ -1081,7 +1081,7 @@ followed by a sequence of zero or more combining characters.
(?>\x0D\x0A?|[\x0A-\x0C\x85\x{2028}\x{2029}])
.
(?
.
match_results
member functions.
(?# ... )
is treated as a comment, it's contents are ignored.
@@ -1166,7 +1166,7 @@ pattern only.
@@ -1197,7 +1197,7 @@ # 1 2 2 3 2 3 4
@@ -1220,7 +1220,7 @@ could be used to validate the password.
@@ -1234,7 +1234,7 @@ (pattern must be of fixed length).
+ (?N) (?-N) (?+N)
+ (?R) (?0)
+
+ (?R)
and (?0)
recurse to the start
+ of the entire pattern.
+
+ (?N)
executes sub-expression N
+ recursively, for example (?2)
will recurse to sub-expression
+ 2.
+
+ (?-N)
and (?+N)
+ are relative recursions, so for example (?-1)
recurses
+ to the last sub-expression to be declared, and (?+1)
recurses
+ to the next sub-expression to be declared.
+
- condition may be either a forward lookahead assert, - or the index of a marked sub-expression (the condition becomes true if the - sub-expression has been matched). + condition may be either: a forward lookahead assert, + the index of a marked sub-expression (the condition becomes true if the sub-expression + has been matched), or an index of a recursion (the condition become true + if we are executing directly inside the specified recursion).
++ Here is a summary of the possible predicates: +
+(?(?=assert)yes-pattern|no-pattern)
Executes yes-pattern
+ if the forward look-ahead assert matches, otherwise executes no-pattern.
+ (?(?!assert)yes-pattern|no-pattern)
Executes yes-pattern
+ if the forward look-ahead assert does not match, otherwise executes no-pattern.
+ (?(R)yes-pattern|no-pattern)
Executes yes-pattern
+ if we are executing inside a recursion, otherwise executes no-pattern.
+ (?(RN)yes-pattern|no-pattern)
Executes
+ yes-pattern if we are executing inside a recursion
+ to sub-expression N, otherwise executes no-pattern.
+
@@ -1485,7 +1532,7 @@
and JScript
are all synonyms for perl
.
@@ -1497,7 +1544,7 @@ are to be applied.
no_mod_s
.
diff --git a/doc/html/boost_regex/unicode.html b/doc/html/boost_regex/unicode.html index 84b3eb20..5abbf2a0 100644 --- a/doc/html/boost_regex/unicode.html +++ b/doc/html/boost_regex/unicode.html @@ -30,7 +30,7 @@ There are two ways to use Boost.Regex with Unicode strings:
Copyright © 1998 -2007 John Maddock
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -196,7 +196,7 @@Last revised: May 13, 2009 at 09:14:16 GMT |
+Last revised: July 16, 2009 at 15:54:11 GMT |
qrs)123)", match_default, make_array(0, 20, 1, 19, 16, 19, -1, -1, -2, -2)); + TEST_REGEX_SEARCH("\\( ( ( (?>[^()]+) | ((?0)) )* ) \\) ", perl|mod_x, "(ab(cd)ef)", match_default, make_array(0, 10, 1, 9, 7, 9, 3, 7, -2, -2)); + TEST_REGEX_SEARCH("\\( ( ( (?>[^()]+) | ((?0)) )* ) \\) ", perl|mod_x, "(ab(cd(ef)gh)ij)", match_default, make_array(0, 16, 1, 15, 13, 15, 3, 13, -2, -2)); + // Again with (?R): + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "(abcd)", match_default, make_array(0, 6, -2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "(abcd)xyz", match_default, make_array(0, 6, -2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "xyz(abcd)", match_default, make_array(3, 9, -2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "(ab(xy)cd)pqr", match_default, make_array(0, 10, -2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "(ab(xycd)pqr", match_default, make_array(3, 9, -2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "() abc ()", match_default, make_array(0, 2, -2, 7, 9, -2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "12(abcde(fsh)xyz(foo(bar))lmno)89", match_default, make_array(2, 31, -2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "abcd", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "abcd)", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\((?:(?>[^()]+)|(?R))*\\)", perl, "(abcd", match_default, make_array(-2, -2)); + + TEST_REGEX_SEARCH("\\( ( (?>[^()]+) | (?R) )* \\) ", perl|mod_x, "(ab(xy)cd)pqr", match_default, make_array(0, 10, 7, 9, -2, -2)); + TEST_REGEX_SEARCH("\\( ( (?>[^()]+) | (?R) )* \\) ", perl|mod_x, "1(abcd)(x(y)z)pqr", match_default, make_array(1, 7, 2, 6, -2, 7, 14, 12, 13, -2, -2)); + TEST_REGEX_SEARCH("\\( (?: (?>[^()]+) | (?R) ) \\) ", perl|mod_x, "(abcd)", match_default, make_array(0, 6, -2, -2)); + TEST_REGEX_SEARCH("\\( (?: (?>[^()]+) | (?R) ) \\) ", perl|mod_x, "(ab(xy)cd)", match_default, make_array(3, 7, -2, -2)); + TEST_REGEX_SEARCH("\\( (?: (?>[^()]+) | (?R) ) \\) ", perl|mod_x, "(a(b(c)d)e)", match_default, make_array(4, 7, -2, -2)); + TEST_REGEX_SEARCH("\\( (?: (?>[^()]+) | (?R) ) \\) ", perl|mod_x, "((ab))", match_default, make_array(0, 6, -2, -2)); + TEST_REGEX_SEARCH("\\( (?: (?>[^()]+) | (?R) ) \\) ", perl|mod_x, "()", match_default, make_array(-2, -2)); + TEST_REGEX_SEARCH("\\( (?: (?>[^()]+) | (?R) )? \\) ", perl|mod_x, "()", match_default, make_array(0, 2, -2, -2)); + TEST_REGEX_SEARCH("\\( (?: (?>[^()]+) | (?R) )? \\) ", perl|mod_x, "12(abcde(fsh)xyz(foo(bar))lmno)89", match_default, make_array(8, 13, -2, 20, 25, -2, -2)); + TEST_REGEX_SEARCH("\\( ( (?>[^()]+) | (?R) )* \\) ", perl|mod_x, "(ab(xy)cd)", match_default, make_array(0, 10, 7, 9, -2, -2)); + TEST_REGEX_SEARCH("\\( ( ( (?>[^()]+) | (?R) )* ) \\) ", perl|mod_x, "(ab(xy)cd)", match_default, make_array(0, 10, 1, 9, 7, 9, -2, -2)); + TEST_REGEX_SEARCH("\\( (123)? ( ( (?>[^()]+) | (?R) )* ) \\) ", perl|mod_x, "(ab(xy)cd)", match_default, make_array(0, 10, -1, -1, 1, 9, 7, 9, -2, -2)); + TEST_REGEX_SEARCH("\\( (123)? ( ( (?>[^()]+) | (?R) )* ) \\) ", perl|mod_x, "(123ab(xy)cd)", match_default, make_array(0, 13, 1, 4, 4, 12, 10, 12, -2, -2)); + TEST_REGEX_SEARCH("\\( ( (123)? ( (?>[^()]+) | (?R) )* ) \\) ", perl|mod_x, "(ab(xy)cd)", match_default, make_array(0, 10, 1, 9, -1, -1, 7, 9, -2, -2)); + TEST_REGEX_SEARCH("\\( ( (123)? ( (?>[^()]+) | (?R) )* ) \\) ", perl|mod_x, "(123ab(xy)cd)", match_default, make_array(0, 13, 1, 12, 1, 4, 10, 12, -2, -2)); + TEST_REGEX_SEARCH("\\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \\) ", perl|mod_x, "(ab(xy)cd)", match_default, make_array(0, 10, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 7, 9, -2, -2)); + TEST_REGEX_SEARCH("\\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \\) ", perl|mod_x, "(abcd(xyz
qrs)123)", match_default, make_array(0, 20, 1, 19, 16, 19, -1, -1, -2, -2));
+ TEST_REGEX_SEARCH("\\( ( ( (?>[^()]+) | ((?R)) )* ) \\) ", perl|mod_x, "(ab(cd)ef)", match_default, make_array(0, 10, 1, 9, 7, 9, 3, 7, -2, -2));
+ TEST_REGEX_SEARCH("\\( ( ( (?>[^()]+) | ((?R)) )* ) \\) ", perl|mod_x, "(ab(cd(ef)gh)ij)", match_default, make_array(0, 16, 1, 15, 13, 15, 3, 13, -2, -2));
+ // And some extra cases:
+ TEST_REGEX_SEARCH("x(ab|(bc|(de|(?R))))", perl|mod_x, "xab", match_default, make_array(0, 3, 1, 3, -1, -1, -1, -1, -2, -2));
+ TEST_REGEX_SEARCH("x(ab|(bc|(de|(?R))))", perl|mod_x, "xbc", match_default, make_array(0, 3, 1, 3, 1, 3, -1, -1, -2, -2));
+ TEST_REGEX_SEARCH("x(ab|(bc|(de|(?R))))", perl|mod_x, "xde", match_default, make_array(0, 3, 1, 3, 1, 3, 1, 3, -2, -2));
+ TEST_REGEX_SEARCH("x(ab|(bc|(de|(?R))))", perl|mod_x, "xxab", match_default, make_array(0, 4, 1, 4, 1, 4, 1, 4, -2, -2));
+ TEST_REGEX_SEARCH("x(ab|(bc|(de|(?R))))", perl|mod_x, "xxxab", match_default, make_array(0, 5, 1, 5, 1, 5, 1, 5, -2, -2));
+ TEST_REGEX_SEARCH("x(ab|(bc|(de|(?R))))", perl|mod_x, "xyab", match_default, make_array(-2, -2));
+ TEST_REGEX_SEARCH("[^()]*(?:\\((?R)\\)[^()]*)*", perl|mod_x, "(this(and)that)", match_default, make_array(0, 15, -2, 15, 15, -2, -2));
+ TEST_REGEX_SEARCH("[^()]*(?:\\((?R)\\)[^()]*)*", perl|mod_x, "(this(and)that)stuff", match_default, make_array(0, 20, -2, 20, 20, -2, -2));
+ TEST_REGEX_SEARCH("[^()]*(?:\\((?>(?R))\\)[^()]*)*", perl|mod_x, "(this(and)that)", match_default, make_array(0, 15, -2, 15, 15, -2, -2));
+
+ // More complex cases involving (?(R):
+ TEST_REGEX_SEARCH("< (?: (?(R) \\d++ | [^<>]*+) | (?R)) * >", perl|mod_x, "<>", match_default, make_array(0, 2, -2, -2));
+ TEST_REGEX_SEARCH("< (?: (?(R) \\d++ | [^<>]*+) | (?R)) * >", perl|mod_x, "