A method and apparatus for multiple string searching using a ternary
content addressable memory. For one embodiment, the method includes
receiving a text string having a plurality of characters and performing
an unanchored search of a database of a stored patterns matching one or
more characters of the text string using a state machine, wherein the
state machine comprises a ternary content addressable memory (CAM) and
wherein the performing comprises comparing a state and one of the
plurality of characters with contents of a state field and a character
field, respectively, stored in the ternary CAM. In various embodiments,
one or more of the following search features may be supported: exact
string matching, inexact string matching, single character wildcard
matching, multiple character wildcard matching, case insensitive
matching, parallel matching and rollback.