Do LLM Agents Have Regret? A Case Study in Online Learning and Games