working on regex for replace, added hash to write temp file