Python Replace By Regex Generator Javascript Interview