Pergunta de entrevista da empresa Cruise

Asked me to essentially write a regex matching function