Amazon interview question

How to do various things with regex.