1. A method of detecting presence of a complex string in a data stream, the method comprising: transforming a predefined complex dictionary into: a segmented dictionary comprising a string prefix and string segments of each complex string in said complex dictionary, each string segment comprising a simple string and a segment suffix; a set of segment descriptors, each segment descriptor defining a content of a corresponding string segment in said segmented dictionary; and a set of bitmasks, each bitmask indicating a location of a string segment in said segmented dictionary within a respective complex string in said complex dictionary; performing a simple search in said data stream to produce detected simple strings defined in said segmented dictionary; selecting candidate string segments, from said segmented dictionary, containing said detected simple strings; and identifying candidate complex strings for said complex string in said complex dictionary containing said candidate string segments using said set of segment descriptors and said set of bitmasks; wherein said selecting composes a further step of ascertaining congruence of a portion of said data stream succeeding each said detected simple string, and a segment suffix of a corresponding string segment in said segmented dictionary.