Very fast pattern matching algorithm