Meta interview question

Implement pattern matching for regular expressions.