Apex › Storage & databases

Boyer-Moore string search

The matcher that gets faster on longer patterns by skipping ahead. Comparing from the right end, a mismatch slides the pattern forward by the bad-character rule — often leaping several characters, or a whole pattern length when the text character isn't in the pattern at all. Step through it and watch the comparisons stay far below a naive scan.

More in Storage & databases