Patent ID: 7359895

Claim:
A string matching method for use in a string matching system, wherein the string matching system receives a text and searches the text for any of a predetermined set of patterns, each of the text and the patterns including a string of characters or symbols, the method comprising: generating a number of pattern folds for each of the patterns, the number of pattern folds for each of the patterns being equal to a folding width, wherein generating the pattern folds for each pattern comprises conceptually arranging a corresponding pattern into a pattern spiral running clockwise downward from top when viewed from above, a number of characters or symbols in each turn of the pattern spiral being equal to the folding width, wherein characters or symbols of the corresponding pattern are aligned along a number of vertical lines, the number of vertical lines being equal to the folding width, and wherein all of the characters or symbols along each of said vertical line constitute a pattern fold; generating a set of pattern folds from the pattern folds of all the patterns; generating a number of text folds for the text, the number of text folds being also equal to the folding width; selecting one of the text folds; performing a first search on the selected text fold for matches of any pattern folds in the set of pattern folds; and if a pattern fold is found in the selected text fold, performing a second search to determine if the text contains a match of any of the predetermined set of patterns.