Apple Interview Question

it was a regular expression question classic one