IBM Interview Question

Regex question, array based question