Extract the string-start matching to an external file