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(); }