The invention provides a rapid
pattern matching method and
system based on a pattern string intermediate character and a medium, and belongs to the technical field of
software engineering, and the method comprises the steps: obtaining a to-be-matched target string, and determining a pattern string and the intermediate character of the pattern string; searching all characters which are the same as the middle character of the pattern string in the target string, and determining the position of a first character which is the same as the middle character; sequentially comparing the left character and the right character of the middle character of the pattern string with the left character and the right character of the first character which is the same as the middle character found in the target string, if the characters are consistent, successfully matching, otherwise, searching a second character which is the same as the middle character of the pattern string in the target string, and determining the position of the character; comparing the left character and the right character of the character in sequence, and judging whether the matching is successful or not; repeatedly executing until the last character which is the same as the middle character of the pattern string is found in the target string, sequentially comparing the left character with the right character after the position of the last character is determined, if the characters are equal, matching succeeds, and if the characters are different, matching of the target string fails; and outputting the position of the pattern string character in the successfully matched target string. According to the method, the character comparison frequency in the execution process is greatly reduced, the
algorithm execution efficiency is improved, and the
time complexity of the
algorithm is greatly reduced.