The ISIS dilemma

Recent gains by the Assad regime in Syria and by jihadists in Iraq have complicated the Middle East morass. What is to be done when both sides feel they are winning, and both are anathema to Western interests?