Pregunta de entrevista de Profluent

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