Skip to content

Instantly share code, notes, and snippets.

@ozgurgul
Forked from acrymble/stripNonAlphaNum.py
Created June 4, 2020 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozgurgul/7211f27b524741d453695fd1c0db16b0 to your computer and use it in GitHub Desktop.
Save ozgurgul/7211f27b524741d453695fd1c0db16b0 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