1. A method for identifying a target pattern from a stream of patterns, the target pattern and the stream of patterns comprises consecutive elements and the target pattern comprises one or more of the consecutive elements of the stream of patterns, the method comprising: acquiring a first occurrence value for each element in the target pattern, wherein the first occurrence value is equal to the number of times each element occurs in the target pattern; storing a predetermined number of consecutive elements from the stream of patterns in a buffer as a section of elements, wherein the section of elements is defined by a buffer starting point indicator and a buffer ending point indicator; determining a second occurrence value for each element in the target pattern, wherein the second occurrence value is equal to the number of times each element in the target pattern occurs in the section of elements stored in the buffer; updating the buffer to include one additional element in the section of elements by moving the buffer ending point indicator towards the end of the stream of patterns by one element; repeating determining the second occurrence value and updating the buffer until the second occurrence value matches the first occurrence value for each element in the target pattern; outputting the elements in the buffer in response to determining the second occurrence value matches the first occurrence value for each element in the target pattern; performing a precise pattern matching operation on the outputted elements of the buffer to determine if the target pattern is contained within only the last x elements of the buffer, wherein x is equal to the number of elements in the target pattern; and in response to determining the target pattern is not contained within the last x elements of the buffer, resetting the buffer to its initial length by updating the buffer starting point indicator to indicate the (y−x+1)th character, wherein y is equal to the buffer ending point indicator.