From d47afc793603fba16ff50d76a3124a0e83b0de61 Mon Sep 17 00:00:00 2001 From: Jan Sundermeyer Date: Thu, 26 Sep 2024 18:26:16 +0200 Subject: [PATCH] use UTF mode for redularexpression where it might matter --- src/qcodeedit/lib/qeditor.cpp | 2 +- src/texstudio.cpp | 2 +- src/utilsSystem.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qcodeedit/lib/qeditor.cpp b/src/qcodeedit/lib/qeditor.cpp index 23cb7afa8..f7e7479a7 100644 --- a/src/qcodeedit/lib/qeditor.cpp +++ b/src/qcodeedit/lib/qeditor.cpp @@ -1582,7 +1582,7 @@ void QEditor::load(const QString& file, QTextCodec* codec) if ( m_lineEndingsActions ) { // TODO : update Conservative to report original line endings - const QRegularExpression rx(" \\[\\w+\\]"); + const QRegularExpression rx(" \\[\\w+\\]",QRegularExpression::UseUnicodePropertiesOption); QAction *a = m_lineEndingsActions->actions().at(0); if ( a ) diff --git a/src/texstudio.cpp b/src/texstudio.cpp index e8f5eb957..0fb66e3b7 100644 --- a/src/texstudio.cpp +++ b/src/texstudio.cpp @@ -3985,7 +3985,7 @@ void Texstudio::editEraseWordCmdEnv() // Prelimiary solution part I: // Predictable behaviour on selections: do nothing except in easy cases if (cursor.hasSelection()) { - QRegularExpression partOfWordOrCmd("^\\\\?\\w*$"); + QRegularExpression partOfWordOrCmd("^\\\\?\\w*$",QRegularExpression::UseUnicodePropertiesOption); QRegularExpressionMatch rxm=partOfWordOrCmd.match(cursor.selectedText()); if (!rxm.hasMatch()) return; diff --git a/src/utilsSystem.cpp b/src/utilsSystem.cpp index a240ddd39..4ac1a09db 100644 --- a/src/utilsSystem.cpp +++ b/src/utilsSystem.cpp @@ -570,7 +570,7 @@ QString getNonextistentFilename(const QString &guess, const QString &fallback) { QFileInfo fi(guess); if (!fi.exists()) return guess; - QRegularExpression reNumberedFilename("^(.*[^\\d])(\\d*)\\.(\\w+)$"); + QRegularExpression reNumberedFilename("^(.*[^\\d])(\\d*)\\.(\\w+)$",QRegularExpression::UseUnicodePropertiesOption); QRegularExpressionMatch reNumberedFilenameMatch = reNumberedFilename.match(guess); if (!reNumberedFilenameMatch.hasMatch()) { return fallback;