extract data from text file using regular expression