gui, shared: Fix and simplify word extraction regexes

They did not work for chars like '-', causing errors.

We can actually just extract non-space chars for these cases.
This commit is contained in:
2022-08-06 08:57:37 +02:00
parent e8b89b77ab
commit 00abc6bc1b
2 changed files with 3 additions and 4 deletions

View File

@ -669,7 +669,7 @@ void MainWindow::makePreviews(int page)
processedPdfPreviews = 0;
QVector<QString> wordsToHighlight;
QRegularExpression extractor(R"#("([^"]*)"|((\p{L}|\p{N})+))#");
QRegularExpression extractor(R"#("([^"]*)"|([^\s]+))#");
for(const Token &token : this->contentSearchQuery.getTokens())
{
if(token.type == FILTER_CONTENT_CONTAINS)