Skip to content

Commit

Permalink
force match to start at start of text while parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianPommerening authored and jendrikseipp committed Oct 6, 2023
1 parent 358c7e7 commit 50cdaa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/search/parser/lexical_analyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ TokenStream split_tokens(const string &text) {
for (const auto &type_and_expression : token_type_expressions) {
TokenType token_type = type_and_expression.first;
const regex &expression = type_and_expression.second;
if (regex_search(start, end, match, expression)) {
if (regex_search(start, end, match, expression, regex_constants::match_continuous)) {
tokens.push_back({utils::tolower(match[1]), token_type});
start += match[0].length();
has_match = true;
Expand Down

0 comments on commit 50cdaa7

Please sign in to comment.