A Fast Pattern Matching Algorithm Based on Middle Characters of Pattern String

String pattern matching is one of the important string operation. At present, the pattern matching algorithm of strings mainly includes BF algorithm, KMP algorithm, and improved KMP algorithm, BM algorithm etc. Drawing from the study of current pattern matching algorithms and practical programming e...

Full description

Saved in:
Bibliographic Details
Published inComputer fraud & security pp. 112 - 118
Main Author Weiqiang Ma
Format Journal Article
LanguageEnglish
Published 25.12.2024
Online AccessGet full text
ISSN1361-3723
1873-7056
DOI10.52710/cfs.94

Cover

More Information
Summary:String pattern matching is one of the important string operation. At present, the pattern matching algorithm of strings mainly includes BF algorithm, KMP algorithm, and improved KMP algorithm, BM algorithm etc. Drawing from the study of current pattern matching algorithms and practical programming experience, this paper presents a refined pattern matching algorithm that leverages the middle character of the pattern string. The enhancement offered by this pattern matching algorithm lies in its departure from the traditional approach, which typically involves sequential comparison and matching starting from the first character. This paper introduces a fast pattern matching algorithm that focuses on the middle character of the pattern string. By locating this central character within the target string and initiating the comparison and matching process from there, the algorithm significantly decreases the number of character comparisons required, thereby substantially enhancing the efficiency of the matching process. After repeated verification by program practice, The algorithm reduces the quantity of character comparisons while achieving correct matching, improves the matching efficiency, and effectively reduces the time complexity of the algorithm.
ISSN:1361-3723
1873-7056
DOI:10.52710/cfs.94