How to find multiple substrings in the string optimally?

Primary tabs