diff --git a/include/boost/regex/detail/regex_compile.hpp b/include/boost/regex/detail/regex_compile.hpp index 5ec6a262..a8613433 100644 --- a/include/boost/regex/detail/regex_compile.hpp +++ b/include/boost/regex/detail/regex_compile.hpp @@ -416,6 +416,17 @@ void BOOST_REGEX_CALL reg_expression::compile_maps() record->can_be_null = 0; compile_map(record->next.p, static_cast(record)->_map, &(record->can_be_null), re_detail::mask_take, static_cast(record)->alt.p); compile_map(static_cast(record)->alt.p, static_cast(record)->_map, &(record->can_be_null), re_detail::mask_skip); + if(record->type == re_detail::syntax_element_rep) + { + re_detail::re_repeat* rep = static_cast(record); + // set whether this is a singleton repeat or not: + if(rep->next.p->next.p->next.p == rep->alt.p) + { + rep->singleton = true; + } + else + rep->singleton = false; + } } else {