Ran, hid, rebuilt and struck again? Yes those guys.
Wars are not won through winning individual battles alone. They are won through strategy, and the Taliban's strategy has worked. They fought against the might of the world for over a decade and wore them down to the point they are pulling out over the large costs they paid.
With regards to the IS, let me be frank. Spending millions per day on cruise missiles, hellfire missiles and paveway bombs against an army using second hand USSR and US equipment is quite frankly retarded.