Uber interview question

Regular Expression verification.