摘要 |
A character and/or character-string retrieving method with retrieves a plurality of patterns at a time by using a single deterministic finite automaton prepared from a plurality of different patterns. There is also a method for optimizing the number of states for the above-mentioned retrieving method, and a storage medium having records of programs and data necessary for executing the above-mentioned character and/or character-string retrieving and a state number optimizing method. A plurality of regular expressions r1, r2, . . . , rn to be simultaneously retrieved by pattern matching are prepared, and then augmented to form an augmented regular expression ((r1)#1,)|((r2)#2)| . . . ((rn)#n). A deterministic finite automaton is constructed so that it treats states including positions corresponding to #1, #2, . . . , n, thereby simultaneously retrieving a plurality of regular expression patterns by distinguishing matches from one another.
|