Pergunta de entrevista da empresa Datadog

match a string against a pattern (reimplementing a basic Regexp engine)