Confluent interview question

Implement logic to see if string matches given regular expression