Meta interview question

Regex matching function