Appen interview question

Writing regular expressions and CFG's