Trying to further improve the performance but in the end it requires native C extansions to outperform preg_match. Working with strings in PHP is just not fast enough.