A computer-implemented method for string-searching which selectively eliminates nondeterministic elements of nondeterministic finite automata comprising (i) selectively eliminating nondeterministic elements of nondeterministic finite automata course and (ii) string-searching process after the eliminating nondeterministic elements course, wherein the eliminating nondeterministic elements course comprising steps of: (a) determining by the highest probability state determining part a specific state calculated to have a highest arrival probability through a transition from a current state among all states in the NFA, as a current highest probability state, wherein a probability of reaching the current highest probability state by moving from the current state is determined to be a value, acquired by dividing a number of characters transiting the current state to the current highest probability state, among all characters included in an input string including a subject to be searched, by a total number of characters included in the input string; (b) determining by the active state removing part whether there exists at least one common transition between a first set of transitions including at least one transition moving the current highest probability state to a state i and a second set of transitions including at least one transition moving the current highest probability state to a state j in the NFA; and (c) excluding by the active state removing part the at least one common transition between the first and the second sets of transitions, if being determined to exist, and creating a state k which is arrived as a result of moving from the current highest probability state through a set of common transitions composed of the at least one common transition, wherein the state k is newly added in the NFA. (a) determining by the highest probability state determining part a specific state calculated to have a highest arrival probability through a transition from a current state among all states in the NFA, as a current highest probability state, wherein a probability of reaching the current highest probability state by moving from the current state is determined to be a value, acquired by dividing a number of characters transiting the current state to the current highest probability state, among all characters included in an input string including a subject to be searched, by a total number of characters included in the input string; (b) determining by the active state removing part whether there exists at least one common transition between a first set of transitions including at least one transition moving the current highest probability state to a state i and a second set of transitions including at least one transition moving the current highest probability state to a state j in the NFA; and (c) excluding by the active state removing part the at least one common transition between the first and the second sets of transitions, if being determined to exist, and creating a state k which is arrived as a result of moving from the current highest probability state through a set of common transitions composed of the at least one common transition, wherein the state k is newly added in the NFA.