mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix: add unicodeoption to qregularexpression
This commit is contained in:
parent
35efa7ac06
commit
530591ffbd
|
@ -857,7 +857,7 @@ bool EpwingBook::getNextHeadword( EpwingHeadword & head )
|
||||||
{
|
{
|
||||||
EB_Position pos;
|
EB_Position pos;
|
||||||
|
|
||||||
QRegularExpression badLinks( "#(v|n)\\d" );
|
QRegularExpression badLinks( "#(v|n)\\d", QRegularExpression::UseUnicodePropertiesOption);
|
||||||
|
|
||||||
// At first we check references queue
|
// At first we check references queue
|
||||||
while( !LinksQueue.isEmpty() )
|
while( !LinksQueue.isEmpty() )
|
||||||
|
|
|
@ -71,8 +71,8 @@ bool parseSearchString( QString const & str, QStringList & indexWords,
|
||||||
{
|
{
|
||||||
searchWords.clear();
|
searchWords.clear();
|
||||||
indexWords.clear();
|
indexWords.clear();
|
||||||
QRegularExpression spacesRegExp( "\\W+" );
|
QRegularExpression spacesRegExp( "\\W+", QRegularExpression::UseUnicodePropertiesOption );
|
||||||
QRegularExpression wordRegExp( QString( "\\w{" ) + QString::number( FTS::MinimumWordSize ) + ",}" );
|
QRegularExpression wordRegExp( QString( "\\w{" ) + QString::number( FTS::MinimumWordSize ) + ",}", QRegularExpression::UseUnicodePropertiesOption );
|
||||||
QRegularExpression setsRegExp( "\\[[^\\]]+\\]", QRegularExpression::CaseInsensitiveOption );
|
QRegularExpression setsRegExp( "\\[[^\\]]+\\]", QRegularExpression::CaseInsensitiveOption );
|
||||||
QRegularExpression regexRegExp( "\\\\[afnrtvdDwWsSbB]|\\\\x([0-9A-Fa-f]{4})|\\\\0([0-7]{3})", QRegularExpression::CaseInsensitiveOption);
|
QRegularExpression regexRegExp( "\\\\[afnrtvdDwWsSbB]|\\\\x([0-9A-Fa-f]{4})|\\\\0([0-7]{3})", QRegularExpression::CaseInsensitiveOption);
|
||||||
|
|
||||||
|
|
|
@ -3503,7 +3503,7 @@ void MainWindow::on_saveArticle_triggered()
|
||||||
// MDict anchors
|
// MDict anchors
|
||||||
QRegularExpression anchorLinkRe(
|
QRegularExpression anchorLinkRe(
|
||||||
"(<\\s*a\\s+[^>]*\\b(?:name|id)\\b\\s*=\\s*[\"']*g[0-9a-f]{32}_)([0-9a-f]+_)(?=[^\"'])",
|
"(<\\s*a\\s+[^>]*\\b(?:name|id)\\b\\s*=\\s*[\"']*g[0-9a-f]{32}_)([0-9a-f]+_)(?=[^\"'])",
|
||||||
QRegularExpression::PatternOption::CaseInsensitiveOption );
|
QRegularExpression::PatternOption::CaseInsensitiveOption|QRegularExpression::UseUnicodePropertiesOption );
|
||||||
html.replace( anchorLinkRe, "\\1" );
|
html.replace( anchorLinkRe, "\\1" );
|
||||||
|
|
||||||
if( complete )
|
if( complete )
|
||||||
|
|
Loading…
Reference in a new issue