Microsoft interview question

Implement regex, it was using js.