Replace Function In Python With Regex