diff --git a/src/regex_impl.cc b/src/regex_impl.cc index ca1f44cc..957f993b 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -769,6 +769,9 @@ private: if (compute_start_chars(m_parsed_regex.ast, accepted, rejected)) return nullptr; + if (not contains(accepted, false) and not contains(rejected, true)) + return nullptr; + auto start_chars = std::make_unique(); for (int i = 0; i < 256; ++i) start_chars->map[i] = accepted[i] and not rejected[i];