Skip to content

Instantly share code, notes, and snippets.

@acrymble
Created July 5, 2011 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save acrymble/1065622 to your computer and use it in GitHub Desktop.
Save acrymble/1065622 to your computer and use it in GitHub Desktop.
Strip Non Alpha-Numeric
# Given a text string, remove all non-alphanumeric
# characters (using Unicode definition of alphanumeric).
def stripNonAlphaNum(text):
import re
return re.compile(r'\W+', re.UNICODE).split(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment