Confluent Interview Question

Implement logic to see if string matches given regular expression