Skip to content

Instantly share code, notes, and snippets.

@eloyz
Created October 11, 2011 21:02
Show Gist options
  • Select an option

  • Save eloyz/1279428 to your computer and use it in GitHub Desktop.

Select an option

Save eloyz/1279428 to your computer and use it in GitHub Desktop.
Slugify a string of text with a max of 200 characters
import re
print re.sub("[^a-zA-Z0-9]", "-", name.lower()[:200]).strip('-')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment