Optiver interview question

Implement a regular expression format match algorithm