forked from boostorg/regex
Fix for bug in recursive expressions, see http://lists.boost.org/Archives/boost/2015/03/221018.php
This commit is contained in:
@ -918,6 +918,7 @@ void test_recursion()
|
||||
TEST_REGEX_SEARCH("namespace\\s+(\\w+)\\s+(\\{(?:[^{}]*(?:(?2)[^{}]*)*)?\\})", perl, "namespace one { namespace two { int foo(); } }", match_default, make_array(0, 46, 10, 13, 14, 46, -2, -2));
|
||||
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));
|
||||
|
||||
// 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