Skip to content

Commit 941d1c0

Browse files
committedJun 19, 2018
Use QRegularExpression and negative look behind
1 parent 24ed8d4 commit 941d1c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/qgsmimedatautils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ QString QgsMimeDataUtils::encode( const QStringList &items )
207207
{
208208
QString encoded;
209209
// Do not escape colon twice
210-
QRegExp re( "([^\\\\]):" );
210+
QRegularExpression re( "(?<!\\\\):" );
211211
Q_FOREACH ( const QString &item, items )
212212
{
213213
QString str = item;
214214
str.replace( '\\', QLatin1String( "\\\\" ) );
215-
str.replace( re, QLatin1String( "\\1\\:" ) );
215+
str.replace( re, QLatin1String( "\\:" ) );
216216
encoded += str + ':';
217217
}
218218
return encoded.left( encoded.length() - 1 );

0 commit comments

Comments
 (0)
Please sign in to comment.