Refined regex used to strip out logging