From 463417cabaf9dc10d92e6f4a239d2dbf53840041 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 9 Mar 2011 18:12:18 +0000 Subject: [PATCH] Fix bug that prevents turning off multiple Perl-modifiers at once. Fixes #5223. [SVN r69775] --- include/boost/regex/v4/basic_regex_parser.hpp | 2 ++ test/regress/test_perl_ex.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 4dacfc6f..0192a9f1 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -2711,6 +2711,8 @@ regex_constants::syntax_option_type basic_regex_parser::parse_opt } } while(!breakout); + + breakout = false; if(*m_position == static_cast('-')) { diff --git a/test/regress/test_perl_ex.cpp b/test/regress/test_perl_ex.cpp index f96be261..3307d314 100644 --- a/test/regress/test_perl_ex.cpp +++ b/test/regress/test_perl_ex.cpp @@ -337,6 +337,7 @@ void test_options2() TEST_REGEX_SEARCH("(?s).", perl, "\n", match_default|match_not_dot_newline, make_array(0, 1, -2, -2)); TEST_REGEX_SEARCH("(?-s).", perl, "\n", match_default, make_array(-2, -2)); TEST_REGEX_SEARCH("(?-s).", perl, "\n", match_default|match_not_dot_newline, make_array(-2, -2)); + TEST_REGEX_SEARCH("(?-xism)d", perl, "d", match_default, make_array(0, 1, -2, -2)); test_options3(); }