Wrapping string.find and limiting pattern length to work around a lua crash bug