Javascript Regex Match Array Function In Python Example