added regex for post code generation cleanup