Domanda di colloquio di Baidu

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