Cognizant interview question

Coding question on regular expression[situation based]