### The good suffix rule

Suppose we have a substring $t$ of $T$. Let $t$ match a suffix of $P$ but a mismatch occurs.

The rightmost copy $t'$ of $t$ in $P$ is found such that $t'$ is not a suffix of $P$. The character to the left of $t'$ in $P$ differs from the characters to the left of $t$ in $P$. $P$ is shifted to the right such that $t'$ in $P$ aligns with $t$ in $T$.

If $t'$ doesn't exist, then shift the search window towards the left end of $P$, past the left end of $t$ in $T$. This occurs such that the prefix of the shifted pattern matches the suffix of $t$ in $T$.

If such a shift isn't possible, then $P$ is shifted by $m$ indexes to the right. If $P$ is found, then it shifts $P$ by at least an amount so that a proper prefix of the shifted $P$ matches a suffix of the occurrence of $P$ in $T$. If the aforementioned shift isn't possible, then it shifts $P$ by $m$ places so that it's shift past $t$.

In a nutshell, if we match some characters, we use knowledge of the matched characters to skip alignments.