regexp for prettier printing and writting to temporaryfile