Datadog Interview Question

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