Another string matching implementation