Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quick bash slugify
# Updated to work on OS X (convert both "-E" flags to "-r" to run on real server OSes)
echo "$STRING" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.