use regex to extract content from head and body to retain formating