If you have a very large amount of data to check, you may want to consider using a more efficient algorithm such as the Aho-Corasick string matching algorithm. This algorithm is specifically designed for searching through large amounts of text for multiple patterns at once.