本文介绍了高光匹配的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在创建IE BHO,而BHO的功能是突出显示匹配的单词,每个运行正常,除了我发布。我的问题是我有一个单词DON,在IE浏览器上有不要的字样。我想忽略突出显示的不要这个词,但这部分内容并不是强调。



我使用以下功能忽略单词





  if (Regex.IsMatch(PageText, string  .Format( @  \b({0})\ b,TextToHighlights)))
{

lst.Add(TextToHighlights);
}





在Pagetext中,我们有来自浏览器的所有单词

 TextToHighlights:在这里我们逐个发送单词以匹配循环


请帮我解决这个问题。


谢谢
AP
解决方案

Hi All,
I am creating IE BHO, and the functionality of the BHO is to highlight the matched words, everyting is running fine, except i issue. My problem is i have a word "DON" and on the IE browser there is word "Don''t". i want to ignore word "don''t" from highlighting, but it part of don''t i.e. don get highlight.

I have use the below function to ignore the words


if (Regex.IsMatch(PageText, string.Format(@"\b({0})\b", TextToHighlights)))
                        {

                            lst.Add(TextToHighlights);
                        }



In Pagetext, we have all the words from browser
and

TextToHighlights: in this we send words 1 by 1 to match in loop


Please help me to solve this issue.


Thanks
AP
解决方案


这篇关于高光匹配的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 01:55