Pregunta de entrevista de Baidu

How would you implement pattern recognition in strings/text in C++?