ISSN 1000-1239 CN 11-1777/TP

• Paper • Previous Articles     Next Articles

A Fast and Exact Single Pattern Matching Algorithm

Fan Hongbo1,2 and Yao Nianmin1   

  1. 1(College of Computer Science and Technology, Harbin Engineering University, Harbin 150001) 2(Department of Computer Science and Technology, Suihua University, Suihua, Heilongjiang 152000)
  • Online:2009-08-15

Abstract: String matching problem is a fundamental problem in computer science. It is the key problem of many important scopes such as network security, information retrieval and filtration, computational biology, etc. And the design of exact single pattern string matching algorithm with high performance is the basis of all string matching problems. In this paper, the authors improve one of the fastest exact single pattern matching algorithms known on English text, which is SBNDM2. The simplest form of the BNDM core loop is obtained, in which there are only 5 instructions per character read by amending the relationship between position in the pattern and bit in the bitmask. And a cross-border protection method is added to the algorithm in order to reduce the cost of cross-border inspection. Two algorithms named S2BNDM and S2BNDM′ are presented. The experimental results indicate that both S2BNDM and S2BNDM′ are faster than SBNDM2 in any case. It can be considered that S2BNDM is the fastest algorithm on English text (2

Key words: string matching, exact single pattern, design of algorithm, bit parallelism, text searching