A fast search is performed of a large text database, while suppressing an increase
in the data size of the data structure used for the process. A pattern search method
for searching a target character string for a desired pattern includes: a range
search step and a character string extraction step. At the range search step, intermediate
patterns are obtained by adding characters in order, one by one, from the last
character of the pattern to the first, and a range is determined for a suffix array,
which corresponds to the target character string, wherein the first character of
each of the intermediate patterns is present. Then, at the character string extraction
step, elements of the character string are designated that correspond to elements
included in the range of the suffix array, and character string segments are extracted
consisting of the same number of elements as the elements of the pattern and having
the elements of the character string as their first characters.