Baidu Interview Question

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