Skip to content

Commit

Permalink
use UTF mode for redularexpression where it might matter
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Sep 26, 2024
1 parent 6aac714 commit d47afc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/qcodeedit/lib/qeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/texstudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/utilsSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d47afc7

Please sign in to comment.