diff --git a/src/regex_selector.cc b/src/regex_selector.cc index d8b409a3..dcdae64c 100644 --- a/src/regex_selector.cc +++ b/src/regex_selector.cc @@ -14,12 +14,9 @@ Selection RegexSelector::operator()(const BufferIterator& cursor) const try { - while (not line_end.is_end() and *line_end != '\n') - ++line_end; - boost::match_results matches; - if (boost::regex_search(cursor, line_end, matches, m_regex)) + if (boost::regex_search(cursor, cursor.buffer().end(), matches, m_regex, boost::match_nosubs)) return Selection(matches.begin()->first, matches.begin()->second); } catch (boost::regex_error& err)