Php Regex Replace Array Python Definition