ใช้ Finite Automata Algorithm ค้นหา Pattern ใน Text ได้รับ text[0..n-1] และ pattern[0..m-1] หาตำแหน่งทั้งหมดที่ pattern ปรากฏใน text วิธี: Preprocess pattern สร้างตาราง 2D (Transition Function) แล้วสแกน text ตาม state machine ตัวอย่างโค้ด #include<stdio.h> #include<string.h> #define tot