Qualcomm interview question

Programming on whiteboard: Implement a regex parser.