Amazon interview question

one : Validating Strings with RegEx