forked from boostorg/regex
Fix recursive expressions where the recursion appears more than once.
Fixes https://github.com/boostorg/regex/issues/87. Also fix some more msvc warnings.
This commit is contained in:
@ -935,6 +935,7 @@ void test_recursion()
|
||||
TEST_REGEX_SEARCH("namespace\\s+(\\w+)\\s+(\\{(?:[^{}]*(?:(?2)[^{}]*)*)?\\})", perl, "namespace one { namespace two { int foo(){} } { {{{ } } } } {}}", match_default, make_array(0, 64, 10, 13, 14, 64, -2, -2));
|
||||
TEST_INVALID_REGEX("((?1)|a)", perl);
|
||||
TEST_REGEX_SEARCH("a(?0)?", perl, "aaaaa", match_default, make_array(0, 5, -2, -2));
|
||||
TEST_REGEX_SEARCH("((?(DEFINE)(?'a'A)(?'b'(?&a)?(?&a)))(?&b)?)", perl, "AA", match_default, make_array(0, 2, 0, 2, -1, -1, -2, 2, 2, 2, 2, -1, -1, -2, -2));
|
||||
|
||||
// Recursion to a named sub with a name that is used multiple times:
|
||||
TEST_REGEX_SEARCH("(?:(?<A>a+)|(?<A>b+))\\.(?&A)", perl, "aaaa.aa", match_default, make_array(0, 7, 0, 4, -1, -1, -2, -2));
|
||||
|
Reference in New Issue
Block a user