AMD interview question

Write a program to retrieve first element of reach row using regular expressions