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 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.

Authors

Institutions

Publication Details

Journal
Computer Fraud & Security
Published
2024-12-25
DOI
https://doi.org/10.52710/cfs.94
Primary Topic
Educational Technology and Assessment
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Weiqiang Ma
Computer Fraud & Security
Educational Technology and Assessment
article

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

Weiqiang Ma
article en

Abstract

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.

Computer Fraud & Security
Henan Institute of Education (CN), Henan University of Engineering (CN)
Openalex Percentile: Top 58%
Educational Technology and Assessment
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.