News for hackers. Stuff that matters.
Re:Knuth–Morris–Pratt Illustrated by byronvickers on Tuesday April 16, 2024 @05:10AM (#40049874)
Thanks for this - I need to solve exactly this problem on a toy project I've been working on; you've saved me the time to hunt down the appropriate algorithm!
Re:Knuth–Morris–Pratt Illustrated by Terr_ on Tuesday April 16, 2024 @04:51PM (#40057028)
I hope it helps, but if you are just looking for text strings, you might want to benchmark your local regex libraries first. Among other optimizations, they might use that algorithm under the hood for long (foo|bar|baz|...) expressions.