我有一个搜索表达式并突出显示匹配单词的代码。
无论是大写还是小写,我都需要找到匹配项,我需要搜索以忽略区分大小写。
代码:
RepX='<u><b style="color:#FF0000">'+x+'</b></u>'
for counter , myLine in enumerate(filename):
#added
self.textEdit_PDFpreview.clear()
thematch=re.sub(x,RepX,TextString)
thematchFilt=re.findall(x,TextString,re.M|re.IGNORECASE)
例如搜索词:charles
现有的词是查尔斯
除非我写了Charles,否则系统将找不到搜索的单词。