Meta Interview Question

Give an algorithm to parse a regular expression.