peferron/slug — pull request #2 by stevenwilkin (2014-11-26 00:04:55+00:00)
Title: Use a few regex to generate slug instead

Perhaps not useful as anything other than a thought exercise but this replaces all the iteration in your original algorithm with a few regex search and replace operations.

Depending on your views on the use of regex this approach may be better or worse than before :sunglasses: