Created
October 11, 2011 21:02
-
-
Save eloyz/1279428 to your computer and use it in GitHub Desktop.
Slugify a string of text with a max of 200 characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode 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