研究BM串匹配算法,分析国内外各种改进算法,结合其优缺点,增加对模式串串末字符或坏字符的邻接字符在模式串中的首次出现位置、存在性、惟一性的判断。根据判断的结果对移动距离重新设置,增加模式串移动距离,减少字符重复比较的次数,以提高匹配效率。
This paper researched algorithm for BM string matching. Analyzed kinds of improved algorithms. On the basis of the advantage of these algorithms, the first position, judged the existence and the uniqueness of the neighbor character of the end character or the bad character of the. string. By the result of these judges, increased the new shift distance, reduced the times of the match, and enhanced the efficiency of string matching.