https://www.mytecharm.com.co/post/yes-all-longest-regex-matches-in-linear-time-is-possible-js1dgh