From c3abe99162c25688afb69ac1787211330824bfae Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Sat, 4 Jun 2022 17:32:33 +0800 Subject: [PATCH] feat: cjk regex match --- ftshelpers.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ftshelpers.cc b/ftshelpers.cc index e1b51641..2ac57cba 100644 --- a/ftshelpers.cc +++ b/ftshelpers.cc @@ -44,6 +44,12 @@ static QString makeHiliteRegExpString( QStringList const & words, QString searchString( "(" ); QString stripWords( "(?:\\W+\\w+){0," ); + + if( hasCJK ) + { + stripWords = "(?:[\\W\\w]){0,"; + } + if( distanceBetweenWords >= 0 ) stripWords += QString::number( distanceBetweenWords ); stripWords += "}";