What pattern matching algorithm does grep use?

do all flavors use the same algorithm?

What pattern matching algorithm does grep use?

Most grep programs use Boyer Moore