Pergunta de entrevista da empresa Profluent

How to find a certain pattern within a string if we do not know whether the subject has one?