Meta Interview Question

Regex string matching implementation for a particular set of patterns