/cat|dog/
What about scat?
START |s c a t | |s c a t c |s c a t Nope. d |s c a t Nope. START s|c a t | s|c a t c s|c a t Yes! a s<c|a t Yes! t s<c a|t Yes! END s<c a t> Yes!
We reached END, so the match succeeds; it found the cat part of scat