Cognizant Interview Question

Coding question on regular expression[situation based]