text_parse function

Parse a snippet of text