Finding the longest matching pattern using Finite State Machines | Hacker News Reader