Exchange Rate Regimes, Capital Flows and Crisis Prevention