Fixed error with regex sub and moved to using .format for strings