Python Replace Regex String Javascript Functions Practice