Question d’entretien chez Baidu

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