X Interview Question

Use regex to print a pattern in linux.