Microsoft Interview Question

Implement regex, it was using js.