Microsoft interview question

asked regex question involving dynamic programming